From patchwork Thu Aug 30 18:12:03 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Machek X-Patchwork-Id: 180852 X-Patchwork-Delegate: marek.vasut@gmail.com 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 959782C0118 for ; Fri, 31 Aug 2012 04:12:12 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CA69428086; Thu, 30 Aug 2012 20:12:10 +0200 (CEST) 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 3rYuY9ZYx8XW; Thu, 30 Aug 2012 20:12:10 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EC98E2807E; Thu, 30 Aug 2012 20:12:08 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CF2732807E for ; Thu, 30 Aug 2012 20:12:06 +0200 (CEST) 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 4EkTko+rm656 for ; Thu, 30 Aug 2012 20:12:06 +0200 (CEST) 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 atrey.karlin.mff.cuni.cz (atrey.karlin.mff.cuni.cz [195.113.26.193]) by theia.denx.de (Postfix) with ESMTP id 0F11B2807D for ; Thu, 30 Aug 2012 20:12:04 +0200 (CEST) Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 1CFFEF091A; Thu, 30 Aug 2012 20:12:04 +0200 (CEST) Date: Thu, 30 Aug 2012 20:12:03 +0200 From: Pavel Machek To: Marek Vasut Message-ID: <20120830181203.GB29900@elf.ucw.cz> References: <1345157139-19585-1-git-send-email-dinguyen@altera.com> <201208300156.32100.marex@denx.de> <20120830165951.GC5980@elf.ucw.cz> <201208302002.30626.marex@denx.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <201208302002.30626.marex@denx.de> X-Warning: Reading this can be dangerous to your mental health. User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Tom Rini , dinh.linux@gmail.com, clsee@altera.com, u-boot@lists.denx.de Subject: Re: [U-Boot] [PATCHv1] ARM: Add Altera SOCFPGA Cyclone5 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de 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? 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; }