Skip to contentSkip to conversation

arm: socfpga: Move to using distro boot

PATCH New Dalon Westergreen 2 participants 10 messages Apr 13, 2017 – Apr 14, 2017

lore
Share & tools
lore
#0 lore raw

v5 cover arm: socfpga: Move to using distro boot

This series adds support to the common socfpga header for distro boot and moves the DE0/1, Socrates, C5/A5 SoCDK, and SoCKIT kits to use the common environment.

Where available, the default devicetree is set to the devicetree for the board available in the kernel source. If none is available in the kernel source, the devicetree is set to the name previously used in the board header file.

Changes in v5:
- Fix typo in socfpga_arria5_defconfig
- ENV must be after GPT to support opensuse
Changes in v4:
- Move env back to immediately after MBR
Changes in v3:
- fix errors in 1/8 patch
Changes in v2:
- Remove unneeded CONFIG_BOOTFILE and fdt_addr
- Cleanup of socfpga_common.h
- Fixed dtb names for de1, sr1500, and arria5 boards

Dalon Westergreen (8):
arm: socfpga: Add distro boot to socfpga common header
arm: socfpga: DE0 use environment in common header
arm: socfpga: A5 SoCDK use environment in common header
arm: socfpga: C5 SoCDK use environment in common header
arm: socfpga: DE1 use environment in common header
arm: socfpga: SoCKit use environment in common header
arm: socfpga: Socrates use environment in common header
arm: socfpga: sr1500 use environment in common header

 configs/socfpga_arria5_defconfig         |  3 ++
 configs/socfpga_cyclone5_defconfig       |  3 ++
 configs/socfpga_de0_nano_soc_defconfig   |  3 ++
 configs/socfpga_de1_soc_defconfig        |  1 +
 configs/socfpga_sockit_defconfig         |  1 +
 configs/socfpga_socrates_defconfig       |  1 +
 configs/socfpga_sr1500_defconfig         |  1 +
 include/configs/socfpga_arria5_socdk.h   | 32 --------------------
 include/configs/socfpga_common.h         | 52 +++++++++++++++++++++++++++++---
 include/configs/socfpga_cyclone5_socdk.h | 32 --------------------
 include/configs/socfpga_de0_nano_soc.h   | 20 ------------
 include/configs/socfpga_de1_soc.h        | 20 ------------
 include/configs/socfpga_sockit.h         | 28 -----------------
 include/configs/socfpga_socrates.h       | 26 ----------------
 include/configs/socfpga_sr1500.h         | 28 -----------------
 15 files changed, 61 insertions(+), 190 deletions(-)
Signature · 1 line
2.7.4
#1 lore raw

PATCH v5 1/8 arm: socfpga: Add distro boot to socfpga common header

This adds a common environment and support for distro boot in the common socfpga header.

--
Changes in v5:
- Per Frank, to support OpenSuse the ENV must be after the GPT
Changes in v4:
- Move env back to being right after the MBR
Changes in v3:
- fix spacing between asterix
- remove verify=n as a default setting

Changes in v2:
- Remove unneeded CONFIG_BOOTFILE and fdt_addr
- cleanup spacing in MMC env size

common

---
 include/configs/socfpga_common.h | 52 ++++++++++++++++++++++++++++++++++++----
 1 file changed, 48 insertions(+), 4 deletions(-)
include/configs/socfpga_common.h +48 -4
index 8472b52..cf02d2d 100644
@@ -65,6 +65,9 @@
 #define CONFIG_SYS_HOSTNAME	CONFIG_SYS_BOARD
 #endif
 
+#define CONFIG_CMD_PXE
+#define CONFIG_MENU
+
 /*
  * Cache
  */
@@ -242,13 +245,13 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
  * U-Boot environment
  */
 #if !defined(CONFIG_ENV_SIZE)
-#define CONFIG_ENV_SIZE			4096
+#define CONFIG_ENV_SIZE			(8 * 1024)
 #endif
 
 /* Environment for SDMMC boot */
 #if defined(CONFIG_ENV_IS_IN_MMC) && !defined(CONFIG_ENV_OFFSET)
