From bcdbd06d56d37533190e3f50c40c0e417fb61aa4 Mon Sep 17 00:00:00 2001 From: Per Fransson Date: Fri, 28 Jan 2011 15:26:35 +0100 Subject: U8500: Kick the Cortex watchdog when dumping ST-Ericsson ID: 321908 Change-Id: Ib51c36558e37c7f52db638052644758e6d3cc51a Signed-off-by: Per Fransson Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/13848 Reviewed-by: QATOOLS Reviewed-by: Michael BRANDT --- board/st/u8500/cmd_cdump.c | 20 ++++++++++++++++++++ include/asm-arm/arch-db8500/hardware.h | 2 ++ 2 files changed, 22 insertions(+) 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 #include "malloc.h" #include +#include #include #include #include +#include + +#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 */ -- cgit v1.2.3