Skip to contentSkip to conversation

i.MX31PDK: Move CONFIG_MX31* to Kconfig

PATCH New Magnus Lilja 2 participants 5 messages May 11, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover i.MX31PDK: Move CONFIG_MX31* to Kconfig

Refresh i.MX31 and i.MX31PDK support in U-boot by moving some CONFIG_MX31* settings to Kconfig options.

Boots nicely on actual hardware.

Applies to tip of tree of the main U-boot branch, please advice if I should rebase on top of another tree.

Regarding compiling and booting: I had to compile U-boot with an old GCC v5 compiler in order to get it to boot. Seems like either something is broken with newer GCC or (more likely) something is broken in the U-boot code when using GCC >= 6 for the ARM1136/i.MX31PDK.

Magnus Lilja (2):
mx31pdk: Convert CONFIG_MX31 flag to use Kconfig.
mx31: Convert MX31_HCLK_FREQ and MX31_CLK32 to Kconfig.

 arch/arm/Kconfig                       | 14 +++++------
 arch/arm/include/asm/arch-mx31/clock.h |  8 ------
 arch/arm/mach-imx/mx3/Kconfig          | 34 ++++++++++++++++++++++++++
 configs/mx31pdk_defconfig              |  3 ++-
 include/configs/mx31pdk.h              |  2 --
 5 files changed, 42 insertions(+), 19 deletions(-)
 create mode 100644 arch/arm/mach-imx/mx3/Kconfig
Signature · 1 line
2.17.0
#1 lore raw

PATCH 1/2 mx31pdk: Convert CONFIG_MX31 flag to use Kconfig.

Move CONFIG_MX31 from mx31pdk.h to mx31pdk_defconfig and introduce necessary Kconfig changes as well.

---
 arch/arm/Kconfig              | 14 ++++++--------
 arch/arm/mach-imx/mx3/Kconfig | 20 ++++++++++++++++++++
 configs/mx31pdk_defconfig     |  3 ++-
 include/configs/mx31pdk.h     |  2 --
 4 files changed, 28 insertions(+), 11 deletions(-)
 create mode 100644 arch/arm/mach-imx/mx3/Kconfig
arch/arm/Kconfig +6 -8
index 2bbb86c462..1645add855 100644
@@ -497,13 +497,6 @@ config TARGET_X600
 	select SUPPORT_SPL
 	select PL011_SERIAL
 
-config TARGET_MX31PDK
-	bool "Support mx31pdk"
-	select BOARD_LATE_INIT
-	select CPU_ARM1136
-	select SUPPORT_SPL
-	select BOARD_EARLY_INIT_F
-
 config TARGET_WOODBURN
 	bool "Support woodburn"
 	select CPU_ARM1136
@@ -665,6 +658,10 @@ config ARCH_MX28
 	select PL011_SERIAL
 	select SUPPORT_SPL
 
+config ARCH_MX31
+	bool "NXP i.MX31 family"
+	select CPU_ARM1136
+
 config ARCH_MX7ULP
         bool "NXP MX7ULP"
 	select CPU_V7A
@@ -1296,6 +1293,8 @@ source "arch/arm/cpu/armv7/ls102xa/Kconfig"
 
 source "arch/arm/mach-imx/mx2/Kconfig"
 
+source "arch/arm/mach-imx/mx3/Kconfig"
+
 source "arch/arm/mach-imx/mx5/Kconfig"
 
 source "arch/arm/mach-imx/mx6/Kconfig"
@@ -1381,7 +1380,6 @@ source "board/freescale/ls1046ardb/Kconfig"
 source "board/freescale/ls1012aqds/Kconfig"
 source "board/freescale/ls1012ardb/Kconfig"
 source "board/freescale/ls1012afrdm/Kconfig"
-source "board/freescale/mx31pdk/Kconfig"
 source "board/freescale/mx35pdk/Kconfig"
 source "board/freescale/s32v234evb/Kconfig"
 source "board/gdsys/a38x/Kconfig"
