diff options
| author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2010-07-23 05:46:52 -0400 |
|---|---|---|
| committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-07-26 05:33:07 -0400 |
| commit | 51aa87beb9dff42ccc3612811e83d1ad98141e0b (patch) | |
| tree | 0c0fe41517d37b984fc2e71b6b7218702f32b0c2 | |
| parent | 73bcc76aeee6afb21471ad9ec33341c7452b4d6f (diff) | |
ARM: 6263/1: ns9xxx: fix FTBFS for zImage
the different putc variants used an initialized local static variable
which is broken since
5de813b (ARM: Eliminate decompressor -Dstatic= PIC hack)
This needs to be initialized at runtime and so needs to be global.
While at it give it a better name.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
| -rw-r--r-- | arch/arm/mach-ns9xxx/include/mach/uncompress.h | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/arch/arm/mach-ns9xxx/include/mach/uncompress.h b/arch/arm/mach-ns9xxx/include/mach/uncompress.h index 1b12d324b087..770a68c46e81 100644 --- a/arch/arm/mach-ns9xxx/include/mach/uncompress.h +++ b/arch/arm/mach-ns9xxx/include/mach/uncompress.h | |||
| @@ -20,50 +20,49 @@ static void putc_dummy(char c, void __iomem *base) | |||
| 20 | /* nothing */ | 20 | /* nothing */ |
| 21 | } | 21 | } |
| 22 | 22 | ||
| 23 | static int timeout; | ||
| 24 | |||
| 23 | static void putc_ns9360(char c, void __iomem *base) | 25 | static void putc_ns9360(char c, void __iomem *base) |
| 24 | { | 26 | { |
| 25 | static int t = 0x10000; | ||
| 26 | do { | 27 | do { |
| 27 | if (t) | 28 | if (timeout) |
| 28 | --t; | 29 | --timeout; |
| 29 | 30 | ||
| 30 | if (__raw_readl(base + 8) & (1 << 3)) { | 31 | if (__raw_readl(base + 8) & (1 << 3)) { |
| 31 | __raw_writeb(c, base + 16); | 32 | __raw_writeb(c, base + 16); |
| 32 | t = 0x10000; | 33 | timeout = 0x10000; |
| 33 | break; | 34 | break; |
| 34 | } | 35 | } |
| 35 | } while (t); | 36 | } while (timeout); |
| 36 | } | 37 | } |
| 37 | 38 | ||
| 38 | static void putc_a9m9750dev(char c, void __iomem *base) | 39 | static void putc_a9m9750dev(char c, void __iomem *base) |
| 39 | { | 40 | { |
| 40 | static int t = 0x10000; | ||
| 41 | do { | 41 | do { |
| 42 | if (t) | 42 | if (timeout) |
| 43 | --t; | 43 | --timeout; |
| 44 | 44 | ||
| 45 | if (__raw_readb(base + 5) & (1 << 5)) { | 45 | if (__raw_readb(base + 5) & (1 << 5)) { |
| 46 | __raw_writeb(c, base); | 46 | __raw_writeb(c, base); |
| 47 | t = 0x10000; | 47 | timeout = 0x10000; |
| 48 | break; | 48 | break; |
| 49 | } | 49 | } |
| 50 | } while (t); | 50 | } while (timeout); |
| 51 | 51 | ||
| 52 | } | 52 | } |
| 53 | 53 | ||
| 54 | static void putc_ns921x(char c, void __iomem *base) | 54 | static void putc_ns921x(char c, void __iomem *base) |
| 55 | { | 55 | { |
| 56 | static int t = 0x10000; | ||
| 57 | do { | 56 | do { |
| 58 | if (t) | 57 | if (timeout) |
| 59 | --t; | 58 | --timeout; |
| 60 | 59 | ||
| 61 | if (!(__raw_readl(base) & (1 << 11))) { | 60 | if (!(__raw_readl(base) & (1 << 11))) { |
| 62 | __raw_writeb(c, base + 0x0028); | 61 | __raw_writeb(c, base + 0x0028); |
| 63 | t = 0x10000; | 62 | timeout = 0x10000; |
| 64 | break; | 63 | break; |
| 65 | } | 64 | } |
| 66 | } while (t); | 65 | } while (timeout); |
| 67 | } | 66 | } |
| 68 | 67 | ||
| 69 | #define MSCS __REG(0xA0900184) | 68 | #define MSCS __REG(0xA0900184) |
| @@ -89,6 +88,7 @@ static void putc_ns921x(char c, void __iomem *base) | |||
| 89 | 88 | ||
| 90 | static void autodetect(void (**putc)(char, void __iomem *), void __iomem **base) | 89 | static void autodetect(void (**putc)(char, void __iomem *), void __iomem **base) |
| 91 | { | 90 | { |
| 91 | timeout = 0x10000; | ||
| 92 | if (((__raw_readl(MSCS) >> 16) & 0xfe) == 0x00) { | 92 | if (((__raw_readl(MSCS) >> 16) & 0xfe) == 0x00) { |
| 93 | /* ns9360 or ns9750 */ | 93 | /* ns9360 or ns9750 */ |
| 94 | if (NS9360_UART_ENABLED(NS9360_UARTA)) { | 94 | if (NS9360_UART_ENABLED(NS9360_UARTA)) { |
