diff options
Diffstat (limited to 'board')
-rw-r--r-- | board/toradex/colibri_imx7/Kconfig | 43 | ||||
-rw-r--r-- | board/toradex/colibri_imx7/colibri_imx7.c | 44 | ||||
-rw-r--r-- | board/toradex/common/tdx-cfg-block.c | 4 |
3 files changed, 84 insertions, 7 deletions
diff --git a/board/toradex/colibri_imx7/Kconfig b/board/toradex/colibri_imx7/Kconfig index 414a600eefb..e958c35e84e 100644 --- a/board/toradex/colibri_imx7/Kconfig +++ b/board/toradex/colibri_imx7/Kconfig @@ -1,14 +1,22 @@ if TARGET_COLIBRI_IMX7 +choice + prompt "Colibri iMX7S/D variant" + +config TARGET_COLIBRI_IMX7_NAND + bool "Support Colibri iMX7 Solo 256MB/Dual 512MB (raw NAND) modules" + +config TARGET_COLIBRI_IMX7_EMMC + bool "Support Colibri iMX7 Dual 1GB (eMMC) modules" + +endchoice + config SYS_BOARD default "colibri_imx7" config SYS_VENDOR default "toradex" -config SYS_CONFIG_NAME - default "colibri_imx7" - config COLIBRI_IMX7_EXT_PHYCLK bool "External oscillator for Ethernet PHY clock provided" help @@ -19,6 +27,14 @@ config COLIBRI_IMX7_EXT_PHYCLK config TDX_CFG_BLOCK default y +config TDX_CFG_BLOCK_2ND_ETHADDR + default y + +if TARGET_COLIBRI_IMX7_NAND + +config SYS_CONFIG_NAME + default "colibri_imx7" + config TDX_HAVE_NAND default y @@ -28,9 +44,28 @@ config TDX_CFG_BLOCK_OFFSET config TDX_CFG_BLOCK_OFFSET2 default "133120" -config TDX_CFG_BLOCK_2ND_ETHADDR +endif + +if TARGET_COLIBRI_IMX7_EMMC + +config SYS_CONFIG_NAME + default "colibri_imx7_emmc" + +config TDX_HAVE_MMC default y +config TDX_CFG_BLOCK_DEV + default "0" + +config TDX_CFG_BLOCK_PART + default "1" + +# Toradex config block in eMMC, at the end of 1st "boot sector" +config TDX_CFG_BLOCK_OFFSET + default "-512" + +endif + source "board/toradex/common/Kconfig" endif diff --git a/board/toradex/colibri_imx7/colibri_imx7.c b/board/toradex/colibri_imx7/colibri_imx7.c index 2536bfd2748..a8d8dbd2bae 100644 --- a/board/toradex/colibri_imx7/colibri_imx7.c +++ b/board/toradex/colibri_imx7/colibri_imx7.c @@ -81,7 +81,7 @@ static iomux_v3_cfg_t const usb_cdet_pads[] = { MX7D_PAD_ENET1_CRS__GPIO7_IO14 | MUX_PAD_CTRL(NO_PAD_CTRL), }; -#ifdef CONFIG_NAND_MXS +#if defined(CONFIG_NAND_MXS) && defined(CONFIG_TARGET_COLIBRI_IMX7_NAND) static iomux_v3_cfg_t const gpmi_pads[] = { MX7D_PAD_SD3_DATA0__NAND_DATA00 | MUX_PAD_CTRL(NAND_PAD_CTRL), MX7D_PAD_SD3_DATA1__NAND_DATA01 | MUX_PAD_CTRL(NAND_PAD_CTRL), @@ -109,6 +109,24 @@ static void setup_gpmi_nand(void) } #endif +#ifdef CONFIG_TARGET_COLIBRI_IMX7_EMMC +static iomux_v3_cfg_t const usdhc3_emmc_pads[] = { + MX7D_PAD_SD3_CLK__SD3_CLK | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX7D_PAD_SD3_CMD__SD3_CMD | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX7D_PAD_SD3_DATA0__SD3_DATA0 | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX7D_PAD_SD3_DATA1__SD3_DATA1 | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX7D_PAD_SD3_DATA2__SD3_DATA2 | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX7D_PAD_SD3_DATA3__SD3_DATA3 | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX7D_PAD_SD3_DATA4__SD3_DATA4 | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX7D_PAD_SD3_DATA5__SD3_DATA5 | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX7D_PAD_SD3_DATA6__SD3_DATA6 | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX7D_PAD_SD3_DATA7__SD3_DATA7 | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX7D_PAD_SD3_STROBE__SD3_STROBE | MUX_PAD_CTRL(USDHC_PAD_CTRL), + + MX7D_PAD_SD3_RESET_B__GPIO6_IO11 | MUX_PAD_CTRL(USDHC_PAD_CTRL), +}; +#endif + #ifdef CONFIG_VIDEO_MXS static iomux_v3_cfg_t const lcd_pads[] = { MX7D_PAD_LCD_CLK__LCD_CLK | MUX_PAD_CTRL(LCD_PAD_CTRL), @@ -198,6 +216,9 @@ static void setup_iomux_uart(void) #define USDHC1_CD_GPIO IMX_GPIO_NR(1, 0) static struct fsl_esdhc_cfg usdhc_cfg[] = { +#ifdef CONFIG_TARGET_COLIBRI_IMX7_EMMC + {USDHC3_BASE_ADDR}, +#endif {USDHC1_BASE_ADDR, 0, 4}, }; @@ -210,6 +231,11 @@ int board_mmc_getcd(struct mmc *mmc) case USDHC1_BASE_ADDR: ret = !gpio_get_value(USDHC1_CD_GPIO); break; +#ifdef CONFIG_TARGET_COLIBRI_IMX7_EMMC + case USDHC3_BASE_ADDR: + ret = 1; + break; +#endif } return ret; @@ -218,7 +244,7 @@ int board_mmc_getcd(struct mmc *mmc) int board_mmc_init(bd_t *bis) { int i, ret; - /* USDHC1 is mmc0 */ + /* USDHC1 is mmc0, USDHC3 is mmc1 */ for (i = 0; i < CONFIG_SYS_FSL_USDHC_NUM; i++) { switch (i) { case 0: @@ -228,6 +254,13 @@ int board_mmc_init(bd_t *bis) gpio_direction_input(USDHC1_CD_GPIO); usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC_CLK); break; +#ifdef CONFIG_TARGET_COLIBRI_IMX7_EMMC + case 1: + imx_iomux_v3_setup_multiple_pads( + usdhc3_emmc_pads, ARRAY_SIZE(usdhc3_emmc_pads)); + usdhc_cfg[1].sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK); + break; +#endif default: printf("Warning: you configured more USDHC controllers" "(%d) than supported by the board\n", i + 1); @@ -305,7 +338,7 @@ int board_init(void) setup_fec(); #endif -#ifdef CONFIG_NAND_MXS +#ifdef CONFIG_TARGET_COLIBRI_IMX7_NAND setup_gpmi_nand(); #endif @@ -324,7 +357,12 @@ int board_init(void) #ifdef CONFIG_CMD_BMODE static const struct boot_mode board_boot_modes[] = { /* 4 bit bus width */ +#ifdef CONFIG_TARGET_COLIBRI_IMX7_NAND {"nand", MAKE_CFGVAL(0x40, 0x34, 0x00, 0x00)}, +#endif +#ifdef CONFIG_TARGET_COLIBRI_IMX7_EMMC + {"mmc", MAKE_CFGVAL(0x20, 0xe0, 0x00, 0x00)}, +#endif {"sd1", MAKE_CFGVAL(0x10, 0x10, 0x00, 0x00)}, {NULL, 0}, }; diff --git a/board/toradex/common/tdx-cfg-block.c b/board/toradex/common/tdx-cfg-block.c index 3a8bd7f5bc1..0a1e3e85f71 100644 --- a/board/toradex/common/tdx-cfg-block.c +++ b/board/toradex/common/tdx-cfg-block.c @@ -313,7 +313,11 @@ static int get_cfgblock_interactive(void) tdx_hw_tag.prodid = COLIBRI_IMX6ULL; #endif /* CONFIG_MACH_TYPE */ } else if (!strcmp("imx7d", soc)) { +#ifdef CONFIG_TARGET_COLIBRI_IMX7_EMMC + tdx_hw_tag.prodid = COLIBRI_IMX7D_EMMC; +#else tdx_hw_tag.prodid = COLIBRI_IMX7D; +#endif } else if (!strcmp("imx7s", soc)) { tdx_hw_tag.prodid = COLIBRI_IMX7S; } else if (!strcmp("tegra20", soc)) { |