aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mach-mvebu
diff options
context:
space:
mode:
authorSean Nyekjaer <sean.nyekjaer@prevas.dk>2017-11-24 14:01:47 +0100
committerStefan Roese <sr@denx.de>2017-11-30 08:30:27 +0100
commit926c8b2e3241f3a694b46d5db3453bc546a01f69 (patch)
treeeb3e7c7254247b2f40e2eada0eef9cb11cd14ce0 /arch/arm/mach-mvebu
parente83e2b390038c9075642cb243a6292241beb8d73 (diff)
downloadu-boot-926c8b2e3241f3a694b46d5db3453bc546a01f69.zip
u-boot-926c8b2e3241f3a694b46d5db3453bc546a01f69.tar.gz
u-boot-926c8b2e3241f3a694b46d5db3453bc546a01f69.tar.bz2
arm: mvebu: enable boot from NAND
Check if we are booting from NAND and let the bootrom continue to load the rest of the bootloader Signed-off-by: Sean Nyekjaer <sean.nyekjaer@prevas.dk> Signed-off-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'arch/arm/mach-mvebu')
-rw-r--r--arch/arm/mach-mvebu/include/mach/soc.h1
-rw-r--r--arch/arm/mach-mvebu/spl.c16
2 files changed, 15 insertions, 2 deletions
diff --git a/arch/arm/mach-mvebu/include/mach/soc.h b/arch/arm/mach-mvebu/include/mach/soc.h
index 4f81285..1a06a1e 100644
--- a/arch/arm/mach-mvebu/include/mach/soc.h
+++ b/arch/arm/mach-mvebu/include/mach/soc.h
@@ -147,6 +147,7 @@
#define BOOT_DEV_SEL_OFFS 4
#define BOOT_DEV_SEL_MASK (0x3f << BOOT_DEV_SEL_OFFS)
+#define BOOT_FROM_NAND 0x0A
#define BOOT_FROM_UART 0x28
#define BOOT_FROM_UART_ALT 0x3f
#define BOOT_FROM_SPI 0x32
diff --git a/arch/arm/mach-mvebu/spl.c b/arch/arm/mach-mvebu/spl.c
index 2fd6c62..d16a62d 100644
--- a/arch/arm/mach-mvebu/spl.c
+++ b/arch/arm/mach-mvebu/spl.c
@@ -45,6 +45,10 @@ static u32 get_boot_device(void)
boot_device = (val & BOOT_DEV_SEL_MASK) >> BOOT_DEV_SEL_OFFS;
debug("SAR_REG=0x%08x boot_device=0x%x\n", val, boot_device);
switch (boot_device) {
+#if defined(CONFIG_ARMADA_38X)
+ case BOOT_FROM_NAND:
+ return BOOT_DEVICE_NAND;
+#endif
#ifdef CONFIG_SPL_MMC_SUPPORT
case BOOT_FROM_MMC:
case BOOT_FROM_MMC_ALT:
@@ -128,7 +132,15 @@ void board_init_f(ulong dummy)
* SPL has no chance to receive this information. So we
* need to return to the BootROM to enable this xmodem
* UART download.
+ *
+ * If booting from NAND lets let the BootROM load the
+ * rest of the bootloader.
*/
- if (get_boot_device() == BOOT_DEVICE_UART)
- return_to_bootrom();
+ switch (get_boot_device()) {
+ case BOOT_DEVICE_UART:
+#if defined(CONFIG_ARMADA_38X)
+ case BOOT_DEVICE_NAND:
+#endif
+ return_to_bootrom();
+ }
}