kernel: backport bcma patches queued for 3.20
[openwrt/svn-archive/archive.git] / target / linux / ipq806x / patches / 0097-ARM-debug-qcom-make-UART-address-selection-configura.patch
1 From 48167d4a55890a783cc8b1590bc8071253ae4b83 Mon Sep 17 00:00:00 2001
2 From: "Ivan T. Ivanov" <iivanov@mm-sol.com>
3 Date: Mon, 14 Apr 2014 16:47:34 +0300
4 Subject: [PATCH 097/182] ARM: debug: qcom: make UART address selection
5 configuration option
6
7 Separate Qualcomm low-level debugging UART to two options.
8
9 DEBUG_MSM_UART is used in earlier non-multi platform arches,
10 like MSM7X00A, QSD8X50 and MSM7X30.
11
12 DEBUG_QCOM_UARTDM is used in multi-plafrom arches and have
13 embedded data mover.
14
15 Make DEBUG_UART_PHYS and DEBUG_UART_BASE user adjustable by
16 Kconfig menu.
17
18 Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com>
19 Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
20 Tested-by: Stephen Boyd <sboyd@codeaurora.org>
21 Signed-off-by: Kumar Gala <galak@codeaurora.org>
22 ---
23 arch/arm/Kconfig.debug | 81 +++++++++++++++++-------------------------
24 arch/arm/include/debug/msm.S | 46 +++---------------------
25 arch/arm/mach-msm/Kconfig | 3 --
26 3 files changed, 38 insertions(+), 92 deletions(-)
27
28 --- a/arch/arm/Kconfig.debug
29 +++ b/arch/arm/Kconfig.debug
30 @@ -353,56 +353,39 @@ choice
31 Say Y here if you want kernel low-level debugging support
32 on MMP UART3.
33
34 - config DEBUG_MSM_UART1
35 - bool "Kernel low-level debugging messages via MSM UART1"
36 - depends on ARCH_MSM7X00A || ARCH_MSM7X30 || ARCH_QSD8X50
37 - select DEBUG_MSM_UART
38 + config DEBUG_MSM_UART
39 + bool "Kernel low-level debugging messages via MSM UART"
40 + depends on ARCH_MSM
41 help
42 Say Y here if you want the debug print routines to direct
43 - their output to the first serial port on MSM devices.
44 + their output to the serial port on MSM devices.
45
46 - config DEBUG_MSM_UART2
47 - bool "Kernel low-level debugging messages via MSM UART2"
48 - depends on ARCH_MSM7X00A || ARCH_MSM7X30 || ARCH_QSD8X50
49 - select DEBUG_MSM_UART
50 - help
51 - Say Y here if you want the debug print routines to direct
52 - their output to the second serial port on MSM devices.
53 + ARCH DEBUG_UART_PHYS DEBUG_UART_BASE #
54 + MSM7X00A, QSD8X50 0xa9a00000 0xe1000000 UART1
55 + MSM7X00A, QSD8X50 0xa9b00000 0xe1000000 UART2
56 + MSM7X00A, QSD8X50 0xa9c00000 0xe1000000 UART3
57
58 - config DEBUG_MSM_UART3
59 - bool "Kernel low-level debugging messages via MSM UART3"
60 - depends on ARCH_MSM7X00A || ARCH_MSM7X30 || ARCH_QSD8X50
61 - select DEBUG_MSM_UART
62 - help
63 - Say Y here if you want the debug print routines to direct
64 - their output to the third serial port on MSM devices.
65 + MSM7X30 0xaca00000 0xe1000000 UART1
66 + MSM7X30 0xacb00000 0xe1000000 UART2
67 + MSM7X30 0xacc00000 0xe1000000 UART3
68
69 - config DEBUG_MSM8660_UART
70 - bool "Kernel low-level debugging messages via MSM 8660 UART"
71 - depends on ARCH_MSM8X60
72 - select MSM_HAS_DEBUG_UART_HS
73 - select DEBUG_MSM_UART
74 - help
75 - Say Y here if you want the debug print routines to direct
76 - their output to the serial port on MSM 8660 devices.
77 + Please adjust DEBUG_UART_PHYS and DEBUG_UART_BASE configuration
78 + options based on your needs.
79
80 - config DEBUG_MSM8960_UART
81 - bool "Kernel low-level debugging messages via MSM 8960 UART"
82 - depends on ARCH_MSM8960
83 - select MSM_HAS_DEBUG_UART_HS
84 - select DEBUG_MSM_UART
85 + config DEBUG_QCOM_UARTDM
86 + bool "Kernel low-level debugging messages via QCOM UARTDM"
87 + depends on ARCH_QCOM
88 help
89 Say Y here if you want the debug print routines to direct
90 - their output to the serial port on MSM 8960 devices.
91 + their output to the serial port on Qualcomm devices.
92
93 - config DEBUG_MSM8974_UART
94 - bool "Kernel low-level debugging messages via MSM 8974 UART"
95 - depends on ARCH_MSM8974
96 - select MSM_HAS_DEBUG_UART_HS
97 - select DEBUG_MSM_UART
98 - help
99 - Say Y here if you want the debug print routines to direct
100 - their output to the serial port on MSM 8974 devices.
101 + ARCH DEBUG_UART_PHYS DEBUG_UART_BASE
102 + MSM8X60 0x19c40000 0xf0040000
103 + MSM8960 0x16440000 0xf0040000
104 + MSM8974 0xf991e000 0xfa71e000
105 +
106 + Please adjust DEBUG_UART_PHYS and DEBUG_UART_BASE configuration
107 + options based on your needs.
108
109 config DEBUG_MVEBU_UART
110 bool "Kernel low-level debugging messages via MVEBU UART (old bootloaders)"
111 @@ -954,10 +937,6 @@ config DEBUG_STI_UART
112 bool
113 depends on ARCH_STI
114
115 -config DEBUG_MSM_UART
116 - bool
117 - depends on ARCH_MSM || ARCH_QCOM
118 -
119 config DEBUG_LL_INCLUDE
120 string
121 default "debug/8250.S" if DEBUG_LL_UART_8250 || DEBUG_UART_8250
122 @@ -975,7 +954,7 @@ config DEBUG_LL_INCLUDE
123 DEBUG_IMX53_UART ||\
124 DEBUG_IMX6Q_UART || \
125 DEBUG_IMX6SL_UART
126 - default "debug/msm.S" if DEBUG_MSM_UART
127 + default "debug/msm.S" if DEBUG_MSM_UART || DEBUG_QCOM_UARTDM
128 default "debug/omap2plus.S" if DEBUG_OMAP2PLUS_UART
129 default "debug/sirf.S" if DEBUG_SIRFPRIMA2_UART1 || DEBUG_SIRFMARCO_UART1
130 default "debug/sti.S" if DEBUG_STI_UART
131 @@ -1039,6 +1018,7 @@ config DEBUG_UART_PHYS
132 default 0x80074000 if DEBUG_IMX28_UART
133 default 0x808c0000 if ARCH_EP93XX
134 default 0x90020000 if DEBUG_NSPIRE_CLASSIC_UART || DEBUG_NSPIRE_CX_UART
135 + default 0xa9a00000 if DEBUG_MSM_UART
136 default 0xb0090000 if DEBUG_VEXPRESS_UART0_CRX
137 default 0xc0013000 if DEBUG_U300_UART
138 default 0xc8000000 if ARCH_IXP4XX && !CPU_BIG_ENDIAN
139 @@ -1054,6 +1034,7 @@ config DEBUG_UART_PHYS
140 ARCH_ORION5X
141 default 0xf7fc9000 if DEBUG_BERLIN_UART
142 default 0xf8b00000 if DEBUG_HI3716_UART
143 + default 0xf991e000 if DEBUG_QCOM_UARTDM
144 default 0xfcb00000 if DEBUG_HI3620_UART
145 default 0xfe800000 if ARCH_IOP32X
146 default 0xffc02000 if DEBUG_SOCFPGA_UART
147 @@ -1062,11 +1043,13 @@ config DEBUG_UART_PHYS
148 default 0xfffff700 if ARCH_IOP33X
149 depends on DEBUG_LL_UART_8250 || DEBUG_LL_UART_PL01X || \
150 DEBUG_LL_UART_EFM32 || \
151 - DEBUG_UART_8250 || DEBUG_UART_PL01X
152 + DEBUG_UART_8250 || DEBUG_UART_PL01X || \
153 + DEBUG_MSM_UART || DEBUG_QCOM_UARTDM
154
155 config DEBUG_UART_VIRT
156 hex "Virtual base address of debug UART"
157 default 0xe0010fe0 if ARCH_RPC
158 + default 0xe1000000 if DEBUG_MSM_UART
159 default 0xf0000be0 if ARCH_EBSA110
160 default 0xf0009000 if DEBUG_CNS3XXX
161 default 0xf01fb000 if DEBUG_NOMADIK_UART
162 @@ -1081,6 +1064,7 @@ config DEBUG_UART_VIRT
163 default 0xf7fc9000 if DEBUG_BERLIN_UART
164 default 0xf8009000 if DEBUG_VEXPRESS_UART0_CA9
165 default 0xf8090000 if DEBUG_VEXPRESS_UART0_RS1
166 + default 0xfa71e000 if DEBUG_QCOM_UARTDM
167 default 0xfb009000 if DEBUG_REALVIEW_STD_PORT
168 default 0xfb10c000 if DEBUG_REALVIEW_PB1176_PORT
169 default 0xfd000000 if ARCH_SPEAR3XX || ARCH_SPEAR6XX
170 @@ -1120,7 +1104,8 @@ config DEBUG_UART_VIRT
171 default 0xff003000 if DEBUG_U300_UART
172 default DEBUG_UART_PHYS if !MMU
173 depends on DEBUG_LL_UART_8250 || DEBUG_LL_UART_PL01X || \
174 - DEBUG_UART_8250 || DEBUG_UART_PL01X
175 + DEBUG_UART_8250 || DEBUG_UART_PL01X || \
176 + DEBUG_MSM_UART || DEBUG_QCOM_UARTDM
177
178 config DEBUG_UART_8250_SHIFT
179 int "Register offset shift for the 8250 debug UART"
180 --- a/arch/arm/include/debug/msm.S
181 +++ b/arch/arm/include/debug/msm.S
182 @@ -15,51 +15,15 @@
183 *
184 */
185
186 -#if defined(CONFIG_ARCH_MSM7X00A) || defined(CONFIG_ARCH_QSD8X50)
187 -#define MSM_UART1_PHYS 0xA9A00000
188 -#define MSM_UART2_PHYS 0xA9B00000
189 -#define MSM_UART3_PHYS 0xA9C00000
190 -#elif defined(CONFIG_ARCH_MSM7X30)
191 -#define MSM_UART1_PHYS 0xACA00000
192 -#define MSM_UART2_PHYS 0xACB00000
193 -#define MSM_UART3_PHYS 0xACC00000
194 -#endif
195 -
196 -#if defined(CONFIG_DEBUG_MSM_UART1)
197 -#define MSM_DEBUG_UART_BASE 0xE1000000
198 -#define MSM_DEBUG_UART_PHYS MSM_UART1_PHYS
199 -#elif defined(CONFIG_DEBUG_MSM_UART2)
200 -#define MSM_DEBUG_UART_BASE 0xE1000000
201 -#define MSM_DEBUG_UART_PHYS MSM_UART2_PHYS
202 -#elif defined(CONFIG_DEBUG_MSM_UART3)
203 -#define MSM_DEBUG_UART_BASE 0xE1000000
204 -#define MSM_DEBUG_UART_PHYS MSM_UART3_PHYS
205 -#endif
206 -
207 -#ifdef CONFIG_DEBUG_MSM8660_UART
208 -#define MSM_DEBUG_UART_BASE 0xF0040000
209 -#define MSM_DEBUG_UART_PHYS 0x19C40000
210 -#endif
211 -
212 -#ifdef CONFIG_DEBUG_MSM8960_UART
213 -#define MSM_DEBUG_UART_BASE 0xF0040000
214 -#define MSM_DEBUG_UART_PHYS 0x16440000
215 -#endif
216 -
217 -#ifdef CONFIG_DEBUG_MSM8974_UART
218 -#define MSM_DEBUG_UART_BASE 0xFA71E000
219 -#define MSM_DEBUG_UART_PHYS 0xF991E000
220 -#endif
221 -
222 .macro addruart, rp, rv, tmp
223 -#ifdef MSM_DEBUG_UART_PHYS
224 - ldr \rp, =MSM_DEBUG_UART_PHYS
225 - ldr \rv, =MSM_DEBUG_UART_BASE
226 +#ifdef CONFIG_DEBUG_UART_PHYS
227 + ldr \rp, =CONFIG_DEBUG_UART_PHYS
228 + ldr \rv, =CONFIG_DEBUG_UART_VIRT
229 #endif
230 .endm
231
232 .macro senduart, rd, rx
233 -#ifdef CONFIG_MSM_HAS_DEBUG_UART_HS
234 +#ifdef CONFIG_DEBUG_QCOM_UARTDM
235 @ Write the 1 character to UARTDM_TF
236 str \rd, [\rx, #0x70]
237 #else
238 @@ -68,7 +32,7 @@
239 .endm
240
241 .macro waituart, rd, rx
242 -#ifdef CONFIG_MSM_HAS_DEBUG_UART_HS
243 +#ifdef CONFIG_DEBUG_QCOM_UARTDM
244 @ check for TX_EMT in UARTDM_SR
245 ldr \rd, [\rx, #0x08]
246 tst \rd, #0x08
247 --- a/arch/arm/mach-msm/Kconfig
248 +++ b/arch/arm/mach-msm/Kconfig
249 @@ -42,9 +42,6 @@ config ARCH_QSD8X50
250
251 endchoice
252
253 -config MSM_HAS_DEBUG_UART_HS
254 - bool
255 -
256 config MSM_SOC_REV_A
257 bool
258