[U-Boot] [PATCH 11/18] ARM: uniphier: detect SD boot mode
Masahiro Yamada
yamada.masahiro at socionext.com
Tue Jul 2 08:32:21 UTC 2019
The planned new SoC supports the SD boot mode. Detect and display it.
Signed-off-by: Masahiro Yamada <yamada.masahiro at socionext.com>
---
arch/arm/mach-uniphier/board_late_init.c | 4 ++++
arch/arm/mach-uniphier/boot-device/boot-device.c | 8 ++++++++
2 files changed, 12 insertions(+)
diff --git a/arch/arm/mach-uniphier/board_late_init.c b/arch/arm/mach-uniphier/board_late_init.c
index 972dbe8ae553..86b128a91f95 100644
--- a/arch/arm/mach-uniphier/board_late_init.c
+++ b/arch/arm/mach-uniphier/board_late_init.c
@@ -68,6 +68,10 @@ int board_late_init(void)
printf("eMMC Boot");
env_set("bootdev", "emmc");
break;
+ case BOOT_DEVICE_MMC2:
+ printf("SD Boot");
+ env_set("bootdev", "sd");
+ break;
case BOOT_DEVICE_NAND:
printf("NAND Boot");
env_set("bootdev", "nand");
diff --git a/arch/arm/mach-uniphier/boot-device/boot-device.c b/arch/arm/mach-uniphier/boot-device/boot-device.c
index 4533aff70df7..b0b39d8e02d4 100644
--- a/arch/arm/mach-uniphier/boot-device/boot-device.c
+++ b/arch/arm/mach-uniphier/boot-device/boot-device.c
@@ -21,6 +21,7 @@ struct uniphier_boot_device_info {
unsigned int boot_device_sel_shift;
const struct uniphier_boot_device *boot_device_table;
const unsigned int *boot_device_count;
+ int (*boot_device_is_sd)(void);
int (*boot_device_is_usb)(void);
unsigned int (*boot_device_fixup)(unsigned int mode);
int (*boot_is_swapped)(void);
@@ -137,6 +138,9 @@ static unsigned int __uniphier_boot_device_raw(
if (info->boot_is_swapped && info->boot_is_swapped())
return BOOT_DEVICE_NOR;
+ if (info->boot_device_is_sd && info->boot_device_is_sd())
+ return BOOT_DEVICE_MMC2;
+
if (info->boot_device_is_usb && info->boot_device_is_usb())
return BOOT_DEVICE_USB;
@@ -218,6 +222,10 @@ static int do_pinmon(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
printf("Boot Swap: %s\n",
info->boot_is_swapped() ? "ON" : "OFF");
+ if (info->boot_device_is_sd)
+ printf("SD Boot: %s\n",
+ info->boot_device_is_sd() ? "ON" : "OFF");
+
if (info->boot_device_is_usb)
printf("USB Boot: %s\n",
info->boot_device_is_usb() ? "ON" : "OFF");
--
2.17.1
More information about the U-Boot
mailing list