return boot_dev;
}
+#ifdef CONFIG_ENV_IS_IN_MMC
+__weak int board_mmc_get_env_dev(int devno)
+{
+ return CONFIG_SYS_MMC_ENV_DEV;
+}
+
+int mmc_get_env_dev(void)
+{
+ struct bootrom_sw_info **p =
+ (struct bootrom_sw_info **)ROM_SW_INFO_ADDR;
+ int devno = (*p)->boot_dev_instance;
+ u8 boot_type = (*p)->boot_dev_type;
+
+ /* 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;
+
+ return board_mmc_get_env_dev(devno);
+}
+#endif
+
void s_init(void)
{
#if !defined CONFIG_SPL_BUILD
{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)
{
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;