diff mbox

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

Message ID 1429226111-29823-5-git-send-email-s.temerkhanov@gmail.com
State Changes Requested
Delegated to: Albert ARIBAUD
Headers show

Commit Message

Sergey Temerkhanov April 16, 2015, 11:15 p.m. UTC
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@gmail.com>
Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>
---
 drivers/serial/serial_pl01x.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Albert ARIBAUD July 2, 2015, 7:47 p.m. UTC | #1
Hello Sergey,

On Thu, 16 Apr 2015 16:15:08 -0700, Sergey Temerkhanov
<s.temerkhanov@gmail.com> wrote:
> 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@gmail.com>
> Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>
> ---
>  drivers/serial/serial_pl01x.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

> +#ifndef CONFIG_PL010_SERIAL_PREINIT

This configuration option is new; please add a description of it
somewhere in a README.* under doc/.

Amicalement,
diff mbox

Patch

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);
 }