summaryrefslogtreecommitdiff
path: root/cleopatre/u-boot-1.1.6/cpu
diff options
context:
space:
mode:
authorJérémy Dufour2012-10-23 14:51:53 +0200
committerJérémy Dufour2012-10-23 18:58:26 +0200
commiteb59f9336084e8400f5adb151df892bfec197a0c (patch)
tree552be5197e852bbf44a418bda219c1553c6ebfd7 /cleopatre/u-boot-1.1.6/cpu
parent7d39280584f63206e9e691833fee5cf623f5d626 (diff)
cleo/uboot: use common watchdog API, closes #3296
Changes introduced by commit 170f07194643 should have been reported to uboot too.
Diffstat (limited to 'cleopatre/u-boot-1.1.6/cpu')
-rw-r--r--cleopatre/u-boot-1.1.6/cpu/spc300/Makefile2
-rw-r--r--cleopatre/u-boot-1.1.6/cpu/spc300/wdt.c120
2 files changed, 1 insertions, 121 deletions
diff --git a/cleopatre/u-boot-1.1.6/cpu/spc300/Makefile b/cleopatre/u-boot-1.1.6/cpu/spc300/Makefile
index c3ad80d174..736e90ee84 100644
--- a/cleopatre/u-boot-1.1.6/cpu/spc300/Makefile
+++ b/cleopatre/u-boot-1.1.6/cpu/spc300/Makefile
@@ -22,7 +22,7 @@ include $(TOPDIR)/config.mk
LIB = lib$(CPU).a
START = start.o
-OBJS = interrupts.o cpu.o timer.o serial.o wdt.o masterclk.o
+OBJS = interrupts.o cpu.o timer.o serial.o masterclk.o
SOBJS = reset.o spcpll.o msepll.o spceth.o mseeth.o nvram.o dsp.o sdram.o \
miu.o spcpio.o iomux.o
diff --git a/cleopatre/u-boot-1.1.6/cpu/spc300/wdt.c b/cleopatre/u-boot-1.1.6/cpu/spc300/wdt.c
deleted file mode 100644
index 572335fa50..0000000000
--- a/cleopatre/u-boot-1.1.6/cpu/spc300/wdt.c
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * cpu/psc300/wdt.c
- *
- * Copyright (C) 2009 SPiDCOM Technologies
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-#include <common.h>
-#include <config.h>
-#include <asm/arch/hardware.h>
-#include <asm/arch/wdt.h>
-
-/**
- * Start watchdog timer.
- */
-void wdt_start(void)
-{
- unsigned int *ptr = (unsigned int *)WDT_CR;
-
- //Enable WDT with reset pulse = 32pclk and without interrupt management
- *ptr = WDT_BF(RPL, 4) | WDT_BF(RMOD, 0) | WDT_BF(EN, 1);
-}
-
-/**
- * Stop watchdog timer.
- */
-void wdt_stop(void)
-{
- unsigned int *ptr = (unsigned int *)WDT_CR;
-
- *ptr = WDT_BF(EN, 0);
-}
-
-/**
- * Refresh watchdog timer.
- */
-void wdt_refresh(void)
-{
- unsigned int *ptr = (unsigned int *)WDT_CRR;
-
- *ptr = WDT_BF(CR, WDT_CR_VAL);
-}
-
-/**
- * Change the watchdog time interval.
- *
- * \param new_time new time interval in seconds.
- * \return range error.
- */
-int wdt_settimeout(int new_time)
-{
- unsigned int *ptr = (unsigned int *)WDT_TORR;
- uint32_t cnt_value, top;
-
- //Timeout period = (2^(16+ TOP_reg)) / MASTER_CLK
-
- if ((new_time < 0) || (new_time > WDT_MAX_TIME))
- return -1;
-
- cnt_value = new_time * get_master_clock();
-
- for(top=15 ; top>0 ; top--)
- {
- if(cnt_value >= (1<<(top+16)))
- {
- *ptr = WDT_BFINS(TOP, top, *ptr);
- break;
- }
- }
-
- return 0;
-}
-
-/**
- * Get the watchdog time interval.
- *
- * \return time interval.
- */
-int wdt_gettimeout(void)
-{
- unsigned int *ptr = (unsigned int *)WDT_TORR;
- uint32_t top;
-
- //Timeout period = (2^(16+ TOP_reg)) / MASTER_CLK
-
- top = WDT_BFEXT(TOP, *ptr);
-
- return ((1 << (top+16)) / get_master_clock());
-}
-
-/**
- * Restart watchdog timer.
- *
- * \param timeout time interval in seconds.
- * \return if new timeout is done.
- */
-int wdt_restart(int timeout)
-{
- int result;
-
- wdt_stop();
- result = wdt_settimeout(timeout);
- wdt_start();
- return result;
-}
-