ARM: uniphier: detect SD boot mode
The planned new SoC supports the SD boot mode. Detect and display it.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
diff --git a/arch/arm/mach-uniphier/boot-device/boot-device.c b/arch/arm/mach-uniphier/boot-device/boot-device.c
index 3c2e7b6..c9dfe13 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 @@
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)(u32 pinmon);
int (*boot_device_is_usb)(u32 pinmon);
unsigned int (*boot_device_fixup)(unsigned int mode);
int (*boot_is_swapped)(void);
@@ -140,6 +141,9 @@
pinmon = readl(SG_PINMON0);
+ if (info->boot_device_is_sd && info->boot_device_is_sd(pinmon))
+ return BOOT_DEVICE_MMC2;
+
if (info->boot_device_is_usb && info->boot_device_is_usb(pinmon))
return BOOT_DEVICE_USB;
@@ -224,6 +228,10 @@
pinmon = readl(SG_PINMON0);
+ if (info->boot_device_is_sd)
+ printf("SD Boot: %s\n",
+ info->boot_device_is_sd(pinmon) ? "ON" : "OFF");
+
if (info->boot_device_is_usb)
printf("USB Boot: %s\n",
info->boot_device_is_usb(pinmon) ? "ON" : "OFF");