Skip to contentSkip to conversation

configs: socfpga_de10_standard: Fix raw partition booting from SDMMC

PATCH Superseded Nimesh Acharya 2 participants 6 messages Oct 19 – Oct 21 1 message not in the archive

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 configs: socfpga_de10_standard: Fix raw partition booting from SDMMC

When using the default meta-intel-fpga configuration in Yocto 6.0 (Wrynose) for the Terasic DE10-Standard, SPL fails to load U-Boot from the raw a2 partition on the SDMMC device.

This change configures SPL to locate the raw U-Boot image using the partition type and data offset, rather than relying on the default offset relative to the beginning of the SD card.

---
 configs/socfpga_de10_standard_defconfig | 5 +++++
 1 file changed, 5 insertions(+)
configs/socfpga_de10_standard_defconfig +5 -0
index 04f9d6c8494..f170778c322 100644
@@ -70,3 +70,8 @@ CONFIG_USB_GADGET_DWC2_OTG=y
 CONFIG_USB_GADGET_DOWNLOAD=y
 # CONFIG_SPL_WDT is not set
 CONFIG_SYS_TIMER_COUNTS_DOWN=y
+
+# SPL Fails to load UBOOT without these!
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_TYPE=0xa2
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_DATA_PART_OFFSET=0x200
Signature · 1 line
2.56.0
#1 lore raw
Quoted 18 lines · Nimesh Acharya

When using the default meta-intel-fpga configuration in Yocto 6.0 (Wrynose) for the Terasic DE10-Standard, SPL fails to load U-Boot from the raw a2 partition on the SDMMC device.

This change configures SPL to locate the raw U-Boot image using the partition type and data offset, rather than relying on the default offset relative to the beginning of the SD card.

---
  configs/socfpga_de10_standard_defconfig | 5 +++++
  1 file changed, 5 insertions(+)
configs/socfpga_de10_standard_defconfig +0 -0
index 04f9d6c8494..f170778c322 100644

configs/socfpga_de10_standard_defconfig CONFIG_USB_GADGET_DWC2_OTG=y · line 77

Quoted 8 lines
configs/socfpga_de10_standard_defconfig +5 -0
@@ -70,3 +70,8 @@ CONFIG_USB_GADGET_DWC2_OTG=y
  CONFIG_USB_GADGET_DOWNLOAD=y
  # CONFIG_SPL_WDT is not set
  CONFIG_SYS_TIMER_COUNTS_DOWN=y
+
+# SPL Fails to load UBOOT without these!
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_TYPE=0xa2
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_DATA_PART_OFFSET=0x200

What does get configured in the .config during OE build without these options ?

For example SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_TYPE is already set to 0xa2 in arch/arm/mach-socfpga/Kconfig , so that shouldn't be part of this patch.

#2 lore raw

Thanks for bringing that up. In fact, on running grep -E 'SPL_FS_LOAD_PAYLOAD_NAME|MMCSD_FS_BOOT_PARTITION|MMCSD_RAW_MODE|SPL_FS_FAT|SPL_FS_EXT4|SPL_LOAD_FIT|SPL_RAW_IMAGE' $B/*/.config

I get this output for the default config:

CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_TYPE=0xa2
# CONFIG_SPL_FS_FAT is not set
# CONFIG_SPL_LOAD_FIT is not set CONFIG_SPL_RAW_IMAGE_SUPPORT=y CONFIG_SPL_SYS_MMCSD_RAW_MODE=y CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
# CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION is not set # CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE is not set CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x200 CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_DATA_PART_OFFSET=0x0 # CONFIG_SPL_FS_EXT4 is not set CONFIG_SYS_MMCSD_FS_BOOT_PARTITION=1

So, me adding CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_TYPE=0xa2 again is indeed redundant. I'll fix this soon.

Quoted 36 lines · Marek Vasut,
Quoted 8 lines · Nimesh Acharya

When using the default meta-intel-fpga configuration in Yocto 6.0 (Wrynose) for the Terasic DE10-Standard, SPL fails to load U-Boot from the raw a2 partition on the SDMMC device.

This change configures SPL to locate the raw U-Boot image using the partition type and data offset, rather than relying on the default offset relative to the beginning of the SD card.

Review

Quoted 6 lines
---
  configs/socfpga_de10_standard_defconfig | 5 +++++
  1 file changed, 5 insertions(+)
(quoted diff) +0 -0

b/configs/socfpga_de10_standard_defconfig

configs/socfpga_de10_standard_defconfig CONFIG_USB_GADGET_DWC2_OTG=y · line 77

Quoted 12 lines

index 04f9d6c8494..f170778c322 100644

configs/socfpga_de10_standard_defconfig +5 -0
@@ -70,3 +70,8 @@ CONFIG_USB_GADGET_DWC2_OTG=y
  CONFIG_USB_GADGET_DOWNLOAD=y
  # CONFIG_SPL_WDT is not set
  CONFIG_SYS_TIMER_COUNTS_DOWN=y
+
+# SPL Fails to load UBOOT without these!
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_TYPE=0xa2
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_DATA_PART_OFFSET=0x200

What does get configured in the .config during OE build without these options ?

For example SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_TYPE is already set to 0xa2 in arch/arm/mach-socfpga/Kconfig , so that shouldn't be part of this patch.

#3 lore raw
Quoted 19 lines · Nimesh Acharya

Thanks for bringing that up. In fact, on running grep -E 'SPL_FS_LOAD_PAYLOAD_NAME|MMCSD_FS_BOOT_PARTITION|MMCSD_RAW_MODE|SPL_FS_FAT|SPL_FS_EXT4|SPL_LOAD_FIT|SPL_RAW_IMAGE' $B/*/.config

I get this output for the default config:

CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_TYPE=0xa2
# CONFIG_SPL_FS_FAT is not set
# CONFIG_SPL_LOAD_FIT is not set CONFIG_SPL_RAW_IMAGE_SUPPORT=y CONFIG_SPL_SYS_MMCSD_RAW_MODE=y CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
# CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION is not set # CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE is not set CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x200 CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_DATA_PART_OFFSET=0x0 # CONFIG_SPL_FS_EXT4 is not set CONFIG_SYS_MMCSD_FS_BOOT_PARTITION=1

Quoted 2 lines

So, me adding CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_TYPE=0xa2 again is indeed redundant. I'll fix this soon.

Please stop top-posting.

Is CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE=y the only option you have to add ?

In any case, please do a V2 and make sure the CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE is in the right place in the defconfig, not at the end.

A message that is not in the archive (sent off-list or not yet received): CAMb=oEYbdBJbQ-sjZ5q5YDXSjgH3j5PdM11smGXxqgGw-e7QQw@mail.gmail.com

#5 lore raw
Quoted 47 lines · Nimesh Acharya
Quoted 24 lines · Marek Vasut
Quoted 2 lines · Nimesh Acharya

Thanks for bringing that up. In fact, on running grep -E

'SPL_FS_LOAD_PAYLOAD_NAME|MMCSD_FS_BOOT_PARTITION|MMCSD_RAW_MODE|SPL_FS_FAT|SPL_FS_EXT4|SPL_LOAD_FIT|SPL_RAW_IMAGE'

Quoted 17 lines

$B/*/.config

I get this output for the default config:

CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_TYPE=0xa2
# CONFIG_SPL_FS_FAT is not set
# CONFIG_SPL_LOAD_FIT is not set CONFIG_SPL_RAW_IMAGE_SUPPORT=y CONFIG_SPL_SYS_MMCSD_RAW_MODE=y CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
# CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION is not set # CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE is not set CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x200 CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_DATA_PART_OFFSET=0x0 # CONFIG_SPL_FS_EXT4 is not set CONFIG_SYS_MMCSD_FS_BOOT_PARTITION=1

Quoted 1 line

So, me adding CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_TYPE=0xa2

again is

Quoted 1 line

indeed redundant. I'll fix this soon.

Quoted 9 lines

Please stop top-posting.

Is CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE=y the only option you have to add ?

In any case, please do a V2 and make sure the CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE is in the right place in the defconfig, not at the end.

Both, CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE=y and CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_DATA_PART_OFFSET=0x200 are to be added.

Both of these values are not visibly set in configs/socfpga_de10_standard_defconfig nor arch/arm/mach-socfpga/Kconfig in the main branch. The meta-intel-fpga layer in Yocto does not set these either, however CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_DATA_PART_OFFSET=0x0 seems to be set by default (as seen from the .config) which makes the default OE build non-bootable.

Quoted 5 lines

The requested change is required to have a bootable system, and has been verified on the board.

Sorry for top-posting and sending V2 too soon.

Sorry the mail didn't get CC'd to the rest.

#6 lore raw
In reply to a message not in the archive
Quoted 31 lines · Nimesh Acharya
Quoted 29 lines · Marek Vasut
Quoted 2 lines · Nimesh Acharya

Thanks for bringing that up. In fact, on running grep -E

'SPL_FS_LOAD_PAYLOAD_NAME|MMCSD_FS_BOOT_PARTITION|MMCSD_RAW_MODE|SPL_FS_FAT|SPL_FS_EXT4|SPL_LOAD_FIT|SPL_RAW_IMAGE'

Quoted 17 lines

$B/*/.config

I get this output for the default config:

CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_TYPE=0xa2
# CONFIG_SPL_FS_FAT is not set
# CONFIG_SPL_LOAD_FIT is not set CONFIG_SPL_RAW_IMAGE_SUPPORT=y CONFIG_SPL_SYS_MMCSD_RAW_MODE=y CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
# CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION is not set # CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE is not set CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x200 CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_DATA_PART_OFFSET=0x0 # CONFIG_SPL_FS_EXT4 is not set CONFIG_SYS_MMCSD_FS_BOOT_PARTITION=1

Quoted 1 line

So, me adding CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_TYPE=0xa2 again

is

Quoted 1 line

indeed redundant. I'll fix this soon.

Please stop top-posting.

Is CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE=y the only option you have to add ?

Quoted 7 lines
Quoted 4 lines

In any case, please do a V2 and make sure the CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE is in the right place in the defconfig, not at the end.

Both, CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE=y and CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_DATA_PART_OFFSET=0x200 are to be added.

OK

Quoted 8 lines

Both of these values are not visibly set in configs/socfpga_de10_standard_defconfig
nor arch/arm/mach-socfpga/Kconfig in the main branch. The meta-intel-fpga layer in Yocto does not set these either, however CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_DATA_PART_OFFSET=0x0 seems to be set by default (as seen from the .config) which makes the default OE build non-bootable.

Quoted 4 lines

The requested change is required to have a bootable system, and has been verified on the board.

Sorry for top-posting and sending V2 too soon.

Please send a V3, thanks !