summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorPeng Fan <peng.fan@nxp.com>2016-02-23 12:52:27 +0800
committerYe Li <ye.li@nxp.com>2017-04-05 14:04:29 +0800
commit8d08fa11118c2c5c46dcac360709c0f6f7bc7f8a (patch)
tree72317a5ee810406a37ebc875bf5d1e25837e18b3 /board
parent46fff9210d161e358a3b2caab5341838cb6596ec (diff)
downloadu-boot-imx-8d08fa11118c2c5c46dcac360709c0f6f7bc7f8a.zip
u-boot-imx-8d08fa11118c2c5c46dcac360709c0f6f7bc7f8a.tar.gz
u-boot-imx-8d08fa11118c2c5c46dcac360709c0f6f7bc7f8a.tar.bz2
MLK-12434-8: mx7dsabresd: dynamic setting mmcdev and mmcroot
Dynamic setting mmcdev and mmcroot for mx7dsabresd. Signed-off-by: Peng Fan <peng.fan@nxp.com> (cherry picked from commit 2fc0e6ccc90989375ac6355d4f33fd4ffaca9b3a)
Diffstat (limited to 'board')
-rw-r--r--board/freescale/mx7dsabresd/mx7dsabresd.c37
1 files changed, 2 insertions, 35 deletions
diff --git a/board/freescale/mx7dsabresd/mx7dsabresd.c b/board/freescale/mx7dsabresd/mx7dsabresd.c
index 6ccdd4b..8ffd474 100644
--- a/board/freescale/mx7dsabresd/mx7dsabresd.c
+++ b/board/freescale/mx7dsabresd/mx7dsabresd.c
@@ -365,7 +365,7 @@ int board_mmc_get_env_dev(int devno)
return devno;
}
-static int mmc_map_to_kernel_blk(int dev_no)
+int mmc_map_to_kernel_blk(int dev_no)
{
if (dev_no == 1)
dev_no++;
@@ -434,39 +434,6 @@ int board_mmc_init(bd_t *bis)
return 0;
}
-
-static int check_mmc_autodetect(void)
-{
- char *autodetect_str = getenv("mmcautodetect");
-
- if ((autodetect_str != NULL) &&
- (strcmp(autodetect_str, "yes") == 0)) {
- return 1;
- }
-
- return 0;
-}
-
-static void mmc_late_init(void)
-{
- char cmd[32];
- char mmcblk[32];
- u32 dev_no = mmc_get_env_dev();
-
- if (!check_mmc_autodetect())
- return;
-
- setenv_ulong("mmcdev", dev_no);
-
- /* Set mmcblk env */
- sprintf(mmcblk, "/dev/mmcblk%dp2 rootwait rw",
- mmc_map_to_kernel_blk(dev_no));
- setenv("mmcroot", mmcblk);
-
- sprintf(cmd, "mmc dev %d", dev_no);
- run_command(cmd, 0);
-}
-
#endif
#ifdef CONFIG_FEC_MXC
@@ -613,7 +580,7 @@ int board_late_init(void)
struct wdog_regs *wdog = (struct wdog_regs *)WDOG1_BASE_ADDR;
#ifdef CONFIG_ENV_IS_IN_MMC
- mmc_late_init();
+ board_late_mmc_env_init();
#endif
imx_iomux_v3_setup_multiple_pads(wdog_pads, ARRAY_SIZE(wdog_pads));