summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPer Fransson <per.xx.fransson@stericsson.com>2011-01-28 15:26:35 +0100
committerMichael BRANDT <michael.brandt@stericsson.com>2011-01-31 10:18:02 +0100
commitbcdbd06d56d37533190e3f50c40c0e417fb61aa4 (patch)
tree9a1b32c29e443be8aa1797b4180cce98c5bacc48
parent564b918d04de5489322a70db70ed95aa3628cd4c (diff)
U8500: Kick the Cortex watchdog when dumping
ST-Ericsson ID: 321908 Change-Id: Ib51c36558e37c7f52db638052644758e6d3cc51a Signed-off-by: Per Fransson <per.xx.fransson@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/13848 Reviewed-by: QATOOLS Reviewed-by: Michael BRANDT <michael.brandt@stericsson.com>
-rw-r--r--board/st/u8500/cmd_cdump.c20
-rw-r--r--include/asm-arm/arch-db8500/hardware.h2
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 */