summaryrefslogtreecommitdiff
path: root/arch/arm/mach-uniphier/boot-mode/boot-mode.c
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2016-06-04 13:39:08 (GMT)
committerMasahiro Yamada <yamada.masahiro@socionext.com>2016-06-08 23:17:49 (GMT)
commitadb3928f152796e275f0535759796422d91f4709 (patch)
treed5ab661b42508b7511e4ca02acb8a314efce07a3 /arch/arm/mach-uniphier/boot-mode/boot-mode.c
parentb104b3dc1dd90cdbf67ccf3c51b06e4f1592fe91 (diff)
downloadu-boot-fsl-qoriq-adb3928f152796e275f0535759796422d91f4709.tar.xz
ARM: uniphier: support eMMC boot for PH1-LD11 and PH1-LD20
The Boot ROM on PH1-LD11/LD20 exports built-in APIs to load images from an eMMC device. They are useful to reduce the memory footprint of SPL, rather than compiling the whole MMC framework. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'arch/arm/mach-uniphier/boot-mode/boot-mode.c')
-rw-r--r--arch/arm/mach-uniphier/boot-mode/boot-mode.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/arch/arm/mach-uniphier/boot-mode/boot-mode.c b/arch/arm/mach-uniphier/boot-mode/boot-mode.c
index 4b744da..d34b9af 100644
--- a/arch/arm/mach-uniphier/boot-mode/boot-mode.c
+++ b/arch/arm/mach-uniphier/boot-mode/boot-mode.c
@@ -51,11 +51,30 @@ u32 spl_boot_device_raw(void)
u32 spl_boot_device(void)
{
- u32 ret;
+ u32 mode;
- ret = spl_boot_device_raw();
+ mode = spl_boot_device_raw();
- return ret == BOOT_DEVICE_USB ? BOOT_DEVICE_NOR : ret;
+ switch (uniphier_get_soc_type()) {
+#if defined(CONFIG_ARCH_UNIPHIER_PXS2) || defined(CONFIG_ARCH_UNIPHIER_LD6B)
+ case SOC_UNIPHIER_PXS2:
+ case SOC_UNIPHIER_LD6B:
+ if (mode == BOOT_DEVICE_USB)
+ mode = BOOT_DEVICE_NOR;
+ break;
+#endif
+#if defined(CONFIG_ARCH_UNIPHIER_LD11) || defined(CONFIG_ARCH_UNIPHIER_LD20)
+ case SOC_UNIPHIER_LD11:
+ case SOC_UNIPHIER_LD20:
+ if (mode == BOOT_DEVICE_MMC1 || mode == BOOT_DEVICE_USB)
+ mode = BOOT_DEVICE_BOARD;
+ break;
+#endif
+ default:
+ break;
+ }
+
+ return mode;
}
u32 spl_boot_mode(void)