mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/7] filetype: add new filetype for SoCFPGA xload image
@ 2016-08-09 12:37 Steffen Trumtrar
  2016-08-09 12:37 ` [PATCH 2/7] ARM: socfpga: defconfig: add bootstrap_devfs Steffen Trumtrar
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: Steffen Trumtrar @ 2016-08-09 12:37 UTC (permalink / raw)
  To: barebox; +Cc: Steffen Trumtrar

Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
---
 common/filetype.c  | 4 ++++
 include/filetype.h | 1 +
 2 files changed, 5 insertions(+)

diff --git a/common/filetype.c b/common/filetype.c
index a8666a1439df..4728f877c975 100644
--- a/common/filetype.c
+++ b/common/filetype.c
@@ -61,6 +61,7 @@ static const struct filetype_str filetype_str[] = {
 	[filetype_xz_compressed] = { "XZ compressed", "xz" },
 	[filetype_exe] = { "MS-DOS executable", "exe" },
 	[filetype_mxs_bootstream] = { "Freescale MXS bootstream", "mxsbs" },
+	[filetype_socfpga_xload] = { "SoCFPGA prebootloader image", "socfpga-xload" },
 };
 
 const char *file_type_to_string(enum filetype f)
@@ -294,6 +295,9 @@ enum filetype file_detect_type(const void *_buf, size_t bufsize)
 	if (le32_to_cpu(buf[5]) == 0x504d5453)
 		return filetype_mxs_bootstream;
 
+	if (buf[16] == 0x31305341)
+		return filetype_socfpga_xload;
+
 	if (is_barebox_arm_head(_buf))
 		return filetype_arm_barebox;
 	if (buf[9] == 0x016f2818 || buf[9] == 0x18286f01)
diff --git a/include/filetype.h b/include/filetype.h
index e87ca174a89d..cde73c1170c6 100644
--- a/include/filetype.h
+++ b/include/filetype.h
@@ -36,6 +36,7 @@ enum filetype {
 	filetype_exe,
 	filetype_xz_compressed,
 	filetype_mxs_bootstream,
+	filetype_socfpga_xload,
 	filetype_max,
 };
 
-- 
2.8.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 2/7] ARM: socfpga: defconfig: add bootstrap_devfs
  2016-08-09 12:37 [PATCH 1/7] filetype: add new filetype for SoCFPGA xload image Steffen Trumtrar
@ 2016-08-09 12:37 ` Steffen Trumtrar
  2016-08-09 17:48   ` Trent Piepho
  2016-08-09 12:37 ` [PATCH 3/7] ARM: socfpga: xload: support more qspi partitions Steffen Trumtrar
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 10+ messages in thread
From: Steffen Trumtrar @ 2016-08-09 12:37 UTC (permalink / raw)
  To: barebox; +Cc: Steffen Trumtrar

Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
---
 arch/arm/configs/socfpga-xload_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/configs/socfpga-xload_defconfig b/arch/arm/configs/socfpga-xload_defconfig
index 521f3f1c1f43..e7b84dacaeaa 100644
--- a/arch/arm/configs/socfpga-xload_defconfig
+++ b/arch/arm/configs/socfpga-xload_defconfig
@@ -25,4 +25,5 @@ CONFIG_EEPROM_AT25=y
 # CONFIG_FS_DEVFS is not set
 CONFIG_FS_FAT=y
 CONFIG_BOOTSTRAP=y
+CONFIG_BOOTSTRAP_DEVFS=y
 CONFIG_BOOTSTRAP_DISK=y
