summaryrefslogtreecommitdiff
path: root/board/freescale
diff options
context:
space:
mode:
authorPeng Fan <peng.fan@nxp.com>2016-02-23 12:46:21 +0800
committerYe Li <ye.li@nxp.com>2016-03-25 13:20:22 +0800
commit14040e07549a394500c11e815f31299e4fb0ac50 (patch)
tree61ea9c21620b5f28d44b3772c98697f63cfd85d9 /board/freescale
parent54ea563dbe1804e426afbbf0710ffa815551d92b (diff)
downloadu-boot-imx-14040e07549a394500c11e815f31299e4fb0ac50.zip
u-boot-imx-14040e07549a394500c11e815f31299e4fb0ac50.tar.gz
u-boot-imx-14040e07549a394500c11e815f31299e4fb0ac50.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>
Diffstat (limited to 'board/freescale')
-rw-r--r--board/freescale/mx6qsabreauto/mx6qsabreauto.c26
-rw-r--r--board/freescale/mx6sabresd/mx6sabresd.c9
2 files changed, 34 insertions, 1 deletions
diff --git a/board/freescale/mx6qsabreauto/mx6qsabreauto.c b/board/freescale/mx6qsabreauto/mx6qsabreauto.c
index c2e9c57..2d3ba8b 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>
*
@@ -270,6 +270,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));
@@ -631,6 +651,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 af273f2..8cdc950 100644
--- a/board/freescale/mx6sabresd/mx6sabresd.c
+++ b/board/freescale/mx6sabresd/mx6sabresd.c
@@ -295,6 +295,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;
@@ -910,6 +915,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;
}