[U-Boot] [PATCH 6/6] i.MX6Q: icore: Add imx6q board for icore/icore_rqs

Jagan Teki jagannadh.teki at gmail.com
Tue Sep 19 18:38:01 UTC 2017


From: Jagan Teki <jagan at amarulasolutions.com>

icore and icore_rqs boards are i.MX6QDL SOC type, so
create them as imx6q board and place the code as optimum
as possible.

Signed-off-by: Jagan Teki <jagan at amarulasolutions.com>
---
 arch/arm/mach-imx/mx6/Kconfig                      | 24 +----------
 board/engicam/icorem6_rqs/Kconfig                  | 12 ------
 board/engicam/icorem6_rqs/MAINTAINERS              |  9 ----
 board/engicam/icorem6_rqs/Makefile                 |  6 ---
 board/engicam/icorem6_rqs/README                   | 30 -------------
 board/engicam/icorem6_rqs/icorem6_rqs.c            | 49 ----------------------
 board/engicam/{icorem6 => imx6q}/Kconfig           |  2 +-
 board/engicam/{icorem6 => imx6q}/MAINTAINERS       |  8 +++-
 board/engicam/{icorem6 => imx6q}/Makefile          |  2 +-
 board/engicam/{icorem6 => imx6q}/README            |  9 ++--
 board/engicam/{icorem6/icorem6.c => imx6q/imx6q.c} | 41 +++++++++++++++++-
 configs/imx6qdl_icore_rqs_defconfig                |  2 +-
 12 files changed, 56 insertions(+), 138 deletions(-)
 delete mode 100644 board/engicam/icorem6_rqs/Kconfig
 delete mode 100644 board/engicam/icorem6_rqs/MAINTAINERS
 delete mode 100644 board/engicam/icorem6_rqs/Makefile
 delete mode 100644 board/engicam/icorem6_rqs/README
 delete mode 100644 board/engicam/icorem6_rqs/icorem6_rqs.c
 rename board/engicam/{icorem6 => imx6q}/Kconfig (87%)
 rename board/engicam/{icorem6 => imx6q}/MAINTAINERS (58%)
 rename board/engicam/{icorem6 => imx6q}/Makefile (80%)
 rename board/engicam/{icorem6 => imx6q}/README (71%)
 rename board/engicam/{icorem6/icorem6.c => imx6q/imx6q.c} (88%)

diff --git a/arch/arm/mach-imx/mx6/Kconfig b/arch/arm/mach-imx/mx6/Kconfig
index 9f2b30c..412bac7 100644
--- a/arch/arm/mach-imx/mx6/Kconfig
+++ b/arch/arm/mach-imx/mx6/Kconfig
@@ -185,26 +185,7 @@ config TARGET_MX6QARM2
 	bool "mx6qarm2"
 
 config TARGET_MX6Q_ICORE
-	bool "Support Engicam i.Core"
-	select BOARD_LATE_INIT
-	select MX6QDL
-	select OF_CONTROL
-	select SPL_OF_LIBFDT
-	select DM
-	select DM_ETH
-	select DM_GPIO
-	select DM_I2C
-	select DM_MMC
-	select DM_THERMAL
-	select SUPPORT_SPL
-	select SPL_LOAD_FIT
-	select SPL_DM if SPL
-	select SPL_OF_CONTROL if SPL
-	select SPL_SEPARATE_BSS if SPL
-	select SPL_PINCTRL if SPL
-
-config TARGET_MX6Q_ICORE_RQS
-	bool "Support Engicam i.Core RQS"
+	bool "Support Engicam i.Core(RQS)"
 	select BOARD_LATE_INIT
 	select MX6QDL
 	select OF_CONTROL
@@ -439,8 +420,7 @@ source "board/congatec/cgtqmx6eval/Kconfig"
 source "board/el/el6x/Kconfig"
 source "board/embest/mx6boards/Kconfig"
 source "board/engicam/geam6ul/Kconfig"
-source "board/engicam/icorem6/Kconfig"
-source "board/engicam/icorem6_rqs/Kconfig"
+source "board/engicam/imx6q/Kconfig"
 source "board/engicam/isiotmx6ul/Kconfig"
 source "board/freescale/mx6qarm2/Kconfig"
 source "board/freescale/mx6sabreauto/Kconfig"
diff --git a/board/engicam/icorem6_rqs/Kconfig b/board/engicam/icorem6_rqs/Kconfig
deleted file mode 100644
index 6dc3a07..0000000
--- a/board/engicam/icorem6_rqs/Kconfig
+++ /dev/null
@@ -1,12 +0,0 @@
-if TARGET_MX6Q_ICORE_RQS
-
-config SYS_BOARD
-	default "icorem6_rqs"
-
-config SYS_VENDOR
-	default "engicam"
-
-config SYS_CONFIG_NAME
-	default "imx6-engicam"
-
-endif
diff --git a/board/engicam/icorem6_rqs/MAINTAINERS b/board/engicam/icorem6_rqs/MAINTAINERS
deleted file mode 100644
index 9a74265..0000000
--- a/board/engicam/icorem6_rqs/MAINTAINERS
+++ /dev/null
@@ -1,9 +0,0 @@
-ICOREM6QDL_RQS BOARD
-M:	Jagan Teki <jagan at amarulasolutions.com>
-S:	Maintained
-F:	board/engicam/icorem6_rqs
-F:	include/configs/imx6-engicam.h
-F:	configs/imx6qdl_icore_rqs_defconfig
-F:	arch/arm/dts/imx6qdl-icore-rqs.dtsi
-F:	arch/arm/dts/imx6q-icore-rqs.dts
-F:	arch/arm/dts/imx6dl-icore-rqs.dts
diff --git a/board/engicam/icorem6_rqs/Makefile b/board/engicam/icorem6_rqs/Makefile
deleted file mode 100644
index 2e3933c..0000000
--- a/board/engicam/icorem6_rqs/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-# Copyright (C) 2016 Amarula Solutions B.V.
-#
-# SPDX-License-Identifier:	GPL-2.0+
-#
-
-obj-y  := icorem6_rqs.o
diff --git a/board/engicam/icorem6_rqs/README b/board/engicam/icorem6_rqs/README
deleted file mode 100644
index 97e978c..0000000
--- a/board/engicam/icorem6_rqs/README
+++ /dev/null
@@ -1,30 +0,0 @@
-How to use U-Boot on Engicam i.CoreM6 RQS Solo/DualLite and Quad/Dual Starter Kit:
-----------------------------------------------------------------------------------
-
-$ make mrproper
-
-- Configure U-Boot for Engicam i.CoreM6 RQS Quad/Dual/Solo/DualLite:
-$ make imx6qdl_icore_rqs_defconfig
-
-- Build U-Boot
-$ make
-
-This will generate the SPL image called SPL and the u-boot-dtb.img.
-
-- Flash the SPL image into the micro SD card:
-
-sudo dd if=SPL of=/dev/mmcblk0 bs=1k seek=1; sync
-
-- Flash the u-boot-dtb.img image into the micro SD card:
-
-sudo dd if=u-boot-dtb.img of=/dev/mmcblk0 bs=1k seek=69; sync
-
-- Jumper settings:
-
-MMC Boot: JM3 Closed
-
-- Connect the Serial cable between the Starter Kit and the PC for the console.
-(J28 is the Linux Serial console connector)
-
-- Insert the micro SD card in the board, power it up and U-Boot messages should
-come up.
diff --git a/board/engicam/icorem6_rqs/icorem6_rqs.c b/board/engicam/icorem6_rqs/icorem6_rqs.c
deleted file mode 100644
index c0a6d4f..0000000
--- a/board/engicam/icorem6_rqs/icorem6_rqs.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (C) 2016 Amarula Solutions B.V.
- * Copyright (C) 2016 Engicam S.r.l.
- * Author: Jagan Teki <jagan at amarulasolutions.com>
- *
- * SPDX-License-Identifier:	GPL-2.0+
- */
-
-#include <asm/arch/sys_proto.h>
-
-DECLARE_GLOBAL_DATA_PTR;
-
-#ifdef CONFIG_ENV_IS_IN_MMC
-int board_mmc_get_env_dev(int devno)
-{
-	/* dev 0 for SD/eSD, dev 1 for MMC/eMMC */
-	return (devno == 3) ? 1 : 0;
-}
-#endif
-
-#ifdef CONFIG_SPL_BUILD
-#include <spl.h>
-
-#ifdef CONFIG_ENV_IS_IN_MMC
-void board_boot_order(u32 *spl_boot_list)
-{
-	u32 bmode = imx6_src_get_boot_mode();
-	u8 boot_dev = BOOT_DEVICE_MMC1;
-
-	switch ((bmode & IMX6_BMODE_MASK) >> IMX6_BMODE_SHIFT) {
-	case IMX6_BMODE_SD:
-	case IMX6_BMODE_ESD:
-		/* SD/eSD - BOOT_DEVICE_MMC1 */
-		break;
-	case IMX6_BMODE_MMC:
-	case IMX6_BMODE_EMMC:
-		/* MMC/eMMC */
-		boot_dev = BOOT_DEVICE_MMC2;
-		break;
-	default:
-		/* Default - BOOT_DEVICE_MMC1 */
-		printf("Wrong board boot order\n");
-		break;
-	}
-
-	spl_boot_list[0] = boot_dev;
-}
-#endif
-#endif /* CONFIG_SPL_BUILD */
diff --git a/board/engicam/icorem6/Kconfig b/board/engicam/imx6q/Kconfig
similarity index 87%
rename from board/engicam/icorem6/Kconfig
rename to board/engicam/imx6q/Kconfig
index 4a1c9ac..bb36425 100644
--- a/board/engicam/icorem6/Kconfig
+++ b/board/engicam/imx6q/Kconfig
@@ -1,7 +1,7 @@
 if TARGET_MX6Q_ICORE
 
 config SYS_BOARD
