From: Alexey Brodkin Date: Tue, 24 Feb 2015 16:31:51 +0000 (+0300) Subject: serial/serial_arc: set registers address during compilation X-Git-Tag: v2015.04~29^2~11 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=36d68668e33191d55b2a23c9f0ec0c1ffecd6897;p=oweals%2Fu-boot.git serial/serial_arc: set registers address during compilation Being global variable with 0 value it falls into .bss area which we may only use after relocation to RAM. And right afetr relocation we zero .bss - effectively cleaing register address set for early console. Now with pre-set value "regs" variable is no longer in .bss and this way safely survives relocation. Signed-off-by: Alexey Brodkin --- diff --git a/drivers/serial/serial_arc.c b/drivers/serial/serial_arc.c index 2ddbf32a50..0ee8ce5e7d 100644 --- a/drivers/serial/serial_arc.c +++ b/drivers/serial/serial_arc.c @@ -28,7 +28,7 @@ struct arc_serial_regs { #define UART_OVERFLOW_ERR (1 << 1) #define UART_TXEMPTY (1 << 7) -struct arc_serial_regs *regs; +struct arc_serial_regs *regs = (struct arc_serial_regs *)CONFIG_ARC_UART_BASE; static void arc_serial_setbrg(void) { @@ -60,7 +60,6 @@ static void arc_serial_setbrg(void) static int arc_serial_init(void) { - regs = (struct arc_serial_regs *)CONFIG_ARC_UART_BASE; serial_setbrg(); return 0; }