mvebu: backport mainline patches from kernel 3.11
[openwrt.git] / target / linux / mvebu / patches-3.10 / 0030-arm-mvebu-add-another-earlyprintk-Kconfig-option.patch
1 From 70c30ca997919a4b8c9051a3903f30c79c735f12 Mon Sep 17 00:00:00 2001
2 From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
3 Date: Wed, 5 Jun 2013 09:05:00 +0200
4 Subject: [PATCH 030/203] arm: mvebu: add another earlyprintk Kconfig option
5
6 In order to support both old and new bootloaders, we add a new Kconfig
7 option for the earlyprintk UART selection. The existing option allows
8 to work with old bootloaders (that keep the internal registers mapped
9 at 0xd0000000), while the newly introduced option allows to work with
10 new bootloaders (that remap the internal registers at 0xf1000000).
11
12 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
13 Acked-by: Arnd Bergmann <arnd@arndb.de>
14 Signed-off-by: Jason Cooper <jason@lakedaemon.net>
15 ---
16  arch/arm/Kconfig.debug         | 30 ++++++++++++++++++++++++++++--
17  arch/arm/include/debug/mvebu.S |  5 +++++
18  2 files changed, 33 insertions(+), 2 deletions(-)
19
20 --- a/arch/arm/Kconfig.debug
21 +++ b/arch/arm/Kconfig.debug
22 @@ -303,12 +303,37 @@ choice
23                   their output to the serial port on MSM 8960 devices.
24  
25         config DEBUG_MVEBU_UART
26 -               bool "Kernel low-level debugging messages via MVEBU UART"
27 +               bool "Kernel low-level debugging messages via MVEBU UART (old bootloaders)"
28                 depends on ARCH_MVEBU
29                 help
30                   Say Y here if you want kernel low-level debugging support
31                   on MVEBU based platforms.
32  
33 +                 This option should be used with the old bootloaders
34 +                 that left the internal registers mapped at
35 +                 0xd0000000. As of today, this is the case on
36 +                 platforms such as the Globalscale Mirabox or the
37 +                 Plathome OpenBlocks AX3, when using the original
38 +                 bootloader.
39 +
40 +                 If the wrong DEBUG_MVEBU_UART* option is selected,
41 +                 when u-boot hands over to the kernel, the system
42 +                 silently crashes, with no serial output at all.
43 +
44 +       config DEBUG_MVEBU_UART_ALTERNATE
45 +               bool "Kernel low-level debugging messages via MVEBU UART (new bootloaders)"
46 +               depends on ARCH_MVEBU
47 +               help
48 +                 Say Y here if you want kernel low-level debugging support
49 +                 on MVEBU based platforms.
50 +
51 +                 This option should be used with the new bootloaders
52 +                 that remap the internal registers at 0xf1000000.
53 +
54 +                 If the wrong DEBUG_MVEBU_UART* option is selected,
55 +                 when u-boot hands over to the kernel, the system
56 +                 silently crashes, with no serial output at all.
57 +
58         config DEBUG_NOMADIK_UART
59                 bool "Kernel low-level debugging messages via NOMADIK UART"
60                 depends on ARCH_NOMADIK
61 @@ -632,7 +657,8 @@ config DEBUG_LL_INCLUDE
62                                  DEBUG_IMX51_UART || \
63                                  DEBUG_IMX53_UART ||\
64                                  DEBUG_IMX6Q_UART
65 -       default "debug/mvebu.S" if DEBUG_MVEBU_UART
66 +       default "debug/mvebu.S" if DEBUG_MVEBU_UART || \
67 +                                  DEBUG_MVEBU_UART_ALTERNATE
68         default "debug/mxs.S" if DEBUG_IMX23_UART || DEBUG_IMX28_UART
69         default "debug/nomadik.S" if DEBUG_NOMADIK_UART
70         default "debug/omap2plus.S" if DEBUG_OMAP2PLUS_UART
71 --- a/arch/arm/include/debug/mvebu.S
72 +++ b/arch/arm/include/debug/mvebu.S
73 @@ -11,7 +11,12 @@
74   * published by the Free Software Foundation.
75  */
76  
77 +#ifdef CONFIG_DEBUG_MVEBU_UART_ALTERNATE
78 +#define ARMADA_370_XP_REGS_PHYS_BASE   0xf1000000
79 +#else
80  #define ARMADA_370_XP_REGS_PHYS_BASE   0xd0000000
81 +#endif
82 +
83  #define ARMADA_370_XP_REGS_VIRT_BASE   0xfec00000
84  
85         .macro  addruart, rp, rv, tmp