engicam: Add GEA-L i.MX6ULL

Message ID 20200528120813.22750-1-jagan@amarulasolutions.com
State New
Headers show
Series
  • engicam: Add GEA-L i.MX6ULL
Related show

Commit Message

Jagan Teki May 28, 2020, 12:08 p.m. UTC
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
 arch/arm/mach-imx/mx6/Kconfig      | 18 ++++++++++
 board/engicam/common/board.c       |  4 +++
 board/engicam/common/spl.c         | 23 ++++++++++---
 board/engicam/imx6ull/Kconfig      | 12 +++++++
 board/engicam/imx6ull/MAINTAINERS  | 19 +++++++++++
 board/engicam/imx6ull/Makefile     |  4 +++
 board/engicam/imx6ull/README       | 33 ++++++++++++++++++
 board/engicam/imx6ull/imx6ull.c    |  6 ++++
 configs/imx6ull_geal_mmc_defconfig | 55 ++++++++++++++++++++++++++++++
 9 files changed, 170 insertions(+), 4 deletions(-)
 create mode 100644 board/engicam/imx6ull/Kconfig
 create mode 100644 board/engicam/imx6ull/MAINTAINERS
 create mode 100644 board/engicam/imx6ull/Makefile
 create mode 100644 board/engicam/imx6ull/README
 create mode 100644 board/engicam/imx6ull/imx6ull.c
 create mode 100644 configs/imx6ull_geal_mmc_defconfig

Patch

diff --git a/arch/arm/mach-imx/mx6/Kconfig b/arch/arm/mach-imx/mx6/Kconfig
index fa6e1112e6..87a1255da2 100644
--- a/arch/arm/mach-imx/mx6/Kconfig
+++ b/arch/arm/mach-imx/mx6/Kconfig
@@ -452,6 +452,24 @@  config TARGET_MX6UL_ENGICAM
 	select SUPPORT_SPL
 	imply CMD_DM
 
+config TARGET_MX6ULL_ENGICAM
+	bool "Support Engicam GEA-L MX6ULL"
+	select BOARD_LATE_INIT
+	select DM
+	select DM_GPIO
+	select DM_I2C
+	select DM_MMC
+	select DM_THERMAL
+	select MX6ULL
+	select MX6_DDRCAL
+	select OF_CONTROL
+	select SPL_DM if SPL
+	select SPL_OF_CONTROL if SPL
+	select SPL_PINCTRL if SPL
+	select SPL_SEPARATE_BSS if SPL
+	select SUPPORT_SPL
+	imply CMD_DM
+
 config TARGET_MX6ULL_14X14_EVK
 	bool "Support mx6ull_14x14_evk"
 	select BOARD_LATE_INIT
diff --git a/board/engicam/common/board.c b/board/engicam/common/board.c
index 2907e2a8e5..c28d172542 100644
--- a/board/engicam/common/board.c
+++ b/board/engicam/common/board.c
@@ -62,6 +62,7 @@  static const char * const board_fdt_file[ENGICAM_BOARDS] = {
 	[IMX6UL_GEAM] = "imx6ul-geam.dtb",
 	[IMX6UL_ISIOT_EMMC] = "imx6ul-isiot-emmc.dtb",
 	[IMX6UL_ISIOT_NAND] = "imx6ul-isiot-nand.dtb",
+	[IMX6UL_GEAL] = "imx6ull-geal.dtb",
 };
 
 static int setenv_fdt_file(int board_detected)
@@ -110,6 +111,9 @@  static enum engicam_boards engicam_board_detect(void)
 	if (!strcmp(cmp_dtb, "imx6ul-isiot-nand"))
 		return IMX6UL_ISIOT_NAND;
 
+	if (!strcmp(cmp_dtb, "imx6ull-geal"))
+		return IMX6ULL_GEAL;
+
 	return -EINVAL;
 }
 
diff --git a/board/engicam/common/spl.c b/board/engicam/common/spl.c
index 6a0612481a..f3ae1ebc4a 100644
--- a/board/engicam/common/spl.c
+++ b/board/engicam/common/spl.c
@@ -34,7 +34,7 @@  static iomux_v3_cfg_t const uart_pads[] = {
 #ifdef CONFIG_MX6QDL
         IOMUX_PADS(PAD_KEY_COL0__UART4_TX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL)),
         IOMUX_PADS(PAD_KEY_ROW0__UART4_RX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL)),
-#elif CONFIG_MX6UL
+#elif defined(CONFIG_MX6UL) || defined(CONFIG_MX6ULL)
 	IOMUX_PADS(PAD_UART1_TX_DATA__UART1_DCE_TX | MUX_PAD_CTRL(UART_PAD_CTRL)),
 	IOMUX_PADS(PAD_UART1_RX_DATA__UART1_DCE_RX | MUX_PAD_CTRL(UART_PAD_CTRL)),
 #endif
@@ -300,7 +300,7 @@  static struct mx6_ddr_sysinfo mem_s = {
 };
 #endif /* CONFIG_MX6QDL */
 
-#ifdef CONFIG_MX6UL
+#if defined(CONFIG_MX6UL) || defined(CONFIG_MX6ULL)
 static struct mx6ul_iomux_grp_regs mx6_grp_ioregs = {
 	.grp_addds = 0x00000030,
 	.grp_ddrmode_ctl = 0x00020000,
@@ -387,6 +387,14 @@  static void ccgr_init(void)
 	writel(0xff00fffc, &ccm->CCGR4);
 	writel(0x033f30ff, &ccm->CCGR5);
 	writel(0x00c00fff, &ccm->CCGR6);
+#elif defined(CONFIG_MX6ULL)
+	writel(0xffffffff, &ccm->CCGR0);
+	writel(0xffffffff, &ccm->CCGR1);
+	writel(0xffffffff, &ccm->CCGR2);
+	writel(0xffffffff, &ccm->CCGR3);
+	writel(0xffffffff, &ccm->CCGR4);
+	writel(0xffffffff, &ccm->CCGR5);
+	writel(0xffffffff, &ccm->CCGR6);
 #endif
 }
 
@@ -403,9 +411,16 @@  static void spl_dram_init(void)
 		mx6dq_dram_iocfg(64, &mx6dq_ddr_ioregs, &mx6dq_grp_ioregs);
 		mx6_dram_cfg(&mem_q, &mx6dq_mmdc_calib, &mt41j256);
 	}
-#elif CONFIG_MX6UL
+#elif CONFIG_MX6UL || CONFIG_MX6ULL
 	mx6ul_dram_iocfg(mem_ddr.width, &mx6_ddr_ioregs, &mx6_grp_ioregs);
 	mx6_dram_cfg(&ddr_sysinfo, &mx6_mmcd_calib, &mem_ddr);
+
+#ifdef CONFIG_MX6_DDRCAL:
+	/* Perform DDR DRAM calibration */
+	udelay(100);
+	mmdc_do_write_level_calibration(&ddr_sysinfo);
+	mmdc_do_dqs_calibration(&ddr_sysinfo);
+#endif
 #endif
 
 	udelay(100);
@@ -418,7 +433,7 @@  void board_init_f(ulong dummy)
 	/* setup AIPS and disable watchdog */
 	arch_cpu_init();
 
-	if (!(is_mx6ul()))
+	if (!(is_mx6ul() || is_mx6ull()))
 		gpr_init();
 
 	/* iomux */
