diff options
author | Stefan Agner <stefan.agner@toradex.com> | 2017-08-23 10:38:35 -0700 |
---|---|---|
committer | Stefan Agner <stefan.agner@toradex.com> | 2018-07-27 14:14:06 +0200 |
commit | d49dfde5fb9659cbf16fd434c27596ff37fdc266 (patch) | |
tree | b21d7080a30b89419ab137aa1214b1567e9c8f29 /board | |
parent | 2196085dc58eeff58f49b30e33dbf7ce95456871 (diff) |
colibri_imx7: add configuration for tezi recovery
Modify configuration for Tezi unified recovery mode:
- Enable SDP in U-Boot
- Enable FDT relocation (in-place is causing issues with FIT images)
- Remove video output
- Currently only for recovery (no flash/eMMC support)
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Diffstat (limited to 'board')
-rw-r--r-- | board/toradex/colibri_imx7/Kconfig | 4 | ||||
-rw-r--r-- | board/toradex/colibri_imx7/colibri_imx7.c | 28 |
2 files changed, 30 insertions, 2 deletions
diff --git a/board/toradex/colibri_imx7/Kconfig b/board/toradex/colibri_imx7/Kconfig index e958c35e84e..3fb3ae490a6 100644 --- a/board/toradex/colibri_imx7/Kconfig +++ b/board/toradex/colibri_imx7/Kconfig @@ -2,6 +2,7 @@ if TARGET_COLIBRI_IMX7 choice prompt "Colibri iMX7S/D variant" + optional config TARGET_COLIBRI_IMX7_NAND bool "Support Colibri iMX7 Solo 256MB/Dual 512MB (raw NAND) modules" @@ -30,6 +31,9 @@ config TDX_CFG_BLOCK config TDX_CFG_BLOCK_2ND_ETHADDR default y +config SYS_CONFIG_NAME + default "colibri_imx7_tezi_recovery" if (!TARGET_COLIBRI_IMX7_NAND && !TARGET_COLIBRI_IMX7_EMMC) + if TARGET_COLIBRI_IMX7_NAND config SYS_CONFIG_NAME diff --git a/board/toradex/colibri_imx7/colibri_imx7.c b/board/toradex/colibri_imx7/colibri_imx7.c index 84d6860c81c..ca28f1cc5d5 100644 --- a/board/toradex/colibri_imx7/colibri_imx7.c +++ b/board/toradex/colibri_imx7/colibri_imx7.c @@ -50,7 +50,12 @@ DECLARE_GLOBAL_DATA_PTR; #define NAND_PAD_READY0_CTRL (PAD_CTL_DSE_3P3V_49OHM | PAD_CTL_PUS_PU5KOHM) +#define FLASH_DETECTION_CTRL (PAD_CTL_HYS | PAD_CTL_PUE) + #define USB_CDET_GPIO IMX_GPIO_NR(7, 14) +#define FLASH_DET_GPIO IMX_GPIO_NR(6, 11) + +static bool is_emmc; int dram_init(void) { @@ -81,6 +86,10 @@ static iomux_v3_cfg_t const usb_cdet_pads[] = { MX7D_PAD_ENET1_CRS__GPIO7_IO14 | MUX_PAD_CTRL(NO_PAD_CTRL), }; +static iomux_v3_cfg_t const flash_detection_pads[] = { + MX7D_PAD_SD3_RESET_B__GPIO6_IO11 | MUX_PAD_CTRL(FLASH_DETECTION_CTRL), +}; + #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), @@ -333,6 +342,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 @@ -373,6 +392,9 @@ int board_late_init(void) add_board_boot_modes(board_boot_modes); #endif + if (is_emmc) + setenv("variant", "-emmc"); + #ifdef CONFIG_CMD_USB_SDP if (get_boot_device() == USB_SDP_BOOT) { printf("Serial Downloader recovery mode, using sdp command\n"); @@ -469,8 +491,10 @@ int ft_board_setup(void *blob, bd_t *bd) }; /* Update partition nodes using info from mtdparts env var */ - puts(" Updating MTD partitions...\n"); - fdt_fixup_mtdparts(blob, nodes, ARRAY_SIZE(nodes)); + if (!is_emmc) { + puts(" Updating MTD partitions...\n"); + fdt_fixup_mtdparts(blob, nodes, ARRAY_SIZE(nodes)); + } #endif #if defined(CONFIG_IMX_BOOTAUX) ret = arch_auxiliary_core_check_up(0); |