Skip to content

Commit

Permalink
board: mediatek: fix mmc_get_boot_dev() for platforms without externa…
Browse files Browse the repository at this point in the history
…l SD

On the UniElec U7623 board there is no external SD slot and the preloader
doesn't fill in the magic field at 0x81dffff0 to indicate that it was
booted from eMMC.

Signed-off-by: David Woodhouse <[email protected]>
  • Loading branch information
dwmw2 authored and trini committed Jul 29, 2020
1 parent b39cacc commit e3cc511
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions board/mediatek/mt7623/mt7623_rfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

#include <common.h>
#include <mmc.h>

DECLARE_GLOBAL_DATA_PTR;

Expand All @@ -15,10 +16,15 @@ int board_init(void)
return 0;
}

#ifdef CONFIG_MMC
int mmc_get_boot_dev(void)
{
int g_mmc_devid = -1;
char *uflag = (char *)0x81DFFFF0;

if (!find_mmc_device(1))
return 0;

if (strncmp(uflag,"eMMC",4)==0) {
g_mmc_devid = 0;
printf("Boot From Emmc(id:%d)\n\n", g_mmc_devid);
Expand All @@ -33,3 +39,4 @@ int mmc_get_env_dev(void)
{
return mmc_get_boot_dev();
}
#endif

0 comments on commit e3cc511

Please sign in to comment.