diff options
author | Peng Fan <peng.fan@nxp.com> | 2016-01-28 16:51:25 +0800 |
---|---|---|
committer | Stefano Babic <sbabic@denx.de> | 2016-02-04 10:13:45 +0100 |
commit | 62d8cce9f37c12ff92a47414484997a74d038440 (patch) | |
tree | 7d13defef8d5c2a3397cd1a5f2fb3c4868b2dfe6 /board | |
parent | 9e30ba2d75b2f4a4880080fc1f9795e9bf59408e (diff) | |
download | u-boot-imx-62d8cce9f37c12ff92a47414484997a74d038440.zip u-boot-imx-62d8cce9f37c12ff92a47414484997a74d038440.tar.gz u-boot-imx-62d8cce9f37c12ff92a47414484997a74d038440.tar.bz2 |
imx: mx7dsabresd: move mmc_get_env_devno to soc code
Move mmc_get_env_devno to soc.c and rename to mmc_get_env_dev to
match the one in common/env_mmc.c.
Introduce a weak function board_mmc_get_env_dev. Different
boards can implement this according to sdhc controller which
is used by the board.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Diffstat (limited to 'board')
-rw-r--r-- | board/freescale/mx7dsabresd/mx7dsabresd.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/board/freescale/mx7dsabresd/mx7dsabresd.c b/board/freescale/mx7dsabresd/mx7dsabresd.c index bbcc5bb..20e56f2 100644 --- a/board/freescale/mx7dsabresd/mx7dsabresd.c +++ b/board/freescale/mx7dsabresd/mx7dsabresd.c @@ -328,22 +328,12 @@ static struct fsl_esdhc_cfg usdhc_cfg[3] = { {USDHC3_BASE_ADDR}, }; -static int mmc_get_env_devno(void) +int board_mmc_get_env_dev(int devno) { - struct bootrom_sw_info **p = - (struct bootrom_sw_info **)ROM_SW_INFO_ADDR; + if (devno == 2) + devno--; - u8 boot_type = (*p)->boot_dev_type; - u8 dev_no = (*p)->boot_dev_instance; - - /* If not boot from sd/mmc, use default value */ - if ((boot_type != BOOT_TYPE_SD) && (boot_type != BOOT_TYPE_MMC)) - return CONFIG_SYS_MMC_ENV_DEV; - - if (dev_no == 2) - dev_no--; - - return dev_no; + return devno; } static int mmc_map_to_kernel_blk(int dev_no) @@ -432,7 +422,7 @@ static void mmc_late_init(void) { char cmd[32]; char mmcblk[32]; - u32 dev_no = mmc_get_env_devno(); + u32 dev_no = mmc_get_env_dev(); if (!check_mmc_autodetect()) return; |