Skip to content
Snippets Groups Projects
Commit 8dc667c9 authored by Po-Yu Chuang's avatar Po-Yu Chuang Committed by Albert ARIBAUD
Browse files

arm: a320: use new ftpmu010 API


ftpmu010 related code has been moved to drivers/power/.

Signed-off-by: default avatarPo-Yu Chuang <ratbert@faraday-tech.com>
Signed-off-by: default avatarAlbert Aribaud <albert.aribaud@free.fr>
parent d6150db2
No related branches found
No related tags found
No related merge requests found
...@@ -19,21 +19,19 @@ ...@@ -19,21 +19,19 @@
#include <common.h> #include <common.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/arch/ftpmu010.h>
#include <asm/arch/fttmr010.h> #include <asm/arch/fttmr010.h>
#include <faraday/ftpmu010.h>
static ulong timestamp; static ulong timestamp;
static ulong lastdec; static ulong lastdec;
static struct fttmr010 *tmr = (struct fttmr010 *)CONFIG_FTTMR010_BASE; static struct fttmr010 *tmr = (struct fttmr010 *)CONFIG_FTTMR010_BASE;
static struct ftpmu010 *pmu = (struct ftpmu010 *)CONFIG_FTPMU010_BASE;
#define TIMER_CLOCK 32768 #define TIMER_CLOCK 32768
#define TIMER_LOAD_VAL 0xffffffff #define TIMER_LOAD_VAL 0xffffffff
int timer_init(void) int timer_init(void)
{ {
unsigned int oscc;
unsigned int cr; unsigned int cr;
debug("%s()\n", __func__); debug("%s()\n", __func__);
...@@ -41,23 +39,8 @@ int timer_init(void) ...@@ -41,23 +39,8 @@ int timer_init(void)
/* disable timers */ /* disable timers */
writel(0, &tmr->cr); writel(0, &tmr->cr);
/* /* use 32768Hz oscillator for RTC, WDT, TIMER */
* use 32768Hz oscillator for RTC, WDT, TIMER ftpmu010_32768osc_enable();
*/
/* 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);
/* setup timer */ /* setup timer */
writel(TIMER_LOAD_VAL, &tmr->timer3_load); writel(TIMER_LOAD_VAL, &tmr->timer3_load);
......
...@@ -31,6 +31,11 @@ ...@@ -31,6 +31,11 @@
#undef CONFIG_SKIP_LOWLEVEL_INIT #undef CONFIG_SKIP_LOWLEVEL_INIT
/*-----------------------------------------------------------------------
* Power Management Unit
*/
#define CONFIG_FTPMU010_POWER
/*----------------------------------------------------------------------- /*-----------------------------------------------------------------------
* Timer * Timer
*/ */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment