Skip to contentSkip to conversation

Distroboot support for DE0-nano-SoC board

PATCH New Frank Kunz 4 participants 10 messages Jan 28, 2017

lore
Share & tools
lore

Frank Kunz

author
#0 lore raw

cover Distroboot support for DE0-nano-SoC board

This adds common distribution boot environment variables for DE0-nanos-SoC board. The current boot procedure is extended to run
the distribution boot as fallback.
The SOC ROM loader scans for the SPL in the special partition 0xa2 (partition mode) if this is not found it scans the MMC card sector 0 (raw mode), for up to four valid SPLs. When a partition table (MBR, GPT) is used with raw mode, the first SPL must not be written to the MMC and the ROM loader uses the second SPL.

Frank Kunz (3):
socfpga: Enable abort for DE-nano-SoC SPL uboot load from MMC
socfpga: Add distoboot support for DE0-nano-SoC
socfpga: Adapt environment storage for DE0-nano-SoC

 include/configs/socfpga_de0_nano_soc.h | 32 +++++++++++++++++++++++++++++++-
 1 file changed, 31 insertions(+), 1 deletion(-)

--
2.11.0

author
#1 lore raw

PATCH 1/3 socfpga: Enable abort for DE-nano-SoC SPL uboot load from MMC

This allows the SPL to scan the MMC for a valid uboot image on a second sector location defined by CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR when the default location "CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR + first partition offset" does not contain a valid uboot image.

---
:100644 100644 6b9546e8f7... f7e2068782... M include/configs/socfpga_de0_nano_soc.h

 include/configs/socfpga_de0_nano_soc.h | 2 ++
 1 file changed, 2 insertions(+)
include/configs/socfpga_de0_nano_soc.h +2 -0
index 6b9546e8f7..f7e2068782 100644
@@ -14,6 +14,8 @@
 #define CONFIG_FAT_WRITE
 #define CONFIG_HW_WATCHDOG
 
+#define CONFIG_SPL_ABORT_ON_RAW_IMAGE
+
 /* Memory configurations */
 #define PHYS_SDRAM_1_SIZE		0x40000000	/* 1GiB */
 
Signature · 1 line
2.11.0
author
#2 lore raw

PATCH 2/3 socfpga: Add distoboot support for DE0-nano-SoC

In reply to Frank Kunz

This enables common distroboot support as fall back when the "mmcboot" command fails to load OS image. In fall back case MMC, PXE and DHCP boot are probed.

---
:100644 100644 f7e2068782... d58240e751... M include/configs/socfpga_de0_nano_soc.h

 include/configs/socfpga_de0_nano_soc.h | 26 +++++++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)
include/configs/socfpga_de0_nano_soc.h +25 -1
index f7e2068782..d58240e751 100644
@@ -22,7 +22,7 @@
 /* Booting Linux */
 #define CONFIG_BOOTFILE		"fitImage"
 #define CONFIG_BOOTARGS		"console=ttyS0," __stringify(CONFIG_BAUDRATE)
-#define CONFIG_BOOTCOMMAND	"run mmcload; run mmcboot"
+#define CONFIG_BOOTCOMMAND	"run mmcload; run mmcboot; run distro_bootcmd"
 #define CONFIG_LOADADDR		0x01000000
 #define CONFIG_SYS_LOAD_ADDR	CONFIG_LOADADDR
 
@@ -35,6 +35,22 @@
 #define CONFIG_ENV_IS_IN_MMC
 
 /* 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
+
+#define BOOT_TARGET_DEVICES(func) \
+	func(MMC, mmc, 0) \
+	BOOT_TARGET_DEVICES_PXE(func) \
+	func(DHCP, dhcp, na)
+
+#include <config_distro_bootcmd.h>
+
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"loadaddr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
 	"ramboot=setenv bootargs " CONFIG_BOOTARGS ";" \
@@ -50,6 +66,14 @@
 	"mmcload=mmc rescan;" \
 		"load mmc 0:1 ${loadaddr} ${bootimage};" \
 		"load mmc 0:1 ${fdt_addr} ${fdtimage}\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
 
 /* The rest of the configuration is shared */
 #include <configs/socfpga_common.h>
Signature · 1 line
2.11.0
author
#3 lore raw

PATCH 3/3 socfpga: Adapt environment storage for DE0-nano-SoC

In reply to Frank Kunz

Increase environment size and locate storage location on MMC after GPT.

---
:100644 100644 d58240e751... 5d0542bd8f... M include/configs/socfpga_de0_nano_soc.h

 include/configs/socfpga_de0_nano_soc.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
include/configs/socfpga_de0_nano_soc.h +5 -1
index d58240e751..5d0542bd8f 100644
@@ -13,9 +13,13 @@
 #define CONFIG_DOS_PARTITION
 #define CONFIG_FAT_WRITE
 #define CONFIG_HW_WATCHDOG
-
 #define CONFIG_SPL_ABORT_ON_RAW_IMAGE
 
+/* U-Boot env settings */
+#define CONFIG_ENV_SIZE (8*1024)
+#define CONFIG_SYS_MMC_ENV_DEV 0	/* device 0 */
+#define CONFIG_ENV_OFFSET (34*512)	/* just after the GPT */
+
 /* Memory configurations */
 #define PHYS_SDRAM_1_SIZE		0x40000000	/* 1GiB */
 
Signature · 1 line
2.11.0
#4 lore raw

cover Distroboot support for DE0-nano-SoC board

In reply to Frank Kunz
Quoted 8 lines · Frank Kunz

This adds common distribution boot environment variables for DE0-nanos-SoC board. The current boot procedure is extended to run
the distribution boot as fallback.
The SOC ROM loader scans for the SPL in the special partition 0xa2 (partition mode) if this is not found it scans the MMC card sector 0 (raw mode), for up to four valid SPLs. When a partition table (MBR, GPT) is used with raw mode, the first SPL must not be written to the MMC and the ROM loader uses the second SPL.

Quoted 7 lines

Frank Kunz (3):
socfpga: Enable abort for DE-nano-SoC SPL uboot load from MMC
socfpga: Add distoboot support for DE0-nano-SoC
socfpga: Adapt environment storage for DE0-nano-SoC

 include/configs/socfpga_de0_nano_soc.h | 32 +++++++++++++++++++++++++++++++-
 1 file changed, 31 insertions(+), 1 deletion(-)

CCing Dalon, he sent a series
[PATCH v7 0/7] arm: socfpga: update default u-boot environment

Can you two coordinate the efforts ? I think it'd make sense to wait for his series to reach v8 and then rebase on top of it. I would also like Dalon to do a v8 which just extracts the common env, so we can merge that first and then look into the more intrusive bits.

Signature · 2 lines
Best regards,
Marek Vasut
#5 lore raw

cover Distroboot support for DE0-nano-SoC board

Quoted 21 lines · Marek Vasut
Quoted 11 lines · Frank Kunz

This adds common distribution boot environment variables for DE0-nanos-SoC board. The current boot procedure is extended to run the distribution boot as fallback.
The SOC ROM loader scans for the SPL in the special partition 0xa2 (partition mode)
if this is not found it scans the MMC card sector 0 (raw mode), for up to four valid SPLs. When a partition table (MBR, GPT) is used with raw mode, the first SPL must not be written to the MMC and the ROM loader uses the second SPL.

Quoted 8 lines

Frank Kunz (3):
? socfpga: Enable abort for DE-nano-SoC SPL uboot load from MMC ? socfpga: Add distoboot support for DE0-nano-SoC
? socfpga: Adapt environment storage for DE0-nano-SoC

?include/configs/socfpga_de0_nano_soc.h | 32
+++++++++++++++++++++++++++++++-
?1 file changed, 31 insertions(+), 1 deletion(-)

Quoted 8 lines

CCing Dalon, he sent a series
[PATCH v7 0/7] arm: socfpga: update default u-boot environment

Can you two coordinate the efforts ? I think it'd make sense to wait for his series to reach v8 and then rebase on top of it. I would also like Dalon to do a v8 which just extracts the common env, so we can merge that first and then look into the more intrusive bits.

Cool, i can submit a v8 which just moves the env to a common location. I have reservations about the use use of raw mode while an MBR is present. ?It is definitely not an intended use, although it does work. If you like i can just merge the two patch sets into v8?

thanks,
dalon

author
#6 lore raw

cover Distroboot support for DE0-nano-SoC board

Am 28.01.2017 um 22:25 schrieb Westergreen, Dalon:

Quoted 30 lines · Marek Vasut
Quoted 21 lines · Frank Kunz
Quoted 11 lines

This adds common distribution boot environment variables for DE0-nanos-SoC board. The current boot procedure is extended to run the distribution boot as fallback.
The SOC ROM loader scans for the SPL in the special partition 0xa2 (partition mode)
if this is not found it scans the MMC card sector 0 (raw mode), for up to four valid SPLs. When a partition table (MBR, GPT) is used with raw mode, the first SPL must not be written to the MMC and the ROM loader uses the second SPL.

Quoted 8 lines

Frank Kunz (3):
socfpga: Enable abort for DE-nano-SoC SPL uboot load from MMC
socfpga: Add distoboot support for DE0-nano-SoC
socfpga: Adapt environment storage for DE0-nano-SoC

 include/configs/socfpga_de0_nano_soc.h | 32
+++++++++++++++++++++++++++++++-
 1 file changed, 31 insertions(+), 1 deletion(-)
Quoted 8 lines

CCing Dalon, he sent a series
[PATCH v7 0/7] arm: socfpga: update default u-boot environment

Can you two coordinate the efforts ? I think it'd make sense to wait for his series to reach v8 and then rebase on top of it. I would also like Dalon to do a v8 which just extracts the common env, so we can merge that first and then look into the more intrusive bits.

Quoted 5 lines

Cool, i can submit a v8 which just moves the env to a common location. I have reservations about the use use of raw mode while an MBR is present. It is definitely not an intended use, although it does work. If you like i can just merge the two patch sets into v8?

I'm fine with that. Looking forward to v8 then.

Br,
Frank

#7 lore raw

cover Distroboot support for DE0-nano-SoC board

In reply to Westergreen
Quoted 30 lines · Dalon
Quoted 21 lines · Marek Vasut
Quoted 11 lines · Frank Kunz

This adds common distribution boot environment variables for DE0-nanos-SoC board. The current boot procedure is extended to run the distribution boot as fallback.
The SOC ROM loader scans for the SPL in the special partition 0xa2 (partition mode)
if this is not found it scans the MMC card sector 0 (raw mode), for up to four valid SPLs. When a partition table (MBR, GPT) is used with raw mode, the first SPL must not be written to the MMC and the ROM loader uses the second SPL.

Quoted 8 lines

Frank Kunz (3):
socfpga: Enable abort for DE-nano-SoC SPL uboot load from MMC
socfpga: Add distoboot support for DE0-nano-SoC
socfpga: Adapt environment storage for DE0-nano-SoC

 include/configs/socfpga_de0_nano_soc.h | 32
+++++++++++++++++++++++++++++++-
 1 file changed, 31 insertions(+), 1 deletion(-)
Quoted 8 lines

CCing Dalon, he sent a series
[PATCH v7 0/7] arm: socfpga: update default u-boot environment

Can you two coordinate the efforts ? I think it'd make sense to wait for his series to reach v8 and then rebase on top of it. I would also like Dalon to do a v8 which just extracts the common env, so we can merge that first and then look into the more intrusive bits.

Quoted 4 lines

Cool, i can submit a v8 which just moves the env to a common location. I have reservations about the use use of raw mode while an MBR is present. It is definitely not an intended use, although it does work. If you like i can just merge the two patch sets into v8?

No, please just keep the stuff separate, so we can get something in and then move on to the next thing.

Signature · 2 lines
Best regards,
Marek Vasut
#8 lore raw

cover Distroboot support for DE0-nano-SoC board

Quoted 36 lines · Marek Vasut
Quoted 35 lines · Dalon
Quoted 33 lines · Marek Vasut
Quoted 14 lines · Frank Kunz

This adds common distribution boot environment variables for DE0-nanos-SoC board. The current boot procedure is extended to run the distribution boot as fallback.
The SOC ROM loader scans for the SPL in the special partition 0xa2 (partition mode)
if this is not found it scans the MMC card sector 0 (raw mode), for up to
four valid SPLs. When a partition table (MBR, GPT) is used with raw mode,
the first SPL must not be written to the MMC and the ROM loader uses the second SPL.

Quoted 8 lines

Frank Kunz (3):
? socfpga: Enable abort for DE-nano-SoC SPL uboot load from MMC ? socfpga: Add distoboot support for DE0-nano-SoC
? socfpga: Adapt environment storage for DE0-nano-SoC

?include/configs/socfpga_de0_nano_soc.h | 32
+++++++++++++++++++++++++++++++-
?1 file changed, 31 insertions(+), 1 deletion(-)

CCing Dalon, he sent a series
[PATCH v7 0/7] arm: socfpga: update default u-boot environment

Can you two coordinate the efforts ? I think it'd make sense to wait for his series to reach v8 and then rebase on top of it. I would also like Dalon to do a v8 which just extracts the common env, so we can merge that first and then look into the more intrusive bits.

Quoted 8 lines
Quoted 4 lines

Cool, i can submit a v8 which just moves the env to a common location. I have reservations about the use use of raw mode while an MBR is present.??It is definitely not an intended use, although it does work. If you like i can just merge the two patch sets into v8?

No, please just keep the stuff separate, so we can get something in and then move on to the next thing.

Will do, it should be identical to the v6 patches. ?I also have tested a patch to support searching for the a2 partition to load the uboot image which i will send afterwards

#9 lore raw

cover Distroboot support for DE0-nano-SoC board

Quoted 42 lines · Dalon Westergreen
Quoted 41 lines · Marek Vasut
Quoted 39 lines · Dalon
Quoted 25 lines · Marek Vasut
Quoted 14 lines · Frank Kunz

This adds common distribution boot environment variables for DE0-nanos-SoC board. The current boot procedure is extended to run the distribution boot as fallback.
The SOC ROM loader scans for the SPL in the special partition 0xa2 (partition mode)
if this is not found it scans the MMC card sector 0 (raw mode), for up to
four valid SPLs. When a partition table (MBR, GPT) is used with raw mode,
the first SPL must not be written to the MMC and the ROM loader uses the second SPL.

Quoted 8 lines

Frank Kunz (3):
socfpga: Enable abort for DE-nano-SoC SPL uboot load from MMC
socfpga: Add distoboot support for DE0-nano-SoC
socfpga: Adapt environment storage for DE0-nano-SoC

 include/configs/socfpga_de0_nano_soc.h | 32
+++++++++++++++++++++++++++++++-
 1 file changed, 31 insertions(+), 1 deletion(-)
Quoted 8 lines

CCing Dalon, he sent a series
[PATCH v7 0/7] arm: socfpga: update default u-boot environment

Can you two coordinate the efforts ? I think it'd make sense to wait for his series to reach v8 and then rebase on top of it. I would also like Dalon to do a v8 which just extracts the common env, so we can merge that first and then look into the more intrusive bits.

Cool, i can submit a v8 which just moves the env to a common location. I have reservations about the use use of raw mode while an MBR is present. It is definitely not an intended use, although it does work. If you like i can just merge the two patch sets into v8?

Quoted 7 lines
Quoted 3 lines

No, please just keep the stuff separate, so we can get something in and then move on to the next thing.

Will do, it should be identical to the v6 patches. I also have tested a patch to support searching for the a2 partition to load the uboot image which i will send afterwards

Cool, thanks! btw we just missed the MW (closes on today), but I'll try to add at least the cleanup, which should be harmless.

Signature · 2 lines
Best regards,
Marek Vasut