Skip to contentSkip to conversation

arm: socfpga: Enable load zImage and Linux DTB from QSPI

PATCH New Chin Liang See 4 participants 14 messages Nov 26, 2015 – Nov 27, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm: socfpga: Enable load zImage and Linux DTB from QSPI

Adding new environment qspiload which will load zImage and Linux DTB from serial NOR flash. The default flash offset for the images as below and they are configurable during run time.

- zImage located at 0xa0000 with assuming file size 6MB
- Linux DTB located at 0x50000 with assuming file size 28kB

Please adjust the file size env var if exceeding the default

Cc Dinh Nguyen <[email protected]>
Cc Dinh Nguyen <[email protected]>
Cc Pavel Machek <[email protected]>
Cc Marek Vasut <[email protected]>
Cc Stefan Roese <[email protected]>
---
 include/configs/socfpga_arria5_socdk.h   | 10 +++++++++-
 include/configs/socfpga_cyclone5_socdk.h | 10 +++++++++-
 2 files changed, 18 insertions(+), 2 deletions(-)
include/configs/socfpga_arria5_socdk.h +9 -1
index 91ecbf7..0506336 100644
@@ -77,9 +77,11 @@
 	"ramboot=setenv bootargs " CONFIG_BOOTARGS ";" \
 		"bootm ${loadaddr} - ${fdt_addr}\0" \
 	"bootimage=zImage\0" \
+	"bootimagesize=0x600000\0" \
 	"fdt_addr=100\0" \
 	"fdtimage=socfpga.dtb\0" \
-		"fsloadcmd=ext2load\0" \
+	"fdtimagesize=0x7000\0" \
+	"fsloadcmd=ext2load\0" \
 	"bootm ${loadaddr} - ${fdt_addr}\0" \
 	"mmcroot=/dev/mmcblk0p2\0" \
 	"mmcboot=setenv bootargs " CONFIG_BOOTARGS \
@@ -90,6 +92,12 @@
 		"load mmc 0:1 ${fdt_addr} ${fdtimage}\0" \
 	"qspiroot=/dev/mtdblock0\0" \
 	"qspirootfstype=jffs2\0" \
+	"qspiloadcs=0\0" \
+	"qspibootimageaddr=0xa0000\0" \
+	"qspifdtaddr=0x50000\0" \
+	"qspiload=sf probe ${qspiloadcs};" \
+		"sf read ${loadaddr} ${qspibootimageaddr} ${bootimagesize};" \
+		"sf read ${fdt_addr} ${qspifdtaddr} ${fdtimagesize};\0" \
 	"qspiboot=setenv bootargs " CONFIG_BOOTARGS \
 		" root=${qspiroot} rw rootfstype=${qspirootfstype};"\
 		"bootm ${loadaddr} - ${fdt_addr}\0"
include/configs/socfpga_cyclone5_socdk.h +9 -1
index b5cf393..d7369ee 100644
@@ -77,9 +77,11 @@
 	"ramboot=setenv bootargs " CONFIG_BOOTARGS ";" \
 		"bootm ${loadaddr} - ${fdt_addr}\0" \
 	"bootimage=zImage\0" \
+	"bootimagesize=0x600000\0" \
 	"fdt_addr=100\0" \
 	"fdtimage=socfpga.dtb\0" \
-		"fsloadcmd=ext2load\0" \
+	"fdtimagesize=0x7000\0" \
+	"fsloadcmd=ext2load\0" \
 	"bootm ${loadaddr} - ${fdt_addr}\0" \
 	"mmcroot=/dev/mmcblk0p2\0" \
 	"mmcboot=setenv bootargs " CONFIG_BOOTARGS \
@@ -90,6 +92,12 @@
 		"load mmc 0:1 ${fdt_addr} ${fdtimage}\0" \
 	"qspiroot=/dev/mtdblock0\0" \
 	"qspirootfstype=jffs2\0" \
+	"qspiloadcs=0\0" \
+	"qspibootimageaddr=0xa0000\0" \
+	"qspifdtaddr=0x50000\0" \
+	"qspiload=sf probe ${qspiloadcs};" \
+		"sf read ${loadaddr} ${qspibootimageaddr} ${bootimagesize};" \
+		"sf read ${fdt_addr} ${qspifdtaddr} ${fdtimagesize};\0" \
 	"qspiboot=setenv bootargs " CONFIG_BOOTARGS \
 		" root=${qspiroot} rw rootfstype=${qspirootfstype};"\
 		"bootm ${loadaddr} - ${fdt_addr}\0"
Signature · 29 lines
2.2.0


