summaryrefslogtreecommitdiffstats
path: root/arch/arm/cpu/armv7
diff options
context:
space:
mode:
authorDaniel KochmaƄski <dkochmanski@turtle-solutions.eu>2015-05-26 17:00:42 +0200
committerHans de Goede <hdegoede@redhat.com>2015-05-29 13:46:36 +0200
commitf76eba38b3eda905ff3bdc18dd1240d3dcbc6e5a (patch)
tree56a788b048b1f8121f45ac335fb98ce157c9eb9a /arch/arm/cpu/armv7
parentd0f4200392515194bf67213165be906e5b9e5748 (diff)
downloadu-boot-f76eba38b3eda905ff3bdc18dd1240d3dcbc6e5a.tar.gz
u-boot-f76eba38b3eda905ff3bdc18dd1240d3dcbc6e5a.tar.xz
u-boot-f76eba38b3eda905ff3bdc18dd1240d3dcbc6e5a.zip
sunxi/nand: Add support to the SPL for loading u-boot from internal NAND memory
This commit adds support to the sunxi SPL to load u-boot from the internal NAND. Note this only adds support to access the boot partitions to load u-boot, full NAND support to load the kernel, etc. from the nand data partition will come later. Signed-off-by: Roy Spliet <r.spliet@ultimaker.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'arch/arm/cpu/armv7')
-rw-r--r--arch/arm/cpu/armv7/sunxi/board.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/arch/arm/cpu/armv7/sunxi/board.c b/arch/arm/cpu/armv7/sunxi/board.c
index 23aa2497a0..a82c8b9d44 100644
--- a/arch/arm/cpu/armv7/sunxi/board.c
+++ b/arch/arm/cpu/armv7/sunxi/board.c
@@ -119,11 +119,20 @@ void s_init(void)
#ifdef CONFIG_SPL_BUILD
/* The sunxi internal brom will try to loader external bootloader
* from mmc0, nand flash, mmc2.
- * Unfortunately we can't check how SPL was loaded so assume
- * it's always the first SD/MMC controller
+ *
+ * Unfortunately we can't check how SPL was loaded so assume it's
+ * always the first SD/MMC controller, unless it was explicitly
+ * stated that SPL is on nand flash.
*/
u32 spl_boot_device(void)
{
+#if defined(CONFIG_SPL_NAND_SUPPORT)
+ /*
+ * This is compile time configuration informing SPL, that it
+ * was loaded from nand flash.
+ */
+ return BOOT_DEVICE_NAND;
+#else
/*
* When booting from the SD card, the "eGON.BT0" signature is expected
* to be found in memory at the address 0x0004 (see the "mksunxiboot"
@@ -144,6 +153,7 @@ u32 spl_boot_device(void)
return BOOT_DEVICE_MMC1;
else
return BOOT_DEVICE_BOARD;
+#endif
}
/* No confirmation data available in SPL yet. Hardcode bootmode */