From patchwork Fri Sep 14 21:34:30 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11449 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 707CD39291A for ; Fri, 14 Sep 2012 21:37:59 +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 4E354A392EB for ; Fri, 14 Sep 2012 21:37:58 +0000 (UTC) Received: by iafj25 with SMTP id j25so3515381iaf.11 for ; Fri, 14 Sep 2012 14:37:57 -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=eKJ3GR4vRcPnqNFluXDZ2GCSqINqan2WFXlSQOhU1kE=; b=iqGb15d+WZuwdr0Jlr3JyJHRn3Mdun904rcTOin1adq6q+EA50O+vi9HnRX07xB2O+ pOYH5/2PMvhI/fnzxrpidhBovfZhBWgM8u//GAAkBqPS30a/vYD0lO+jjUXPMEH/z6Of 78lK2t8ZkJ7G15yhftWnOhXPhQj9i6W7bPpb1rLTrUa39ZeyJRGnCrYGnz3QBl8K37QA /CDwhtRoNEcaFqR1hdzCqb+Py2cxF0UlMhOL2Y71DxO/XFqYvH4VArd19aRsB7Ik3bhe PfmrpBCnWWhKkxHLZbaOPRJYB88iW0fW2Yfeciq9JbhvsXybLO4YWDoDu1LEq7GJ313t 1t3Q== Received: by 10.50.157.229 with SMTP id wp5mr14605igb.0.1347658677669; Fri, 14 Sep 2012 14:37:57 -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 ex8csp215522igc; Fri, 14 Sep 2012 14:37:56 -0700 (PDT) Received: by 10.204.152.145 with SMTP id g17mr2109906bkw.120.1347658675930; Fri, 14 Sep 2012 14:37:55 -0700 (PDT) Received: from moutng.kundenserver.de (moutng.kundenserver.de. [212.227.126.187]) by mx.google.com with ESMTP id hw3si4077687bkc.149.2012.09.14.14.37.55; Fri, 14 Sep 2012 14:37:55 -0700 (PDT) Received-SPF: neutral (google.com: 212.227.126.187 is neither permitted nor denied by best guess record for domain of arnd@arndb.de) client-ip=212.227.126.187; Authentication-Results: mx.google.com; spf=neutral (google.com: 212.227.126.187 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 0MN62C-1TASkC2RVw-007BbX; Fri, 14 Sep 2012 23:35:20 +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 , Nicolas Ferre , Jean-Christophe Plagniol-Villard Subject: [PATCH 02/24] ARM: at91: use __iomem pointers for MMIO Date: Fri, 14 Sep 2012 23:34:30 +0200 Message-Id: <1347658492-11608-3-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:RB8aWDz5MXaNq7jejUkCh3Dyc/6QFsTmMJ4Zg66Dm8Z TsNqd7gaqFMbqHUMRSn+SgonUcGnV379fs1ZCN6B79Djukdp6z 6qkbHHe/RnQDXOGBDZ/mtMVt6AblJ6cvb9N+chV53xnrMnAqQl WJvometfA9Y+YYfde8fRz33JtZ93kOYEpqwQJB0ydSnxZyBRjj YKbN/IVzbNsw3heqK9n++uRaVZW9SdQ72ghFoz+4a2UpigYjr9 9xCZqATPZyWv5Mondx/L+ufy3PUycNHasU55U3QHh2eTU/rnXk bJcPF7TjQX1v49+2Ry0K8vT1cRoudSCFz3u/O5QuOiw781ha/r PxbRG2CXNPEBW4MFYoDPqyAguFGg2FUi3nXAhd+W3Z4MnG5mr7 PnYZOO2+vDo7A== X-Gm-Message-State: ALoCoQkCahrdeT83i2jTdyXleX0buFNq9/6q/kEVKwJG0jaapq7sPl15PvbWzBuWnvhFTYRhm4DQ ARM is moving to stricter checks on readl/write functions, so we need to use the correct types everywhere. Cc: Nicolas Ferre Cc: Jean-Christophe Plagniol-Villard Signed-off-by: Arnd Bergmann --- arch/arm/mach-at91/at91x40.c | 2 +- arch/arm/mach-at91/at91x40_time.c | 4 ++-- arch/arm/mach-at91/include/mach/hardware.h | 4 ++-- arch/arm/mach-at91/include/mach/uncompress.h | 6 +++--- arch/arm/mach-at91/setup.c | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/arch/arm/mach-at91/at91x40.c b/arch/arm/mach-at91/at91x40.c index 46090e6..6bd7300 100644 --- a/arch/arm/mach-at91/at91x40.c +++ b/arch/arm/mach-at91/at91x40.c @@ -47,7 +47,7 @@ static void at91x40_idle(void) * Disable the processor clock. The processor will be automatically * re-enabled by an interrupt or by a reset. */ - __raw_writel(AT91_PS_CR_CPU, AT91_PS_CR); + __raw_writel(AT91_PS_CR_CPU, AT91_IO_P2V(AT91_PS_CR)); cpu_do_idle(); } diff --git a/arch/arm/mach-at91/at91x40_time.c b/arch/arm/mach-at91/at91x40_time.c index 6ca680a..ee06d7b 100644 --- a/arch/arm/mach-at91/at91x40_time.c +++ b/arch/arm/mach-at91/at91x40_time.c @@ -29,10 +29,10 @@ #include #define at91_tc_read(field) \ - __raw_readl(AT91_TC + field) + __raw_readl(AT91_IO_P2V(AT91_TC) + field) #define at91_tc_write(field, value) \ - __raw_writel(value, AT91_TC + field); + __raw_writel(value, AT91_IO_P2V(AT91_TC) + field); /* * 3 counter/timer units present. diff --git a/arch/arm/mach-at91/include/mach/hardware.h b/arch/arm/mach-at91/include/mach/hardware.h index 09242b6..711a789 100644 --- a/arch/arm/mach-at91/include/mach/hardware.h +++ b/arch/arm/mach-at91/include/mach/hardware.h @@ -67,13 +67,13 @@ * to 0xFEF78000 .. 0xFF000000. (544Kb) */ #define AT91_IO_PHYS_BASE 0xFFF78000 -#define AT91_IO_VIRT_BASE (0xFF000000 - AT91_IO_SIZE) +#define AT91_IO_VIRT_BASE IOMEM(0xFF000000 - AT91_IO_SIZE) #else /* * Identity mapping for the non MMU case. */ #define AT91_IO_PHYS_BASE AT91_BASE_SYS -#define AT91_IO_VIRT_BASE AT91_IO_PHYS_BASE +#define AT91_IO_VIRT_BASE IOMEM(AT91_IO_PHYS_BASE) #endif #define AT91_IO_SIZE (0xFFFFFFFF - AT91_IO_PHYS_BASE + 1) diff --git a/arch/arm/mach-at91/include/mach/uncompress.h b/arch/arm/mach-at91/include/mach/uncompress.h index 6f6118d..58c9d5b 100644 --- a/arch/arm/mach-at91/include/mach/uncompress.h +++ b/arch/arm/mach-at91/include/mach/uncompress.h @@ -94,7 +94,7 @@ static const u32 uarts_sam9x5[] = { 0, }; -static inline const u32* decomp_soc_detect(u32 dbgu_base) +static inline const u32* decomp_soc_detect(void __iomem*dbgu_base) { u32 cidr, socid; @@ -142,10 +142,10 @@ static inline void arch_decomp_setup(void) int i = 0; const u32* usarts; - usarts = decomp_soc_detect(AT91_BASE_DBGU0); + usarts = decomp_soc_detect((void __iomem *)AT91_BASE_DBGU0); if (!usarts) - usarts = decomp_soc_detect(AT91_BASE_DBGU1); + usarts = decomp_soc_detect((void __iomem *)AT91_BASE_DBGU1); if (!usarts) { at91_uart = NULL; return; diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c index 944bffb..e6f52de 100644 --- a/arch/arm/mach-at91/setup.c +++ b/arch/arm/mach-at91/setup.c @@ -73,7 +73,7 @@ void __init at91_init_sram(int bank, unsigned long base, unsigned int length) { struct map_desc *desc = &sram_desc[bank]; - desc->virtual = AT91_IO_VIRT_BASE - length; + desc->virtual = (unsigned long)AT91_IO_VIRT_BASE - length; if (bank > 0) desc->virtual -= sram_desc[bank - 1].length; @@ -88,7 +88,7 @@ void __init at91_init_sram(int bank, unsigned long base, unsigned int length) } static struct map_desc at91_io_desc __initdata = { - .virtual = AT91_VA_BASE_SYS, + .virtual = (unsigned long)AT91_VA_BASE_SYS, .pfn = __phys_to_pfn(AT91_BASE_SYS), .length = SZ_16K, .type = MT_DEVICE,