-#define CONFIG_SYS_MMC_ENV_DEV		0	/* device 0 */
-#define CONFIG_ENV_OFFSET		512	/* just after the MBR */
+#define CONFIG_SYS_MMC_ENV_DEV		0 /* device 0 */
+#define CONFIG_ENV_OFFSET		(34 * 512) /* just after the GPT */
 #endif
 
 /* Environment for QSPI boot */
@@ -305,8 +308,12 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
 /* SPL SDMMC boot support */
 #ifdef CONFIG_SPL_MMC_SUPPORT
 #if defined(CONFIG_SPL_FAT_SUPPORT) || defined(CONFIG_SPL_EXT_SUPPORT)
-#define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION	2
 #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME		"u-boot-dtb.img"
+#define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION	1
+#endif
+#else
+#ifndef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION
+#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION	1
 #endif
 #endif
 
@@ -328,4 +335,41 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
  */
 #define CONFIG_SPL_STACK		CONFIG_SYS_INIT_SP_ADDR
 
+/* Extra Environment */
+#ifndef CONFIG_SPL_BUILD
+#include <config_distro_defaults.h>
+
+#ifdef CONFIG_CMD_PXE
+#define BOOT_TARGET_DEVICES_PXE(func) func(PXE, pxe, na)
+#else
+#define BOOT_TARGET_DEVICES_PXE(func)
+#endif
+
+#ifdef CONFIG_CMD_MMC
+#define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0)
+#else
+#define BOOT_TARGET_DEVICES_MMC(func)
+#endif
+
+#define BOOT_TARGET_DEVICES(func) \
+	BOOT_TARGET_DEVICES_MMC(func) \
+	BOOT_TARGET_DEVICES_PXE(func) \
+	func(DHCP, dhcp, na)
+
+#include <config_distro_bootcmd.h>
+
+#ifndef CONFIG_EXTRA_ENV_SETTINGS
+#define CONFIG_EXTRA_ENV_SETTINGS \
+	"fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
+	"bootm_size=0xa000000\0" \
+	"kernel_addr_r="__stringify(CONFIG_SYS_LOAD_ADDR)"\0" \
+	"fdt_addr_r=0x02000000\0" \
+	"scriptaddr=0x02100000\0" \
+	"pxefile_addr_r=0x02200000\0" \
+	"ramdisk_addr_r=0x02300000\0" \
+	BOOTENV
+
+#endif
+#endif
+
 #endif	/* __CONFIG_SOCFPGA_COMMON_H__ */
Signature · 1 line
2.7.4
#2 lore raw

PATCH v5 2/8 arm: socfpga: DE0 use environment in common header

In reply to Dalon Westergreen

This removes the default environment from the de0 headers and instead uses the common environment provided in socfpga_common.h which now uses distro boot.

In addition to the above, add support to boot from the custom a2 type partition

--
Changes in v2:
- Remove unneeded CONFIG_BOOTFILE

---
 configs/socfpga_de0_nano_soc_defconfig |  3 +++
 include/configs/socfpga_de0_nano_soc.h | 20 --------------------
 2 files changed, 3 insertions(+), 20 deletions(-)
configs/socfpga_de0_nano_soc_defconfig +3 -0
index af41e1e..b122135 100644
@@ -4,6 +4,7 @@ CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_TARGET_SOCFPGA_TERASIC_DE0_NANO=y
 CONFIG_SPL_STACK_R_ADDR=0x00800000
 CONFIG_DEFAULT_DEVICE_TREE="socfpga_cyclone5_de0_nano_soc"
+CONFIG_DEFAULT_FDT_FILE="socfpga_cyclone5_de0_nano_soc.dtb"
 CONFIG_FIT=y
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
@@ -58,3 +59,5 @@ CONFIG_G_DNL_MANUFACTURER="terasic"
 CONFIG_G_DNL_VENDOR_NUM=0x0525
 CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
 CONFIG_USE_TINY_PRINTF=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_TYPE=0xa2
\ No newline at end of file
include/configs/socfpga_de0_nano_soc.h +0 -20
index f655972..dd5933d 100644
@@ -16,9 +16,6 @@
 #define PHYS_SDRAM_1_SIZE		0x40000000	/* 1GiB */
 
 /* Booting Linux */
-#define CONFIG_BOOTFILE		"fitImage"
-#define CONFIG_BOOTARGS		"console=ttyS0," __stringify(CONFIG_BAUDRATE)
-#define CONFIG_BOOTCOMMAND	"run mmcload; run mmcboot"
 #define CONFIG_LOADADDR		0x01000000
 #define CONFIG_SYS_LOAD_ADDR	CONFIG_LOADADDR
 
@@ -30,23 +27,6 @@
 
 #define CONFIG_ENV_IS_IN_MMC
 
-/* Extra Environment */
-#define CONFIG_EXTRA_ENV_SETTINGS \
-	"loadaddr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
-	"ramboot=setenv bootargs " CONFIG_BOOTARGS ";" \
-		"bootm ${loadaddr} - ${fdt_addr}\0" \
-	"bootimage=zImage\0" \
-	"fdt_addr=100\0" \
-	"fdtimage=socfpga.dtb\0" \
-	"bootm ${loadaddr} - ${fdt_addr}\0" \
-	"mmcroot=/dev/mmcblk0p2\0" \
-	"mmcboot=setenv bootargs " CONFIG_BOOTARGS \
-		" root=${mmcroot} rw rootwait;" \
-		"bootz ${loadaddr} - ${fdt_addr}\0" \
-	"mmcload=mmc rescan;" \
-		"load mmc 0:1 ${loadaddr} ${bootimage};" \
-		"load mmc 0:1 ${fdt_addr} ${fdtimage}\0" \
-
 /* The rest of the configuration is shared */
 #include <configs/socfpga_common.h>
 
Signature · 1 line
2.7.4
#3 lore raw

PATCH v5 3/8 arm: socfpga: A5 SoCDK use environment in common header

In reply to Dalon Westergreen

This removes the default environment from the A5 socdk headers and instead uses the common environment provided in socfpga_common.h which now uses distro boot.

Add support to boot from the custom a2 type partition.

Change default devicetree name to match devicetree name in upstream kernel source.

--
Changes in v3:
- Fix small typo in defconfig, missing "C"
Changes in v2:
- Remove unneeded CONFIG_BOOTFILE
- Fix dtb name

a5config test

---
 configs/socfpga_arria5_defconfig       |  3 +++
 include/configs/socfpga_arria5_socdk.h | 32 --------------------------------
 2 files changed, 3 insertions(+), 32 deletions(-)
configs/socfpga_arria5_defconfig +3 -0
index 43c51fe..5aa8e25 100644
@@ -4,6 +4,7 @@ CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_TARGET_SOCFPGA_ARRIA5_SOCDK=y
 CONFIG_SPL_STACK_R_ADDR=0x00800000
 CONFIG_DEFAULT_DEVICE_TREE="socfpga_arria5_socdk"
+CONFIG_DEFAULT_FDT_FILE="socfpga_arria5_socdk.dtb"
 CONFIG_FIT=y
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
@@ -64,3 +65,5 @@ CONFIG_G_DNL_MANUFACTURER="altera"
 CONFIG_G_DNL_VENDOR_NUM=0x0525
 CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
 CONFIG_USE_TINY_PRINTF=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_TYPE=0xa2
include/configs/socfpga_arria5_socdk.h +0 -32
index 9b1f753..b60d007 100644
@@ -16,13 +16,6 @@
 #define PHYS_SDRAM_1_SIZE		0x40000000	/* 1GiB on SoCDK */
 
 /* Booting Linux */
-#define CONFIG_BOOTFILE		"zImage"
-#define CONFIG_BOOTARGS		"console=ttyS0," __stringify(CONFIG_BAUDRATE)
-#ifdef CONFIG_SOCFPGA_VIRTUAL_TARGET
-#define CONFIG_BOOTCOMMAND	"run ramboot"
-#else
-#define CONFIG_BOOTCOMMAND	"run mmcload; run mmcboot"
-#endif
 #define CONFIG_LOADADDR		0x01000000
 #define CONFIG_SYS_LOAD_ADDR	CONFIG_LOADADDR
 
@@ -34,31 +27,6 @@
 
 #define CONFIG_ENV_IS_IN_MMC
 
-/* Extra Environment */
-#define CONFIG_EXTRA_ENV_SETTINGS \
-	"verify=n\0" \
-	"loadaddr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
-	"ramboot=setenv bootargs " CONFIG_BOOTARGS ";" \
-		"bootm ${loadaddr} - ${fdt_addr}\0" \
-	"bootimage=zImage\0" \
-	"fdt_addr=100\0" \
-	"fdtimage=socfpga.dtb\0" \
-	"bootm ${loadaddr} - ${fdt_addr}\0" \
-	"mmcroot=/dev/mmcblk0p2\0" \
-	"mmcboot=setenv bootargs " CONFIG_BOOTARGS \
-		" root=${mmcroot} rw rootwait;" \
-		"bootz ${loadaddr} - ${fdt_addr}\0" \
-	"mmcload=mmc rescan;" \
-		"load mmc 0:1 ${loadaddr} ${bootimage};" \
-		"load mmc 0:1 ${fdt_addr} ${fdtimage}\0" \
-	"qspiload=sf probe && mtdparts default && run ubiload\0" \
-	"qspiboot=setenv bootargs " CONFIG_BOOTARGS \
-		" ubi.mtd=1,64 root=ubi0:rootfs rw rootfstype=ubifs;"\
-		"bootz ${loadaddr} - ${fdt_addr}\0" \
-	"ubiload=ubi part UBI && ubifsmount ubi0 && " \
-		"ubifsload ${loadaddr} /boot/${bootimage} && " \
-		"ubifsload ${fdt_addr} /boot/${fdtimage}\0"
-
 /* The rest of the configuration is shared */
 #include <configs/socfpga_common.h>
 
Signature · 1 line
2.7.4
#4 lore raw

PATCH v5 4/8 arm: socfpga: C5 SoCDK use environment in common header

In reply to Dalon Westergreen

This removes the default environment from the C5 SoCDK headers and instead uses the common environment provided in socfpga_common.h which now uses distro boot.

In addition to the above, add support to boot from the custom a2 type partition.

Change default devicetree name to match devicetree name in upstream kernel source.

--
Changes in v2:
- Remove unneeded CONFIG_BOOTFILE

---
 configs/socfpga_cyclone5_defconfig       |  3 +++
 include/configs/socfpga_cyclone5_socdk.h | 32 --------------------------------
 2 files changed, 3 insertions(+), 32 deletions(-)
configs/socfpga_cyclone5_defconfig +3 -0
index 8b050b9..c8b8084 100644
@@ -4,6 +4,7 @@ CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_TARGET_SOCFPGA_CYCLONE5_SOCDK=y
 CONFIG_SPL_STACK_R_ADDR=0x00800000
 CONFIG_DEFAULT_DEVICE_TREE="socfpga_cyclone5_socdk"
+CONFIG_DEFAULT_FDT_FILE="socfpga_cyclone5_socdk.dtb"
 CONFIG_FIT=y
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
@@ -64,3 +65,5 @@ CONFIG_G_DNL_MANUFACTURER="altera"
 CONFIG_G_DNL_VENDOR_NUM=0x0525
 CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
 CONFIG_USE_TINY_PRINTF=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_TYPE=0xa2
include/configs/socfpga_cyclone5_socdk.h +0 -32
index 4100ef9..dfe4980 100644
@@ -16,13 +16,6 @@
 #define PHYS_SDRAM_1_SIZE		0x40000000	/* 1GiB on SoCDK */
 
 /* Booting Linux */
-#define CONFIG_BOOTFILE		"zImage"
-#define CONFIG_BOOTARGS		"console=ttyS0," __stringify(CONFIG_BAUDRATE)
-#ifdef CONFIG_SOCFPGA_VIRTUAL_TARGET
-#define CONFIG_BOOTCOMMAND	"run ramboot"
-#else
-#define CONFIG_BOOTCOMMAND	"run mmcload; run mmcboot"
-#endif
 #define CONFIG_LOADADDR		0x01000000
 #define CONFIG_SYS_LOAD_ADDR	CONFIG_LOADADDR
 
@@ -34,31 +27,6 @@
 
 #define CONFIG_ENV_IS_IN_MMC
 
-/* Extra Environment */
-#define CONFIG_EXTRA_ENV_SETTINGS \
-	"verify=n\0" \
-	"loadaddr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
-	"ramboot=setenv bootargs " CONFIG_BOOTARGS ";" \
-		"bootm ${loadaddr} - ${fdt_addr}\0" \
-	"bootimage=zImage\0" \
-	"fdt_addr=100\0" \
-	"fdtimage=socfpga.dtb\0" \
-	"bootm ${loadaddr} - ${fdt_addr}\0" \
-	"mmcroot=/dev/mmcblk0p2\0" \
-	"mmcboot=setenv bootargs " CONFIG_BOOTARGS \
-		" root=${mmcroot} rw rootwait;" \
-		"bootz ${loadaddr} - ${fdt_addr}\0" \
-	"mmcload=mmc rescan;" \
-		"load mmc 0:1 ${loadaddr} ${bootimage};" \
-		"load mmc 0:1 ${fdt_addr} ${fdtimage}\0" \
-	"qspiload=sf probe && mtdparts default && run ubiload\0" \
-	"qspiboot=setenv bootargs " CONFIG_BOOTARGS \
-		" ubi.mtd=1,64 root=ubi0:rootfs rw rootfstype=ubifs;"\
-		"bootz ${loadaddr} - ${fdt_addr}\0" \
-	"ubiload=ubi part UBI && ubifsmount ubi0 && " \
-		"ubifsload ${loadaddr} /boot/${bootimage} && " \
-		"ubifsload ${fdt_addr} /boot/${fdtimage}\0"
-
 /* The rest of the configuration is shared */
 #include <configs/socfpga_common.h>
 
Signature · 1 line
2.7.4
#5 lore raw

PATCH v5 5/8 arm: socfpga: DE1 use environment in common header

In reply to Dalon Westergreen

This removes the default environment from the de1 headers and instead uses the common environment provided in socfpga_common.h which now uses distro boot.

This board does not have a devicetree in the upstream kernel source so set devicetree to socfpga_cyclone5_de1_soc.dtb.

--
Changes in V2:
- Remove unneeded CONFIG_BOOTFILE
- set devicetree name to match socfpga_{fpga model}_{board model}.dts pattern

---
 configs/socfpga_de1_soc_defconfig |  1 +
 include/configs/socfpga_de1_soc.h | 20 --------------------
 2 files changed, 1 insertion(+), 20 deletions(-)
configs/socfpga_de1_soc_defconfig +1 -0
index 135dfac..211ea41 100644
@@ -5,6 +5,7 @@ CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_TARGET_SOCFPGA_TERASIC_DE1_SOC=y
 CONFIG_SPL_STACK_R_ADDR=0x00800000
 CONFIG_DEFAULT_DEVICE_TREE="socfpga_cyclone5_de1_soc"
+CONFIG_DEFAULT_FDT_FILE="socfpga_cyclone5_de1_soc.dtb"
 CONFIG_FIT=y
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
include/configs/socfpga_de1_soc.h +0 -20
index c6e8d81..014828b 100644
@@ -16,9 +16,6 @@
 #define PHYS_SDRAM_1_SIZE		0x40000000	/* 1GiB */
 
 /* Booting Linux */
-#define CONFIG_BOOTFILE		"fitImage"
-#define CONFIG_BOOTARGS		"console=ttyS0," __stringify(CONFIG_BAUDRATE)
-#define CONFIG_BOOTCOMMAND	"run mmcload; run mmcboot"
 #define CONFIG_LOADADDR		0x01000000
 #define CONFIG_SYS_LOAD_ADDR	CONFIG_LOADADDR
 
@@ -30,23 +27,6 @@
 
 #define CONFIG_ENV_IS_IN_MMC
 
-/* Extra Environment */
-#define CONFIG_EXTRA_ENV_SETTINGS \
-	"loadaddr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
-	"ramboot=setenv bootargs " CONFIG_BOOTARGS ";" \
-		"bootm ${loadaddr} - ${fdtaddr}\0" \
-	"bootimage=zImage\0" \
-	"fdtaddr=100\0" \
-	"fdtimage=socfpga.dtb\0" \
-	"bootm ${loadaddr} - ${fdtaddr}\0" \
-	"mmcroot=/dev/mmcblk0p2\0" \
-	"mmcboot=setenv bootargs " CONFIG_BOOTARGS \
-		" root=${mmcroot} rw rootwait;" \
-		"bootz ${loadaddr} - ${fdtaddr}\0" \
-	"mmcload=mmc rescan;" \
-		"load mmc 0:1 ${loadaddr} ${bootimage};" \
-		"load mmc 0:1 ${fdtaddr} ${fdtimage}\0" \
-
 /* The rest of the configuration is shared */
 #include <configs/socfpga_common.h>
 
Signature · 1 line
2.7.4
#6 lore raw

PATCH v5 6/8 arm: socfpga: SoCKit use environment in common header

In reply to Dalon Westergreen

This removes the default environment from the SoCKit headers and instead uses the common environment provided in socfpga_common.h which now uses distro boot.

Change default devicetree name to match devicetree name in upstream kernel source.

--
Changes in v2:
- Remove unneeded CONFIG_BOOTFILE

---
 configs/socfpga_sockit_defconfig |  1 +
 include/configs/socfpga_sockit.h | 28 ----------------------------
 2 files changed, 1 insertion(+), 28 deletions(-)
configs/socfpga_sockit_defconfig +1 -0
index d0c2bda..bf60783 100644
@@ -4,6 +4,7 @@ CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_TARGET_SOCFPGA_TERASIC_SOCKIT=y
 CONFIG_SPL_STACK_R_ADDR=0x00800000
 CONFIG_DEFAULT_DEVICE_TREE="socfpga_cyclone5_sockit"
+CONFIG_DEFAULT_FDT_FILE="socfpga_cyclone5_sockit.dtb"
 CONFIG_FIT=y
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
include/configs/socfpga_sockit.h +0 -28
index 326310b..c9fc5c9 100644
@@ -16,9 +16,6 @@
 #define PHYS_SDRAM_1_SIZE		0x40000000	/* 1GiB on SoCDK */
 
 /* Booting Linux */
-#define CONFIG_BOOTFILE		"fitImage"
-#define CONFIG_BOOTARGS		"console=ttyS0," __stringify(CONFIG_BAUDRATE)
-#define CONFIG_BOOTCOMMAND	"run mmcload; run mmcboot"
 #define CONFIG_LOADADDR		0x01000000
 #define CONFIG_SYS_LOAD_ADDR	CONFIG_LOADADDR
 
@@ -30,31 +27,6 @@
 
 #define CONFIG_ENV_IS_IN_MMC
 
-/* Extra Environment */
-#define CONFIG_EXTRA_ENV_SETTINGS \
-	"verify=n\0" \
-	"loadaddr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
-	"ramboot=setenv bootargs " CONFIG_BOOTARGS ";" \
-		"bootm ${loadaddr} - ${fdt_addr}\0" \
-	"bootimage=zImage\0" \
-	"fdt_addr=100\0" \
-	"fdtimage=socfpga.dtb\0" \
-	"bootm ${loadaddr} - ${fdt_addr}\0" \
-	"mmcroot=/dev/mmcblk0p2\0" \
-	"mmcboot=setenv bootargs " CONFIG_BOOTARGS \
-		" root=${mmcroot} rw rootwait;" \
-		"bootz ${loadaddr} - ${fdt_addr}\0" \
-	"mmcload=mmc rescan;" \
-		"load mmc 0:1 ${loadaddr} ${bootimage};" \
-		"load mmc 0:1 ${fdt_addr} ${fdtimage}\0" \
-	"qspiload=sf probe && mtdparts default && run ubiload\0" \
-	"qspiboot=setenv bootargs " CONFIG_BOOTARGS \
-		" ubi.mtd=1,64 root=ubi0:rootfs rw rootfstype=ubifs;"\
-		"bootz ${loadaddr} - ${fdt_addr}\0" \
-	"ubiload=ubi part UBI && ubifsmount ubi0 && " \
-		"ubifsload ${loadaddr} /boot/${bootimage} && " \
-		"ubifsload ${fdt_addr} /boot/${fdtimage}\0"
-
 /* The rest of the configuration is shared */
 #include <configs/socfpga_common.h>
 
Signature · 1 line
2.7.4
#7 lore raw

PATCH v5 7/8 arm: socfpga: Socrates use environment in common header

In reply to Dalon Westergreen

This removes the default environment from the socrates headers and instead uses the common environment provided in socfpga_common.h which now uses distro boot.

Change default devicetree name to match devicetree name in upstream kernel source.

--
Changes in v2:
- Remove unneeded CONFIG_BOOTFILE

---
 configs/socfpga_socrates_defconfig |  1 +
 include/configs/socfpga_socrates.h | 26 --------------------------
 2 files changed, 1 insertion(+), 26 deletions(-)
configs/socfpga_socrates_defconfig +1 -0
index e9276f9..4246ad6 100644
@@ -4,6 +4,7 @@ CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_TARGET_SOCFPGA_EBV_SOCRATES=y
 CONFIG_SPL_STACK_R_ADDR=0x00800000
 CONFIG_DEFAULT_DEVICE_TREE="socfpga_cyclone5_socrates"
+CONFIG_DEFAULT_FDT_FILE="socfpga_cyclone5_socrates.dtb"
 CONFIG_FIT=y
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
include/configs/socfpga_socrates.h +0 -26
index 90343b7..5dc9298 100644
@@ -16,9 +16,6 @@
 #define PHYS_SDRAM_1_SIZE		0x40000000	/* 1GiB on SoCrates */
 
 /* Booting Linux */
-#define CONFIG_BOOTFILE		"zImage"
-#define CONFIG_BOOTARGS		"console=ttyS0," __stringify(CONFIG_BAUDRATE)
-#define CONFIG_BOOTCOMMAND	"run mmcload; run mmcboot"
 #define CONFIG_LOADADDR		0x01000000
 #define CONFIG_SYS_LOAD_ADDR	CONFIG_LOADADDR
 
@@ -30,29 +27,6 @@
 
 #define CONFIG_ENV_IS_IN_MMC
 
-/* Extra Environment */
-#define CONFIG_EXTRA_ENV_SETTINGS \
-	"verify=n\0" \
-	"loadaddr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
-	"ramboot=setenv bootargs " CONFIG_BOOTARGS ";" \
-		"bootm ${loadaddr} - ${fdt_addr}\0" \
-	"bootimage=zImage\0" \
-	"fdt_addr=100\0" \
-	"fdtimage=socfpga.dtb\0" \
-	"bootm ${loadaddr} - ${fdt_addr}\0" \
-	"mmcroot=/dev/mmcblk0p2\0" \
-	"mmcboot=setenv bootargs " CONFIG_BOOTARGS \
-		" root=${mmcroot} rw rootwait;" \
-		"bootz ${loadaddr} - ${fdt_addr}\0" \
-	"mmcload=mmc rescan;" \
-		"load mmc 0:1 ${loadaddr} ${bootimage};" \
-		"load mmc 0:1 ${fdt_addr} ${fdtimage}\0" \
-	"qspiroot=/dev/mtdblock0\0" \
-	"qspirootfstype=jffs2\0" \
-	"qspiboot=setenv bootargs " CONFIG_BOOTARGS \
-		" root=${qspiroot} rw rootfstype=${qspirootfstype};"\
-		"bootm ${loadaddr} - ${fdt_addr}\0"
-
 /* The rest of the configuration is shared */
 #include <configs/socfpga_common.h>
 
Signature · 1 line
2.7.4
#8 lore raw

PATCH v5 8/8 arm: socfpga: sr1500 use environment in common header

In reply to Dalon Westergreen

This removes the default environment from the sr1500 header and instead uses the common environment provided in socfpga_common.h which now uses distro boot.

This board has no upstream devicetree in the kernel source, so set to socfpga_cyclone5_sr1500.dtb.

--
Changes in v2:
- Remove unneeded CONFIG_BOOTFILE
- set devicetree name to match socfpga_{fpga model}_{board model}.dts pattern

---
 configs/socfpga_sr1500_defconfig |  1 +
 include/configs/socfpga_sr1500.h | 28 ----------------------------
 2 files changed, 1 insertion(+), 28 deletions(-)
configs/socfpga_sr1500_defconfig +1 -0
index 981600b..ac1ed53 100644
@@ -4,6 +4,7 @@ CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_TARGET_SOCFPGA_SR1500=y
 CONFIG_SPL_STACK_R_ADDR=0x00800000
 CONFIG_DEFAULT_DEVICE_TREE="socfpga_cyclone5_sr1500"
+CONFIG_DEFAULT_FDT_FILE="socfpga_cyclone5_sr1500.dtb"
 CONFIG_FIT=y
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
include/configs/socfpga_sr1500.h +0 -28
index f67fafd..64e1595 100644
@@ -16,9 +16,6 @@
 #define PHYS_SDRAM_1_SIZE		0x40000000	/* 1GiB on SR1500 */
 
 /* Booting Linux */
-#define CONFIG_BOOTFILE		"uImage"
-#define CONFIG_BOOTARGS		"console=ttyS0," __stringify(CONFIG_BAUDRATE)
-#define CONFIG_BOOTCOMMAND	"run mmcload; run mmcboot"
 #define CONFIG_LOADADDR		0x01000000
 #define CONFIG_SYS_LOAD_ADDR	CONFIG_LOADADDR
 
@@ -28,31 +25,6 @@
 #define CONFIG_PHY_MARVELL
 #define PHY_ANEG_TIMEOUT	8000
 
-#define CONFIG_EXTRA_ENV_SETTINGS \
-	"verify=n\0" \
-	"loadaddr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
-	"ramboot=setenv bootargs " CONFIG_BOOTARGS ";" \
-		"bootm ${loadaddr} - ${fdt_addr}\0" \
-	"bootimage=zImage\0" \
-	"fdt_addr=100\0" \
-	"fdtimage=socfpga.dtb\0" \
-		"fsloadcmd=ext2load\0" \
-	"bootm ${loadaddr} - ${fdt_addr}\0" \
-	"mmcroot=/dev/mmcblk0p2\0" \
-	"mmcboot=setenv bootargs " CONFIG_BOOTARGS \
-		" root=${mmcroot} rw rootwait;" \
-		"bootz ${loadaddr} - ${fdt_addr}\0" \
-	"mmcload=mmc rescan;" \
-		"load mmc 0:1 ${loadaddr} ${bootimage};" \
-		"load mmc 0:1 ${fdt_addr} ${fdtimage}\0" \
-	"qspiload=sf probe && mtdparts default && run ubiload\0" \
-	"qspiboot=setenv bootargs " CONFIG_BOOTARGS \
-		" ubi.mtd=1,64 root=ubi0:rootfs rw rootfstype=ubifs;"\
-		"bootz ${loadaddr} - ${fdt_addr}\0" \
-	"ubiload=ubi part UBI && ubifsmount ubi0 && " \
-		"ubifsload ${loadaddr} /boot/${bootimage} && " \
-		"ubifsload ${fdt_addr} /boot/${fdtimage}\0"
-
 /* Environment */
 #define CONFIG_ENV_IS_IN_SPI_FLASH
 
Signature · 1 line
2.7.4
Applied
#9 lore raw

v5 cover arm: socfpga: Move to using distro boot

In reply to Dalon Westergreen
Quoted 7 lines · Dalon Westergreen

This series adds support to the common socfpga header for distro boot and moves the DE0/1, Socrates, C5/A5 SoCDK, and SoCKIT kits to use the common environment.

Where available, the default devicetree is set to the devicetree for the board available in the kernel source. If none is available in the kernel source, the devicetree is set to the name previously used in the board header file.

Applied all, thanks!

Signature · 2 lines
Best regards,
Marek Vasut