-	default "icorem6"
+	default "imx6q"
 
 config SYS_VENDOR
 	default "engicam"
diff --git a/board/engicam/icorem6/MAINTAINERS b/board/engicam/imx6q/MAINTAINERS
similarity index 58%
rename from board/engicam/icorem6/MAINTAINERS
rename to board/engicam/imx6q/MAINTAINERS
index a348bdd..18aeb47 100644
--- a/board/engicam/icorem6/MAINTAINERS
+++ b/board/engicam/imx6q/MAINTAINERS
@@ -1,10 +1,14 @@
-ICOREM6QDL BOARD
+IMX6Q ICORE BOARD
 M:	Jagan Teki <jagan at amarulasolutions.com>
 S:	Maintained
-F:	board/engicam/icorem6
+F:	board/engicam/imx6q
 F:	include/configs/imx6-engicam.h
 F:	configs/imx6qdl_icore_mmc_defconfig
 F:	configs/imx6qdl_icore_nand_defconfig
+F:	configs/imx6qdl_icore_rqs_defconfig
 F:	arch/arm/dts/imx6qdl-icore.dtsi
 F:	arch/arm/dts/imx6q-icore.dts
 F:	arch/arm/dts/imx6dl-icore.dts
+F:	arch/arm/dts/imx6qdl-icore-rqs.dtsi
+F:	arch/arm/dts/imx6q-icore-rqs.dts
+F:	arch/arm/dts/imx6dl-icore-rqs.dts
diff --git a/board/engicam/icorem6/Makefile b/board/engicam/imx6q/Makefile
similarity index 80%
rename from board/engicam/icorem6/Makefile
rename to board/engicam/imx6q/Makefile
index 9ec9ecd..ef2fb6a 100644
--- a/board/engicam/icorem6/Makefile
+++ b/board/engicam/imx6q/Makefile
@@ -3,4 +3,4 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-obj-y  := icorem6.o
+obj-y  := imx6q.o
diff --git a/board/engicam/icorem6/README b/board/engicam/imx6q/README
similarity index 71%
rename from board/engicam/icorem6/README
rename to board/engicam/imx6q/README
index 3779e96..3f3478c 100644
--- a/board/engicam/icorem6/README
+++ b/board/engicam/imx6q/README
@@ -1,11 +1,14 @@
-How to use U-Boot on Engicam i.CoreM6 Solo/DualLite and Quad/Dual Starter Kit:
------------------------------------------------------------------------------
+Hsow to use U-Boot on Engicam i.CoreM6 (RQS) Solo/DualLite/Quad/Dual Starter Kit:
+--------------------------------------------------------------------------------
 
 $ make mrproper
 
