From patchwork Fri Sep 14 21:34:33 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11444 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 79DE123E42 for ; Fri, 14 Sep 2012 21:35:55 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id A104BA3924E for ; Fri, 14 Sep 2012 21:35:53 +0000 (UTC) Received: by mail-iy0-f180.google.com with SMTP id j25so3512531iaf.11 for ; Fri, 14 Sep 2012 14:35:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-provags-id:x-gm-message-state; bh=KIqDCXOdEJm9k3qrDKGTMQdwUlan5k2iSBHNpygohI4=; b=di/ifbjRjQKwjreiCyffjkvWLy8iygxfgkBOpzuoLCjBy0ZfHflpUdhCzKbGpmdWiB vCw/5Kv2UwZLXy/JEWCe0DNKghTDecd3bX9jTOz+UcUL0gwg3omIUoUvgTeKJLNt5uHQ lKNjSTHJjnhktJWMIsCVLdBhkYGLUJWXuUDjR4KlH47Ugun7R3+EGA8gjuHHUjhJ5fK2 q8zohQLGXhRw1ahGORh85FWopv5gyOO+oakSUWPv0uZ5AhNXlXoxtI5SHuHNLcEON2is aEOSriVDC2ugSQ6SR0SmIl8f1eYoGXG/asuk3JPt/EJ7VrIX/4kYyve8Bw2A6xwJVEVP mx+g== Received: by 10.50.195.134 with SMTP id ie6mr121674igc.28.1347658553339; Fri, 14 Sep 2012 14:35:53 -0700 (PDT) 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.50.184.232 with SMTP id ex8csp215442igc; Fri, 14 Sep 2012 14:35:52 -0700 (PDT) Received: by 10.204.152.152 with SMTP id g24mr2108406bkw.104.1347658551875; Fri, 14 Sep 2012 14:35:51 -0700 (PDT) Received: from moutng.kundenserver.de (moutng.kundenserver.de. [212.227.17.8]) by mx.google.com with ESMTP id c12si4084088bkw.43.2012.09.14.14.35.51; Fri, 14 Sep 2012 14:35:51 -0700 (PDT) Received-SPF: neutral (google.com: 212.227.17.8 is neither permitted nor denied by best guess record for domain of arnd@arndb.de) client-ip=212.227.17.8; Authentication-Results: mx.google.com; spf=neutral (google.com: 212.227.17.8 is neither permitted nor denied by best guess record for domain of arnd@arndb.de) smtp.mail=arnd@arndb.de Received: from localhost.localdomain (HSI-KBW-149-172-5-253.hsi13.kabel-badenwuerttemberg.de [149.172.5.253]) by mrelayeu.kundenserver.de (node=mrbap2) with ESMTP (Nemesis) id 0Lv94E-1TcNfn3E38-00zpT7; Fri, 14 Sep 2012 23:35:22 +0200 From: Arnd Bergmann To: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, Will Deacon , Russell King , Nicolas Pitre , Arnd Bergmann , Sascha Hauer , Shawn Guo Subject: [PATCH 05/24] ARM: imx: use __iomem pointers for MMIO Date: Fri, 14 Sep 2012 23:34:33 +0200 Message-Id: <1347658492-11608-6-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1347658492-11608-1-git-send-email-arnd@arndb.de> References: <1347658492-11608-1-git-send-email-arnd@arndb.de> X-Provags-ID: V02:K0:YzbX+9CssHxOJAoHha4xdR6RnEGFsdPWgWWSJOSXFKs +pMx414c9nXxjl/nr1lgE3HrKfZgAm9dw9gdIMQmGZY3OHAEvb kPph9sFMGGON+DnDzmH0BtAUbcsFrbkvE4eUYNzxMPzIPnxAxN rCYiAC/Cw7IXb35A425QTvjrb7f7b+82/3CB7WKpTt6SaLQvb7 wGJ2/kiS2ybkwUFz6iVrtpVViCB/xjCxpWhShcBTfF2clDvosb fhV+gwF1+eD8ZWwqH695ab0kGcvAK9GlpIUGVobNClifYLENib 4x1ySz6ec1YPhW7rtbEFt1l0YvSmLLjFgsPXlI+qcKL3FYrnNy 2yhHwq9JrfAplpaXypDZk9Bi7ZTwlhpA2nlNeEThcmopk0aGfX JzXvpo2exWBXQ== X-Gm-Message-State: ALoCoQk0WnxZaPZhfcdMBxechWazrid3j13YLA+S8M0viQ6IAC2w6f6qU2SRbF/Xp+osOGfJsQ7b ARM is moving to stricter checks on readl/write functions, so we need to use the correct types everywhere. This found a bug in mach-armadillo5x0.c, where we attempt mmio on the MXC_CCM_RCSR address that is currently defined to 0xc and consequently causes an illegal address access. Signed-off-by: Arnd Bergmann Cc: Sascha Hauer Cc: Shawn Guo --- arch/arm/mach-imx/mach-armadillo5x0.c | 2 +- arch/arm/mach-imx/mach-kzm_arm11_01.c | 4 ++-- arch/arm/mach-imx/mach-mx31ads.c | 2 +- arch/arm/mach-imx/mach-mx31lite.c | 2 +- arch/arm/plat-mxc/include/mach/mx31.h | 6 +++--- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/arch/arm/mach-imx/mach-armadillo5x0.c b/arch/arm/mach-imx/mach-armadillo5x0.c index 2c6ab32..c9a9653 100644 --- a/arch/arm/mach-imx/mach-armadillo5x0.c +++ b/arch/arm/mach-imx/mach-armadillo5x0.c @@ -526,7 +526,7 @@ static void __init armadillo5x0_init(void) imx31_add_mxc_nand(&armadillo5x0_nand_board_info); /* set NAND page size to 2k if not configured via boot mode pins */ - __raw_writel(__raw_readl(MXC_CCM_RCSR) | (1 << 30), MXC_CCM_RCSR); + /* FIXME __raw_writel(__raw_readl(MXC_CCM_RCSR) | (1 << 30), MXC_CCM_RCSR); */ /* RTC */ /* Get RTC IRQ and register the chip */ diff --git a/arch/arm/mach-imx/mach-kzm_arm11_01.c b/arch/arm/mach-imx/mach-kzm_arm11_01.c index 5d08533..4b9b7aa 100644 --- a/arch/arm/mach-imx/mach-kzm_arm11_01.c +++ b/arch/arm/mach-imx/mach-kzm_arm11_01.c @@ -259,13 +259,13 @@ static void __init kzm_board_init(void) */ static struct map_desc kzm_io_desc[] __initdata = { { - .virtual = MX31_CS4_BASE_ADDR_VIRT, + .virtual = (unsigned long)MX31_CS4_BASE_ADDR_VIRT, .pfn = __phys_to_pfn(MX31_CS4_BASE_ADDR), .length = MX31_CS4_SIZE, .type = MT_DEVICE }, { - .virtual = MX31_CS5_BASE_ADDR_VIRT, + .virtual = (unsigned long)MX31_CS5_BASE_ADDR_VIRT, .pfn = __phys_to_pfn(MX31_CS5_BASE_ADDR), .length = MX31_CS5_SIZE, .type = MT_DEVICE diff --git a/arch/arm/mach-imx/mach-mx31ads.c b/arch/arm/mach-imx/mach-mx31ads.c index d37f480..e774b07 100644 --- a/arch/arm/mach-imx/mach-mx31ads.c +++ b/arch/arm/mach-imx/mach-mx31ads.c @@ -540,7 +540,7 @@ static void __init mxc_init_audio(void) */ static struct map_desc mx31ads_io_desc[] __initdata = { { - .virtual = MX31_CS4_BASE_ADDR_VIRT, + .virtual = (unsigned long)MX31_CS4_BASE_ADDR_VIRT, .pfn = __phys_to_pfn(MX31_CS4_BASE_ADDR), .length = CS4_CS8900_MMIO_START, .type = MT_DEVICE diff --git a/arch/arm/mach-imx/mach-mx31lite.c b/arch/arm/mach-imx/mach-mx31lite.c index c8785b3..ef57cff 100644 --- a/arch/arm/mach-imx/mach-mx31lite.c +++ b/arch/arm/mach-imx/mach-mx31lite.c @@ -207,7 +207,7 @@ static struct platform_device physmap_flash_device = { */ static struct map_desc mx31lite_io_desc[] __initdata = { { - .virtual = MX31_CS4_BASE_ADDR_VIRT, + .virtual = (unsigned long)MX31_CS4_BASE_ADDR_VIRT, .pfn = __phys_to_pfn(MX31_CS4_BASE_ADDR), .length = MX31_CS4_SIZE, .type = MT_DEVICE diff --git a/arch/arm/plat-mxc/include/mach/mx31.h b/arch/arm/plat-mxc/include/mach/mx31.h index dbced61..ee9b1f9 100644 --- a/arch/arm/plat-mxc/include/mach/mx31.h +++ b/arch/arm/plat-mxc/include/mach/mx31.h @@ -76,7 +76,7 @@ #define MX31_RTIC_BASE_ADDR (MX31_AIPS2_BASE_ADDR + 0xec000) #define MX31_ROMP_BASE_ADDR 0x60000000 -#define MX31_ROMP_BASE_ADDR_VIRT 0xfc500000 +#define MX31_ROMP_BASE_ADDR_VIRT IOMEM(0xfc500000) #define MX31_ROMP_SIZE SZ_1M #define MX31_AVIC_BASE_ADDR 0x68000000 @@ -92,11 +92,11 @@ #define MX31_CS3_BASE_ADDR 0xb2000000 #define MX31_CS4_BASE_ADDR 0xb4000000 -#define MX31_CS4_BASE_ADDR_VIRT 0xf6000000 +#define MX31_CS4_BASE_ADDR_VIRT IOMEM(0xf6000000) #define MX31_CS4_SIZE SZ_32M #define MX31_CS5_BASE_ADDR 0xb6000000 -#define MX31_CS5_BASE_ADDR_VIRT 0xf8000000 +#define MX31_CS5_BASE_ADDR_VIRT IOMEM(0xf8000000) #define MX31_CS5_SIZE SZ_32M #define MX31_X_MEMC_BASE_ADDR 0xb8000000