From patchwork Wed Apr 9 18:08:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 3957011 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5698A9F387 for ; Wed, 9 Apr 2014 18:09:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7A94A206AB for ; Wed, 9 Apr 2014 18:09:51 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 56E6F206A9 for ; Wed, 9 Apr 2014 18:09:50 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WXwuf-0001fZ-KG; Wed, 09 Apr 2014 18:07:53 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WXwuK-0007EP-N1; Wed, 09 Apr 2014 18:07:32 +0000 Received: from perceval.ideasonboard.com ([95.142.166.194]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WXwtN-00077s-1d for linux-arm-kernel@lists.infradead.org; Wed, 09 Apr 2014 18:06:44 +0000 Received: from avalon.ideasonboard.com (unknown [91.178.230.94]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 9BFD3359FB; Wed, 9 Apr 2014 20:04:17 +0200 (CEST) From: Laurent Pinchart To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 1/4] ARM: pxa: Don't hardcode addresses and size in map_desc tables Date: Wed, 9 Apr 2014 20:08:14 +0200 Message-Id: <1397066897-31826-2-git-send-email-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1397066897-31826-1-git-send-email-laurent.pinchart@ideasonboard.com> References: <1397066897-31826-1-git-send-email-laurent.pinchart@ideasonboard.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140409_140640_603452_4F699B7B X-CRM114-Status: GOOD ( 13.52 ) X-Spam-Score: -2.2 (--) Cc: Nicolas Pitre , Russell King - ARM Linux , Haojian Zhuang , David Heidelberger , Ezequiel Garcia , Eric Miao X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The virtual address, physical address and size of all regions for which we create static mappings are defined in PXA headers. Replaced the hardcoded values with macros. Signed-off-by: Laurent Pinchart --- arch/arm/mach-pxa/generic.c | 10 +++++----- arch/arm/mach-pxa/include/mach/hardware.h | 2 +- arch/arm/mach-pxa/pxa25x.c | 2 +- arch/arm/mach-pxa/pxa27x.c | 8 ++++---- arch/arm/mach-pxa/pxa3xx.c | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/arch/arm/mach-pxa/generic.c b/arch/arm/mach-pxa/generic.c index 4225417..4bc0a2c 100644 --- a/arch/arm/mach-pxa/generic.c +++ b/arch/arm/mach-pxa/generic.c @@ -79,14 +79,14 @@ EXPORT_SYMBOL(get_clk_frequency_khz); */ static struct map_desc common_io_desc[] __initdata = { { /* Devs */ - .virtual = 0xf2000000, - .pfn = __phys_to_pfn(0x40000000), - .length = 0x02000000, + .virtual = (unsigned long)PERIPH_VIRT, + .pfn = __phys_to_pfn(PERIPH_PHYS), + .length = PERIPH_SIZE, .type = MT_DEVICE }, { /* UNCACHED_PHYS_0 */ - .virtual = 0xff000000, + .virtual = UNCACHED_PHYS_0, .pfn = __phys_to_pfn(0x00000000), - .length = 0x00100000, + .length = UNCACHED_PHYS_0_SIZE, .type = MT_DEVICE } }; diff --git a/arch/arm/mach-pxa/include/mach/hardware.h b/arch/arm/mach-pxa/include/mach/hardware.h index ccb06e4..efb3965 100644 --- a/arch/arm/mach-pxa/include/mach/hardware.h +++ b/arch/arm/mach-pxa/include/mach/hardware.h @@ -20,7 +20,7 @@ * The mapping is set in mach-pxa/generic.c. */ #define UNCACHED_PHYS_0 0xff000000 -#define UNCACHED_ADDR UNCACHED_PHYS_0 +#define UNCACHED_PHYS_0_SIZE 0x00100000 /* * Intel PXA2xx internal register mapping: diff --git a/arch/arm/mach-pxa/pxa25x.c b/arch/arm/mach-pxa/pxa25x.c index f2c2897..926c506 100644 --- a/arch/arm/mach-pxa/pxa25x.c +++ b/arch/arm/mach-pxa/pxa25x.c @@ -331,7 +331,7 @@ static struct map_desc pxa25x_io_desc[] __initdata = { { /* Mem Ctl */ .virtual = (unsigned long)SMEMC_VIRT, .pfn = __phys_to_pfn(PXA2XX_SMEMC_BASE), - .length = 0x00200000, + .length = SMEMC_SIZE, .type = MT_DEVICE }, }; diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c index 301471a..4405644 100644 --- a/arch/arm/mach-pxa/pxa27x.c +++ b/arch/arm/mach-pxa/pxa27x.c @@ -402,12 +402,12 @@ static struct map_desc pxa27x_io_desc[] __initdata = { { /* Mem Ctl */ .virtual = (unsigned long)SMEMC_VIRT, .pfn = __phys_to_pfn(PXA2XX_SMEMC_BASE), - .length = 0x00200000, + .length = SMEMC_SIZE, .type = MT_DEVICE }, { /* IMem ctl */ - .virtual = 0xfe000000, - .pfn = __phys_to_pfn(0x58000000), - .length = 0x00100000, + .virtual = (unsigned long)IMEMC_VIRT, + .pfn = __phys_to_pfn(IMEMC_PHYS), + .length = IMEMC_SIZE, .type = MT_DEVICE }, }; diff --git a/arch/arm/mach-pxa/pxa3xx.c b/arch/arm/mach-pxa/pxa3xx.c index 87011f3..593ccd35 100644 --- a/arch/arm/mach-pxa/pxa3xx.c +++ b/arch/arm/mach-pxa/pxa3xx.c @@ -416,7 +416,7 @@ static struct map_desc pxa3xx_io_desc[] __initdata = { { /* Mem Ctl */ .virtual = (unsigned long)SMEMC_VIRT, .pfn = __phys_to_pfn(PXA3XX_SMEMC_BASE), - .length = 0x00200000, + .length = SMEMC_SIZE, .type = MT_DEVICE } };