summaryrefslogtreecommitdiff
path: root/cleopatre/linux-2.6.25.10-spc300
diff options
context:
space:
mode:
authorOlivier Dufour2012-09-19 10:46:21 +0200
committerJérémy Dufour2012-10-18 10:25:03 +0200
commitef7574d6c17218f2e3125c2433b9545d0297333f (patch)
tree44a1d582c2a7f1d1d052459cc93352233b2f7d5e /cleopatre/linux-2.6.25.10-spc300
parente0f4e08c89c4e4e1825ff214e1245e6391b70ef7 (diff)
{cleo,polux}/linux/arm/wdt: move some functions to header, refs #3272
In order to be able to add support for watchdog functions in boot sequence, functions to start and refresh it need to be defined directly in header files.
Diffstat (limited to 'cleopatre/linux-2.6.25.10-spc300')
-rw-r--r--cleopatre/linux-2.6.25.10-spc300/arch/arm/mach-spc300/spc300-device-wdt.c80
1 files changed, 0 insertions, 80 deletions
diff --git a/cleopatre/linux-2.6.25.10-spc300/arch/arm/mach-spc300/spc300-device-wdt.c b/cleopatre/linux-2.6.25.10-spc300/arch/arm/mach-spc300/spc300-device-wdt.c
index 23f7322610..d262da2b69 100644
--- a/cleopatre/linux-2.6.25.10-spc300/arch/arm/mach-spc300/spc300-device-wdt.c
+++ b/cleopatre/linux-2.6.25.10-spc300/arch/arm/mach-spc300/spc300-device-wdt.c
@@ -29,76 +29,6 @@
uint32_t spc300_wdt_user_mode = 0;
EXPORT_SYMBOL(spc300_wdt_user_mode);
-/**
- * Refresh watchdog timer.
- *
- * \param va true if need to use virtual address to access register, false
- * for physical address.
- */
-static void spc300_wdt_refresh_(bool va)
-{
- uint32_t reg = WDT_BF(CR, WDT_CR_VAL);
- if (va)
- WDT_CRR_VA = reg;
- else
- WDT_CRR_PA = reg;
-}
-
-/**
- * Start watchdog timer countdown.
- *
- * \param timeout_s timeout of the watchdog (in second).
- * \param va true if need to use virtual address to access register, false
- * for physical address.
- * \return 0 if no error, error value otherwise (-EINVAL if timeout_s is too
- * big).
- */
-static int spc300_wdt_start_(uint timeout_s, bool va)
-{
- uint32_t cnt_value, top, reg;
-
- //Timeout period = (2^(16+ TOP_reg)) / PCLK
-
- // Configure timeout?
- if(timeout_s)
- {
- if(timeout_s > WDT_MAX_TIME)
- return -EINVAL;
-
- cnt_value = timeout_s * PCLK;
-
- for(top=15 ; top>0 ; top--)
- {
- if(cnt_value >= (1<<(top+16)))
- {
- if (va)
- WDT_TORR_VA = WDT_BFINS(TOP, top, WDT_TORR_VA);
- else
- WDT_TORR_PA = WDT_BFINS(TOP, top, WDT_TORR_PA);
- break;
- }
- }
- }
- //Enable WDT with reset pulse = 32pclk and without interrupt management
- reg = WDT_BF(RPL, 4) | WDT_BF(RMOD, 0) | WDT_BF(EN, 1);
- if (va)
- WDT_CR_VA = reg;
- else
- WDT_CR_PA = reg;
- spc300_wdt_refresh_(va);
- return 0;
-}
-
-int spc300_wdt_start(uint timeout_s)
-{
- return spc300_wdt_start_(timeout_s, true);
-}
-
-int spc300_wdt_start_pa(uint timeout_s)
-{
- return spc300_wdt_start_(timeout_s, false);
-}
-
void spc300_wdt_switch(int use_umode)
{
if(use_umode)
@@ -107,16 +37,6 @@ void spc300_wdt_switch(int use_umode)
spc300_wdt_user_mode = 0;
}
-void spc300_wdt_refresh(void)
-{
- spc300_wdt_refresh_ (true);
-}
-
-void spc300_wdt_refresh_pa(void)
-{
- spc300_wdt_refresh_ (false);
-}
-
int spc300_wdt_gettimeout(void)
{
uint32_t top;