-- Configure U-Boot for Engicam i.CoreM6 Quad/Dual/Solo/DualLite:
+- Configure U-Boot for Engicam i.CoreM6 Quad/Duali/Solo/DualLite:
 $ make imx6qdl_icore_mmc_defconfig
 
+- Configure U-Boot for Engicam i.CoreM6 RQS Quad/Duali/Solo/DualLite:
+$ make imx6qdl_icore_rqs_defconfig
+
 - Build U-Boot
 $ make
 
diff --git a/board/engicam/icorem6/icorem6.c b/board/engicam/imx6q/imx6q.c
similarity index 88%
rename from board/engicam/icorem6/icorem6.c
rename to board/engicam/imx6q/imx6q.c
index a967ccd..0600547 100644
--- a/board/engicam/icorem6/icorem6.c
+++ b/board/engicam/imx6q/imx6q.c
@@ -25,13 +25,12 @@
 DECLARE_GLOBAL_DATA_PTR;
 
 #ifdef CONFIG_NAND_MXS
-
 #define GPMI_PAD_CTRL0	(PAD_CTL_PKE | PAD_CTL_PUE | PAD_CTL_PUS_100K_UP)
 #define GPMI_PAD_CTRL1	(PAD_CTL_DSE_40ohm | PAD_CTL_SPEED_MED | \
 			PAD_CTL_SRE_FAST)
 #define GPMI_PAD_CTRL2	(GPMI_PAD_CTRL0 | GPMI_PAD_CTRL1)
 
-iomux_v3_cfg_t gpmi_pads[] = {
+static iomux_v3_cfg_t gpmi_pads[] = {
 	IOMUX_PADS(PAD_NANDF_CLE__NAND_CLE	| MUX_PAD_CTRL(GPMI_PAD_CTRL2)),
 	IOMUX_PADS(PAD_NANDF_ALE__NAND_ALE	| MUX_PAD_CTRL(GPMI_PAD_CTRL2)),
 	IOMUX_PADS(PAD_NANDF_WP_B__NAND_WP_B	| MUX_PAD_CTRL(GPMI_PAD_CTRL2)),
@@ -190,3 +189,41 @@ void setup_display(void)
 	writel(reg, &iomux->gpr[3]);
 }
 #endif /* CONFIG_VIDEO_IPUV3 */
+
+#ifdef CONFIG_ENV_IS_IN_MMC
+int board_mmc_get_env_dev(int devno)
+{
+	/* dev 0 for SD/eSD, dev 1 for MMC/eMMC */
+	return (devno == 3) ? 1 : 0;
+}
+#endif
+
+#ifdef CONFIG_SPL_BUILD
+#include <spl.h>
+
+#ifdef CONFIG_ENV_IS_IN_MMC
+void board_boot_order(u32 *spl_boot_list)
+{
+	u32 bmode = imx6_src_get_boot_mode();
+	u8 boot_dev = BOOT_DEVICE_MMC1;
+
+	switch ((bmode & IMX6_BMODE_MASK) >> IMX6_BMODE_SHIFT) {
+	case IMX6_BMODE_SD:
+	case IMX6_BMODE_ESD:
+		/* SD/eSD - BOOT_DEVICE_MMC1 */
+		break;
+	case IMX6_BMODE_MMC:
+	case IMX6_BMODE_EMMC:
+		/* MMC/eMMC */
+		boot_dev = BOOT_DEVICE_MMC2;
+		break;
+	default:
+		/* Default - BOOT_DEVICE_MMC1 */
+		printf("Wrong board boot order\n");
+		break;
+	}
+
+	spl_boot_list[0] = boot_dev;
+}
+#endif
+#endif /* CONFIG_SPL_BUILD */
diff --git a/configs/imx6qdl_icore_rqs_defconfig b/configs/imx6qdl_icore_rqs_defconfig
index e6b4dff..813201f 100644
--- a/configs/imx6qdl_icore_rqs_defconfig
+++ b/configs/imx6qdl_icore_rqs_defconfig
@@ -3,7 +3,7 @@ CONFIG_ARCH_MX6=y
 CONFIG_SPL_GPIO_SUPPORT=y
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
-CONFIG_TARGET_MX6Q_ICORE_RQS=y
+CONFIG_TARGET_MX6Q_ICORE=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
 CONFIG_SPL_WATCHDOG_SUPPORT=y
-- 
2.7.4



More information about the U-Boot mailing list