linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: s.hauer@pengutronix.de (Sascha Hauer)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: imx: move selection between i.MX21 and i.MX27 to CPU family choice
Date: Fri, 4 Mar 2011 09:19:16 +0100	[thread overview]
Message-ID: <20110304081916.GB29521@pengutronix.de> (raw)
In-Reply-To: <20110303201009.GT22310@pengutronix.de>

On Thu, Mar 03, 2011 at 09:10:09PM +0100, Uwe Kleine-K?nig wrote:
> Right, it's not sensible to do this selection, but the fact that it is
> possible makes me feel it's ugly. I thought a bit more about that I and
> another reason for not using SOC_IMXxy for Kconfig is that it might be
> natural to group i.MX50 and i.MX53 together because they share the same
> PHYS_OFFSET. So there are three possibilities:
> 
>  1) group them using a symbol named SOC_IMX50_IMX53
>  2) select both SOC_IMX50 and SOC_IMX53 independant of the machines
>     enabled.
>  3) don't allow to build both SoCs into a single image without
>     IMX_MULTI_ARCHITECTURE
> 
> 2) is similar to my first suggestion---it might make things more
> complicated than necessary at runtime. 3) is a limitation that shouldn't
> be needed. So 1) is the best? Then I prefer to have a completly
> different naming scheme for the grouping.
> 
> Does this make sense?

Lets give it a try. How does the following look like? Note I also skipped
The explicit IMX_MULTI_ARCHITECTURE switch and depend on
ARM_PATCH_PHYS_VIRT && AUTO_ZRELADDR directly instead.

8<---------------------------------------

ARM i.MX: Allow to compile armv4 and armv5 based i.MX SoCs in a single kernel

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-imx/Kconfig |  109 +++++++++++++++++++++++++++++++++++----------
 arch/arm/plat-mxc/Kconfig |   17 +------
 2 files changed, 88 insertions(+), 38 deletions(-)

diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index 5eec099..932084c 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -1,8 +1,28 @@
+if ARCH_IMX
+
 config IMX_HAVE_DMA_V1
 	bool
 
+# obsolete: The MACH_MX/ARCH_MX should go away once the users
+# are moved to the corresponding SOC_IMX_* in the tree
+config MACH_MX21
+	bool
+
+config MACH_MX27
+	bool
+
+config ARCH_MX25
+	bool
+
+config ARCH_MX2
+	bool
+
+config ARCH_MX1
+	bool
+
 config SOC_IMX1
 	bool
+	select ARCH_MX1
 	select CPU_ARM920T
 	select IMX_HAVE_DMA_V1
 	select IMX_HAVE_IOMUX_V1
@@ -10,6 +30,8 @@ config SOC_IMX1
 
 config SOC_IMX21
 	bool
+	select MACH_MX21
+	select ARCH_MX2
 	select CPU_ARM926T
 	select ARCH_MXC_AUDMUX_V1
 	select IMX_HAVE_DMA_V1
@@ -18,6 +40,7 @@ config SOC_IMX21
 
 config SOC_IMX25
 	bool
+	select ARCH_MX25
 	select CPU_ARM926T
 	select ARCH_MXC_AUDMUX_V2
 	select ARCH_MXC_IOMUX_V3
@@ -25,13 +48,68 @@ config SOC_IMX25
 
 config SOC_IMX27
 	bool
+	select ARCH_MX2
+	select MACH_MX27
 	select CPU_ARM926T
 	select ARCH_MXC_AUDMUX_V1
 	select IMX_HAVE_DMA_V1
 	select IMX_HAVE_IOMUX_V1
 	select MXC_AVIC
 
-if ARCH_MX1
+config ARCH_ALLOW_IMX1
+	bool
+
+config ARCH_ALLOW_IMX21
+	bool
+
+config ARCH_ALLOW_IMX25
+	bool
+
+config ARCH_ALLOW_IMX27
+	bool
+
+if ARM_PATCH_PHYS_VIRT && AUTO_ZRELADDR
+config ARCH_IMX_MULTI_IMX1
+	select ARCH_ALLOW_IMX1
+	bool "i.MX1 support"
+
+config ARCH_IMX_MULTI_IMX21
+	select ARCH_ALLOW_IMX21
+	bool "i.MX21 support"
+
+config ARCH_IMX_MULTI_IMX25
+	select ARCH_ALLOW_IMX25
+	bool "i.MX25 support"
+
+config ARCH_IMX_MULTI_OMX27
+	select ARCH_ALLOW_IMX27
+	bool "i.MX27 support"
+endif
+
+if !(ARM_PATCH_PHYS_VIRT && AUTO_ZRELADDR)
+comment "enable ARM_PATCH_PHYS_VIRT and AUTO_ZRELADDR to get"
+comment "support for multiple i.MX Families"
+choice
+	prompt "Select i.MX CPU"
+config ARCH_IMX_ONLY_IMX1
+	select ARCH_ALLOW_IMX1
+	bool "i.MX1 support"
+
+config ARCH_IMX_ONLY_IMX21
+	select ARCH_ALLOW_IMX21
+	bool "i.MX21 support"
+
+config ARCH_IMX_ONLY_IMX25
+	select ARCH_ALLOW_IMX25
+	bool "i.MX25 support"
+
+config ARCH_IMX_ONLY_IMX27
+	select ARCH_ALLOW_IMX27
+	bool "i.MX27 support"
+endchoice
+endif
+
+if ARCH_ALLOW_IMX1
 
 comment "MX1 platforms:"
 config MACH_MXLADS