From clsee at ubuntu  Thu Nov 26 01:37:35 2015
From: clsee at ubuntu (clsee)
Date: Thu, 26 Nov 2015 08:37:35 +0800
Subject: [U-Boot] [PATCH] mmc: socfpga_dw_mmc: Move drvsel and smplsel to dts
Message-ID: <1448498255-2505-1-git-send-email-user@ubuntu>

From: Chin Liang See <[email protected]>

socfpga_dw_mmc driver will obtain the drvsel and
smplsel value from device tree instead of definition
in config header file.

Signed-off-by: Chin Liang See <[email protected]>
Cc: Dinh Nguyen <[email protected]>
Cc: Dinh Nguyen <[email protected]>
Cc: Pavel Machek <[email protected]>
Cc: Marek Vasut <[email protected]>
Cc: Stefan Roese <[email protected]>
Cc: Pantelis Antoniou <[email protected]>
Cc: Simon Glass <[email protected]>
Cc: Jaehoon Chung <[email protected]>
---
 arch/arm/dts/socfpga_cyclone5.dtsi |  2 ++
 drivers/mmc/socfpga_dw_mmc.c       | 24 ++++++++++++++++++++++--
 include/configs/socfpga_common.h   |  2 --
 3 files changed, 24 insertions(+), 4 deletions(-)
arch/arm/dts/socfpga_cyclone5.dtsi +2 -0
index de36209..040b236 100644
@@ -25,6 +25,8 @@
 			bus-width = <4>;
 			cap-mmc-highspeed;
 			cap-sd-highspeed;
+			drvsel = <3>;
+			smplsel = <0>;
 		};
 
 		sysmgr at ffd08000 {
drivers/mmc/socfpga_dw_mmc.c +22 -2
index 8076761..2cd7a51 100644
@@ -19,18 +19,25 @@ static const struct socfpga_clock_manager *clock_manager_base =
 static const struct socfpga_system_manager *system_manager_base =
 		(void *)SOCFPGA_SYSMGR_ADDRESS;
 
+/* socfpga implmentation specific drver private data */
+struct dwmci_socfpga_priv_data {
+	unsigned int drvsel;
+	unsigned int smplsel;
+};
+
 static void socfpga_dwmci_clksel(struct dwmci_host *host)
 {
 	unsigned int drvsel;
 	unsigned int smplsel;
+	struct dwmci_socfpga_priv_data *priv = host->priv;
 
 	/* Disable SDMMC clock. */
 	clrbits_le32(&clock_manager_base->per_pll.en,
 		CLKMGR_PERPLLGRP_EN_SDMMCCLK_MASK);
 
 	/* Configures drv_sel and smpl_sel */
-	drvsel = CONFIG_SOCFPGA_DWMMC_DRVSEL;
-	smplsel = CONFIG_SOCFPGA_DWMMC_SMPSEL;
+	drvsel = priv->drvsel;
+	smplsel = priv->smplsel;
 
 	debug("%s: drvsel %d smplsel %d\n", __func__, drvsel, smplsel);
 	writel(SYSMGR_SDMMC_CTRL_SET(smplsel, drvsel),
@@ -50,8 +57,10 @@ static int socfpga_dwmci_of_probe(const void *blob, int node, const int idx)
 	const unsigned long clk = cm_get_mmc_controller_clk_hz();
 
 	struct dwmci_host *host;
+	struct dwmci_socfpga_priv_data *priv;
 	fdt_addr_t reg_base;
 	int bus_width, fifo_depth;
+	unsigned int drvsel, smplsel;
 
 	if (clk == 0) {
 		printf("DWMMC%d: MMC clock is zero!", idx);
@@ -78,11 +87,19 @@ static int socfpga_dwmci_of_probe(const void *blob, int node, const int idx)
 		return -EINVAL;
 	}
 
+	drvsel = fdtdec_get_uint(blob, node, "drvsel", 0);
+	smplsel = fdtdec_get_uint(blob, node, "smplsel", 0);
+
 	/* Allocate the host */
 	host = calloc(1, sizeof(*host));
 	if (!host)
 		return -ENOMEM;
 
+	/* Allocate the priv */
+	priv = calloc(1, sizeof(*priv));
+	if (!priv)
+		return -ENOMEM;
+
 	host->name = "SOCFPGA DWMMC";
 	host->ioaddr = (void *)reg_base;
 	host->buswidth = bus_width;
@@ -92,6 +109,9 @@ static int socfpga_dwmci_of_probe(const void *blob, int node, const int idx)
 	host->bus_hz = clk;
 	host->fifoth_val = MSIZE(0x2) |
 		RX_WMARK(fifo_depth / 2 - 1) | TX_WMARK(fifo_depth / 2);
+	priv->drvsel = drvsel;
+	priv->smplsel = smplsel;
+	host->priv = priv;
 
 	return add_dwmci(host, host->bus_hz, 400000);
 }
include/configs/socfpga_common.h +0 -2
index f6808b5..b661cc2 100644
@@ -153,8 +153,6 @@
 #define CONFIG_DWMMC
 #define CONFIG_SOCFPGA_DWMMC
 #define CONFIG_SOCFPGA_DWMMC_FIFO_DEPTH	1024
-#define CONFIG_SOCFPGA_DWMMC_DRVSEL	3
-#define CONFIG_SOCFPGA_DWMMC_SMPSEL	0
 /* FIXME */
 /* using smaller max blk cnt to avoid flooding the limited stack we have */
 #define CONFIG_SYS_MMC_MAX_BLK_COUNT	256	/* FIXME -- SPL only? */
Signature · 1 line
2.2.0
#1 lore raw

PATCH 1/1 arm: socfpga: Enable load zImage and Linux DTB from QSPI

Quoted 70 lines · Chin Liang See

Adding new environment qspiload which will load zImage and Linux DTB from serial NOR flash. The default flash offset for the images as below and they are configurable during run time.

- zImage located at 0xa0000 with assuming file size 6MB
- Linux DTB located at 0x50000 with assuming file size 28kB

Please adjust the file size env var if exceeding the default

Cc Dinh Nguyen <[email protected]>
Cc Dinh Nguyen <[email protected]>
Cc Pavel Machek <[email protected]>
Cc Marek Vasut <[email protected]>
Cc Stefan Roese <[email protected]>
---
  include/configs/socfpga_arria5_socdk.h   | 10 +++++++++-
  include/configs/socfpga_cyclone5_socdk.h | 10 +++++++++-
  2 files changed, 18 insertions(+), 2 deletions(-)
include/configs/socfpga_arria5_socdk.h +9 -1
index 91ecbf7..0506336 100644
@@ -77,9 +77,11 @@
  	"ramboot=setenv bootargs " CONFIG_BOOTARGS ";" \
  		"bootm ${loadaddr} - ${fdt_addr}\0" \
  	"bootimage=zImage\0" \
+	"bootimagesize=0x600000\0" \
  	"fdt_addr=100\0" \
  	"fdtimage=socfpga.dtb\0" \
-		"fsloadcmd=ext2load\0" \
+	"fdtimagesize=0x7000\0" \
+	"fsloadcmd=ext2load\0" \
  	"bootm ${loadaddr} - ${fdt_addr}\0" \
  	"mmcroot=/dev/mmcblk0p2\0" \
  	"mmcboot=setenv bootargs " CONFIG_BOOTARGS \
@@ -90,6 +92,12 @@
  		"load mmc 0:1 ${fdt_addr} ${fdtimage}\0" \
  	"qspiroot=/dev/mtdblock0\0" \
  	"qspirootfstype=jffs2\0" \
+	"qspiloadcs=0\0" \
+	"qspibootimageaddr=0xa0000\0" \
+	"qspifdtaddr=0x50000\0" \
+	"qspiload=sf probe ${qspiloadcs};" \
+		"sf read ${loadaddr} ${qspibootimageaddr} ${bootimagesize};" \
+		"sf read ${fdt_addr} ${qspifdtaddr} ${fdtimagesize};\0" \
  	"qspiboot=setenv bootargs " CONFIG_BOOTARGS \
  		" root=${qspiroot} rw rootfstype=${qspirootfstype};"\
  		"bootm ${loadaddr} - ${fdt_addr}\0"
include/configs/socfpga_cyclone5_socdk.h +3 -1
index b5cf393..d7369ee 100644
@@ -77,9 +77,11 @@
  	"ramboot=setenv bootargs " CONFIG_BOOTARGS ";" \
  		"bootm ${loadaddr} - ${fdt_addr}\0" \
  	"bootimage=zImage\0" \
+	"bootimagesize=0x600000\0" \
  	"fdt_addr=100\0" \
  	"fdtimage=socfpga.dtb\0" \
-		"fsloadcmd=ext2load\0" \
+	"fdtimagesize=0x7000\0" \
+	"fsloadcmd=ext2load\0" \
  	"bootm ${loadaddr} - ${fdt_addr}\0" \
  	"mmcroot=/dev/mmcblk0p2\0" \
  	"mmcboot=setenv bootargs " CONFIG_BOOTARGS \
@@ -90,6 +92,12 @@
  		"load mmc 0:1 ${fdt_addr} ${fdtimage}\0" \
  	"qspiroot=/dev/mtdblock0\0" \

include/configs/socfpga_cyclone5_socdk.h line 103

Quoted 10 lines
include/configs/socfpga_cyclone5_socdk.h +6 -0
  	"qspirootfstype=jffs2\0" \
+	"qspiloadcs=0\0" \
+	"qspibootimageaddr=0xa0000\0" \
+	"qspifdtaddr=0x50000\0" \
+	"qspiload=sf probe ${qspiloadcs};" \
+		"sf read ${loadaddr} ${qspibootimageaddr} ${bootimagesize};" \
+		"sf read ${fdt_addr} ${qspifdtaddr} ${fdtimagesize};\0" \
  	"qspiboot=setenv bootargs " CONFIG_BOOTARGS \
  		" root=${qspiroot} rw rootfstype=${qspirootfstype};"\
  		"bootm ${loadaddr} - ${fdt_addr}\0"

I know that you didn't introduce this here, but wouldn't it make sense to switch to the generic FS commands, "load" and "ls" instead of using the specific ones "ext2load" etc? Especially since EXT2 is a bit deprecated.

Thanks,
Stefan

#2 lore raw

PATCH 1/1 arm: socfpga: Enable load zImage and Linux DTB from QSPI

Hi Stefan,

Quoted 86 lines · Stefan Roese
Quoted 85 lines · Chin Liang See

Adding new environment qspiload which will load zImage and Linux DTB from serial NOR flash. The default flash offset for the images as below and they are configurable during run time.

- zImage located at 0xa0000 with assuming file size 6MB
- Linux DTB located at 0x50000 with assuming file size 28kB

Please adjust the file size env var if exceeding the default

Cc Dinh Nguyen <[email protected]>
Cc Dinh Nguyen <[email protected]>
Cc Pavel Machek <[email protected]>
Cc Marek Vasut <[email protected]>
Cc Stefan Roese <[email protected]>
---
  include/configs/socfpga_arria5_socdk.h   | 10 +++++++++-
  include/configs/socfpga_cyclone5_socdk.h | 10 +++++++++-
  2 files changed, 18 insertions(+), 2 deletions(-)
include/configs/socfpga_arria5_socdk.h +9 -1
index 91ecbf7..0506336 100644
@@ -77,9 +77,11 @@
  	"ramboot=setenv bootargs " CONFIG_BOOTARGS ";" \
  		"bootm ${loadaddr} - ${fdt_addr}\0" \
  	"bootimage=zImage\0" \
+	"bootimagesize=0x600000\0" \
  	"fdt_addr=100\0" \
  	"fdtimage=socfpga.dtb\0" \
-		"fsloadcmd=ext2load\0" \
+	"fdtimagesize=0x7000\0" \
+	"fsloadcmd=ext2load\0" \
  	"bootm ${loadaddr} - ${fdt_addr}\0" \
  	"mmcroot=/dev/mmcblk0p2\0" \
  	"mmcboot=setenv bootargs " CONFIG_BOOTARGS \
@@ -90,6 +92,12 @@
  		"load mmc 0:1 ${fdt_addr} ${fdtimage}\0" \
  	"qspiroot=/dev/mtdblock0\0" \
  	"qspirootfstype=jffs2\0" \
+	"qspiloadcs=0\0" \
+	"qspibootimageaddr=0xa0000\0" \
+	"qspifdtaddr=0x50000\0" \
+	"qspiload=sf probe ${qspiloadcs};" \
+		"sf read ${loadaddr} ${qspibootimageaddr}
 ${bootimagesize};" \
+		"sf read ${fdt_addr} ${qspifdtaddr}
 ${fdtimagesize};\0" \
  	"qspiboot=setenv bootargs " CONFIG_BOOTARGS \

" root=${qspiroot} rw
rootfstype=${qspirootfstype};"\
"bootm ${loadaddr} - ${fdt_addr}\0"

include/configs/socfpga_cyclone5_socdk.h +9 -1
index b5cf393..d7369ee 100644
@@ -77,9 +77,11 @@
  	"ramboot=setenv bootargs " CONFIG_BOOTARGS ";" \
  		"bootm ${loadaddr} - ${fdt_addr}\0" \
  	"bootimage=zImage\0" \
+	"bootimagesize=0x600000\0" \
  	"fdt_addr=100\0" \
  	"fdtimage=socfpga.dtb\0" \
-		"fsloadcmd=ext2load\0" \
+	"fdtimagesize=0x7000\0" \
+	"fsloadcmd=ext2load\0" \
  	"bootm ${loadaddr} - ${fdt_addr}\0" \
  	"mmcroot=/dev/mmcblk0p2\0" \
  	"mmcboot=setenv bootargs " CONFIG_BOOTARGS \
@@ -90,6 +92,12 @@
  		"load mmc 0:1 ${fdt_addr} ${fdtimage}\0" \
  	"qspiroot=/dev/mtdblock0\0" \
  	"qspirootfstype=jffs2\0" \
+	"qspiloadcs=0\0" \
+	"qspibootimageaddr=0xa0000\0" \
+	"qspifdtaddr=0x50000\0" \
+	"qspiload=sf probe ${qspiloadcs};" \
+		"sf read ${loadaddr} ${qspibootimageaddr}
 ${bootimagesize};" \
+		"sf read ${fdt_addr} ${qspifdtaddr}
 ${fdtimagesize};\0" \
  	"qspiboot=setenv bootargs " CONFIG_BOOTARGS \
Quoted 9 lines
Quoted 3 lines

" root=${qspiroot} rw
rootfstype=${qspirootfstype};"\
"bootm ${loadaddr} - ${fdt_addr}\0"

I know that you didn't introduce this here, but wouldn't it make sense to switch to the generic FS commands, "load" and "ls" instead of using the specific ones "ext2load" etc? Especially since EXT2 is a bit deprecated.

Yah, we should be using newer ext command. Let me drop another patch to use load command. Thanks for raising this.

Thanks
Chin Liang

Quoted 3 lines

Thanks,
Stefan

#3 lore raw

PATCH 1/1 arm: socfpga: Enable load zImage and Linux DTB from QSPI

In reply to Chin Liang See

Hi!

Quoted 6 lines

Adding new environment qspiload which will load zImage and Linux DTB from serial NOR flash. The default flash offset for the images as below and they are configurable during run time.

- zImage located at 0xa0000 with assuming file size 6MB
- Linux DTB located at 0x50000 with assuming file size 28kB

Hmm. Ok, zImage second, so that it can grow. Makes sense. Not sure if 28kB is not a bit small for DTB. I'd reserve at least 64kB.

Quoted 5 lines

Please adjust the file size env var if exceeding the default

Cc Dinh Nguyen <[email protected]>
Cc Dinh Nguyen <[email protected]>

Notice that you sent two patches marked "v1".

Thanks,
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#4 lore raw

PATCH 1/1 arm: socfpga: Enable load zImage and Linux DTB from QSPI

Hi Pavel,

Quoted 11 lines · Pavel Machek

Hi!

Quoted 6 lines

Adding new environment qspiload which will load zImage and Linux DTB from serial NOR flash. The default flash offset for the images as below and they are configurable during run time.

- zImage located at 0xa0000 with assuming file size 6MB
- Linux DTB located at 0x50000 with assuming file size 28kB

Hmm. Ok, zImage second, so that it can grow. Makes sense. Not sure if 28kB is not a bit small for DTB. I'd reserve at least 64kB.

Yup, it can grow up to 64kB as the size for a sector. We used 28KB mainly for boot time performance.

Quoted 10 lines
Quoted 6 lines

Please adjust the file size env var if exceeding the default

Cc Dinh Nguyen <[email protected]>
Cc Dinh Nguyen <[email protected]>

Notice that you sent two patches marked "v1".

Haha too obsess with the -v argument within git format-patch :P

Thanks
Chin Liang

Quoted 3 lines

Thanks,
Pavel

#5 lore raw

PATCH 1/1 arm: socfpga: Enable load zImage and Linux DTB from QSPI

Quoted 9 lines · Chin Liang See

Hi Pavel,

Quoted 6 lines · Pavel Machek

Hi!

Quoted 4 lines

Adding new environment qspiload which will load zImage and Linux DTB from serial NOR flash. The default flash offset for the images as below and they are configurable during run time.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

- zImage located at 0xa0000 with assuming file size 6MB
- Linux DTB located at 0x50000 with assuming file size 28kB

Hmm. Ok, zImage second, so that it can grow. Makes sense. Not sure if 28kB is not a bit small for DTB. I'd reserve at least 64kB.

Yup, it can grow up to 64kB as the size for a sector. We used 28KB mainly for boot time performance.

So why don't you use UBI on the QSPI NOR ? That way, you'd secure the binaries against bitrot as well.

Best regards,
Marek Vasut

#6 lore raw

PATCH 1/1 arm: socfpga: Enable load zImage and Linux DTB from QSPI

Hi Marek,

Quoted 17 lines · Marek Vasut
Quoted 16 lines · Chin Liang See

Hi Pavel,

Quoted 12 lines · Pavel Machek

Hi!

Quoted 6 lines

Adding new environment qspiload which will load zImage and Linux DTB from serial NOR flash. The default flash offset for the images as below and they are configurable during run time.

- zImage located at 0xa0000 with assuming file size 6MB
- Linux DTB located at 0x50000 with assuming file size 28kB

Hmm. Ok, zImage second, so that it can grow. Makes sense. Not sure if
28kB is not a bit small for DTB. I'd reserve at least 64kB.

Quoted 6 lines
Quoted 2 lines

Yup, it can grow up to 64kB as the size for a sector. We used 28KB mainly for boot time performance.

So why don't you use UBI on the QSPI NOR ? That way, you'd secure the binaries against bitrot as well.

Good point. Its a nice enhancement as we were using raw access for the images in NAND and QSPI. Will add a new command for fs support once we enable the ubifs support in socfpga

Thanks
Chin Liang

Quoted 2 lines

Best regards,
Marek Vasut

#7 lore raw

PATCH 1/1 arm: socfpga: Enable load zImage and Linux DTB from QSPI

Quoted 23 lines · Chin Liang See

Hi Marek,

Quoted 20 lines · Marek Vasut
Quoted 18 lines · Chin Liang See

Hi Pavel,

Quoted 6 lines · Pavel Machek

Hi!

Quoted 4 lines

Adding new environment qspiload which will load zImage and Linux DTB from serial NOR flash. The default flash offset for the images as below and they are configurable during run time.

Quoted 6 lines
Quoted 2 lines

- zImage located at 0xa0000 with assuming file size 6MB
- Linux DTB located at 0x50000 with assuming file size 28kB

Hmm. Ok, zImage second, so that it can grow. Makes sense. Not sure if
28kB is not a bit small for DTB. I'd reserve at least 64kB.

Yup, it can grow up to 64kB as the size for a sector. We used 28KB mainly for boot time performance.

Quoted 6 lines
Quoted 2 lines

So why don't you use UBI on the QSPI NOR ? That way, you'd secure the binaries against bitrot as well.

Good point. Its a nice enhancement as we were using raw access for the images in NAND and QSPI. Will add a new command for fs support once we enable the ubifs support in socfpga

Why can't this be enabled now then ?

Best regards,
Marek Vasut

#8 lore raw

PATCH 1/1 arm: socfpga: Enable load zImage and Linux DTB from QSPI

Quoted 32 lines · Marek Vasut
Quoted 31 lines · Chin Liang See

Hi Marek,

Quoted 27 lines · Marek Vasut
Quoted 14 lines · Chin Liang See

Hi Pavel,

Quoted 11 lines · Pavel Machek

Hi!

Quoted 8 lines

Adding new environment qspiload which will load zImage and Linux DTB from serial NOR flash. The default flash offset for
the images as below and they are configurable during run time.

- zImage located at 0xa0000 with assuming file size 6MB
- Linux DTB located at 0x50000 with assuming file size 28kB

Quoted 7 lines
Quoted 3 lines

Hmm. Ok, zImage second, so that it can grow. Makes sense. Not sure if
28kB is not a bit small for DTB. I'd reserve at least 64kB.

Yup, it can grow up to 64kB as the size for a sector. We used 28KB
mainly for boot time performance.

So why don't you use UBI on the QSPI NOR ? That way, you'd secure the
binaries against bitrot as well.

Quoted 7 lines
Quoted 5 lines

Good point. Its a nice enhancement as we were using raw access for the
images in NAND and QSPI. Will add a new command for fs support once we
enable the ubifs support in socfpga

Why can't this be enabled now then ?

Mainly for backward compatibility as customer might have their own script on programming a blank flash in production. This is the same where we can do mmc load or a load (with file system).

Thanks
Chin Liang

Quoted 3 lines

Best regards,
Marek Vasut

#9 lore raw

PATCH 1/1 arm: socfpga: Enable load zImage and Linux DTB from QSPI

Quoted 40 lines · Chin Liang See
Quoted 39 lines · Marek Vasut
Quoted 37 lines · Chin Liang See

Hi Marek,

Quoted 21 lines · Marek Vasut

On Friday, November 27, 2015 at 02:24:49 AM, Chin Liang See

Quoted 18 lines · wrote:

Hi Pavel,

Quoted 14 lines · Pavel Machek

Hi!

Quoted 8 lines

Adding new environment qspiload which will load zImage and Linux DTB from serial NOR flash. The default flash offset for
the images as below and they are configurable during run time.

- zImage located at 0xa0000 with assuming file size 6MB
- Linux DTB located at 0x50000 with assuming file size 28kB

Hmm. Ok, zImage second, so that it can grow. Makes sense. Not sure if
28kB is not a bit small for DTB. I'd reserve at least 64kB.

Quoted 7 lines
Quoted 3 lines

Yup, it can grow up to 64kB as the size for a sector. We used 28KB
mainly for boot time performance.

So why don't you use UBI on the QSPI NOR ? That way, you'd secure the
binaries against bitrot as well.

Good point. Its a nice enhancement as we were using raw access for the
images in NAND and QSPI. Will add a new command for fs support once we
enable the ubifs support in socfpga

Quoted 5 lines
Quoted 1 line

Why can't this be enabled now then ?

Mainly for backward compatibility as customer might have their own script on programming a blank flash in production. This is the same where we can do mmc load or a load (with file system).

Does that imply that we will have to get stuck in the past because some random customer of some random company might have a random script somewhere? :)

Best regards,
Marek Vasut

#10 lore raw

PATCH 1/1 arm: socfpga: Enable load zImage and Linux DTB from QSPI

Quoted 55 lines · Marek Vasut
Quoted 54 lines · Chin Liang See
Quoted 52 lines · Marek Vasut
Quoted 41 lines · Chin Liang See

Hi Marek,

Quoted 33 lines · Marek Vasut

On Friday, November 27, 2015 at 02:24:49 AM, Chin Liang See

Quoted 25 lines · wrote:

Hi Pavel,

Quoted 16 lines · Pavel Machek

Hi!

Quoted 9 lines

Adding new environment qspiload which will load zImage and
Linux DTB from serial NOR flash. The default flash offset
for
the images as below and they are configurable during run
time.

Quoted 4 lines

- zImage located at 0xa0000 with assuming file size
6MB
- Linux DTB located at 0x50000 with assuming file size 28kB

Quoted 5 lines

Hmm. Ok, zImage second, so that it can grow. Makes sense. Not
sure if
28kB is not a bit small for DTB. I'd reserve at least 64kB.

Quoted 4 lines

Yup, it can grow up to 64kB as the size for a sector. We used
28KB
mainly for boot time performance.

Quoted 4 lines

So why don't you use UBI on the QSPI NOR ? That way, you'd secure
the
binaries against bitrot as well.

Quoted 7 lines

Good point. Its a nice enhancement as we were using raw access for
the
images in NAND and QSPI. Will add a new command for fs support once
we
enable the ubifs support in socfpga

Why can't this be enabled now then ?

Quoted 9 lines
Quoted 3 lines

Mainly for backward compatibility as customer might have their own script on programming a blank flash in production. This is the same where we can do mmc load or a load (with file system).

Does that imply that we will have to get stuck in the past because some
random customer of some random company might have a random script somewhere? :)

Haha nope, we still need to advance. Just that we are giving choice for classic and new :)

Thanks
Chin Liang

Quoted 2 lines

Best regards,
Marek Vasut

#11 lore raw

PATCH 1/1 arm: socfpga: Enable load zImage and Linux DTB from QSPI

Quoted 61 lines · Chin Liang See
Quoted 60 lines · Marek Vasut
Quoted 58 lines · Chin Liang See
Quoted 52 lines · Marek Vasut

On Friday, November 27, 2015 at 02:34:27 AM, Chin Liang See

Quoted 41 lines · wrote:

Hi Marek,

Quoted 33 lines · Marek Vasut

On Friday, November 27, 2015 at 02:24:49 AM, Chin Liang See

Quoted 25 lines · wrote:

Hi Pavel,

Quoted 16 lines · Pavel Machek

Hi!

Quoted 9 lines

Adding new environment qspiload which will load zImage and
Linux DTB from serial NOR flash. The default flash offset
for
the images as below and they are configurable during run
time.

Quoted 4 lines

- zImage located at 0xa0000 with assuming file size
6MB
- Linux DTB located at 0x50000 with assuming file size 28kB

Quoted 5 lines

Hmm. Ok, zImage second, so that it can grow. Makes sense. Not
sure if
28kB is not a bit small for DTB. I'd reserve at least 64kB.

Quoted 4 lines

Yup, it can grow up to 64kB as the size for a sector. We used
28KB
mainly for boot time performance.

Quoted 4 lines

So why don't you use UBI on the QSPI NOR ? That way, you'd secure
the
binaries against bitrot as well.

Quoted 7 lines

Good point. Its a nice enhancement as we were using raw access for
the
images in NAND and QSPI. Will add a new command for fs support once
we
enable the ubifs support in socfpga

Quoted 1 line

Why can't this be enabled now then ?

Mainly for backward compatibility as customer might have their own script on programming a blank flash in production. This is the same where we can do mmc load or a load (with file system).

Quoted 7 lines
Quoted 4 lines

Does that imply that we will have to get stuck in the past because some
random customer of some random company might have a random script somewhere? :)

Haha nope, we still need to advance. Just that we are giving choice for classic and new :)

Can you check if we can do both then? With the option to prefer the new one?

Check the attached patch, it should give you an idea how to load files from UBI/UBIFS on QSPI. It even enables mtdparts for the QSPI, which is cool too. -------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-FIXME-SoCkit-OpenWRT-tuning.patch
Type: text/x-patch
Size: 6457 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151127/950b314d/attachment.bin>

#12 lore raw

PATCH 1/1 arm: socfpga: Enable load zImage and Linux DTB from QSPI

