summaryrefslogtreecommitdiff
path: root/board/freescale
diff options
context:
space:
mode:
authorPeng Fan <peng.fan@nxp.com>2016-02-23 12:52:27 +0800
committerYe Li <ye.li@nxp.com>2016-03-25 13:29:01 +0800
commit2fc0e6ccc90989375ac6355d4f33fd4ffaca9b3a (patch)
tree4e26b5d6ad91264911e810f6d8edfa57c7b9beb6 /board/freescale
parent95cf514bb3c17014622bca26cbcbfda31cec861a (diff)
downloadu-boot-imx-2fc0e6ccc90989375ac6355d4f33fd4ffaca9b3a.zip
u-boot-imx-2fc0e6ccc90989375ac6355d4f33fd4ffaca9b3a.tar.gz
u-boot-imx-2fc0e6ccc90989375ac6355d4f33fd4ffaca9b3a.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>
Diffstat (limited to 'board/freescale')
-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 d7986c9..5085384 100644
--- a/board/freescale/mx7dsabresd/mx7dsabresd.c
+++ b/board/freescale/mx7dsabresd/mx7dsabresd.c
@@ -390,7 +390,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++;
@@ -459,39 +459,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
@@ -849,7 +816,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));