[U-Boot] [PATCH 4/7] arm: uart: Add ability to use pre-initialized UARTs

Sergey Temerkhanov s.temerkhanov at gmail.com
Fri Apr 17 01:15:08 CEST 2015


On some systems, UART initialization is performed before running U-Boot.
This commit allows to skip UART re-initializaion on those systems

Signed-off-by: Sergey Temerkhanov <s.temerkhanov at gmail.com>
Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla at cavium.com>
---
 drivers/serial/serial_pl01x.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/serial/serial_pl01x.c b/drivers/serial/serial_pl01x.c
index 75eb6bd..be9a14a 100644
--- a/drivers/serial/serial_pl01x.c
+++ b/drivers/serial/serial_pl01x.c
@@ -69,7 +69,7 @@ static int pl01x_tstc(struct pl01x_regs *regs)
 	return !(readl(&regs->fr) & UART_PL01x_FR_RXFE);
 }
 
-static int pl01x_generic_serial_init(struct pl01x_regs *regs,
+static __used int pl01x_generic_serial_init(struct pl01x_regs *regs,
 				     enum pl01x_type type)
 {
 	switch (type) {
@@ -204,7 +204,9 @@ static void pl01x_serial_init_baud(int baudrate)
 #endif
 	base_regs = (struct pl01x_regs *)port[CONFIG_CONS_INDEX];
 
+#ifndef CONFIG_PL010_SERIAL_PREINIT
 	pl01x_generic_serial_init(base_regs, pl01x_type);
+#endif
 	pl01x_generic_setbrg(base_regs, pl01x_type, clock, baudrate);
 }
 
-- 
2.1.4



More information about the U-Boot mailing list