diff options
| author | Ben Dooks <ben-linux@fluff.org> | 2005-11-08 17:43:05 -0500 |
|---|---|---|
| committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2005-11-08 17:43:05 -0500 |
| commit | f8c905d368c757e2c96db293a472a31abcf4b147 (patch) | |
| tree | ff762892db823ec597eba3cd895575c4d09d7762 | |
| parent | 4c18ad20493c9eac6e7d0c2a05156acfc02d9b6b (diff) | |
[ARM] 3132/1: S3C2410 - reset on decompression error
Patch from Ben Dooks
Force a watchdog reset if the system fails to
decompress properly.
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
| -rw-r--r-- | arch/arm/boot/compressed/misc.c | 6 | ||||
| -rw-r--r-- | arch/arm/mach-s3c2410/Kconfig | 8 | ||||
| -rw-r--r-- | include/asm-arm/arch-s3c2410/uncompress.h | 22 |
3 files changed, 34 insertions, 2 deletions
diff --git a/arch/arm/boot/compressed/misc.c b/arch/arm/boot/compressed/misc.c index 50f13eec6cd7..5ab94584baee 100644 --- a/arch/arm/boot/compressed/misc.c +++ b/arch/arm/boot/compressed/misc.c | |||
| @@ -283,8 +283,14 @@ void flush_window(void) | |||
| 283 | putstr("."); | 283 | putstr("."); |
| 284 | } | 284 | } |
| 285 | 285 | ||
| 286 | #ifndef arch_error | ||
| 287 | #define arch_error(x) | ||
| 288 | #endif | ||
| 289 | |||
| 286 | static void error(char *x) | 290 | static void error(char *x) |
| 287 | { | 291 | { |
| 292 | arch_error(x); | ||
| 293 | |||
| 288 | putstr("\n\n"); | 294 | putstr("\n\n"); |
| 289 | putstr(x); | 295 | putstr(x); |
| 290 | putstr("\n\n -- System halted"); | 296 | putstr("\n\n -- System halted"); |
diff --git a/arch/arm/mach-s3c2410/Kconfig b/arch/arm/mach-s3c2410/Kconfig index c796bcdd6158..0b9d7ca49ec1 100644 --- a/arch/arm/mach-s3c2410/Kconfig +++ b/arch/arm/mach-s3c2410/Kconfig | |||
| @@ -121,6 +121,14 @@ config S3C2410_BOOT_WATCHDOG | |||
| 121 | system resets depends on the value of PCLK. The timeout on an | 121 | system resets depends on the value of PCLK. The timeout on an |
| 122 | 200MHz s3c2410 should be about 30 seconds. | 122 | 200MHz s3c2410 should be about 30 seconds. |
| 123 | 123 | ||
| 124 | config S3C2410_BOOT_ERROR_RESET | ||
| 125 | bool "S3C2410 Reboot on decompression error" | ||
| 126 | depends on ARCH_S3C2410 | ||
| 127 | help | ||
| 128 | Say y here to use the watchdog to reset the system if the | ||
| 129 | kernel decompressor detects an error during decompression. | ||
| 130 | |||
| 131 | |||
| 124 | comment "S3C2410 Setup" | 132 | comment "S3C2410 Setup" |
| 125 | 133 | ||
| 126 | config S3C2410_DMA | 134 | config S3C2410_DMA |
diff --git a/include/asm-arm/arch-s3c2410/uncompress.h b/include/asm-arm/arch-s3c2410/uncompress.h index d7a4a8354fa9..ddd1578a7ee0 100644 --- a/include/asm-arm/arch-s3c2410/uncompress.h +++ b/include/asm-arm/arch-s3c2410/uncompress.h | |||
| @@ -116,6 +116,8 @@ putstr(const char *ptr) | |||
| 116 | } | 116 | } |
| 117 | } | 117 | } |
| 118 | 118 | ||
| 119 | #define __raw_writel(d,ad) do { *((volatile unsigned int *)(ad)) = (d); } while(0) | ||
| 120 | |||
| 119 | /* CONFIG_S3C2410_BOOT_WATCHDOG | 121 | /* CONFIG_S3C2410_BOOT_WATCHDOG |
| 120 | * | 122 | * |
| 121 | * Simple boot-time watchdog setup, to reboot the system if there is | 123 | * Simple boot-time watchdog setup, to reboot the system if there is |
| @@ -126,8 +128,6 @@ putstr(const char *ptr) | |||
| 126 | 128 | ||
| 127 | #define WDOG_COUNT (0xff00) | 129 | #define WDOG_COUNT (0xff00) |
| 128 | 130 | ||
| 129 | #define __raw_writel(d,ad) do { *((volatile unsigned int *)(ad)) = (d); } while(0) | ||
| 130 | |||
| 131 | static inline void arch_decomp_wdog(void) | 131 | static inline void arch_decomp_wdog(void) |
| 132 | { | 132 | { |
| 133 | __raw_writel(WDOG_COUNT, S3C2410_WTCNT); | 133 | __raw_writel(WDOG_COUNT, S3C2410_WTCNT); |
| @@ -145,6 +145,24 @@ static void arch_decomp_wdog_start(void) | |||
| 145 | #define arch_decomp_wdog() | 145 | #define arch_decomp_wdog() |
| 146 | #endif | 146 | #endif |
| 147 | 147 | ||
| 148 | #ifdef CONFIG_S3C2410_BOOT_ERROR_RESET | ||
| 149 | |||
| 150 | static void arch_decomp_error(const char *x) | ||
| 151 | { | ||
| 152 | putstr("\n\n"); | ||
| 153 | putstr(x); | ||
| 154 | putstr("\n\n -- System resetting\n"); | ||
| 155 | |||
| 156 | __raw_writel(0x4000, S3C2410_WTDAT); | ||
| 157 | __raw_writel(0x4000, S3C2410_WTCNT); | ||
| 158 | __raw_writel(S3C2410_WTCON_ENABLE | S3C2410_WTCON_DIV128 | S3C2410_WTCON_RSTEN | S3C2410_WTCON_PRESCALE(0x40), S3C2410_WTCON); | ||
| 159 | |||
| 160 | while(1); | ||
| 161 | } | ||
| 162 | |||
| 163 | #define arch_error arch_decomp_error | ||
| 164 | #endif | ||
| 165 | |||
| 148 | static void error(char *err); | 166 | static void error(char *err); |
| 149 | 167 | ||
| 150 | static void | 168 | static void |
