summaryrefslogtreecommitdiff
path: root/arch/arm/mach-uniphier/boot-device
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2019-07-10 20:07:39 +0900
committerMasahiro Yamada <yamada.masahiro@socionext.com>2019-07-10 22:41:59 +0900
commitc3d8f1e8e92fd70abb912942300cf44fff9e9d86 (patch)
tree1ec3c23ba24a893e8e076438ca9de6468115bf74 /arch/arm/mach-uniphier/boot-device
parent539d6e0dbc9634cbf0e14a383d2907e6e462558a (diff)
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>
Diffstat (limited to 'arch/arm/mach-uniphier/boot-device')
-rw-r--r--arch/arm/mach-uniphier/boot-device/boot-device.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/arm/mach-uniphier/boot-device/boot-device.c b/arch/arm/mach-uniphier/boot-device/boot-device.c
index 3c2e7b660f..c9dfe13ed9 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)(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 @@ static unsigned int __uniphier_boot_device_raw(
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 @@ static int do_pinmon(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
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");