]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
arm: a320: use new ftpmu010 API
authorPo-Yu Chuang <ratbert@faraday-tech.com>
Thu, 17 Feb 2011 19:35:23 +0000 (19:35 +0000)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>
Wed, 27 Apr 2011 17:38:07 +0000 (19:38 +0200)
ftpmu010 related code has been moved to drivers/power/.

Signed-off-by: Po-Yu Chuang <ratbert@faraday-tech.com>
Signed-off-by: Albert Aribaud <albert.aribaud@free.fr>
arch/arm/cpu/arm920t/a320/timer.c
include/configs/a320evb.h

index d2e316fd54cf5f1c5ebf99f3c59023b679ab9fb2..7785036f57a0e78c4387683e95a85b65ba5f54d6 100644 (file)
 
 #include <common.h>
 #include <asm/io.h>
-#include <asm/arch/ftpmu010.h>
 #include <asm/arch/fttmr010.h>
+#include <faraday/ftpmu010.h>
 
 static ulong timestamp;
 static ulong lastdec;
 
 static struct fttmr010 *tmr = (struct fttmr010 *)CONFIG_FTTMR010_BASE;
-static struct ftpmu010 *pmu = (struct ftpmu010 *)CONFIG_FTPMU010_BASE;
 
 #define TIMER_CLOCK    32768
 #define TIMER_LOAD_VAL 0xffffffff
 
 int timer_init(void)
 {
-       unsigned int oscc;
        unsigned int cr;
 
        debug("%s()\n", __func__);
@@ -41,23 +39,8 @@ int timer_init(void)
        /* disable timers */
        writel(0, &tmr->cr);
 
-       /*
-        * use 32768Hz oscillator for RTC, WDT, TIMER
-        */
-
-       /* enable the 32768Hz oscillator */
-       oscc = readl(&pmu->OSCC);
-       oscc &= ~(FTPMU010_OSCC_OSCL_OFF | FTPMU010_OSCC_OSCL_TRI);
-       writel(oscc, &pmu->OSCC);
-
-       /* wait until ready */
-       while (!(readl(&pmu->OSCC) & FTPMU010_OSCC_OSCL_STABLE))
-               ;
-
-       /* select 32768Hz oscillator */
-       oscc = readl(&pmu->OSCC);
-       oscc |= FTPMU010_OSCC_OSCL_RTCLSEL;
-       writel(oscc, &pmu->OSCC);
+       /* use 32768Hz oscillator for RTC, WDT, TIMER */
+       ftpmu010_32768osc_enable();
 
        /* setup timer */
        writel(TIMER_LOAD_VAL, &tmr->timer3_load);
index 27f137f06d8ec39044a80cba116e4bde28ec7960..5373bcb57097b5f6937cc79a366bf7717b68e32e 100644 (file)
 
 #undef CONFIG_SKIP_LOWLEVEL_INIT
 
+/*-----------------------------------------------------------------------
+ * Power Management Unit
+ */
+#define CONFIG_FTPMU010_POWER
+
 /*-----------------------------------------------------------------------
  * Timer
  */