@@ -39,6 +117,7 @@ config MACH_MXLADS
 
 config ARCH_MX1ADS
 	bool "MX1ADS platform"
+	select SOC_IMX1
 	select MACH_MXLADS
 	select IMX_HAVE_PLATFORM_IMX_I2C
 	select IMX_HAVE_PLATFORM_IMX_UART
@@ -48,32 +127,13 @@ config ARCH_MX1ADS
 config MACH_SCB9328
 	bool "Synertronixx scb9328"
 	select IMX_HAVE_PLATFORM_IMX_UART
+	select SOC_IMX1
 	help
 	  Say Y here if you are using a Synertronixx scb9328 board
 
 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 ARCH_ALLOW_IMX21
 
 comment "MX21 platforms:"
 
@@ -90,7 +150,7 @@ config MACH_MX21ADS
 
 endif
 
-if ARCH_MX25
+if ARCH_ALLOW_IMX25
 
 comment "MX25 platforms:"
 
@@ -138,7 +198,7 @@ endchoice
 
 endif
 
-if MACH_MX27
+if ARCH_ALLOW_IMX27
 
 comment "MX27 platforms:"
 
@@ -313,3 +373,4 @@ config MACH_IMX27IPCAM
 	  configurations for the board and its peripherals.
 
 endif
+endif
diff --git a/arch/arm/plat-mxc/Kconfig b/arch/arm/plat-mxc/Kconfig
index b0cb425..5625e78 100644
--- a/arch/arm/plat-mxc/Kconfig
+++ b/arch/arm/plat-mxc/Kconfig
@@ -8,21 +8,10 @@ choice
 	prompt "Freescale CPU family:"
 	default ARCH_MX3
 
-config ARCH_MX1
-	bool "MX1-based"
-	select SOC_IMX1
+config ARCH_IMX
+	bool "i.MX1, i.MX21, i.MX25, i.MX27 based"
 	help
-	  This enables support for systems based on the Freescale i.MX1 family
-
-config ARCH_MX2
-	bool "MX2-based"
-	help
-	  This enables support for systems based on the Freescale i.MX2 family
-
-config ARCH_MX25
-	bool "MX25-based"
-	help
-	  This enables support for systems based on the Freescale i.MX25 family
+	  This enables support for systems based on the Freescale i.MX1/2 family
 
 config ARCH_MX3
 	bool "MX3-based"
-- 
1.7.2.3

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

  reply	other threads:[~2011-03-04  8:19 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-02  3:28 [RFC PATCH 1/1] ARM: imx5x: clean up ARCH_MX5X Richard Zhao
2011-03-02  9:54 ` Shawn Guo
2011-03-02 11:25 ` Uwe Kleine-König
2011-03-02 16:06   ` Richard Zhao
2011-03-02 16:33     ` Uwe Kleine-König
2011-03-03  6:17       ` Richard Zhao
2011-03-02 17:23   ` [PATCH] ARM: imx: move selection between i.MX21 and i.MX27 to CPU family choice Uwe Kleine-König
2011-03-03  5:26     ` Richard Zhao
2011-03-03 10:02       ` Uwe Kleine-König
2011-03-03 12:11     ` Sascha Hauer
2011-03-03 16:25       ` Uwe Kleine-König
2011-03-03 18:00         ` Sascha Hauer
2011-03-03 20:10           ` Uwe Kleine-König
2011-03-04  8:19             ` Sascha Hauer [this message]
2011-03-04 10:11               ` Uwe Kleine-König
2011-03-04 21:20               ` Uwe Kleine-König
2011-03-04 22:28               ` Uwe Kleine-König

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110304081916.GB29521@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).