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