arch/arm/mach-imx/mx3/Kconfig new file +20 -0
new file mode 100644
index 0000000000..bf6a1c6927
@@ -0,0 +1,20 @@
+if ARCH_MX31
+
+config MX31
+       bool
+       default y
+choice
+	prompt "MX31 board select"
+	optional
+
+config TARGET_MX31PDK
+	bool "Support the i.MX31 PDK board from Freescale/NXP"
+	select BOARD_LATE_INIT
+	select SUPPORT_SPL
+	select BOARD_EARLY_INIT_F
+
+endchoice
+
+source "board/freescale/mx31pdk/Kconfig"
+
+endif
configs/mx31pdk_defconfig +2 -1
index 0f78a63762..037e250e96 100644
@@ -1,9 +1,10 @@
 CONFIG_ARM=y
 # CONFIG_SPL_USE_ARCH_MEMCPY is not set
 # CONFIG_SPL_USE_ARCH_MEMSET is not set
-CONFIG_TARGET_MX31PDK=y
+CONFIG_ARCH_MX31=y
 CONFIG_SYS_TEXT_BASE=0x87e00000
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
+CONFIG_TARGET_MX31PDK=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_NAND_SUPPORT=y
 CONFIG_SPL=y
include/configs/mx31pdk.h +0 -2
index 583892fed2..3ec3126233 100644
@@ -16,8 +16,6 @@
 #include <asm/arch/imx-regs.h>
 
 /* High Level Configuration Options */
-#define CONFIG_MX31			/* This is a mx31 */
-
 #define CONFIG_CMDLINE_TAG			/* enable passing of ATAGs */
 #define CONFIG_SETUP_MEMORY_TAGS
 #define CONFIG_INITRD_TAG
Signature · 1 line
2.17.0
#2 lore raw

PATCH 1/2 mx31pdk: Convert CONFIG_MX31 flag to use Kconfig.

Quoted 4 lines · Magnus Lilja

Move CONFIG_MX31 from mx31pdk.h to mx31pdk_defconfig and introduce necessary Kconfig changes as well.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180511/44ea4cbb/attachment.sig>
#3 lore raw

PATCH 2/2 mx31: Convert MX31_HCLK_FREQ and MX31_CLK32 to Kconfig.

In reply to Magnus Lilja

Also remove the #ifdef's from clock.h since the Kconfig values defaults the to old default values in clock.h.

---
 arch/arm/include/asm/arch-mx31/clock.h |  8 --------
 arch/arm/mach-imx/mx3/Kconfig          | 14 ++++++++++++++
 2 files changed, 14 insertions(+), 8 deletions(-)
arch/arm/include/asm/arch-mx31/clock.h +0 -8
index e340db42fa..aafc2d690e 100644
@@ -9,17 +9,9 @@
 
 #include <common.h>
 
-#ifdef CONFIG_MX31_HCLK_FREQ
 #define MXC_HCLK	CONFIG_MX31_HCLK_FREQ
-#else
-#define MXC_HCLK	26000000
-#endif
 
-#ifdef CONFIG_MX31_CLK32
 #define MXC_CLK32	CONFIG_MX31_CLK32
-#else
-#define MXC_CLK32	32768
-#endif
 
 enum mxc_clock {
 	MXC_ARM_CLK,
arch/arm/mach-imx/mx3/Kconfig +14 -0
index bf6a1c6927..6cc970fc49 100644
@@ -15,6 +15,20 @@ config TARGET_MX31PDK
 
 endchoice
 
+config MX31_HCLK_FREQ
+       int "i.MX31 HCLK frequency"
+       default 26000000
+       help
+         Frequency in Hz of the high frequency input clock. Typically
+	 26000000 Hz.
+
+config MX31_CLK32
+       int "i.MX31 CLK32 Frequency"
+       default 32768
+       help
+         Frequency in Hz of the low frequency input clock. Typically
+	 32768 or 32000 Hz.
+
 source "board/freescale/mx31pdk/Kconfig"
 
 endif
Signature · 1 line
2.17.0
#4 lore raw

PATCH 2/2 mx31: Convert MX31_HCLK_FREQ and MX31_CLK32 to Kconfig.

Quoted 4 lines · Magnus Lilja

Also remove the #ifdef's from clock.h since the Kconfig values defaults the to old default values in clock.h.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180511/1e1333ab/attachment.sig>