summaryrefslogtreecommitdiff
path: root/common/include/asm
diff options
context:
space:
mode:
authorOlivier Dufour2012-09-17 14:11:53 +0200
committerJérémy Dufour2012-10-18 10:25:02 +0200
commite0f4e08c89c4e4e1825ff214e1245e6391b70ef7 (patch)
treed3ef3597fda4c4b27c09a2201763060132a325f2 /common/include/asm
parent170f0719464382c7a45dbae9d6459daa7cbc6e1c (diff)
{cleo,polux}/linux/arm/wdt: support physical address in wdt, refs #3272
Before booting the kernel, there is not support for MMU and virtual address. This commit enables to setup and use the watchdog using physical address.
Diffstat (limited to 'common/include/asm')
-rw-r--r--common/include/asm/arch/ips/wdt.h2
-rw-r--r--common/include/asm/arch/wdt.h16
2 files changed, 18 insertions, 0 deletions
diff --git a/common/include/asm/arch/ips/wdt.h b/common/include/asm/arch/ips/wdt.h
index d4f574bfb0..39680347fb 100644
--- a/common/include/asm/arch/ips/wdt.h
+++ b/common/include/asm/arch/ips/wdt.h
@@ -40,6 +40,8 @@
#define WDT_COMP_TYPE_VA (*((volatile uint32_t *)(IO_ADDRESS(ARM_WDT_BASE) + WDTCOMP_TYPE_Offset)))
#define WDT_CRR_PA (*((volatile uint32_t *)(ARM_WDT_BASE + WDTCounterResetReg_Offset)))
+#define WDT_CR_PA (*((volatile uint32_t *)(ARM_WDT_BASE + WDTControlReg_Offset)))
+#define WDT_TORR_PA (*((volatile uint32_t *)(ARM_WDT_BASE + WDTTimeoutRangeReg_Offset)))
#endif /* __ASSEMBLY__ */
// Bitfields in Control Register
diff --git a/common/include/asm/arch/wdt.h b/common/include/asm/arch/wdt.h
index 76cc399eb1..52ccddffa3 100644
--- a/common/include/asm/arch/wdt.h
+++ b/common/include/asm/arch/wdt.h
@@ -43,6 +43,17 @@ extern uint32_t spc300_wdt_user_mode;
int spc300_wdt_start(uint timeout_s);
/**
+ * Start watchdog timer countdown (using physical address).
+ *
+ * \param timeout_s timeout of the watchdog (in second).
+ * \return 0 if no error, error value otherwise (EINVAL if timeout_s is too
+ * big).
+ *
+ * This function is the same as spc300_wdt_start but using physical address.
+ */
+int spc300_wdt_start_pa(uint timeout_s);
+
+/**
* Switch watchdog between user and kernel mode.
*
* \param use_umode 1 to switch to user mode.
@@ -55,6 +66,11 @@ void spc300_wdt_switch(int use_umode);
void spc300_wdt_refresh(void);
/**
+ * Refresh watchdog timer (using physical address).
+ */
+void spc300_wdt_refresh_pa(void);
+
+/**
* Get the watchdog time interval.
*
* \return time interval.