]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
serial/serial_arc: set registers address during compilation
authorAlexey Brodkin <abrodkin@synopsys.com>
Tue, 24 Feb 2015 16:31:51 +0000 (19:31 +0300)
committerAlexey Brodkin <abrodkin@synopsys.com>
Fri, 3 Apr 2015 06:47:49 +0000 (09:47 +0300)
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 <abrodkin@synopsys.com>
drivers/serial/serial_arc.c

index 2ddbf32a507ace37bbd66d54402e0d3895b7785f..0ee8ce5e7d12e40fd1e4d42d01b6117670d5d12d 100644 (file)
@@ -28,7 +28,7 @@ struct arc_serial_regs {
 #define UART_OVERFLOW_ERR      (1 << 1)
 #define UART_TXEMPTY           (1 << 7)
 
 #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)
 {
 
 static void arc_serial_setbrg(void)
 {
@@ -60,7 +60,6 @@ static void arc_serial_setbrg(void)
 
 static int arc_serial_init(void)
 {
 
 static int arc_serial_init(void)
 {
-       regs = (struct arc_serial_regs *)CONFIG_ARC_UART_BASE;
        serial_setbrg();
        return 0;
 }
        serial_setbrg();
        return 0;
 }