diff options
-rw-r--r-- | board/st/u8500/cmd_cdump.c | 20 | ||||
-rw-r--r-- | include/asm-arm/arch-db8500/hardware.h | 2 |
2 files changed, 22 insertions, 0 deletions
diff --git a/board/st/u8500/cmd_cdump.c b/board/st/u8500/cmd_cdump.c index 87ae2a793..d37f3d77f 100644 --- a/board/st/u8500/cmd_cdump.c +++ b/board/st/u8500/cmd_cdump.c @@ -13,10 +13,14 @@ #include <command.h> #include "malloc.h" #include <mmc.h> +#include <asm/io.h> #include <asm/setup.h> #include <elf.h> #include <fat.h> +#include <asm/arch/hardware.h> + +#define TWD_WDOG_LOAD 0x20 /* * Note: with the Rockbox FAT support, the file path must be an absolute path, @@ -24,6 +28,19 @@ */ static char *crash_filename = "/cdump.elf"; +static void kick_mpcore_wdt(void) +{ + unsigned long mpcore_wdt_loadreg; + + mpcore_wdt_loadreg = readl(U8500_TWD_BASE + TWD_WDOG_LOAD); + /* + * According to the linux mpcore_wdt driver a different value needs to + * be written to the load register every time + */ + mpcore_wdt_loadreg = mpcore_wdt_loadreg ^ 0x1; + writel(mpcore_wdt_loadreg, U8500_TWD_BASE + TWD_WDOG_LOAD); +} + /* * Check ELF header */ @@ -72,6 +89,8 @@ static int write_big_chunk(int fd, void *addr, size_t count) while (total < count) { size_t bytes = count - total; + kick_mpcore_wdt(); + if (bytes > 0x100000) bytes = 0x100000; if (write_chunk(fd, a, bytes)) @@ -256,6 +275,7 @@ static int wait_for_mmc(void) return 1; } while (mmc_init(mmc) != 0) { + kick_mpcore_wdt(); printf("Insert MMC/SD card or press ctrl-c to abort\n"); putc('.'); udelay(500000); diff --git a/include/asm-arm/arch-db8500/hardware.h b/include/asm-arm/arch-db8500/hardware.h index df55a841d..990c062fb 100644 --- a/include/asm-arm/arch-db8500/hardware.h +++ b/include/asm-arm/arch-db8500/hardware.h @@ -87,4 +87,6 @@ #define U8500_ASIC_ID_LOC_ED_V1 (U8500_BOOTROM_BASE + 0x1FFF4) #define U8500_ASIC_ID_LOC_V2 (U8500_BOOTROM_BASE + 0x1DBF4) +#define U8500_TWD_BASE 0xa0410600 + #endif /* __ASM_ARCH_HARDWARE_H */ |