-- 
2.8.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 3/7] ARM: socfpga: xload: support more qspi partitions
  2016-08-09 12:37 [PATCH 1/7] filetype: add new filetype for SoCFPGA xload image Steffen Trumtrar
  2016-08-09 12:37 ` [PATCH 2/7] ARM: socfpga: defconfig: add bootstrap_devfs Steffen Trumtrar
@ 2016-08-09 12:37 ` Steffen Trumtrar
  2016-08-09 12:37 ` [PATCH 4/7] socfpga: remove dt entries that are upstream Steffen Trumtrar
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Steffen Trumtrar @ 2016-08-09 12:37 UTC (permalink / raw)
  To: barebox; +Cc: Steffen Trumtrar

From: Ulrich Ölmann <u.oelmann@pengutronix.de>

Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
---
 arch/arm/mach-socfpga/xload.c | 56 +++++++++++++++++++++++++++++++------------
 1 file changed, 41 insertions(+), 15 deletions(-)

diff --git a/arch/arm/mach-socfpga/xload.c b/arch/arm/mach-socfpga/xload.c
index 7f8f0320ca0e..993626966e17 100644
--- a/arch/arm/mach-socfpga/xload.c
+++ b/arch/arm/mach-socfpga/xload.c
@@ -20,13 +20,15 @@
 #include <mach/system-manager.h>
 #include <mach/socfpga-regs.h>
 
-
-static struct socfpga_barebox_part default_part = {
-	.nor_offset = SZ_256K,
-	.nor_size = SZ_1M,
-	.mmc_disk = "disk0.1",
+static struct socfpga_barebox_part default_parts[] = {
+	{
+		.nor_offset = SZ_256K,
+		.nor_size = SZ_1M,
+		.mmc_disk = "disk0.1",
+	},
+	{ /* sentinel */ }
 };
-const struct socfpga_barebox_part *barebox_part = &default_part;
+const struct socfpga_barebox_part *barebox_parts = &default_parts;
 
 enum socfpga_clks {
 	timer, mmc, qspi_clk, uart, clk_max
@@ -109,28 +111,52 @@ static void socfpga_timer_init(void)
 static __noreturn int socfpga_xload(void)
 {
 	enum bootsource bootsource = bootsource_get();
-	void *buf;
+	struct socfpga_barebox_part *part;
+	void *buf = NULL;
 
 	switch (bootsource) {
 	case BOOTSOURCE_MMC:
 		socfpga_mmc_init();
-		buf = bootstrap_read_disk(barebox_part->mmc_disk, "fat");
+
+		for (part = barebox_parts; part->mmc_disk; part++) {
+			buf = bootstrap_read_disk(barebox_parts->mmc_disk, "fat");
+			if (!buf) {
+				pr_info("failed to load barebox from MMC %s\n",
+					part->mmc_disk);
+				continue;
+			}
+		}
+		if (!buf) {
+			pr_err("failed to load barebox.bin from MMC\n");
+			hang();
+		}
 		break;
 	case BOOTSOURCE_SPI:
 		socfpga_qspi_init();
-		buf = bootstrap_read_devfs("mtd0", false, barebox_part->nor_offset,
-					barebox_part->nor_size, SZ_1M);
+
+		for (part = barebox_parts; part->nor_size; part++) {
+			buf = bootstrap_read_devfs("mtd0", false,
+					part->nor_offset, part->nor_size, SZ_1M);
+			if (!buf) {
+				pr_info("failed to load barebox from QSPI NOR flash at offset %#x\n",
+					part->nor_offset);
+				continue;
+			}
+
+			break;
+		}
+
+		if (!buf) {
+			pr_err("failed to load barebox from QSPI NOR flash\n");
+			hang();
+		}
+
 		break;
 	default:
 		pr_err("unknown bootsource %d\n", bootsource);
 		hang();
 	}
 
-	if (!buf) {
-		pr_err("failed to load barebox.bin\n");
-		hang();
-	}
-
 	pr_info("starting bootloader...\n");
 
 	bootstrap_boot(buf, 0);
-- 
2.8.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 4/7] socfpga: remove dt entries that are upstream
  2016-08-09 12:37 [PATCH 1/7] filetype: add new filetype for SoCFPGA xload image Steffen Trumtrar
  2016-08-09 12:37 ` [PATCH 2/7] ARM: socfpga: defconfig: add bootstrap_devfs Steffen Trumtrar
  2016-08-09 12:37 ` [PATCH 3/7] ARM: socfpga: xload: support more qspi partitions Steffen Trumtrar
@ 2016-08-09 12:37 ` Steffen Trumtrar
  2016-08-09 12:37 ` [PATCH 5/7] ARM: socfpga: socrates: set alias for ethernet0 Steffen Trumtrar
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Steffen Trumtrar @ 2016-08-09 12:37 UTC (permalink / raw)
  To: barebox; +Cc: Steffen Trumtrar

Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
---
 arch/arm/dts/socfpga_cyclone5_socrates.dts | 34 ------------------------------
 1 file changed, 34 deletions(-)

diff --git a/arch/arm/dts/socfpga_cyclone5_socrates.dts b/arch/arm/dts/socfpga_cyclone5_socrates.dts
index 95cdf5d3d5bd..12b3fa5dae40 100644
--- a/arch/arm/dts/socfpga_cyclone5_socrates.dts
+++ b/arch/arm/dts/socfpga_cyclone5_socrates.dts
@@ -19,43 +19,9 @@
 #include "socfpga.dtsi"
 
 / {
-	model = "EBV SoCrates";
-	compatible = "ebv,socrates", "altr,socfpga";
-
 	chosen {
 		stdout-path = &uart0;
 	};
-
-	leds: gpio-leds {
-	};
-};
-
-&gpio0 {
-	status = "okay";
-};
-
-&gpio1 {
-	status = "okay";
-};
-
-&leds {
-	compatible = "gpio-leds";
-
-	led@0 {
-		label = "0";
-		gpios = <&porta 28 1>;
-		linux,default-trigger = "heartbeat";
-	};
-
-	led@1 {
-		label = "1";
-		gpios = <&portb 19 1>;
-	};
-
-	led@2 {
-		label = "2";
-		gpios = <&portb 25 1>;
-	};
 };
 
 &qspi {
-- 
2.8.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 5/7] ARM: socfpga: socrates: set alias for ethernet0
  2016-08-09 12:37 [PATCH 1/7] filetype: add new filetype for SoCFPGA xload image Steffen Trumtrar
                   ` (2 preceding siblings ...)
  2016-08-09 12:37 ` [PATCH 4/7] socfpga: remove dt entries that are upstream Steffen Trumtrar
@ 2016-08-09 12:37 ` Steffen Trumtrar
  2016-08-09 12:37 ` [PATCH 6/7] ARM: socfpga: socrates: add qspi partitions Steffen Trumtrar
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Steffen Trumtrar @ 2016-08-09 12:37 UTC (permalink / raw)
  To: barebox; +Cc: Steffen Trumtrar

Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
---
 arch/arm/dts/socfpga_cyclone5_socrates.dts | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/dts/socfpga_cyclone5_socrates.dts b/arch/arm/dts/socfpga_cyclone5_socrates.dts
index 12b3fa5dae40..e94df86813dc 100644
--- a/arch/arm/dts/socfpga_cyclone5_socrates.dts
+++ b/arch/arm/dts/socfpga_cyclone5_socrates.dts
@@ -22,6 +22,10 @@
 	chosen {
 		stdout-path = &uart0;
 	};
+
+	aliases {
+		ethernet0 = &gmac1;
+	};
 };
 
 &qspi {
-- 
2.8.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 6/7] ARM: socfpga: socrates: add qspi partitions
  2016-08-09 12:37 [PATCH 1/7] filetype: add new filetype for SoCFPGA xload image Steffen Trumtrar
                   ` (3 preceding siblings ...)
  2016-08-09 12:37 ` [PATCH 5/7] ARM: socfpga: socrates: set alias for ethernet0 Steffen Trumtrar
@ 2016-08-09 12:37 ` Steffen Trumtrar
  2016-08-09 12:37 ` [PATCH 7/7] ARM: socfpga: socrates: register bbu handlers Steffen Trumtrar
  2016-08-18  6:23 ` [PATCH 1/7] filetype: add new filetype for SoCFPGA xload image Sascha Hauer
  6 siblings, 0 replies; 10+ messages in thread
From: Steffen Trumtrar @ 2016-08-09 12:37 UTC (permalink / raw)
  To: barebox; +Cc: Steffen Trumtrar

Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
---
 arch/arm/dts/socfpga_cyclone5_socrates.dts | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/arch/arm/dts/socfpga_cyclone5_socrates.dts b/arch/arm/dts/socfpga_cyclone5_socrates.dts
index e94df86813dc..ea7e6cc102bd 100644
--- a/arch/arm/dts/socfpga_cyclone5_socrates.dts
+++ b/arch/arm/dts/socfpga_cyclone5_socrates.dts
@@ -45,5 +45,35 @@
 		cdns,tsd2d-ns = <50>;
 		cdns,tchsh-ns = <4>;
 		cdns,tslch-ns = <4>;
+
+		partition@0 {
+			label = "prebootloader0";
+			reg = <0x00000 0x10000>;
+		};
+
+		partition@1 {
+			label = "prebootloader1";
+			reg = <0x10000 0x10000>;
+		};
+
+		partition@2 {
+			label = "prebootloader2";
+			reg = <0x20000 0x10000>;
+		};
+
+		partition@3 {
+			label = "prebootloader3";
+			reg = <0x30000 0x10000>;
+		};
+
+		partition@4 {
+			label = "barebox";
+			reg = <0x40000 0x80000>;
+		};
+
+		partition@5 {
+			label = "data";
+			reg = <0xc0000 0x1f40000>;
+		};
 	};
 };
-- 
2.8.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 7/7] ARM: socfpga: socrates: register bbu handlers
  2016-08-09 12:37 [PATCH 1/7] filetype: add new filetype for SoCFPGA xload image Steffen Trumtrar
                   ` (4 preceding siblings ...)
  2016-08-09 12:37 ` [PATCH 6/7] ARM: socfpga: socrates: add qspi partitions Steffen Trumtrar
@ 2016-08-09 12:37 ` Steffen Trumtrar
  2016-08-18  6:23 ` [PATCH 1/7] filetype: add new filetype for SoCFPGA xload image Sascha Hauer
  6 siblings, 0 replies; 10+ messages in thread
From: Steffen Trumtrar @ 2016-08-09 12:37 UTC (permalink / raw)
  To: barebox; +Cc: Steffen Trumtrar

Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
---
 arch/arm/boards/ebv-socrates/board.c | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/arch/arm/boards/ebv-socrates/board.c b/arch/arm/boards/ebv-socrates/board.c
index 5d2d61991431..f3207b88efdf 100644
--- a/arch/arm/boards/ebv-socrates/board.c
+++ b/arch/arm/boards/ebv-socrates/board.c
@@ -2,6 +2,9 @@
 #include <types.h>
 #include <driver.h>
 #include <init.h>
+#include <bbu.h>
+#include <bootsource.h>
+#include <filetype.h>
 #include <asm/armlinux.h>
 #include <linux/micrel_phy.h>
 #include <linux/phy.h>
@@ -26,12 +29,45 @@ static int phy_fixup(struct phy_device *dev)
 
 static int socrates_init(void)
 {
+	enum bootsource bootsource = bootsource_get();
+	uint32_t flag_qspi = 0;
+	uint32_t flag_mmc = 0;
+
 	if (!of_machine_is_compatible("ebv,socrates"))
 		return 0;
 
 	if (IS_ENABLED(CONFIG_PHYLIB))
 		phy_register_fixup_for_uid(PHY_ID_KSZ9021, MICREL_PHY_ID_MASK, phy_fixup);
 
+	switch (bootsource) {
+	case BOOTSOURCE_MMC:
+		flag_mmc |= BBU_HANDLER_FLAG_DEFAULT;
+		break;
+	case BOOTSOURCE_SPI:
+		flag_qspi |= BBU_HANDLER_FLAG_DEFAULT;
+		break;
+	default:
+		break;
+	}
+
+	bbu_register_std_file_update("qspi-xload0", flag_qspi,
+					"/dev/mtd0.prebootloader0",
+					filetype_socfpga_xload);
+	bbu_register_std_file_update("qspi-xload1", 0,
+					"/dev/mtd0.prebootloader1",
+					filetype_socfpga_xload);
+	bbu_register_std_file_update("qspi-xload2", 0,
+					"/dev/mtd0.prebootloader2",
+					filetype_socfpga_xload);
+	bbu_register_std_file_update("qspi-xload3", 0,
+					"/dev/mtd0.prebootloader3",
+					filetype_socfpga_xload);
+	bbu_register_std_file_update("qspi", 0,	"/dev/mtd0.barebox",
+					filetype_arm_barebox);
+
+	bbu_register_std_file_update("mmc-xload", flag_mmc, "/dev/mmc0.0",
+					filetype_socfpga_xload);
+
 	return 0;
 }
 postcore_initcall(socrates_init);
