imx8m_som/spl.c : add code to initailize the MMC when we boot from SDP

parent 2bfa1c85
......@@ -371,10 +371,27 @@ static int setup_typec(void)
}
#endif
static int sdp_mmc_init(void)
{
struct mmc *mmc = NULL;
int err = 0;
err = spl_mmc_find_device(&mmc, BOOT_DEVICE_MMC1);
if (err)
return err;
err = mmc_init(mmc);
if (err) {
printf("spl: mmc_init failed: %d\n", err);
}
return 0;
}
void board_init_f(ulong dummy)
{
int ret;
int ret, err;
struct mmc *mmc;
/* Clear global data */
memset((void *)gd, 0, sizeof(gd_t));
......@@ -412,8 +429,12 @@ void board_init_f(ulong dummy)
/* DDR initialization */
spl_dram_init();
printf( "Board init\n" );
if( is_usb_boot() ) {
printf( "MMC init\n" );
sdp_mmc_init();
}
printf( "Board init\n" );
board_init_r(NULL, 0);
}
......
......@@ -124,7 +124,7 @@ int spl_mmc_get_device_index(u32 boot_device)
return -ENODEV;
}
static int spl_mmc_find_device(struct mmc **mmcp, u32 boot_device)
int spl_mmc_find_device(struct mmc **mmcp, u32 boot_device)
{
#ifdef CONFIG_DM_MMC
struct udevice *dev;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment