mediatek: filogic: use UBI fast map to speed up boot
[openwrt/staging/dedeckeh.git] / package / boot / uboot-mediatek / patches / 002-0000-serial-Replace-CONFIG_DEBUG_UART_BASE-by-CONFIG_VAL-.patch
1 From b62450cf229c50ad2ce819dd02a09726909cc89a Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Pali=20Roh=C3=A1r?= <pali@kernel.org>
3 Date: Fri, 27 May 2022 22:15:24 +0200
4 Subject: [PATCH] serial: Replace CONFIG_DEBUG_UART_BASE by
5 CONFIG_VAL(DEBUG_UART_BASE)
6 MIME-Version: 1.0
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
9
10 CONFIG_VAL(DEBUG_UART_BASE) expands to CONFIG_DEBUG_UART_BASE or
11 CONFIG_SPL_DEBUG_UART_BASE or CONFIG_TPL_DEBUG_UART_BASE and allows boards
12 to set different values for SPL, TPL and U-Boot Proper.
13
14 For ns16550 driver this support is there since commit d293759d55cc
15 ("serial: ns16550: Add support for SPL_DEBUG_UART_BASE").
16
17 Signed-off-by: Pali Rohár <pali@kernel.org>
18 ---
19 arch/arm/mach-uniphier/debug-uart/debug-uart.c | 4 ++--
20 arch/x86/cpu/apollolake/cpu_common.c | 2 +-
21 board/eets/pdu001/board.c | 2 +-
22 drivers/serial/altera_jtag_uart.c | 2 +-
23 drivers/serial/altera_uart.c | 4 ++--
24 drivers/serial/atmel_usart.c | 4 ++--
25 drivers/serial/serial_ar933x.c | 4 ++--
26 drivers/serial/serial_arc.c | 4 ++--
27 drivers/serial/serial_bcm6345.c | 4 ++--
28 drivers/serial/serial_linflexuart.c | 4 ++--
29 drivers/serial/serial_meson.c | 2 +-
30 drivers/serial/serial_msm_geni.c | 6 +++---
31 drivers/serial/serial_mt7620.c | 4 ++--
32 drivers/serial/serial_mtk.c | 4 ++--
33 drivers/serial/serial_mvebu_a3700.c | 4 ++--
34 drivers/serial/serial_mxc.c | 4 ++--
35 drivers/serial/serial_omap.c | 4 ++--
36 drivers/serial/serial_pic32.c | 4 ++--
37 drivers/serial/serial_pl01x.c | 4 ++--
38 drivers/serial/serial_s5p.c | 4 ++--
39 drivers/serial/serial_sifive.c | 4 ++--
40 drivers/serial/serial_stm32.c | 4 ++--
41 drivers/serial/serial_xuartlite.c | 4 ++--
42 drivers/serial/serial_zynq.c | 4 ++--
43 24 files changed, 45 insertions(+), 45 deletions(-)
44
45 --- a/arch/arm/mach-uniphier/debug-uart/debug-uart.c
46 +++ b/arch/arm/mach-uniphier/debug-uart/debug-uart.c
47 @@ -18,7 +18,7 @@
48
49 static void _debug_uart_putc(int c)
50 {
51 - void __iomem *base = (void __iomem *)CONFIG_DEBUG_UART_BASE;
52 + void __iomem *base = (void __iomem *)CONFIG_VAL(DEBUG_UART_BASE);
53
54 while (!(readl(base + UNIPHIER_UART_LSR) & UART_LSR_THRE))
55 ;
56 @@ -57,7 +57,7 @@ void sg_set_iectrl(unsigned int pin)
57 void _debug_uart_init(void)
58 {
59 #ifdef CONFIG_SPL_BUILD
60 - void __iomem *base = (void __iomem *)CONFIG_DEBUG_UART_BASE;
61 + void __iomem *base = (void __iomem *)CONFIG_VAL(DEBUG_UART_BASE);
62 unsigned int divisor;
63
64 switch (uniphier_get_soc_id()) {
65 --- a/arch/x86/cpu/apollolake/cpu_common.c
66 +++ b/arch/x86/cpu/apollolake/cpu_common.c
67 @@ -72,7 +72,7 @@ static void pch_uart_init(void)
68 }
69
70 #ifdef CONFIG_DEBUG_UART
71 - apl_uart_init(PCH_DEV_UART, CONFIG_DEBUG_UART_BASE);
72 + apl_uart_init(PCH_DEV_UART, CONFIG_VAL(DEBUG_UART_BASE));
73 #endif
74 }
75
76 --- a/board/eets/pdu001/board.c
77 +++ b/board/eets/pdu001/board.c
78 @@ -273,7 +273,7 @@ void board_debug_uart_init(void)
79 setup_early_clocks();
80
81 /* done by pin controller driver if not debugging */
82 - enable_uart_pin_mux(CONFIG_DEBUG_UART_BASE);
83 + enable_uart_pin_mux(CONFIG_VAL(DEBUG_UART_BASE));
84 }
85 #endif
86
87 --- a/drivers/serial/altera_jtag_uart.c
88 +++ b/drivers/serial/altera_jtag_uart.c
89 @@ -134,7 +134,7 @@ static inline void _debug_uart_init(void
90
91 static inline void _debug_uart_putc(int ch)
92 {
93 - struct altera_jtaguart_regs *regs = (void *)CONFIG_DEBUG_UART_BASE;
94 + struct altera_jtaguart_regs *regs = (void *)CONFIG_VAL(DEBUG_UART_BASE);
95
96 while (1) {
97 u32 st = readl(&regs->control);
98 --- a/drivers/serial/altera_uart.c
99 +++ b/drivers/serial/altera_uart.c
100 @@ -123,7 +123,7 @@ U_BOOT_DRIVER(altera_uart) = {
101
102 static inline void _debug_uart_init(void)
103 {
104 - struct altera_uart_regs *regs = (void *)CONFIG_DEBUG_UART_BASE;
105 + struct altera_uart_regs *regs = (void *)CONFIG_VAL(DEBUG_UART_BASE);
106 u32 div;
107
108 div = (CONFIG_DEBUG_UART_CLOCK / CONFIG_BAUDRATE) - 1;
109 @@ -132,7 +132,7 @@ static inline void _debug_uart_init(void
110
111 static inline void _debug_uart_putc(int ch)
112 {
113 - struct altera_uart_regs *regs = (void *)CONFIG_DEBUG_UART_BASE;
114 + struct altera_uart_regs *regs = (void *)CONFIG_VAL(DEBUG_UART_BASE);
115
116 while (1) {
117 u32 st = readl(&regs->status);
118 --- a/drivers/serial/atmel_usart.c
119 +++ b/drivers/serial/atmel_usart.c
120 @@ -319,14 +319,14 @@ U_BOOT_DRIVER(serial_atmel) = {
121 #ifdef CONFIG_DEBUG_UART_ATMEL
122 static inline void _debug_uart_init(void)
123 {
124 - atmel_usart3_t *usart = (atmel_usart3_t *)CONFIG_DEBUG_UART_BASE;
125 + atmel_usart3_t *usart = (atmel_usart3_t *)CONFIG_VAL(DEBUG_UART_BASE);
126
127 _atmel_serial_init(usart, CONFIG_DEBUG_UART_CLOCK, CONFIG_BAUDRATE);
128 }
129
130 static inline void _debug_uart_putc(int ch)
131 {
132 - atmel_usart3_t *usart = (atmel_usart3_t *)CONFIG_DEBUG_UART_BASE;
133 + atmel_usart3_t *usart = (atmel_usart3_t *)CONFIG_VAL(DEBUG_UART_BASE);
134
135 while (!(readl(&usart->csr) & USART3_BIT(TXRDY)))
136 ;
137 --- a/drivers/serial/serial_ar933x.c
138 +++ b/drivers/serial/serial_ar933x.c
139 @@ -199,7 +199,7 @@ U_BOOT_DRIVER(serial_ar933x) = {
140
141 static inline void _debug_uart_init(void)
142 {
143 - void __iomem *regs = (void *)CONFIG_DEBUG_UART_BASE;
144 + void __iomem *regs = (void *)CONFIG_VAL(DEBUG_UART_BASE);
145 u32 val, scale, step;
146
147 /*
148 @@ -227,7 +227,7 @@ static inline void _debug_uart_init(void
149
150 static inline void _debug_uart_putc(int c)
151 {
152 - void __iomem *regs = (void *)CONFIG_DEBUG_UART_BASE;
153 + void __iomem *regs = (void *)CONFIG_VAL(DEBUG_UART_BASE);
154 u32 data;
155
156 do {
157 --- a/drivers/serial/serial_arc.c
158 +++ b/drivers/serial/serial_arc.c
159 @@ -137,7 +137,7 @@ U_BOOT_DRIVER(serial_arc) = {
160
161 static inline void _debug_uart_init(void)
162 {
163 - struct arc_serial_regs *regs = (struct arc_serial_regs *)CONFIG_DEBUG_UART_BASE;
164 + struct arc_serial_regs *regs = (struct arc_serial_regs *)CONFIG_VAL(DEBUG_UART_BASE);
165 int arc_console_baud = CONFIG_DEBUG_UART_CLOCK / (CONFIG_BAUDRATE * 4) - 1;
166
167 writeb(arc_console_baud & 0xff, &regs->baudl);
168 @@ -146,7 +146,7 @@ static inline void _debug_uart_init(void
169
170 static inline void _debug_uart_putc(int c)
171 {
172 - struct arc_serial_regs *regs = (struct arc_serial_regs *)CONFIG_DEBUG_UART_BASE;
173 + struct arc_serial_regs *regs = (struct arc_serial_regs *)CONFIG_VAL(DEBUG_UART_BASE);
174
175 while (!(readb(&regs->status) & UART_TXEMPTY))
176 ;
177 --- a/drivers/serial/serial_bcm6345.c
178 +++ b/drivers/serial/serial_bcm6345.c
179 @@ -269,7 +269,7 @@ U_BOOT_DRIVER(bcm6345_serial) = {
180 #ifdef CONFIG_DEBUG_UART_BCM6345
181 static inline void _debug_uart_init(void)
182 {
183 - void __iomem *base = (void __iomem *)CONFIG_DEBUG_UART_BASE;
184 + void __iomem *base = (void __iomem *)CONFIG_VAL(DEBUG_UART_BASE);
185
186 bcm6345_serial_init(base, CONFIG_DEBUG_UART_CLOCK, CONFIG_BAUDRATE);
187 }
188 @@ -285,7 +285,7 @@ static inline void wait_xfered(void __io
189
190 static inline void _debug_uart_putc(int ch)
191 {
192 - void __iomem *base = (void __iomem *)CONFIG_DEBUG_UART_BASE;
193 + void __iomem *base = (void __iomem *)CONFIG_VAL(DEBUG_UART_BASE);
194
195 wait_xfered(base);
196 writel(ch, base + UART_FIFO_REG);
197 --- a/drivers/serial/serial_linflexuart.c
198 +++ b/drivers/serial/serial_linflexuart.c
199 @@ -201,14 +201,14 @@ U_BOOT_DRIVER(serial_linflex) = {
200
201 static inline void _debug_uart_init(void)
202 {
203 - struct linflex_fsl *base = (struct linflex_fsl *)CONFIG_DEBUG_UART_BASE;
204 + struct linflex_fsl *base = (struct linflex_fsl *)CONFIG_VAL(DEBUG_UART_BASE);
205
206 linflex_serial_init_internal(base);
207 }
208
209 static inline void _debug_uart_putc(int ch)
210 {
211 - struct linflex_fsl *base = (struct linflex_fsl *)CONFIG_DEBUG_UART_BASE;
212 + struct linflex_fsl *base = (struct linflex_fsl *)CONFIG_VAL(DEBUG_UART_BASE);
213
214 /* XXX: Is this OK? Should this use the non-DM version? */
215 _linflex_serial_putc(base, ch);
216 --- a/drivers/serial/serial_meson.c
217 +++ b/drivers/serial/serial_meson.c
218 @@ -182,7 +182,7 @@ static inline void _debug_uart_init(void
219
220 static inline void _debug_uart_putc(int ch)
221 {
222 - struct meson_uart *regs = (struct meson_uart *)CONFIG_DEBUG_UART_BASE;
223 + struct meson_uart *regs = (struct meson_uart *)CONFIG_VAL(DEBUG_UART_BASE);
224
225 while (readl(&regs->status) & AML_UART_TX_FULL)
226 ;
227 --- a/drivers/serial/serial_msm_geni.c
228 +++ b/drivers/serial/serial_msm_geni.c
229 @@ -569,7 +569,7 @@ U_BOOT_DRIVER(serial_msm_geni) = {
230 #ifdef CONFIG_DEBUG_UART_MSM_GENI
231
232 static struct msm_serial_data init_serial_data = {
233 - .base = CONFIG_DEBUG_UART_BASE
234 + .base = CONFIG_VAL(DEBUG_UART_BASE)
235 };
236
237 /* Serial dumb device, to reuse driver code */
238 @@ -587,7 +587,7 @@ static struct udevice init_dev = {
239
240 static inline void _debug_uart_init(void)
241 {
242 - phys_addr_t base = CONFIG_DEBUG_UART_BASE;
243 + phys_addr_t base = CONFIG_VAL(DEBUG_UART_BASE);
244
245 geni_serial_init(&init_dev);
246 geni_serial_baud(base, CLK_DIV, CONFIG_BAUDRATE);
247 @@ -596,7 +596,7 @@ static inline void _debug_uart_init(void
248
249 static inline void _debug_uart_putc(int ch)
250 {
251 - phys_addr_t base = CONFIG_DEBUG_UART_BASE;
252 + phys_addr_t base = CONFIG_VAL(DEBUG_UART_BASE);
253
254 writel(DEF_TX_WM, base + SE_GENI_TX_WATERMARK_REG);
255 qcom_geni_serial_setup_tx(base, 1);
256 --- a/drivers/serial/serial_mt7620.c
257 +++ b/drivers/serial/serial_mt7620.c
258 @@ -220,7 +220,7 @@ static inline void _debug_uart_init(void
259 {
260 struct mt7620_serial_plat plat;
261
262 - plat.regs = (void *)CONFIG_DEBUG_UART_BASE;
263 + plat.regs = (void *)CONFIG_VAL(DEBUG_UART_BASE);
264 plat.clock = CONFIG_DEBUG_UART_CLOCK;
265
266 writel(0, &plat.regs->ier);
267 @@ -233,7 +233,7 @@ static inline void _debug_uart_init(void
268 static inline void _debug_uart_putc(int ch)
269 {
270 struct mt7620_serial_regs __iomem *regs =
271 - (void *)CONFIG_DEBUG_UART_BASE;
272 + (void *)CONFIG_VAL(DEBUG_UART_BASE);
273
274 while (!(readl(&regs->lsr) & UART_LSR_THRE))
275 ;
276 --- a/drivers/serial/serial_mtk.c
277 +++ b/drivers/serial/serial_mtk.c
278 @@ -426,7 +426,7 @@ static inline void _debug_uart_init(void
279 {
280 struct mtk_serial_priv priv;
281
282 - priv.regs = (void *) CONFIG_DEBUG_UART_BASE;
283 + priv.regs = (void *) CONFIG_VAL(DEBUG_UART_BASE);
284 priv.clock = CONFIG_DEBUG_UART_CLOCK;
285
286 writel(0, &priv.regs->ier);
287 @@ -439,7 +439,7 @@ static inline void _debug_uart_init(void
288 static inline void _debug_uart_putc(int ch)
289 {
290 struct mtk_serial_regs __iomem *regs =
291 - (void *) CONFIG_DEBUG_UART_BASE;
292 + (void *) CONFIG_VAL(DEBUG_UART_BASE);
293
294 while (!(readl(&regs->lsr) & UART_LSR_THRE))
295 ;
296 --- a/drivers/serial/serial_mvebu_a3700.c
297 +++ b/drivers/serial/serial_mvebu_a3700.c
298 @@ -321,7 +321,7 @@ U_BOOT_DRIVER(serial_mvebu) = {
299
300 static inline void _debug_uart_init(void)
301 {
302 - void __iomem *base = (void __iomem *)CONFIG_DEBUG_UART_BASE;
303 + void __iomem *base = (void __iomem *)CONFIG_VAL(DEBUG_UART_BASE);
304 u32 parent_rate, divider;
305
306 /* reset FIFOs */
307 @@ -349,7 +349,7 @@ static inline void _debug_uart_init(void
308
309 static inline void _debug_uart_putc(int ch)
310 {
311 - void __iomem *base = (void __iomem *)CONFIG_DEBUG_UART_BASE;
312 + void __iomem *base = (void __iomem *)CONFIG_VAL(DEBUG_UART_BASE);
313
314 while (readl(base + UART_STATUS_REG) & UART_STATUS_TXFIFO_FULL)
315 ;
316 --- a/drivers/serial/serial_mxc.c
317 +++ b/drivers/serial/serial_mxc.c
318 @@ -372,7 +372,7 @@ U_BOOT_DRIVER(serial_mxc) = {
319
320 static inline void _debug_uart_init(void)
321 {
322 - struct mxc_uart *base = (struct mxc_uart *)CONFIG_DEBUG_UART_BASE;
323 + struct mxc_uart *base = (struct mxc_uart *)CONFIG_VAL(DEBUG_UART_BASE);
324
325 _mxc_serial_init(base, false);
326 _mxc_serial_setbrg(base, CONFIG_DEBUG_UART_CLOCK,
327 @@ -381,7 +381,7 @@ static inline void _debug_uart_init(void
328
329 static inline void _debug_uart_putc(int ch)
330 {
331 - struct mxc_uart *base = (struct mxc_uart *)CONFIG_DEBUG_UART_BASE;
332 + struct mxc_uart *base = (struct mxc_uart *)CONFIG_VAL(DEBUG_UART_BASE);
333
334 while (!(readl(&base->ts) & UTS_TXEMPTY))
335 WATCHDOG_RESET();
336 --- a/drivers/serial/serial_omap.c
337 +++ b/drivers/serial/serial_omap.c
338 @@ -66,7 +66,7 @@ static inline int serial_in_shift(void *
339
340 static inline void _debug_uart_init(void)
341 {
342 - struct ns16550 *com_port = (struct ns16550 *)CONFIG_DEBUG_UART_BASE;
343 + struct ns16550 *com_port = (struct ns16550 *)CONFIG_VAL(DEBUG_UART_BASE);
344 int baud_divisor;
345
346 baud_divisor = ns16550_calc_divisor(com_port, CONFIG_DEBUG_UART_CLOCK,
347 @@ -85,7 +85,7 @@ static inline void _debug_uart_init(void
348
349 static inline void _debug_uart_putc(int ch)
350 {
351 - struct ns16550 *com_port = (struct ns16550 *)CONFIG_DEBUG_UART_BASE;
352 + struct ns16550 *com_port = (struct ns16550 *)CONFIG_VAL(DEBUG_UART_BASE);
353
354 while (!(serial_din(&com_port->lsr) & UART_LSR_THRE))
355 ;
356 --- a/drivers/serial/serial_pic32.c
357 +++ b/drivers/serial/serial_pic32.c
358 @@ -187,14 +187,14 @@ U_BOOT_DRIVER(pic32_serial) = {
359
360 static inline void _debug_uart_init(void)
361 {
362 - void __iomem *base = (void __iomem *)CONFIG_DEBUG_UART_BASE;
363 + void __iomem *base = (void __iomem *)CONFIG_VAL(DEBUG_UART_BASE);
364
365 pic32_serial_init(base, CONFIG_DEBUG_UART_CLOCK, CONFIG_BAUDRATE);
366 }
367
368 static inline void _debug_uart_putc(int ch)
369 {
370 - writel(ch, CONFIG_DEBUG_UART_BASE + U_TXR);
371 + writel(ch, CONFIG_VAL(DEBUG_UART_BASE) + U_TXR);
372 }
373
374 DEBUG_UART_FUNCS
375 --- a/drivers/serial/serial_pl01x.c
376 +++ b/drivers/serial/serial_pl01x.c
377 @@ -403,7 +403,7 @@ U_BOOT_DRIVER(serial_pl01x) = {
378 static void _debug_uart_init(void)
379 {
380 #ifndef CONFIG_DEBUG_UART_SKIP_INIT
381 - struct pl01x_regs *regs = (struct pl01x_regs *)CONFIG_DEBUG_UART_BASE;
382 + struct pl01x_regs *regs = (struct pl01x_regs *)CONFIG_VAL(DEBUG_UART_BASE);
383 enum pl01x_type type;
384
385 if (IS_ENABLED(CONFIG_DEBUG_UART_PL011))
386 @@ -419,7 +419,7 @@ static void _debug_uart_init(void)
387
388 static inline void _debug_uart_putc(int ch)
389 {
390 - struct pl01x_regs *regs = (struct pl01x_regs *)CONFIG_DEBUG_UART_BASE;
391 + struct pl01x_regs *regs = (struct pl01x_regs *)CONFIG_VAL(DEBUG_UART_BASE);
392
393 while (pl01x_putc(regs, ch) == -EAGAIN)
394 ;
395 --- a/drivers/serial/serial_s5p.c
396 +++ b/drivers/serial/serial_s5p.c
397 @@ -276,7 +276,7 @@ static inline void _debug_uart_init(void
398 if (IS_ENABLED(CONFIG_DEBUG_UART_SKIP_INIT))
399 return;
400
401 - struct s5p_uart *uart = (struct s5p_uart *)CONFIG_DEBUG_UART_BASE;
402 + struct s5p_uart *uart = (struct s5p_uart *)CONFIG_VAL(DEBUG_UART_BASE);
403
404 s5p_serial_init(uart);
405 #if CONFIG_IS_ENABLED(ARCH_APPLE)
406 @@ -288,7 +288,7 @@ static inline void _debug_uart_init(void
407
408 static inline void _debug_uart_putc(int ch)
409 {
410 - struct s5p_uart *uart = (struct s5p_uart *)CONFIG_DEBUG_UART_BASE;
411 + struct s5p_uart *uart = (struct s5p_uart *)CONFIG_VAL(DEBUG_UART_BASE);
412
413 #if CONFIG_IS_ENABLED(ARCH_APPLE)
414 while (readl(&uart->ufstat) & S5L_TX_FIFO_FULL);
415 --- a/drivers/serial/serial_sifive.c
416 +++ b/drivers/serial/serial_sifive.c
417 @@ -212,7 +212,7 @@ U_BOOT_DRIVER(serial_sifive) = {
418 static inline void _debug_uart_init(void)
419 {
420 struct uart_sifive *regs =
421 - (struct uart_sifive *)CONFIG_DEBUG_UART_BASE;
422 + (struct uart_sifive *)CONFIG_VAL(DEBUG_UART_BASE);
423
424 _sifive_serial_setbrg(regs, CONFIG_DEBUG_UART_CLOCK,
425 CONFIG_BAUDRATE);
426 @@ -222,7 +222,7 @@ static inline void _debug_uart_init(void
427 static inline void _debug_uart_putc(int ch)
428 {
429 struct uart_sifive *regs =
430 - (struct uart_sifive *)CONFIG_DEBUG_UART_BASE;
431 + (struct uart_sifive *)CONFIG_VAL(DEBUG_UART_BASE);
432
433 while (_sifive_serial_putc(regs, ch) == -EAGAIN)
434 WATCHDOG_RESET();
435 --- a/drivers/serial/serial_stm32.c
436 +++ b/drivers/serial/serial_stm32.c
437 @@ -270,7 +270,7 @@ static inline struct stm32_uart_info *_d
438
439 static inline void _debug_uart_init(void)
440 {
441 - fdt_addr_t base = CONFIG_DEBUG_UART_BASE;
442 + fdt_addr_t base = CONFIG_VAL(DEBUG_UART_BASE);
443 struct stm32_uart_info *uart_info = _debug_uart_info();
444
445 _stm32_serial_init(base, uart_info);
446 @@ -281,7 +281,7 @@ static inline void _debug_uart_init(void
447
448 static inline void _debug_uart_putc(int c)
449 {
450 - fdt_addr_t base = CONFIG_DEBUG_UART_BASE;
451 + fdt_addr_t base = CONFIG_VAL(DEBUG_UART_BASE);
452 struct stm32_uart_info *uart_info = _debug_uart_info();
453
454 while (_stm32_serial_putc(base, uart_info, c) == -EAGAIN)
455 --- a/drivers/serial/serial_xuartlite.c
456 +++ b/drivers/serial/serial_xuartlite.c
457 @@ -143,7 +143,7 @@ U_BOOT_DRIVER(serial_uartlite) = {
458
459 static inline void _debug_uart_init(void)
460 {
461 - struct uartlite *regs = (struct uartlite *)CONFIG_DEBUG_UART_BASE;
462 + struct uartlite *regs = (struct uartlite *)CONFIG_VAL(DEBUG_UART_BASE);
463 int ret;
464
465 uart_out32(&regs->control, 0);
466 @@ -159,7 +159,7 @@ static inline void _debug_uart_init(void
467
468 static inline void _debug_uart_putc(int ch)
469 {
470 - struct uartlite *regs = (struct uartlite *)CONFIG_DEBUG_UART_BASE;
471 + struct uartlite *regs = (struct uartlite *)CONFIG_VAL(DEBUG_UART_BASE);
472
473 while (uart_in32(&regs->status) & SR_TX_FIFO_FULL)
474 ;
475 --- a/drivers/serial/serial_zynq.c
476 +++ b/drivers/serial/serial_zynq.c
477 @@ -295,7 +295,7 @@ U_BOOT_DRIVER(serial_zynq) = {
478 #ifdef CONFIG_DEBUG_UART_ZYNQ
479 static inline void _debug_uart_init(void)
480 {
481 - struct uart_zynq *regs = (struct uart_zynq *)CONFIG_DEBUG_UART_BASE;
482 + struct uart_zynq *regs = (struct uart_zynq *)CONFIG_VAL(DEBUG_UART_BASE);
483
484 _uart_zynq_serial_init(regs);
485 _uart_zynq_serial_setbrg(regs, CONFIG_DEBUG_UART_CLOCK,
486 @@ -304,7 +304,7 @@ static inline void _debug_uart_init(void
487
488 static inline void _debug_uart_putc(int ch)
489 {
490 - struct uart_zynq *regs = (struct uart_zynq *)CONFIG_DEBUG_UART_BASE;
491 + struct uart_zynq *regs = (struct uart_zynq *)CONFIG_VAL(DEBUG_UART_BASE);
492
493 while (_uart_zynq_serial_putc(regs, ch) == -EAGAIN)
494 WATCHDOG_RESET();