From patchwork Sun Sep 18 07:52:49 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 115220 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 2C448B70BE for ; Sun, 18 Sep 2011 17:53:12 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 656A5282E1; Sun, 18 Sep 2011 09:53:09 +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 vOD0up9UjXaK; Sun, 18 Sep 2011 09:53:09 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 64E7B282E2; Sun, 18 Sep 2011 09:53:00 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E6402282FB for ; Sun, 18 Sep 2011 09:52:54 +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 jBKoanRJ4rvV for ; Sun, 18 Sep 2011 09:52:54 +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 mail.df.lth.se (mail.df.lth.se [194.47.250.12]) by theia.denx.de (Postfix) with ESMTPS id 37F8F282E2 for ; Sun, 18 Sep 2011 09:52:53 +0200 (CEST) Received: from mer.df.lth.se (mer.df.lth.se [194.47.250.37]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.df.lth.se (Postfix) with ESMTPS id 91D5865D99; Sun, 18 Sep 2011 09:52:51 +0200 (CEST) Received: from mer.df.lth.se (triad@localhost.localdomain [127.0.0.1]) by mer.df.lth.se (8.14.3/8.14.3/Debian-9.4) with ESMTP id p8I7qphO018517; Sun, 18 Sep 2011 09:52:51 +0200 Received: (from triad@localhost) by mer.df.lth.se (8.14.3/8.14.3/Submit) id p8I7qplo018516; Sun, 18 Sep 2011 09:52:51 +0200 From: Linus Walleij To: u-boot@lists.denx.de, Albert ARIBAUD Date: Sun, 18 Sep 2011 09:52:49 +0200 Message-Id: <1316332369-18487-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.7.2.5 Subject: [U-Boot] [PATCH 4/5 v1] integrator: use io-accessors for board init 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 Casting around to *(volatile ulong *) doesn't look good, so include the macros and use good old readl() instead. Signed-off-by: Linus Walleij --- board/armltd/integrator/integrator.c | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/board/armltd/integrator/integrator.c b/board/armltd/integrator/integrator.c index 83f047c..780218c 100644 --- a/board/armltd/integrator/integrator.c +++ b/board/armltd/integrator/integrator.c @@ -35,6 +35,7 @@ #include #include +#include DECLARE_GLOBAL_DATA_PTR; @@ -101,15 +102,15 @@ int dram_init (void) #ifdef CONFIG_CM_SPD_DETECT { extern void dram_query(void); - unsigned long cm_reg_sdram; - unsigned long sdram_shift; + u32 cm_reg_sdram; + u32 sdram_shift; dram_query(); /* Assembler accesses to CM registers */ /* Queries the SPD values */ /* Obtain the SDRAM size from the CM SDRAM register */ - cm_reg_sdram = *(volatile ulong *)(CM_BASE + OS_SDRAM); + cm_reg_sdram = readl(CM_BASE + OS_SDRAM); /* Register SDRAM size * * 0xXXXXXXbbb000bb 16 MB @@ -119,7 +120,7 @@ extern void dram_query(void); * 0xXXXXXXbbb100bb 256 MB * */ - sdram_shift = ((cm_reg_sdram & 0x0000001C)/4)%4; + sdram_shift = ((cm_reg_sdram & 0x0000001C)/4)%4; gd->ram_size = get_ram_size((long *) CONFIG_SYS_SDRAM_BASE + REMAPPED_FLASH_SZ, 0x01000000 << sdram_shift);