-- 
2.8.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/7] ARM: socfpga: defconfig: add bootstrap_devfs
  2016-08-09 12:37 ` [PATCH 2/7] ARM: socfpga: defconfig: add bootstrap_devfs Steffen Trumtrar
@ 2016-08-09 17:48   ` Trent Piepho
  2016-08-10  6:14     ` Steffen Trumtrar
  0 siblings, 1 reply; 10+ messages in thread
From: Trent Piepho @ 2016-08-09 17:48 UTC (permalink / raw)
  To: Steffen Trumtrar; +Cc: barebox

On Tue, 2016-08-09 at 14:37 +0200, Steffen Trumtrar wrote:
> Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
> ---
>  arch/arm/configs/socfpga-xload_defconfig | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/arm/configs/socfpga-xload_defconfig b/arch/arm/configs/socfpga-xload_defconfig
> index 521f3f1c1f43..e7b84dacaeaa 100644
> --- a/arch/arm/configs/socfpga-xload_defconfig
> +++ b/arch/arm/configs/socfpga-xload_defconfig
> @@ -25,4 +25,5 @@ CONFIG_EEPROM_AT25=y
>  # CONFIG_FS_DEVFS is not set
>  CONFIG_FS_FAT=y
>  CONFIG_BOOTSTRAP=y
> +CONFIG_BOOTSTRAP_DEVFS=y
>  CONFIG_BOOTSTRAP_DISK=y

What's this used for?  I'm not using devfs in my socfpga based device's
xload config.  Does the xload still fit in 64kB with these extra
features?

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/7] ARM: socfpga: defconfig: add bootstrap_devfs
  2016-08-09 17:48   ` Trent Piepho
@ 2016-08-10  6:14     ` Steffen Trumtrar
  0 siblings, 0 replies; 10+ messages in thread
From: Steffen Trumtrar @ 2016-08-10  6:14 UTC (permalink / raw)
  To: Trent Piepho; +Cc: barebox

On Tue, Aug 09, 2016 at 05:48:13PM +0000, Trent Piepho wrote:
> On Tue, 2016-08-09 at 14:37 +0200, Steffen Trumtrar wrote:
> > Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
> > ---
> >  arch/arm/configs/socfpga-xload_defconfig | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/arch/arm/configs/socfpga-xload_defconfig b/arch/arm/configs/socfpga-xload_defconfig
> > index 521f3f1c1f43..e7b84dacaeaa 100644
> > --- a/arch/arm/configs/socfpga-xload_defconfig
> > +++ b/arch/arm/configs/socfpga-xload_defconfig
> > @@ -25,4 +25,5 @@ CONFIG_EEPROM_AT25=y
> >  # CONFIG_FS_DEVFS is not set
> >  CONFIG_FS_FAT=y
> >  CONFIG_BOOTSTRAP=y
> > +CONFIG_BOOTSTRAP_DEVFS=y
> >  CONFIG_BOOTSTRAP_DISK=y
> 
> What's this used for?  I'm not using devfs in my socfpga based device's
> xload config.  Does the xload still fit in 64kB with these extra
> features?
> 

Ah, mixed it up. The defconfig assumes MMC is used, devfs is only needed for
QSPI. So, this patch can be dropped.

But, yeah, it still fits ;-)

Thanks,
Steffen

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/7] filetype: add new filetype for SoCFPGA xload image
  2016-08-09 12:37 [PATCH 1/7] filetype: add new filetype for SoCFPGA xload image Steffen Trumtrar
                   ` (5 preceding siblings ...)
  2016-08-09 12:37 ` [PATCH 7/7] ARM: socfpga: socrates: register bbu handlers Steffen Trumtrar
@ 2016-08-18  6:23 ` Sascha Hauer
  6 siblings, 0 replies; 10+ messages in thread
