[U-Boot] [PATCH v2 1/3] ARM: imx6: DHCOM i.MX6 PDK: fix board_boot_modes emmc entry

The board_boot_modes contained the wrong values for the emmc entry.
The eMMC here is connected over a 8-bit bus.
This change allows to use the 'bmode emmc' command to boot from emmc.
Signed-off-by: Claudius Heine ch@denx.de --- board/dhelectronics/dh_imx6/dh_imx6.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/board/dhelectronics/dh_imx6/dh_imx6.c b/board/dhelectronics/dh_imx6/dh_imx6.c index 2d0f78da11..8dc4b80872 100644 --- a/board/dhelectronics/dh_imx6/dh_imx6.c +++ b/board/dhelectronics/dh_imx6/dh_imx6.c @@ -197,7 +197,7 @@ static const struct boot_mode board_boot_modes[] = { {"sd2", MAKE_CFGVAL(0x40, 0x28, 0x00, 0x00)}, {"sd3", MAKE_CFGVAL(0x40, 0x30, 0x00, 0x00)}, /* 8 bit bus width */ - {"emmc", MAKE_CFGVAL(0x40, 0x38, 0x00, 0x00)}, + {"emmc", MAKE_CFGVAL(0x60, 0x58, 0x00, 0x00)}, {NULL, 0}, }; #endif

In order for 'bmode emmc' to work, the eMMC needs to be initialized in the SPL. This change initializes the eMMC as BOOT_DEVICE_MMC1 (index=0).
Signed-off-by: Claudius Heine ch@denx.de --- board/dhelectronics/dh_imx6/dh_imx6_spl.c | 26 +++++++++++++++++++++++ 1 file changed, 26 insertions(+)
diff --git a/board/dhelectronics/dh_imx6/dh_imx6_spl.c b/board/dhelectronics/dh_imx6/dh_imx6_spl.c index 1b7acc8df7..f2c3ac3e28 100644 --- a/board/dhelectronics/dh_imx6/dh_imx6_spl.c +++ b/board/dhelectronics/dh_imx6/dh_imx6_spl.c @@ -476,6 +476,32 @@ static void setup_iomux_uart(void) SETUP_IOMUX_PADS(uart1_pads); }
+#ifdef CONFIG_FSL_USDHC +struct fsl_esdhc_cfg usdhc_cfg[1] = { + {USDHC4_BASE_ADDR}, +}; + +int board_mmc_get_env_dev(int devno) +{ + return devno - 1; +} + +int board_mmc_getcd(struct mmc *mmc) +{ + return 1; /* eMMC/uSDHC4 is always present */ +} + +int board_mmc_init(bd_t *bis) +{ + SETUP_IOMUX_PADS(usdhc4_pads); + usdhc_cfg[0].esdhc_base = USDHC4_BASE_ADDR; + usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC4_CLK); + usdhc_cfg[0].max_bus_width = 8; + + return fsl_esdhc_initialize(bis, &usdhc_cfg[0]); +} +#endif + /* USB */ static iomux_v3_cfg_t const usb_pads[] = { IOMUX_PADS(PAD_GPIO_1__USB_OTG_ID | MUX_PAD_CTRL(NO_PAD_CTRL)),

In order for 'bmode emmc' to work, the eMMC needs to be initialized in the SPL. This change initializes the eMMC as BOOT_DEVICE_MMC1 (index=0). Signed-off-by: Claudius Heine ch@denx.de
Applied to u-boot-imx, master, thanks !
Best regards, Stefano Babic

Signed-off-by: Claudius Heine ch@denx.de --- configs/dh_imx6_defconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/configs/dh_imx6_defconfig b/configs/dh_imx6_defconfig index f459af07f8..43f7cd47ee 100644 --- a/configs/dh_imx6_defconfig +++ b/configs/dh_imx6_defconfig @@ -6,6 +6,7 @@ CONFIG_SPL_LIBCOMMON_SUPPORT=y CONFIG_SPL_LIBGENERIC_SUPPORT=y CONFIG_MX6_DDRCAL=y CONFIG_TARGET_DHCOMIMX6=y +CONFIG_SPL_MMC_SUPPORT=y CONFIG_SPL_SERIAL_SUPPORT=y CONFIG_NR_DRAM_BANKS=1 CONFIG_SPL=y

Signed-off-by: Claudius Heine ch@denx.de
Applied to u-boot-imx, master, thanks !
Best regards, Stefano Babic

The board_boot_modes contained the wrong values for the emmc entry. The eMMC here is connected over a 8-bit bus. This change allows to use the 'bmode emmc' command to boot from emmc. Signed-off-by: Claudius Heine ch@denx.de
Applied to u-boot-imx, master, thanks !
Best regards, Stefano Babic
participants (2)
-
Claudius Heine
-
sbabic@denx.de