summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2016-01-11 13:11:08 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2016-01-11 13:11:08 +0100
commit96b115be942ed8dcc94a5230fce0eafb4ac93f2d (patch)
tree791df75fe3b7932ca4690abc2f8eb5d94f25af62
parent1b59b573e434b19b45b12b07a28d749d72aeb145 (diff)
parentc44e12f0bde314f33f45bab31b1f7c69157d89b4 (diff)
downloadbarebox-96b115be942ed8dcc94a5230fce0eafb4ac93f2d.tar.gz
Merge branch 'for-next/socfpga'
-rw-r--r--arch/arm/mach-socfpga/include/mach/generic.h4
-rw-r--r--arch/arm/mach-socfpga/xload.c8
2 files changed, 7 insertions, 5 deletions
diff --git a/arch/arm/mach-socfpga/include/mach/generic.h b/arch/arm/mach-socfpga/include/mach/generic.h
index 1f4247f..2a7e0ea 100644
--- a/arch/arm/mach-socfpga/include/mach/generic.h
+++ b/arch/arm/mach-socfpga/include/mach/generic.h
@@ -18,6 +18,10 @@ static inline void __udelay(unsigned us)
struct socfpga_barebox_part {
unsigned int nor_offset;
unsigned int nor_size;
+ const char *mmc_disk;
};
+/* Partition/device for xloader to load main bootloader from */
+extern const struct socfpga_barebox_part *barebox_part;
+
#endif /* __MACH_SOCFPGA_GENERIC_H */
diff --git a/arch/arm/mach-socfpga/xload.c b/arch/arm/mach-socfpga/xload.c
index cf05ff3..fd0d777 100644
--- a/arch/arm/mach-socfpga/xload.c
+++ b/arch/arm/mach-socfpga/xload.c
@@ -20,12 +20,13 @@
#include <mach/system-manager.h>
#include <mach/socfpga-regs.h>
-struct socfpga_barebox_part *barebox_part;
static struct socfpga_barebox_part default_part = {
.nor_offset = SZ_256K,
.nor_size = SZ_1M,
+ .mmc_disk = "disk0.1",
};
+const struct socfpga_barebox_part *barebox_part = &default_part;
enum socfpga_clks {
timer, mmc, qspi_clk, uart, clk_max
@@ -110,13 +111,10 @@ static __noreturn int socfpga_xload(void)
enum bootsource bootsource = bootsource_get();
void *buf;
- if (!barebox_part)
- barebox_part = &default_part;
-
switch (bootsource) {
case BOOTSOURCE_MMC:
socfpga_mmc_init();
- buf = bootstrap_read_disk("disk0.1", "fat");
+ buf = bootstrap_read_disk(barebox_part->mmc_disk, "fat");
break;
case BOOTSOURCE_SPI:
socfpga_qspi_init();