From patchwork Wed Jun 1 13:22:06 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sascha Hauer X-Patchwork-Id: 98183 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id B7A62B6EDF for ; Wed, 1 Jun 2011 23:22:26 +1000 (EST) Received: from canuck.infradead.org ([134.117.69.58]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QRlNE-0005WD-Gq; Wed, 01 Jun 2011 13:22:12 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QRlNE-0002r3-9x; Wed, 01 Jun 2011 13:22:12 +0000 Received: from metis.ext.pengutronix.de ([2001:6f8:1178:4:290:27ff:fe1d:cc33]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QRlNA-0002qO-Kw for linux-arm-kernel@lists.infradead.org; Wed, 01 Jun 2011 13:22:10 +0000 Received: from octopus.hi.pengutronix.de ([2001:6f8:1178:2:215:17ff:fe12:23b0]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1QRlN8-0001pI-NL; Wed, 01 Jun 2011 15:22:06 +0200 Received: from sha by octopus.hi.pengutronix.de with local (Exim 4.76) (envelope-from ) id 1QRlN8-0003Lz-Ll; Wed, 01 Jun 2011 15:22:06 +0200 Date: Wed, 1 Jun 2011 15:22:06 +0200 From: Sascha Hauer To: alkml Subject: [PATCH 5/8 v2] ARM i.MX Allow to compile together i.MX1/21/25/27 Message-ID: <20110601132206.GF23771@pengutronix.de> References: <1305823648-2428-1-git-send-email-s.hauer@pengutronix.de> <1305823648-2428-6-git-send-email-s.hauer@pengutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1305823648-2428-6-git-send-email-s.hauer@pengutronix.de> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 15:21:39 up 6 days, 6:23, 60 users, load average: 1.25, 2.18, 1.93 User-Agent: Mutt/1.5.21 (2010-09-15) X-SA-Exim-Connect-IP: 2001:6f8:1178:2:215:17ff:fe12:23b0 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110601_092209_318765_1ED82ED0 X-CRM114-Status: GOOD ( 35.64 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain Cc: Uwe =?iso-8859-15?Q?Kleine-K=F6nig?= X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org This allows for all armv4 and armv5 based i.MX systems to be compiled together in one kernel. To accomplish this we need ARM_PATCH_PHYS_VIRT and AUTO_ZRELADDR which is selected in Kconfig. As compiling with ARM_PATCH_PHYS_VIRT breaks XIP support and different PHYS_OFFSETs break uImage support the old way to integrate only one of these SoCs is kept in place. Also, As the ARM_PATCH_PHYS_VIRT now has a user this removes the dependency to EXPERIMENTAL. Signed-off-by: Sascha Hauer --- arch/arm/Kconfig | 1 - arch/arm/mach-imx/Kconfig | 58 +++++++++++++++----------- arch/arm/mach-imx/Makefile | 10 ++-- arch/arm/plat-mxc/Kconfig | 34 ++++++++++++--- arch/arm/plat-mxc/devices/platform-imx-dma.c | 2 +- 5 files changed, 66 insertions(+), 39 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 9adc278..89c3f16 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -193,7 +193,6 @@ config VECTORS_BASE config ARM_PATCH_PHYS_VIRT bool "Patch physical to virtual translations at runtime (EXPERIMENTAL)" - depends on EXPERIMENTAL depends on !XIP_KERNEL && MMU depends on !ARCH_REALVIEW || !SPARSEMEM help diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig index 59c97a3..501cf9b 100644 --- a/arch/arm/mach-imx/Kconfig +++ b/arch/arm/mach-imx/Kconfig @@ -11,8 +11,33 @@ config ARCH_MX31 config ARCH_MX35 bool +config ARCH_MX1 + bool + +config ARCH_MX2 + bool + +config ARCH_MX25 + bool + +config MACH_MX27 + bool + +config HAVE_SOC_IMX1 + bool + +config HAVE_SOC_IMX21 + bool + +config HAVE_SOC_IMX25 + bool + +config HAVE_SOC_IMX27 + bool + config SOC_IMX1 bool + select ARCH_MX1 select CPU_ARM920T select IMX_HAVE_DMA_V1 select IMX_HAVE_IOMUX_V1 @@ -20,6 +45,7 @@ config SOC_IMX1 config SOC_IMX21 bool + select ARCH_MX2 select CPU_ARM926T select ARCH_MXC_AUDMUX_V1 select IMX_HAVE_DMA_V1 @@ -28,6 +54,7 @@ config SOC_IMX21 config SOC_IMX25 bool + select ARCH_MX25 select CPU_ARM926T select ARCH_MXC_AUDMUX_V2 select ARCH_MXC_IOMUX_V3 @@ -35,6 +62,8 @@ config SOC_IMX25 config SOC_IMX27 bool + select MACH_MX27 + select ARCH_MX2 select CPU_ARM926T select ARCH_MXC_AUDMUX_V1 select IMX_HAVE_DMA_V1 @@ -59,7 +88,7 @@ config SOC_IMX35 select MXC_AVIC -if ARCH_MX1 +if HAVE_SOC_IMX1 comment "MX1 platforms:" config MACH_MXLADS @@ -89,27 +118,7 @@ config MACH_APF9328 endif -if ARCH_MX2 - -choice - prompt "CPUs:" - default MACH_MX21 - -config MACH_MX21 - bool "i.MX21 support" - help - This enables support for Freescale's MX2 based i.MX21 processor. - -config MACH_MX27 - bool "i.MX27 support" - help - This enables support for Freescale's MX2 based i.MX27 processor. - -endchoice - -endif - -if MACH_MX21 +if HAVE_SOC_IMX21 comment "MX21 platforms:" @@ -126,7 +135,7 @@ config MACH_MX21ADS endif -if ARCH_MX25 +if HAVE_SOC_IMX25 comment "MX25 platforms:" @@ -175,8 +184,7 @@ endchoice endif -if MACH_MX27 - +if HAVE_SOC_IMX27 comment "MX27 platforms:" config MACH_MX27ADS diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile index e9eb36d..db6394a 100644 --- a/arch/arm/mach-imx/Makefile +++ b/arch/arm/mach-imx/Makefile @@ -1,12 +1,12 @@ obj-$(CONFIG_IMX_HAVE_DMA_V1) += dma-v1.o -obj-$(CONFIG_ARCH_MX1) += clock-imx1.o mm-imx1.o -obj-$(CONFIG_MACH_MX21) += clock-imx21.o mm-imx21.o +obj-$(CONFIG_SOC_IMX1) += clock-imx1.o mm-imx1.o +obj-$(CONFIG_SOC_IMX21) += clock-imx21.o mm-imx21.o -obj-$(CONFIG_ARCH_MX25) += clock-imx25.o mm-imx25.o ehci-imx25.o +obj-$(CONFIG_SOC_IMX25) += clock-imx25.o mm-imx25.o ehci-imx25.o -obj-$(CONFIG_MACH_MX27) += cpu-imx27.o pm-imx27.o -obj-$(CONFIG_MACH_MX27) += clock-imx27.o mm-imx27.o ehci-imx27.o +obj-$(CONFIG_SOC_IMX27) += cpu-imx27.o pm-imx27.o +obj-$(CONFIG_SOC_IMX27) += clock-imx27.o mm-imx27.o ehci-imx27.o obj-$(CONFIG_SOC_IMX31) += mm-imx31.o cpu-imx31.o clock-imx31.o iomux-imx31.o ehci-imx31.o obj-$(CONFIG_SOC_IMX35) += mm-imx35.o cpu-imx35.o clock-imx35.o ehci-imx35.o diff --git a/arch/arm/plat-mxc/Kconfig b/arch/arm/plat-mxc/Kconfig index a5353fc..44ebde3 100644 --- a/arch/arm/plat-mxc/Kconfig +++ b/arch/arm/plat-mxc/Kconfig @@ -14,21 +14,41 @@ choice prompt "Freescale CPU family:" default ARCH_MX3 -config ARCH_MX1 - bool "MX1-based" +config SOC_SELECT_IMX1 + bool "i.MX1 based" + select HAVE_SOC_IMX1 help This enables support for systems based on the Freescale i.MX1 family -config ARCH_MX2 - bool "MX2-based" +config SOC_SELECT_IMX21 + bool "i.MX21 based" + select HAVE_SOC_IMX21 help - This enables support for systems based on the Freescale i.MX2 family + This enables support for systems based on the Freescale i.MX21 family -config ARCH_MX25 - bool "MX25-based" +config SOC_SELECT_IMX25 + bool "i.MX25 based" + select HAVE_SOC_IMX25 help This enables support for systems based on the Freescale i.MX25 family +config SOC_SELECT_IMX27 + bool "i.MX27 based" + select HAVE_SOC_IMX27 + help + This enables support for systems based on the Freescale i.MX27 family + +config ARCH_IMX_V4_V5 + select ARM_PATCH_PHYS_VIRT + select AUTO_ZRELADDR + select HAVE_SOC_IMX1 + select HAVE_SOC_IMX21 + select HAVE_SOC_IMX25 + select HAVE_SOC_IMX27 + bool "i.MX1, i.MX21, i.MX25 and i.MX27 based" + help + This enables support for all armv4 and armv5 based i.MX systems + config ARCH_MX3 bool "MX3-based" help diff --git a/arch/arm/plat-mxc/devices/platform-imx-dma.c b/arch/arm/plat-mxc/devices/platform-imx-dma.c index 3538b85..735b81d 100644 --- a/arch/arm/plat-mxc/devices/platform-imx-dma.c +++ b/arch/arm/plat-mxc/devices/platform-imx-dma.c @@ -76,7 +76,7 @@ static struct platform_device __init __maybe_unused *imx_add_imx_dma(void) return imx_add_platform_device("imx-dma", -1, NULL, 0, NULL, 0); } -#ifdef CONFIG_ARCH_MX25 +#ifdef CONFIG_SOC_IMX25 static struct sdma_script_start_addrs addr_imx25_to1 = { .ap_2_ap_addr = 729, .uart_2_mcu_addr = 904,