summaryrefslogtreecommitdiff
path: root/arch/arm/mach-socfpga/spl.c
diff options
context:
space:
mode:
authorMarek Vasut <marex@denx.de>2015-07-10 00:04:23 +0200
committerMarek Vasut <marex@denx.de>2015-08-08 14:14:08 +0200
commitd3f34e752dd432eb75e50b2f2ab44d0849b3deef (patch)
tree43065ca8f49fa5da23fcb4f873f73cea780a69d3 /arch/arm/mach-socfpga/spl.c
parent1d8c93939194fb075c429fa1cdc0f1e2a916d192 (diff)
arm: socfpga: spl: Add support for booting from SD/MMC
Add code and configuration options to support booting from RAW SD/MMC card as well as for ext4/vfat filesystems. Enable support for booting from SD/MMC card, but don't enable the filesystem support just yet to retain compatibility with old SoCFPGA card format. Signed-off-by: Marek Vasut <marex@denx.de>
Diffstat (limited to 'arch/arm/mach-socfpga/spl.c')
-rw-r--r--arch/arm/mach-socfpga/spl.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/arm/mach-socfpga/spl.c b/arch/arm/mach-socfpga/spl.c
index ea0ed1a24d..bacc845cd4 100644
--- a/arch/arm/mach-socfpga/spl.c
+++ b/arch/arm/mach-socfpga/spl.c
@@ -31,8 +31,25 @@ static struct nic301_registers *nic301_regs =
u32 spl_boot_device(void)
{
+#ifdef CONFIG_SPL_MMC_SUPPORT
+ socfpga_per_reset(SOCFPGA_RESET(SDMMC), 0);
+ socfpga_per_reset(SOCFPGA_RESET(DMA), 0);
+ return BOOT_DEVICE_MMC1;
+#else
return BOOT_DEVICE_RAM;
+#endif
+}
+
+#ifdef CONFIG_SPL_MMC_SUPPORT
+u32 spl_boot_mode(void)
+{
+#if defined(CONFIG_SPL_FAT_SUPPORT) || defined(CONFIG_SPL_EXT_SUPPORT)
+ return MMCSD_MODE_FS;
+#else
+ return MMCSD_MODE_RAW;
+#endif
}
+#endif
static void socfpga_nic301_slave_ns(void)
{