Quoted 81 lines · Marek Vasut
Quoted 80 lines · Chin Liang See
Quoted 78 lines · Marek Vasut
Quoted 63 lines · Chin Liang See
Quoted 62 lines · Marek Vasut

On Friday, November 27, 2015 at 02:34:27 AM, Chin Liang See

Quoted 58 lines · wrote:

Hi Marek,

Quoted 40 lines · Marek Vasut

On Friday, November 27, 2015 at 02:24:49 AM, Chin Liang See

Quoted 30 lines · wrote:

Hi Pavel,

Quoted 20 lines · Pavel Machek

Hi!

Quoted 11 lines

Adding new environment qspiload which will load zImage
and
Linux DTB from serial NOR flash. The default flash offset
for
the images as below and they are configurable during
run
time.

Quoted 6 lines

- zImage located at 0xa0000 with assuming file
size
6MB
- Linux DTB located at 0x50000 with assuming file
size
28kB

Quoted 6 lines

Hmm. Ok, zImage second, so that it can grow. Makes sense.
Not
sure if
28kB is not a bit small for DTB. I'd reserve at least 64kB.

Quoted 5 lines

Yup, it can grow up to 64kB as the size for a sector. We
used
28KB
mainly for boot time performance.

Quoted 5 lines

So why don't you use UBI on the QSPI NOR ? That way, you'd
secure
the
binaries against bitrot as well.

Good point. Its a nice enhancement as we were using raw access
for
the
images in NAND and QSPI. Will add a new command for fs support
once
we
enable the ubifs support in socfpga

Quoted 7 lines
Quoted 1 line

Why can't this be enabled now then ?

Mainly for backward compatibility as customer might have their own
script on programming a blank flash in production. This is the same
where we can do mmc load or a load (with file system).

Does that imply that we will have to get stuck in the past because
some
random customer of some random company might have a random script somewhere? :)

Quoted 7 lines
Quoted 3 lines

Haha nope, we still need to advance. Just that we are giving choice for
classic and new :)

Can you check if we can do both then? With the option to prefer the new one?

Sure as you already give me a jump start :)

Quoted 4 lines

Check the attached patch, it should give you an idea how to load files from
UBI/UBIFS on QSPI. It even enables mtdparts for the QSPI, which is cool too.

Cool, thanks for the pointer.

Thanks
Chin Liang

#13 lore raw

PATCH 1/1 arm: socfpga: Enable load zImage and Linux DTB from QSPI

Quoted 90 lines · Chin Liang See
Quoted 82 lines · Marek Vasut
Quoted 81 lines · Chin Liang See
Quoted 79 lines · Marek Vasut

On Friday, November 27, 2015 at 01:07:23 PM, Chin Liang See

Quoted 63 lines · wrote:
Quoted 62 lines · Marek Vasut

On Friday, November 27, 2015 at 02:34:27 AM, Chin Liang See

Quoted 58 lines · wrote:

Hi Marek,

Quoted 40 lines · Marek Vasut

On Friday, November 27, 2015 at 02:24:49 AM, Chin Liang See

Quoted 30 lines · wrote:

Hi Pavel,

Quoted 20 lines · Pavel Machek

Hi!

Quoted 11 lines

Adding new environment qspiload which will load zImage
and
Linux DTB from serial NOR flash. The default flash offset
for
the images as below and they are configurable during
run
time.

Quoted 6 lines

- zImage located at 0xa0000 with assuming file
size
6MB
- Linux DTB located at 0x50000 with assuming file
size
28kB

Quoted 6 lines

Hmm. Ok, zImage second, so that it can grow. Makes sense.
Not
sure if
28kB is not a bit small for DTB. I'd reserve at least 64kB.

Quoted 5 lines

Yup, it can grow up to 64kB as the size for a sector. We
used
28KB
mainly for boot time performance.

Quoted 5 lines

So why don't you use UBI on the QSPI NOR ? That way, you'd
secure
the
binaries against bitrot as well.

Good point. Its a nice enhancement as we were using raw access
for
the
images in NAND and QSPI. Will add a new command for fs support
once
we
enable the ubifs support in socfpga

Quoted 7 lines
Quoted 1 line

Why can't this be enabled now then ?

Mainly for backward compatibility as customer might have their own
script on programming a blank flash in production. This is the same
where we can do mmc load or a load (with file system).

Does that imply that we will have to get stuck in the past because
some
random customer of some random company might have a random script somewhere? :)

Quoted 6 lines
Quoted 3 lines

Haha nope, we still need to advance. Just that we are giving choice for
classic and new :)

Can you check if we can do both then? With the option to prefer the new one?

Quoted 8 lines

Sure as you already give me a jump start :)

Quoted 4 lines

Check the attached patch, it should give you an idea how to load files from
UBI/UBIFS on QSPI. It even enables mtdparts for the QSPI, which is cool too.

Cool, thanks for the pointer.

Thanks! This really helps.