From patchwork Wed Feb 16 09:11:34 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Po-Yu Chuang X-Patchwork-Id: 83349 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 29914B70E9 for ; Wed, 16 Feb 2011 20:12:03 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B02CA2808C; Wed, 16 Feb 2011 10:12:01 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NyzdRdKYMHhe; Wed, 16 Feb 2011 10:12:01 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1299328097; Wed, 16 Feb 2011 10:11:59 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C7A9528097 for ; Wed, 16 Feb 2011 10:11:56 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FmuSQJqILRoA for ; Wed, 16 Feb 2011 10:11:56 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-iw0-f172.google.com (mail-iw0-f172.google.com [209.85.214.172]) by theia.denx.de (Postfix) with ESMTPS id 191322808C for ; Wed, 16 Feb 2011 10:11:55 +0100 (CET) Received: by iwc10 with SMTP id 10so1104254iwc.3 for ; Wed, 16 Feb 2011 01:11:54 -0800 (PST) Received: by 10.42.226.72 with SMTP id iv8mr451389icb.395.1297847514691; Wed, 16 Feb 2011 01:11:54 -0800 (PST) Received: from localhost.localdomain ([111.82.36.107]) by mx.google.com with ESMTPS id ey6sm3872567icb.17.2011.02.16.01.11.48 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 16 Feb 2011 01:11:54 -0800 (PST) From: Po-Yu Chuang To: u-boot@lists.denx.de Date: Wed, 16 Feb 2011 17:11:34 +0800 Message-Id: <1297847494-2044-1-git-send-email-ratbert.chuang@gmail.com> X-Mailer: git-send-email 1.7.1 Cc: Po-Yu Chuang Subject: [U-Boot] [PATCH 2/2] arm: a320: use new ftpmu010 API X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de From: Po-Yu Chuang ftpmu010 related code has been moved to drivers/power/. Signed-off-by: Po-Yu Chuang --- 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 #include -#include +#include #include 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 */