From: Sascha Hauer @ 2016-08-18  6:23 UTC (permalink / raw)
  To: Steffen Trumtrar; +Cc: barebox

On Tue, Aug 09, 2016 at 02:37:26PM +0200, Steffen Trumtrar wrote:
> Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
> ---
>  common/filetype.c  | 4 ++++
>  include/filetype.h | 1 +
>  2 files changed, 5 insertions(+)

Applied 1 and 3-7.

Sascha

> 
> diff --git a/common/filetype.c b/common/filetype.c
> index a8666a1439df..4728f877c975 100644
> --- a/common/filetype.c
> +++ b/common/filetype.c
> @@ -61,6 +61,7 @@ static const struct filetype_str filetype_str[] = {
>  	[filetype_xz_compressed] = { "XZ compressed", "xz" },
>  	[filetype_exe] = { "MS-DOS executable", "exe" },
>  	[filetype_mxs_bootstream] = { "Freescale MXS bootstream", "mxsbs" },
> +	[filetype_socfpga_xload] = { "SoCFPGA prebootloader image", "socfpga-xload" },
>  };
>  
>  const char *file_type_to_string(enum filetype f)
> @@ -294,6 +295,9 @@ enum filetype file_detect_type(const void *_buf, size_t bufsize)
>  	if (le32_to_cpu(buf[5]) == 0x504d5453)
>  		return filetype_mxs_bootstream;
>  
> +	if (buf[16] == 0x31305341)
> +		return filetype_socfpga_xload;
> +
>  	if (is_barebox_arm_head(_buf))
>  		return filetype_arm_barebox;
>  	if (buf[9] == 0x016f2818 || buf[9] == 0x18286f01)
> diff --git a/include/filetype.h b/include/filetype.h
> index e87ca174a89d..cde73c1170c6 100644
> --- a/include/filetype.h
> +++ b/include/filetype.h
> @@ -36,6 +36,7 @@ enum filetype {
>  	filetype_exe,
>  	filetype_xz_compressed,
>  	filetype_mxs_bootstream,
> +	filetype_socfpga_xload,
>  	filetype_max,
>  };
>  
> -- 
> 2.8.1
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-08-18  6:23 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-09 12:37 [PATCH 1/7] filetype: add new filetype for SoCFPGA xload image Steffen Trumtrar
2016-08-09 12:37 ` [PATCH 2/7] ARM: socfpga: defconfig: add bootstrap_devfs Steffen Trumtrar
2016-08-09 17:48   ` Trent Piepho
2016-08-10  6:14     ` Steffen Trumtrar
2016-08-09 12:37 ` [PATCH 3/7] ARM: socfpga: xload: support more qspi partitions Steffen Trumtrar
2016-08-09 12:37 ` [PATCH 4/7] socfpga: remove dt entries that are upstream Steffen Trumtrar
2016-08-09 12:37 ` [PATCH 5/7] ARM: socfpga: socrates: set alias for ethernet0 Steffen Trumtrar
2016-08-09 12:37 ` [PATCH 6/7] ARM: socfpga: socrates: add qspi partitions Steffen Trumtrar
2016-08-09 12:37 ` [PATCH 7/7] ARM: socfpga: socrates: register bbu handlers Steffen Trumtrar
2016-08-18  6:23 ` [PATCH 1/7] filetype: add new filetype for SoCFPGA xload image Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox