[ARM] mmp: fix for variables in uncompress.h being discarded
authorEric Miao <eric.y.miao@gmail.com>
Mon, 22 Mar 2010 01:39:58 +0000 (09:39 +0800)
committerEric Miao <eric.y.miao@gmail.com>
Mon, 22 Mar 2010 04:03:05 +0000 (12:03 +0800)
Due to commit:

    5de813b  ARM: Eliminate decompressor -Dstatic= PIC hack

The data section will be discarded for the decompressor, thus move the
static variables into BSS section by initializing them at run time.

Reported-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
arch/arm/mach-mmp/include/mach/uncompress.h

index a7dcc5307216524b4f2e57c05af043530be64f5a..85bd8a2d84b5e47cc3acc1a24192a8387c3d28ab 100644 (file)
@@ -14,7 +14,7 @@
 #define UART2_BASE     (APB_PHYS_BASE + 0x17000)
 #define UART3_BASE     (APB_PHYS_BASE + 0x18000)
 
-static volatile unsigned long *UART = (unsigned long *)UART2_BASE;
+static volatile unsigned long *UART;
 
 static inline void putc(char c)
 {
@@ -37,6 +37,9 @@ static inline void flush(void)
 
 static inline void arch_decomp_setup(void)
 {
+       /* default to UART2 */
+       UART = (unsigned long *)UART2_BASE;
+
        if (machine_is_avengers_lite())
                UART = (unsigned long *)UART3_BASE;
 }