From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Thu, 30 Aug 2012 20:16:57 +0200 Subject: [U-Boot] [PATCHv1] ARM: Add Altera SOCFPGA Cyclone5 In-Reply-To: <20120830181203.GB29900@elf.ucw.cz> References: <1345157139-19585-1-git-send-email-dinguyen@altera.com> <201208302002.30626.marex@denx.de> <20120830181203.GB29900@elf.ucw.cz> Message-ID: <201208302016.57241.marex@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 Dear Pavel Machek, > Hi! > > > > > > + writel(TIMER_LOAD_VAL, &timer_base->load_val); > > > > > + writel(TIMER_LOAD_VAL, &timer_base->curr_val); > > > > > + writel((readl((&timer_base->ctrl)) | 0x3), > > > > > > > > I think you should stick to programming in C here, not ((((LISP)))), > > > > so try cutting down on the ((braces)) :-) > > > > > > Some braces have been harmed by creation of this patch. > > > > At least one more pair must be killed on the above statement :) > > I removed two pairs but failed to post the patch ;-). Be sure you'll > never see them again. > > > > > btw. what's this 0x3 magic constant ? > > > > > > Dinh has to help here :-(. > > > > Also, use setbits_le32() there instead anyway. > > Uff, setbits_le32 looks seriously strange. Should I do this? Yes please, that's the suggested way: Instead of: ret = readl() ret |= 1 << BIT; writel(ret, ) You do: setbits_le32() > > Thanks for review, > Pavel > > diff --git a/arch/arm/cpu/armv7/socfpga/timer.c > b/arch/arm/cpu/armv7/socfpga/timer.c index 79fa081..1ceb6e9 100644 > --- a/arch/arm/cpu/armv7/socfpga/timer.c > +++ b/arch/arm/cpu/armv7/socfpga/timer.c > @@ -30,7 +30,7 @@ int timer_init(void) > { > writel(TIMER_LOAD_VAL, &timer_base->load_val); > writel(TIMER_LOAD_VAL, &timer_base->curr_val); > - writel(readl(&timer_base->ctrl) | 0x3, &timer_base->ctrl); > + setbits_le32(&timer_base->ctrl, 0x3); > return 0; > } Best regards, Marek Vasut