[U-Boot] [PATCH v2] ARM: phytec: pcm051: select board revision by Kconfig

poeschel at lemonage.de poeschel at lemonage.de
Thu Jun 4 10:07:36 CEST 2015


From: Lars Poeschel <poeschel at lemonage.de>

This add a Kconfig entry that allows to set the board revision in
menuconfig. So the deprecated CONFIG_SYS_EXTRA_OPTIONS is no longer
needed for this boad.

Signed-off-by: Lars Poeschel <poeschel at lemonage.de>
---
 arch/arm/Kconfig              | 19 +++++++++++++++++--
 board/phytec/pcm051/Kconfig   | 11 +++++++++--
 board/phytec/pcm051/board.c   |  2 +-
 configs/pcm051_rev1_defconfig |  3 +--
 configs/pcm051_rev3_defconfig |  3 +--
 5 files changed, 29 insertions(+), 9 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 2985e6e..193a111 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -333,13 +333,28 @@ config TARGET_AM335X_IGEP0033
 	select DM_SERIAL
 	select DM_GPIO
 
-config TARGET_PCM051
-	bool "Support pcm051"
+config TARGET_PCM051_REV1
+	bool "Support pcm051 board revision 1 or 2"
 	select CPU_V7
 	select SUPPORT_SPL
 	select DM
 	select DM_SERIAL
 	select DM_GPIO
+	help
+	  If you have 1358.1 written on the pcb of your pcm051, you
+	  have a revision 1 board. Likewise if you have 1358.2 on your
+	  board, it is a revision 2 board and this entry is for you.
+
+config TARGET_PCM051_REV3
+	bool "Support pcm051 board revision 3"
+	select CPU_V7
+	select SUPPORT_SPL
+	select DM
+	select DM_SERIAL
+	select DM_GPIO
+	help
+	  If you have 1358.3 written on the pcb of your pcm051, you
+	  have a revision 3 board and you have to select this entry.
 
 config TARGET_DRACO
 	bool "Support draco"
diff --git a/board/phytec/pcm051/Kconfig b/board/phytec/pcm051/Kconfig
index 2cc0d88..5981c72 100644
--- a/board/phytec/pcm051/Kconfig
+++ b/board/phytec/pcm051/Kconfig
@@ -1,7 +1,14 @@
-if TARGET_PCM051
+if TARGET_PCM051_REV1 || TARGET_PCM051_REV3
 
+if TARGET_PCM051_REV1
 config SYS_BOARD
-	default "pcm051"
+	default "pcm051rev1"
+endif
+
+if TARGET_PCM051_REV3
+config SYS_BOARD
+	default "pcm051rev3"
+endif
 
 config SYS_VENDOR
 	default "phytec"
diff --git a/board/phytec/pcm051/board.c b/board/phytec/pcm051/board.c
index 1bf9d73..3e01c01 100644
--- a/board/phytec/pcm051/board.c
+++ b/board/phytec/pcm051/board.c
@@ -49,7 +49,7 @@ const struct dpll_params *get_dpll_ddr_params(void)
 	return &dpll_ddr;
 }
 
-#ifdef CONFIG_REV1
+#ifdef CONFIG_TARGET_PCM051_REV1
 const struct ctrl_ioregs ioregs = {
 	.cm0ioctl		= MT41J256M8HX15E_IOCTRL_VALUE,
 	.cm1ioctl		= MT41J256M8HX15E_IOCTRL_VALUE,
diff --git a/configs/pcm051_rev1_defconfig b/configs/pcm051_rev1_defconfig
index 1ea9333..239ed70 100644
--- a/configs/pcm051_rev1_defconfig
+++ b/configs/pcm051_rev1_defconfig
@@ -1,5 +1,4 @@
 CONFIG_ARM=y
-CONFIG_TARGET_PCM051=y
+CONFIG_TARGET_PCM051_REV1=y
 CONFIG_SPL=y
-CONFIG_SYS_EXTRA_OPTIONS="REV1"
 CONFIG_CMD_NET=y
diff --git a/configs/pcm051_rev3_defconfig b/configs/pcm051_rev3_defconfig
index a0a32f6..7992dc3 100644
--- a/configs/pcm051_rev3_defconfig
+++ b/configs/pcm051_rev3_defconfig
@@ -1,5 +1,4 @@
 CONFIG_ARM=y
-CONFIG_TARGET_PCM051=y
+CONFIG_TARGET_PCM051_REV3=y
 CONFIG_SPL=y
-CONFIG_SYS_EXTRA_OPTIONS="REV3"
 CONFIG_CMD_NET=y
-- 
2.1.4



More information about the U-Boot mailing list