From patchwork Wed Nov 9 16:14:40 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 4977 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id C7F3823E0E for ; Wed, 9 Nov 2011 16:14:49 +0000 (UTC) Received: from mail-fx0-f52.google.com (mail-fx0-f52.google.com [209.85.161.52]) by fiordland.canonical.com (Postfix) with ESMTP id BC622A1810B for ; Wed, 9 Nov 2011 16:14:49 +0000 (UTC) Received: by mail-fx0-f52.google.com with SMTP id n26so2568780faa.11 for ; Wed, 09 Nov 2011 08:14:49 -0800 (PST) Received: by 10.152.148.165 with SMTP id tt5mr1965391lab.23.1320855289362; Wed, 09 Nov 2011 08:14:49 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.10.72 with SMTP id g8cs176178lab; Wed, 9 Nov 2011 08:14:49 -0800 (PST) Received: by 10.204.130.65 with SMTP id r1mr2250890bks.27.1320855287919; Wed, 09 Nov 2011 08:14:47 -0800 (PST) Received: from mail.df.lth.se (mail.df.lth.se. [194.47.250.12]) by mx.google.com with ESMTPS id w13si3094166bkd.142.2011.11.09.08.14.47 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 09 Nov 2011 08:14:47 -0800 (PST) Received-SPF: neutral (google.com: 194.47.250.12 is neither permitted nor denied by best guess record for domain of linus.walleij@linaro.org) client-ip=194.47.250.12; Authentication-Results: mx.google.com; spf=neutral (google.com: 194.47.250.12 is neither permitted nor denied by best guess record for domain of linus.walleij@linaro.org) smtp.mail=linus.walleij@linaro.org Received: from Fecusia (c83-249-208-177.bredband.comhem.se [83.249.208.177]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.df.lth.se (Postfix) with ESMTPSA id EB23365D73; Wed, 9 Nov 2011 17:14:46 +0100 (CET) Received: by Fecusia (sSMTP sendmail emulation); Wed, 9 Nov 2011 17:14:45 +0100 From: Linus Walleij To: Albert ARIBAUD Cc: u-boot@lists.denx.de, Linus Walleij Subject: [PATCH 4/7 v3] integrator: use io-accessors for board init Date: Wed, 9 Nov 2011 17:14:40 +0100 Message-Id: <1320855280-4170-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.7.6.4 Casting around to *(volatile ulong *) doesn't look good, so include the macros and use good old readl() instead. Signed-off-by: Linus Walleij --- ChangeLog v1->v2: - Rebased to U-Boot ARM HEAD at Alberts request, see message 4EA1C8E7.7090105@aribaud.net ChangeLog v2->v3: - Rebased to U-Boot ARM HEAD at Alberts request, see message 4EB84700.1030109@aribaud.net --- 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);