From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiko Schocher Date: Thu, 13 Oct 2011 07:42:34 +0200 Subject: [U-Boot] [PATCH 3/4] arm, davinci: Add function lpsc_syncreset() In-Reply-To: <1318419080-14396-4-git-send-email-christian.riesch@omicron.at> References: <1318419080-14396-1-git-send-email-christian.riesch@omicron.at> <1318419080-14396-4-git-send-email-christian.riesch@omicron.at> Message-ID: <4E967A4A.3060305@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello Christian, Christian Riesch wrote: > This patch adds a function lpsc_syncreset that allows setting a > lpsc module into Sync Reset state. > > Signed-off-by: Christian Riesch > Cc: Heiko Schocher > Cc: Paulraj Sandeep > Cc: Albert ARIBAUD > --- > arch/arm/cpu/arm926ejs/davinci/psc.c | 20 +++++++++++++++----- > arch/arm/include/asm/arch-davinci/hardware.h | 1 + > 2 files changed, 16 insertions(+), 5 deletions(-) > > diff --git a/arch/arm/cpu/arm926ejs/davinci/psc.c b/arch/arm/cpu/arm926ejs/davinci/psc.c > index 486adb0..e02d1f6 100644 > --- a/arch/arm/cpu/arm926ejs/davinci/psc.c > +++ b/arch/arm/cpu/arm926ejs/davinci/psc.c > @@ -46,7 +46,7 @@ > */ > > /* Works on Always On power domain only (no PD argument) */ > -void lpsc_on(unsigned int id) > +static void lpsc_transition(unsigned int id, unsigned int state) > { > dv_reg_p mdstat, mdctl, ptstat, ptcmd; > #ifdef CONFIG_SOC_DA8XX > @@ -83,10 +83,10 @@ void lpsc_on(unsigned int id) > while (readl(ptstat) & 0x01) > continue; > > - if ((readl(mdstat) & 0x3f) == 0x03) > - return; /* Already on and enabled */ > + if ((readl(mdstat) & 0x3f) == state) > + return; /* Already in that state */ > > - writel(readl(mdctl) | 0x03, mdctl); > + writel((readl(mdctl) & ~0x1f) | state, mdctl); ^ Shouldn't this be ~0x3f ? And we should use a define instead 0x3f ... bye, Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany