diff options
author | Peng Fan <peng.fan@nxp.com> | 2016-02-23 12:46:21 +0800 |
---|---|---|
committer | Ye Li <ye.li@nxp.com> | 2017-04-05 14:04:29 +0800 |
commit | 7810c81124f8816fa0a3540f87111786e977fc99 (patch) | |
tree | 7702c6866693b1d55c94304b7d2298802ff8df46 | |
parent | 5c0d6eee4fc68955b70b5be890ef6078f971a1b8 (diff) | |
download | u-boot-imx-7810c81124f8816fa0a3540f87111786e977fc99.zip u-boot-imx-7810c81124f8816fa0a3540f87111786e977fc99.tar.gz u-boot-imx-7810c81124f8816fa0a3540f87111786e977fc99.tar.bz2 |
MLK-12434-3: mx6sabre: dynamic setting mmcdev and mmcroot
Dynamic setting mmcdev and mmcroot for mx6sabresd and mx6qsabreauto.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 14040e07549a394500c11e815f31299e4fb0ac50)
-rw-r--r-- | board/freescale/mx6qsabreauto/mx6qsabreauto.c | 26 | ||||
-rw-r--r-- | board/freescale/mx6sabresd/mx6sabresd.c | 9 | ||||
-rw-r--r-- | include/configs/mx6sabre_common.h | 1 |
3 files changed, 35 insertions, 1 deletions
diff --git a/board/freescale/mx6qsabreauto/mx6qsabreauto.c b/board/freescale/mx6qsabreauto/mx6qsabreauto.c index 51bbbc4..f4b095f 100644 --- a/board/freescale/mx6qsabreauto/mx6qsabreauto.c +++ b/board/freescale/mx6qsabreauto/mx6qsabreauto.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012 Freescale Semiconductor, Inc. + * Copyright (C) 2012-2016 Freescale Semiconductor, Inc. * * Author: Fabio Estevam <fabio.estevam@freescale.com> * @@ -297,6 +297,26 @@ static struct fsl_esdhc_cfg usdhc_cfg[1] = { {USDHC3_BASE_ADDR}, }; +int board_mmc_get_env_dev(int devno) +{ + /* + * need ubstract 1 to map to the mmc3 device id + * see the comments in board_mmc_init function + */ + if (devno == 2) + devno--; + + return devno; +} + +int mmc_map_to_kernel_blk(int devno) +{ + if (devno == 1) + devno = 2; + + return devno; +} + int board_mmc_getcd(struct mmc *mmc) { gpio_direction_input(IMX_GPIO_NR(6, 15)); @@ -626,6 +646,10 @@ int board_late_init(void) setenv("board_rev", "MX6DL"); #endif +#ifdef CONFIG_ENV_IS_IN_MMC + board_late_mmc_env_init(); +#endif + return 0; } diff --git a/board/freescale/mx6sabresd/mx6sabresd.c b/board/freescale/mx6sabresd/mx6sabresd.c index d079fc4..9097426 100644 --- a/board/freescale/mx6sabresd/mx6sabresd.c +++ b/board/freescale/mx6sabresd/mx6sabresd.c @@ -318,6 +318,11 @@ int board_mmc_get_env_dev(int devno) return devno - 1; } +int mmc_map_to_kernel_blk(int devno) +{ + return devno + 1; +} + int board_mmc_getcd(struct mmc *mmc) { struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv; @@ -983,6 +988,10 @@ int board_late_init(void) setenv("board_rev", "MX6DL"); #endif +#ifdef CONFIG_ENV_IS_IN_MMC + board_late_mmc_env_init(); +#endif + return 0; } diff --git a/include/configs/mx6sabre_common.h b/include/configs/mx6sabre_common.h index 4d2adb0..9b0eded 100644 --- a/include/configs/mx6sabre_common.h +++ b/include/configs/mx6sabre_common.h @@ -82,6 +82,7 @@ "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \ "mmcpart=1\0" \ "mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \ + "mmcautodetect=yes\0" \ "update_sd_firmware=" \ "if test ${ip_dyn} = yes; then " \ "setenv get_cmd dhcp; " \ |