diff --git a/board/engicam/imx6ull/Kconfig b/board/engicam/imx6ull/Kconfig
new file mode 100644
index 0000000000..af79ea225b
--- /dev/null
+++ b/board/engicam/imx6ull/Kconfig
@@ -0,0 +1,12 @@ 
+if TARGET_MX6ULL_ENGICAM
+
+config SYS_BOARD
+	default "imx6ull"
+
+config SYS_VENDOR
+	default "engicam"
+
+config SYS_CONFIG_NAME
+	default "imx6-engicam"
+
+endif
diff --git a/board/engicam/imx6ull/MAINTAINERS b/board/engicam/imx6ull/MAINTAINERS
new file mode 100644
index 0000000000..915a595e97
--- /dev/null
+++ b/board/engicam/imx6ull/MAINTAINERS
@@ -0,0 +1,19 @@ 
+MX6ULL_ENGICAM BOARD
+M:	Jagan Teki <jagan@amarulasolutions.com>
+S:	Maintained
+F:	board/engicam/imx6ul
+F:	include/configs/imx6-engicam.h
+F:	configs/imx6ul_geam_mmc_defconfig
+F:	configs/imx6ul_geam_nand_defconfig
+F:	configs/imx6ul_isiot_emmc_defconfig
+F:	configs/imx6ul_isiot_mmc_defconfig
+F:	configs/imx6ul_isiot_nand_defconfig
+F:	arch/arm/dts/imx6ul.dtsi
+F:	arch/arm/dts/imx6ul-u-boot.dtsi
+F:	arch/arm/dts/imx6ul-geam-kit.dts
+F:	arch/arm/dts/imx6ul-geam-kit-u-boot.dtsi
+F:	arch/arm/dts/imx6ul-isiot.dtsi
+F:	arch/arm/dts/imx6ul-isiot-u-boot.dtsi
+F:	arch/arm/dts/imx6ul-isiot-emmc.dts
+F:	arch/arm/dts/imx6ul-isiot-emmc-u-boot.dtsi
+F:	arch/arm/dts/imx6ul-isiot-nand.dts
diff --git a/board/engicam/imx6ull/Makefile b/board/engicam/imx6ull/Makefile
new file mode 100644
index 0000000000..da4c33773b
--- /dev/null
+++ b/board/engicam/imx6ull/Makefile
@@ -0,0 +1,4 @@ 
+# SPDX-License-Identifier: GPL-2.0+
+# Copyright (C) 2016 Amarula Solutions B.V.
+
+obj-y  := imx6ull.o
diff --git a/board/engicam/imx6ull/README b/board/engicam/imx6ull/README
new file mode 100644
index 0000000000..1e85f618f1
--- /dev/null
+++ b/board/engicam/imx6ull/README
@@ -0,0 +1,33 @@ 
+Hsow to use U-Boot on Engicam GEAM6UL and Is.IoT MX6UL Starter Kit:
+-------------------------------------------------------------------
+
+$ make mrproper
+
+- Configure U-Boot for Engicam GEAM6UL:
+$ make imx6ul_geam_mmc_defconfig
+
+- Configure U-Boot for Engicam Is.IoT MX6UL:
+$ make imx6ul_isiot_mmc_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/imx6ull/imx6ull.c b/board/engicam/imx6ull/imx6ull.c
new file mode 100644
index 0000000000..8a2e629dbe
--- /dev/null
+++ b/board/engicam/imx6ull/imx6ull.c
@@ -0,0 +1,6 @@ 
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2016 Amarula Solutions B.V.
+ * Copyright (C) 2016 Engicam S.r.l.
+ * Author: Jagan Teki <jagan@amarulasolutions.com>
+ */
diff --git a/configs/imx6ull_geal_mmc_defconfig b/configs/imx6ull_geal_mmc_defconfig
new file mode 100644
index 0000000000..144c3aa656
--- /dev/null
+++ b/configs/imx6ull_geal_mmc_defconfig
@@ -0,0 +1,55 @@ 
+CONFIG_ARM=y
+CONFIG_ARCH_MX6=y
+CONFIG_SYS_TEXT_BASE=0x87800000
+CONFIG_SPL_GPIO_SUPPORT=y
+CONFIG_SPL_LIBCOMMON_SUPPORT=y
+CONFIG_SPL_LIBGENERIC_SUPPORT=y
+CONFIG_ENV_SIZE=0x20000
+CONFIG_ENV_OFFSET=0x100000
+CONFIG_TARGET_MX6ULL_ENGICAM=y
+CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_NR_DRAM_BANKS=1
+CONFIG_SPL=y
+CONFIG_SPL_LIBDISK_SUPPORT=y
+# CONFIG_CMD_BMODE is not set
+CONFIG_SPL_TEXT_BASE=0x00908000
+CONFIG_FIT=y
+CONFIG_FIT_SIGNATURE=y
+CONFIG_FIT_VERBOSE=y
+CONFIG_LEGACY_IMAGE_FORMAT=y
+CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg"
+CONFIG_BOOTDELAY=3
+CONFIG_SUPPORT_RAW_INITRD=y
+CONFIG_BOUNCE_BUFFER=y
+CONFIG_SPL_WATCHDOG_SUPPORT=y
+CONFIG_HUSH_PARSER=y
+CONFIG_SYS_PROMPT="geal6ull> "
+CONFIG_CRC32_VERIFY=y
+CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x88000000
+CONFIG_CMD_GPIO=y
+CONFIG_CMD_I2C=y
+CONFIG_CMD_MMC=y
+CONFIG_CMD_MII=y
+CONFIG_CMD_PING=y
+CONFIG_CMD_CACHE=y
+CONFIG_CMD_EXT2=y
+CONFIG_CMD_EXT4=y
+CONFIG_CMD_EXT4_WRITE=y
+CONFIG_CMD_FAT=y
+CONFIG_CMD_FS_GENERIC=y
+CONFIG_DEFAULT_DEVICE_TREE="imx6ull-geal"
+CONFIG_ENV_IS_IN_MMC=y
+CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_SYS_I2C_MXC=y
+CONFIG_FSL_USDHC=y
+CONFIG_MTD=y
+CONFIG_PHYLIB=y
+CONFIG_PHY_SMSC=y
+CONFIG_FEC_MXC=y
+CONFIG_MII=y
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_IMX6=y
+CONFIG_MXC_UART=y
+CONFIG_IMX_THERMAL=y