diff options
author | Max Krummenacher <max.krummenacher@toradex.com> | 2021-07-27 19:52:36 +0200 |
---|---|---|
committer | Max Krummenacher <max.krummenacher@toradex.com> | 2021-07-29 19:14:45 +0200 |
commit | c463e5ab8ed96d054007b60c8c7c2cc387cfdbc3 (patch) | |
tree | a1c78d6d51324e7b0e440ca130f44b9df9d6074d /board/toradex | |
parent | 98584bdb41cc6c214f7bffdb9c98b6a49b18b570 (diff) |
colibri-imx6ull: add emmc variant
Add code to build the eMMC variant of the Colibri iMX6ULL, i.e. the
'Colibri iMX6ULL 1GB' which has a eMMC instead of the raw NAND used
on other SKUs.
Related-to: ELB-4056, ELB-4057
Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Diffstat (limited to 'board/toradex')
-rw-r--r-- | board/toradex/colibri-imx6ull/Kconfig | 54 | ||||
-rw-r--r-- | board/toradex/colibri-imx6ull/colibri-imx6ull.c | 27 |
2 files changed, 76 insertions, 5 deletions
diff --git a/board/toradex/colibri-imx6ull/Kconfig b/board/toradex/colibri-imx6ull/Kconfig index 3ce9885c12..8548548a95 100644 --- a/board/toradex/colibri-imx6ull/Kconfig +++ b/board/toradex/colibri-imx6ull/Kconfig @@ -1,17 +1,44 @@ if TARGET_COLIBRI_IMX6ULL +choice + prompt "Colibri iMX6ULL variant" + optional + +config TARGET_COLIBRI_IMX6ULL_NAND + bool "Support Colibri iMX6ULL 256MB / 512MB (raw NAND) modules" + imply NAND_MXS + help + Choose this option if you build for a Toradex Colibri iMX6ULL + 256MB or 512MB module which do have raw NAND on-module. + +config TARGET_COLIBRI_IMX6ULL_EMMC + bool "Support Colibri iMX6ULL 1GB (eMMC) modules" + help + Choose this option if you build for a Toradex Colibri iMX6ULL + 1GB module which does have eMMC on-module. + +endchoice + config SYS_BOARD default "colibri-imx6ull" config SYS_VENDOR default "toradex" -config SYS_CONFIG_NAME - default "colibri-imx6ull" - config TDX_CFG_BLOCK default y +config TDX_CFG_BLOCK_2ND_ETHADDR + default y + +config SYS_CONFIG_NAME + default "colibri-imx6ull-tezi-recovery" if (!TARGET_COLIBRI_IMX6ULL_NAND && !TARGET_COLIBRI_IMX6ULL_EMMC) + +if TARGET_COLIBRI_IMX6ULL_NAND + +config SYS_CONFIG_NAME + default "colibri-imx6ull" + config TDX_HAVE_NAND default y @@ -21,9 +48,28 @@ config TDX_CFG_BLOCK_OFFSET config TDX_CFG_BLOCK_OFFSET2 default "133120" -config TDX_CFG_BLOCK_2ND_ETHADDR +endif + +if TARGET_COLIBRI_IMX6ULL_EMMC + +config SYS_CONFIG_NAME + default "colibri-imx6ull" + +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-imx6ull/colibri-imx6ull.c b/board/toradex/colibri-imx6ull/colibri-imx6ull.c index c02db78881..200a1447e0 100644 --- a/board/toradex/colibri-imx6ull/colibri-imx6ull.c +++ b/board/toradex/colibri-imx6ull/colibri-imx6ull.c @@ -42,6 +42,14 @@ DECLARE_GLOBAL_DATA_PTR; #define NAND_PAD_READY0_CTRL (PAD_CTL_DSE_48ohm | PAD_CTL_PUS_22K_UP) +#define FLASH_DETECTION_CTRL (PAD_CTL_HYS | PAD_CTL_PUE) +#define FLASH_DET_GPIO IMX_GPIO_NR(4, 1) +static iomux_v3_cfg_t const flash_detection_pads[] = { + MX6_PAD_NAND_WE_B__GPIO4_IO01 | MUX_PAD_CTRL(FLASH_DETECTION_CTRL), +}; + +static bool is_emmc; + int dram_init(void) { gd->ram_size = get_ram_size((void *)PHYS_SDRAM, PHYS_SDRAM_SIZE); @@ -119,6 +127,16 @@ int board_init(void) /* address of boot parameters */ gd->bd->bi_boot_params = PHYS_SDRAM + 0x100; + /* + * Enable GPIO on NAND_WE_B/eMMC_RST with 100k pull-down. eMMC_RST + * is pulled high with 4.7k for eMMC devices. This allows to reliably + * detect eMMC/NAND flash + */ + imx_iomux_v3_setup_multiple_pads(flash_detection_pads, ARRAY_SIZE(flash_detection_pads)); + gpio_request(FLASH_DET_GPIO, "flash-detection-gpio"); + is_emmc = gpio_get_value(FLASH_DET_GPIO); + gpio_free(FLASH_DET_GPIO); + #ifdef CONFIG_FEC_MXC setup_fec(); #endif @@ -147,8 +165,15 @@ int board_late_init(void) * Wi-Fi/Bluetooth make sure we use the -wifi device tree. */ if (tdx_hw_tag.prodid == COLIBRI_IMX6ULL_WIFI_BT_IT || - tdx_hw_tag.prodid == COLIBRI_IMX6ULL_WIFI_BT) + tdx_hw_tag.prodid == COLIBRI_IMX6ULL_WIFI_BT) { env_set("variant", "-wifi"); + } else { + if (is_emmc) + env_set("variant", "-emmc"); + } +#else + if (is_emmc) + env_set("variant", "-emmc"); #endif /* |