public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Po-Yu Chuang <ratbert.chuang@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/2] arm: a320: use new ftpmu010 API
Date: Wed, 16 Feb 2011 17:11:34 +0800	[thread overview]
Message-ID: <1297847494-2044-1-git-send-email-ratbert.chuang@gmail.com> (raw)

From: Po-Yu Chuang <ratbert@faraday-tech.com>

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

Signed-off-by: Po-Yu Chuang <ratbert@faraday-tech.com>
---
 arch/arm/cpu/arm920t/a320/timer.c |   22 +++-------------------
 include/configs/a320evb.h         |    5 +++++
 2 files changed, 8 insertions(+), 19 deletions(-)

diff --git a/arch/arm/cpu/arm920t/a320/timer.c b/arch/arm/cpu/arm920t/a320/timer.c
index d2e316f..e261a49 100644
--- a/arch/arm/cpu/arm920t/a320/timer.c
+++ b/arch/arm/cpu/arm920t/a320/timer.c
@@ -19,14 +19,13 @@
 
 #include <common.h>
 #include <asm/io.h>
-#include <asm/arch/ftpmu010.h>
+#include <ftpmu010.h>
 #include <asm/arch/fttmr010.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
@@ -41,23 +40,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);
diff --git a/include/configs/a320evb.h b/include/configs/a320evb.h
index 27f137f..5373bcb 100644
--- a/include/configs/a320evb.h
+++ b/include/configs/a320evb.h
@@ -32,6 +32,11 @@
 #undef CONFIG_SKIP_LOWLEVEL_INIT
 
 /*-----------------------------------------------------------------------
+ * Power Management Unit
+ */
+#define CONFIG_FTPMU010_POWER
+
+/*-----------------------------------------------------------------------
  * Timer
  */
 #define CONFIG_SYS_HZ		1000	/* timer ticks per second */
-- 
1.6.3.3

             reply	other threads:[~2011-02-16  9:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-16  9:11 Po-Yu Chuang [this message]
2011-02-18  5:35 ` [U-Boot] [PATCH v2 2/2] arm: a320: use new ftpmu010 API Po-Yu Chuang
2011-03-03  7:27   ` Albert ARIBAUD

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1297847494-2044-1-git-send-email-ratbert.chuang@gmail.com \
    --to=ratbert.chuang@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox