Skip to contentSkip to conversation

configs: socfpga: Add QSPI support for Cyclone 5

PATCH New Ley Foon Tan 3 participants 10 messages Feb 21, 2020 – Mar 4, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 configs: socfpga: Add QSPI support for Cyclone 5

Add QSPI boot support to boot target devices list.
Platform can provide their own boot settings through SOCFPGA_BOOT_SETTINGS macro if needed.

Add SOCFPGA_BOOT_SETTINGS for Cyclone 5.

---
 include/configs/socfpga_common.h         | 18 ++++++++++++++++++
 include/configs/socfpga_cyclone5_socdk.h | 18 ++++++++++++++++++
 2 files changed, 36 insertions(+)
include/configs/socfpga_common.h +18 -0
index 8d10469e7c..f3ddfca289 100644
@@ -228,11 +228,28 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
 #define BOOT_TARGET_DEVICES_MMC(func)
 #endif
 
+#ifdef CONFIG_CMD_SF
+#define BOOT_TARGET_DEVICES_QSPI(func) func(QSPI, qspi, na)
+#else
+#define BOOT_TARGET_DEVICES_QSPI(func)
+#endif
+
+#define BOOTENV_DEV_QSPI(devtypeu, devtypel, instance) \
+	"bootcmd_qspi=run qspiload; run qspiboot\0"
+
+#define BOOTENV_DEV_NAME_QSPI(devtypeu, devtypel, instance) \
+	"qspi "
+
 #define BOOT_TARGET_DEVICES(func) \
 	BOOT_TARGET_DEVICES_MMC(func) \
+	BOOT_TARGET_DEVICES_QSPI(func) \
 	BOOT_TARGET_DEVICES_PXE(func) \
 	BOOT_TARGET_DEVICES_DHCP(func)
 
+#ifndef SOCFPGA_BOOT_SETTINGS
+#define SOCFPGA_BOOT_SETTINGS
+#endif
+
 #include <config_distro_bootcmd.h>
 
 #ifndef CONFIG_EXTRA_ENV_SETTINGS
@@ -245,6 +262,7 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
 	"pxefile_addr_r=0x02200000\0" \
 	"ramdisk_addr_r=0x02300000\0" \
 	"socfpga_legacy_reset_compat=1\0" \
+	SOCFPGA_BOOT_SETTINGS \
 	BOOTENV
 
 #endif
include/configs/socfpga_cyclone5_socdk.h +18 -0
index 028db2a09e..62ad001c4b 100644
@@ -14,6 +14,24 @@
 #define CONFIG_LOADADDR		0x01000000
 #define CONFIG_SYS_LOAD_ADDR	CONFIG_LOADADDR
 
+/* QSPI boot */
+#define FDT_SIZE		__stringify(0x00010000)
+#define KERNEL_SIZE		__stringify(0x005d0000)
+#define QSPI_FDT_ADDR		__stringify(0x00220000)
+#define QSPI_KERNEL_ADDR	__stringify(0x00230000)
+
+#define SOCFPGA_BOOT_SETTINGS \
+	"fdt_size=" FDT_SIZE "\0" \
+	"kernel_size=" KERNEL_SIZE "\0" \
+	"qspi_fdt_addr=" QSPI_FDT_ADDR "\0" \
+	"qspi_kernel_addr=" QSPI_KERNEL_ADDR "\0" \
+	"qspiboot=setenv bootargs earlycon " \
+		"root=/dev/mtdblock1 rw rootfstype=jffs2; " \
+		"bootz ${kernel_addr_r} - ${fdt_addr_r}\0" \
+	"qspiload=sf probe; " \
+		"sf read ${kernel_addr_r} ${qspi_kernel_addr} ${kernel_size}; " \
+		"sf read ${fdt_addr_r} ${qspi_fdt_addr} ${fdt_size}\0"
+
 /* The rest of the configuration is shared */
 #include <configs/socfpga_common.h>
 
Signature · 1 line
2.19.0
#1 lore raw

PATCH 2/2 configs: socfpga: Add QSPI boot for Arria 10 SoCDK

Add QSPI boot settings for Arria 10 SoCDK.

---
 include/configs/socfpga_arria10_socdk.h | 9 +++++++++
 1 file changed, 9 insertions(+)
include/configs/socfpga_arria10_socdk.h +9 -0
index 645e66e6b0..e1d01c095f 100644
@@ -39,6 +39,15 @@
 /* SPL memory allocation configuration, this is for FAT implementation */
 #define CONFIG_SYS_SPL_MALLOC_SIZE	0x00015000
 
+#define KERNEL_FIT_ADDR		__stringify(0x1200000)
+
+#define SOCFPGA_BOOT_SETTINGS \
+	"kernelfit_addr=" KERNEL_FIT_ADDR "\0" \
+	"qspiboot=setenv bootargs " CONFIG_BOOTARGS \
+			"root=/dev/mtdblock1 rw rootfstype=jffs2;" \
+			"bootm ${scriptaddr}\0" \
+	"qspiload=sf probe; sf read ${scriptaddr} ${kernelfit_addr}\0" \
+
 /* The rest of the configuration is shared */
 #include <configs/socfpga_common.h>
 
Signature · 1 line
2.19.0
#2 lore raw

PATCH 2/2 configs: socfpga: Add QSPI boot for Arria 10 SoCDK

Quoted 18 lines · Ley Foon Tan

Add QSPI boot settings for Arria 10 SoCDK.

---
 include/configs/socfpga_arria10_socdk.h | 9 +++++++++
 1 file changed, 9 insertions(+)
include/configs/socfpga_arria10_socdk.h +2 -0
index 645e66e6b0..e1d01c095f 100644
@@ -39,6 +39,15 @@
 /* SPL memory allocation configuration, this is for FAT implementation */
 #define CONFIG_SYS_SPL_MALLOC_SIZE     0x00015000
 
+#define KERNEL_FIT_ADDR                __stringify(0x1200000)
+

include/configs/socfpga_arria10_socdk.h line 53

Quoted 10 lines
include/configs/socfpga_arria10_socdk.h +7 -0
+#define SOCFPGA_BOOT_SETTINGS \
+       "kernelfit_addr=" KERNEL_FIT_ADDR "\0" \
+       "qspiboot=setenv bootargs " CONFIG_BOOTARGS \
+                       "root=/dev/mtdblock1 rw rootfstype=jffs2;" \
+                       "bootm ${scriptaddr}\0" \
+       "qspiload=sf probe; sf read ${scriptaddr} ${kernelfit_addr}\0" \
+
 /* The rest of the configuration is shared */
 #include <configs/socfpga_common.h>
 

Any comment on this patch?

Regards
Ley Foon

#3 lore raw

PATCH 2/2 configs: socfpga: Add QSPI boot for Arria 10 SoCDK

Quoted 17 lines · Ley Foon Tan
Quoted 16 lines · Ley Foon Tan

Add QSPI boot settings for Arria 10 SoCDK.

---
 include/configs/socfpga_arria10_socdk.h | 9 +++++++++
 1 file changed, 9 insertions(+)
include/configs/socfpga_arria10_socdk.h +0 -0
index 645e66e6b0..e1d01c095f 100644
@@ -39,6 +39,15 @@
 /* SPL memory allocation configuration, this is for FAT implementation */
 #define CONFIG_SYS_SPL_MALLOC_SIZE     0x00015000
 
Quoted 14 lines

include/configs/socfpga_arria10_socdk.h line 53

Quoted 12 lines
include/configs/socfpga_arria10_socdk.h +9 -0
+#define KERNEL_FIT_ADDR                __stringify(0x1200000)
+
+#define SOCFPGA_BOOT_SETTINGS \
+       "kernelfit_addr=" KERNEL_FIT_ADDR "\0" \
+       "qspiboot=setenv bootargs " CONFIG_BOOTARGS \
+                       "root=/dev/mtdblock1 rw rootfstype=jffs2;" \
+                       "bootm ${scriptaddr}\0" \
+       "qspiload=sf probe; sf read ${scriptaddr} ${kernelfit_addr}\0" \
+
 /* The rest of the configuration is shared */
 #include <configs/socfpga_common.h>
 

Any comment on this patch?

Can we get rid of rootfstype=jffs2 ? It's archaic and you can use UBI on top of SPI NOR too. Also, isn't there already some kernel_addr_r for the kernel address ?

Finally, can't we switch to distro boot command on socfpga, to handle all the various devices ?

#4 lore raw

PATCH 2/2 configs: socfpga: Add QSPI boot for Arria 10 SoCDK

Quoted 34 lines · Marek Vasut
Quoted 17 lines · Ley Foon Tan
Quoted 16 lines · Ley Foon Tan

Add QSPI boot settings for Arria 10 SoCDK.

---
 include/configs/socfpga_arria10_socdk.h | 9 +++++++++
 1 file changed, 9 insertions(+)
include/configs/socfpga_arria10_socdk.h +0 -0
index 645e66e6b0..e1d01c095f 100644
@@ -39,6 +39,15 @@
 /* SPL memory allocation configuration, this is for FAT implementation */
 #define CONFIG_SYS_SPL_MALLOC_SIZE     0x00015000
 
Quoted 14 lines

include/configs/socfpga_arria10_socdk.h line 53

Quoted 12 lines
include/configs/socfpga_arria10_socdk.h +9 -0
+#define KERNEL_FIT_ADDR                __stringify(0x1200000)
+
+#define SOCFPGA_BOOT_SETTINGS \
+       "kernelfit_addr=" KERNEL_FIT_ADDR "\0" \
+       "qspiboot=setenv bootargs " CONFIG_BOOTARGS \
+                       "root=/dev/mtdblock1 rw rootfstype=jffs2;" \
+                       "bootm ${scriptaddr}\0" \
+       "qspiload=sf probe; sf read ${scriptaddr} ${kernelfit_addr}\0" \
+
 /* The rest of the configuration is shared */
 #include <configs/socfpga_common.h>
 

Any comment on this patch?

Quoted 3 lines

Can we get rid of rootfstype=jffs2 ? It's archaic and you can use UBI on top of SPI NOR too. Also, isn't there already some kernel_addr_r for the kernel address ?

Yes, I know SPI flash can use UBI FS too, but we only enable jffs2 now. kernelfit_addr is for kernel fit image offset in SPI flash, it is different from kernel_addr_r.
Maybe change kernelfit_addr to qspi_kernelfit_addr to avoid confusion.

Quoted 3 lines

Finally, can't we switch to distro boot command on socfpga, to handle all the various devices ?

socfpga_common.h already use distro boot command, right?

In patch "[PATCH 1/2] configs: socfpga: Add QSPI support for Cyclone 5", it added QSPI to the list:
+ BOOT_TARGET_DEVICES_QSPI(func) \

#5 lore raw

PATCH 2/2 configs: socfpga: Add QSPI boot for Arria 10 SoCDK

Quoted 35 lines · Ley Foon Tan
Quoted 34 lines · Marek Vasut
Quoted 31 lines · Ley Foon Tan
Quoted 18 lines · Ley Foon Tan

Add QSPI boot settings for Arria 10 SoCDK.

---
 include/configs/socfpga_arria10_socdk.h | 9 +++++++++
 1 file changed, 9 insertions(+)
include/configs/socfpga_arria10_socdk.h +2 -0
index 645e66e6b0..e1d01c095f 100644
@@ -39,6 +39,15 @@
 /* SPL memory allocation configuration, this is for FAT implementation */
 #define CONFIG_SYS_SPL_MALLOC_SIZE     0x00015000
 
+#define KERNEL_FIT_ADDR                __stringify(0x1200000)
+

include/configs/socfpga_arria10_socdk.h line 53

Quoted 10 lines
include/configs/socfpga_arria10_socdk.h +7 -0
+#define SOCFPGA_BOOT_SETTINGS \
+       "kernelfit_addr=" KERNEL_FIT_ADDR "\0" \
+       "qspiboot=setenv bootargs " CONFIG_BOOTARGS \
+                       "root=/dev/mtdblock1 rw rootfstype=jffs2;" \
+                       "bootm ${scriptaddr}\0" \
+       "qspiload=sf probe; sf read ${scriptaddr} ${kernelfit_addr}\0" \
+
 /* The rest of the configuration is shared */
 #include <configs/socfpga_common.h>
 

Any comment on this patch?

Quoted 4 lines
Quoted 3 lines

Can we get rid of rootfstype=jffs2 ? It's archaic and you can use UBI on top of SPI NOR too. Also, isn't there already some kernel_addr_r for the kernel address ?

Yes, I know SPI flash can use UBI FS too, but we only enable jffs2 now.

JFFS2 is dead for a very long time. I only ever met it on some archaic altera hardware, everywhere else it's UBI, which makes me wonder -- what is the reason Altera is sticking to this antique ?

Quoted 2 lines

kernelfit_addr is for kernel fit image offset in SPI flash, it is different from kernel_addr_r.

Shouldn't the MTD layout of the SPI NOR be described in mtdparts ?

Quoted 9 lines

Maybe change kernelfit_addr to qspi_kernelfit_addr to avoid confusion.

Quoted 3 lines

Finally, can't we switch to distro boot command on socfpga, to handle all the various devices ?

socfpga_common.h already use distro boot command, right?

In patch "[PATCH 1/2] configs: socfpga: Add QSPI support for Cyclone 5", it added QSPI to the list:
+ BOOT_TARGET_DEVICES_QSPI(func) \

OK

#6 lore raw

PATCH 2/2 configs: socfpga: Add QSPI boot for Arria 10 SoCDK

Quoted 37 lines · Marek Vasut
Quoted 35 lines · Ley Foon Tan
Quoted 34 lines · Marek Vasut
Quoted 31 lines · Ley Foon Tan
Quoted 18 lines · Ley Foon Tan

Add QSPI boot settings for Arria 10 SoCDK.

---
 include/configs/socfpga_arria10_socdk.h | 9 +++++++++
 1 file changed, 9 insertions(+)
include/configs/socfpga_arria10_socdk.h +2 -0
index 645e66e6b0..e1d01c095f 100644
@@ -39,6 +39,15 @@
 /* SPL memory allocation configuration, this is for FAT implementation */
 #define CONFIG_SYS_SPL_MALLOC_SIZE     0x00015000
 
+#define KERNEL_FIT_ADDR                __stringify(0x1200000)
+

include/configs/socfpga_arria10_socdk.h line 53

Quoted 10 lines
include/configs/socfpga_arria10_socdk.h +7 -0
+#define SOCFPGA_BOOT_SETTINGS \
+       "kernelfit_addr=" KERNEL_FIT_ADDR "\0" \
+       "qspiboot=setenv bootargs " CONFIG_BOOTARGS \
+                       "root=/dev/mtdblock1 rw rootfstype=jffs2;" \
+                       "bootm ${scriptaddr}\0" \
+       "qspiload=sf probe; sf read ${scriptaddr} ${kernelfit_addr}\0" \
+
 /* The rest of the configuration is shared */
 #include <configs/socfpga_common.h>
 

Any comment on this patch?

Quoted 8 lines
Quoted 4 lines
Quoted 3 lines

Can we get rid of rootfstype=jffs2 ? It's archaic and you can use UBI on top of SPI NOR too. Also, isn't there already some kernel_addr_r for the kernel address ?

Yes, I know SPI flash can use UBI FS too, but we only enable jffs2 now.

JFFS2 is dead for a very long time. I only ever met it on some archaic altera hardware, everywhere else it's UBI, which makes me wonder -- what is the reason Altera is sticking to this antique ?

We haven't enable UBI for Gen5. Tien Fong did enable UBI for A10 and submit the patches before.
But, he is busy on other tasks now and haven't continue rework the patches. But, Gen5 haven't enable UBI yet.

Quoted 5 lines
Quoted 3 lines

kernelfit_addr is for kernel fit image offset in SPI flash, it is different from kernel_addr_r.

Shouldn't the MTD layout of the SPI NOR be described in mtdparts ?

It doesn't use mtdparts now. I will try enable it.

Regards
Ley Foon

#7 lore raw

PATCH 2/2 configs: socfpga: Add QSPI boot for Arria 10 SoCDK

Quoted 43 lines · Ley Foon Tan
Quoted 42 lines · Marek Vasut
Quoted 39 lines · Ley Foon Tan
Quoted 34 lines · Marek Vasut
Quoted 17 lines · Ley Foon Tan
Quoted 16 lines · Ley Foon Tan

Add QSPI boot settings for Arria 10 SoCDK.

---
 include/configs/socfpga_arria10_socdk.h | 9 +++++++++
 1 file changed, 9 insertions(+)
include/configs/socfpga_arria10_socdk.h +0 -0
index 645e66e6b0..e1d01c095f 100644
@@ -39,6 +39,15 @@
 /* SPL memory allocation configuration, this is for FAT implementation */
 #define CONFIG_SYS_SPL_MALLOC_SIZE     0x00015000
 
Quoted 14 lines

include/configs/socfpga_arria10_socdk.h line 53

Quoted 12 lines
include/configs/socfpga_arria10_socdk.h +9 -0
+#define KERNEL_FIT_ADDR                __stringify(0x1200000)
+
+#define SOCFPGA_BOOT_SETTINGS \
+       "kernelfit_addr=" KERNEL_FIT_ADDR "\0" \
+       "qspiboot=setenv bootargs " CONFIG_BOOTARGS \
+                       "root=/dev/mtdblock1 rw rootfstype=jffs2;" \
+                       "bootm ${scriptaddr}\0" \
+       "qspiload=sf probe; sf read ${scriptaddr} ${kernelfit_addr}\0" \
+
 /* The rest of the configuration is shared */
 #include <configs/socfpga_common.h>
 

Any comment on this patch?

Quoted 3 lines

Can we get rid of rootfstype=jffs2 ? It's archaic and you can use UBI on top of SPI NOR too. Also, isn't there already some kernel_addr_r for the kernel address ?

Yes, I know SPI flash can use UBI FS too, but we only enable jffs2 now.

Quoted 8 lines
Quoted 3 lines

JFFS2 is dead for a very long time. I only ever met it on some archaic altera hardware, everywhere else it's UBI, which makes me wonder -- what is the reason Altera is sticking to this antique ?

We haven't enable UBI for Gen5. Tien Fong did enable UBI for A10 and submit the patches before.
But, he is busy on other tasks now and haven't continue rework the patches. But, Gen5 haven't enable UBI yet.

Well, just enable it, it's two config options.

Quoted 5 lines
Quoted 4 lines
Quoted 2 lines

kernelfit_addr is for kernel fit image offset in SPI flash, it is different from kernel_addr_r.

Shouldn't the MTD layout of the SPI NOR be described in mtdparts ?

It doesn't use mtdparts now. I will try enable it.

Thanks!

#8 lore raw

PATCH 1/2 configs: socfpga: Add QSPI support for Cyclone 5

In reply to Ley Foon Tan
Quoted 73 lines · Ley Foon Tan

Add QSPI boot support to boot target devices list.
Platform can provide their own boot settings through SOCFPGA_BOOT_SETTINGS macro if needed.

Add SOCFPGA_BOOT_SETTINGS for Cyclone 5.

---
 include/configs/socfpga_common.h         | 18 ++++++++++++++++++
 include/configs/socfpga_cyclone5_socdk.h | 18 ++++++++++++++++++
 2 files changed, 36 insertions(+)
include/configs/socfpga_common.h +18 -0
index 8d10469e7c..f3ddfca289 100644
@@ -228,11 +228,28 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
 #define BOOT_TARGET_DEVICES_MMC(func)
 #endif
 
+#ifdef CONFIG_CMD_SF
+#define BOOT_TARGET_DEVICES_QSPI(func) func(QSPI, qspi, na)
+#else
+#define BOOT_TARGET_DEVICES_QSPI(func)
+#endif
+
+#define BOOTENV_DEV_QSPI(devtypeu, devtypel, instance) \
+       "bootcmd_qspi=run qspiload; run qspiboot\0"
+
+#define BOOTENV_DEV_NAME_QSPI(devtypeu, devtypel, instance) \
+       "qspi "
+
 #define BOOT_TARGET_DEVICES(func) \
        BOOT_TARGET_DEVICES_MMC(func) \
+       BOOT_TARGET_DEVICES_QSPI(func) \
        BOOT_TARGET_DEVICES_PXE(func) \
        BOOT_TARGET_DEVICES_DHCP(func)
 
+#ifndef SOCFPGA_BOOT_SETTINGS
+#define SOCFPGA_BOOT_SETTINGS
+#endif
+
 #include <config_distro_bootcmd.h>
 
 #ifndef CONFIG_EXTRA_ENV_SETTINGS
@@ -245,6 +262,7 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
        "pxefile_addr_r=0x02200000\0" \
        "ramdisk_addr_r=0x02300000\0" \
        "socfpga_legacy_reset_compat=1\0" \
+       SOCFPGA_BOOT_SETTINGS \
        BOOTENV
 
 #endif
include/configs/socfpga_cyclone5_socdk.h +11 -0
index 028db2a09e..62ad001c4b 100644
@@ -14,6 +14,24 @@
 #define CONFIG_LOADADDR                0x01000000
 #define CONFIG_SYS_LOAD_ADDR   CONFIG_LOADADDR
 
+/* QSPI boot */
+#define FDT_SIZE               __stringify(0x00010000)
+#define KERNEL_SIZE            __stringify(0x005d0000)
+#define QSPI_FDT_ADDR          __stringify(0x00220000)
+#define QSPI_KERNEL_ADDR       __stringify(0x00230000)
+
+#define SOCFPGA_BOOT_SETTINGS \
+       "fdt_size=" FDT_SIZE "\0" \
+       "kernel_size=" KERNEL_SIZE "\0" \
+       "qspi_fdt_addr=" QSPI_FDT_ADDR "\0" \
+       "qspi_kernel_addr=" QSPI_KERNEL_ADDR "\0" \

include/configs/socfpga_cyclone5_socdk.h line 37

Quoted 10 lines
include/configs/socfpga_cyclone5_socdk.h +7 -0
+       "qspiboot=setenv bootargs earlycon " \
+               "root=/dev/mtdblock1 rw rootfstype=jffs2; " \
+               "bootz ${kernel_addr_r} - ${fdt_addr_r}\0" \
+       "qspiload=sf probe; " \
+               "sf read ${kernel_addr_r} ${qspi_kernel_addr} ${kernel_size}; " \
+               "sf read ${fdt_addr_r} ${qspi_fdt_addr} ${fdt_size}\0"
+
 /* The rest of the configuration is shared */
 #include <configs/socfpga_common.h>
 

Any comment on this patch?

Regards
Ley Foon

#9 lore raw

PATCH 1/2 configs: socfpga: Add QSPI support for Cyclone 5

Quoted 77 lines · Ley Foon Tan
Quoted 76 lines · Ley Foon Tan

Add QSPI boot support to boot target devices list.
Platform can provide their own boot settings through SOCFPGA_BOOT_SETTINGS macro if needed.

Add SOCFPGA_BOOT_SETTINGS for Cyclone 5.

---
 include/configs/socfpga_common.h         | 18 ++++++++++++++++++
 include/configs/socfpga_cyclone5_socdk.h | 18 ++++++++++++++++++
 2 files changed, 36 insertions(+)
include/configs/socfpga_common.h +18 -0
index 8d10469e7c..f3ddfca289 100644
@@ -228,11 +228,28 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
 #define BOOT_TARGET_DEVICES_MMC(func)
 #endif
 
+#ifdef CONFIG_CMD_SF
+#define BOOT_TARGET_DEVICES_QSPI(func) func(QSPI, qspi, na)
+#else
+#define BOOT_TARGET_DEVICES_QSPI(func)
+#endif
+
+#define BOOTENV_DEV_QSPI(devtypeu, devtypel, instance) \
+       "bootcmd_qspi=run qspiload; run qspiboot\0"
+
+#define BOOTENV_DEV_NAME_QSPI(devtypeu, devtypel, instance) \
+       "qspi "
+
 #define BOOT_TARGET_DEVICES(func) \
        BOOT_TARGET_DEVICES_MMC(func) \
+       BOOT_TARGET_DEVICES_QSPI(func) \
        BOOT_TARGET_DEVICES_PXE(func) \
        BOOT_TARGET_DEVICES_DHCP(func)
 
+#ifndef SOCFPGA_BOOT_SETTINGS
+#define SOCFPGA_BOOT_SETTINGS
+#endif
+
 #include <config_distro_bootcmd.h>
 
 #ifndef CONFIG_EXTRA_ENV_SETTINGS
@@ -245,6 +262,7 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
        "pxefile_addr_r=0x02200000\0" \
        "ramdisk_addr_r=0x02300000\0" \
        "socfpga_legacy_reset_compat=1\0" \
+       SOCFPGA_BOOT_SETTINGS \
        BOOTENV
 
 #endif
include/configs/socfpga_cyclone5_socdk.h +14 -0
index 028db2a09e..62ad001c4b 100644
@@ -14,6 +14,24 @@
 #define CONFIG_LOADADDR                0x01000000
 #define CONFIG_SYS_LOAD_ADDR   CONFIG_LOADADDR
 
+/* QSPI boot */
+#define FDT_SIZE               __stringify(0x00010000)
+#define KERNEL_SIZE            __stringify(0x005d0000)
+#define QSPI_FDT_ADDR          __stringify(0x00220000)
+#define QSPI_KERNEL_ADDR       __stringify(0x00230000)
+
+#define SOCFPGA_BOOT_SETTINGS \
+       "fdt_size=" FDT_SIZE "\0" \
+       "kernel_size=" KERNEL_SIZE "\0" \
+       "qspi_fdt_addr=" QSPI_FDT_ADDR "\0" \
+       "qspi_kernel_addr=" QSPI_KERNEL_ADDR "\0" \
+       "qspiboot=setenv bootargs earlycon " \
+               "root=/dev/mtdblock1 rw rootfstype=jffs2; " \
+               "bootz ${kernel_addr_r} - ${fdt_addr_r}\0" \
Quoted 8 lines

include/configs/socfpga_cyclone5_socdk.h line 37

Quoted 7 lines
include/configs/socfpga_cyclone5_socdk.h +4 -0
+       "qspiload=sf probe; " \
+               "sf read ${kernel_addr_r} ${qspi_kernel_addr} ${kernel_size}; " \
+               "sf read ${fdt_addr_r} ${qspi_fdt_addr} ${fdt_size}\0"
+
 /* The rest of the configuration is shared */
 #include <configs/socfpga_common.h>
 

Any comment on this patch?

Same as A10 very much.