configs: socfpga_de10_standard: Fix raw partition booting from SDMMC
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
@@ -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
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.
Signed-off-by Nimesh Acharya <[email protected]>--- configs/socfpga_de10_standard_defconfig | 5 +++++ 1 file changed, 5 insertions(+)configs/socfpga_de10_standard_defconfig +0
-0
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.
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
Signed-off-by Nimesh Acharya <[email protected]>--- configs/socfpga_de10_standard_defconfig | 5 +++++ 1 file changed, 5 insertions(+)(quoted diff) +0
-0b/configs/socfpga_de10_standard_defconfig
configs/socfpga_de10_standard_defconfig CONFIG_USB_GADGET_DWC2_OTG=y · line 77
Quoted 12 lines
index
04f9d6c8494..f170778c322100644configs/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=0x200What does get configured in the .config during OE build without these options ?
For example
SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_TYPEis already set to0xa2inarch/arm/mach-socfpga/Kconfig, so that shouldn't be part of this patch.
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_FATis not set
#CONFIG_SPL_LOAD_FITis not setCONFIG_SPL_RAW_IMAGE_SUPPORT=yCONFIG_SPL_SYS_MMCSD_RAW_MODE=yCONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
#CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITIONis not set #CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPEis not setCONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x200CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_DATA_PART_OFFSET=0x0#CONFIG_SPL_FS_EXT4is not setCONFIG_SYS_MMCSD_FS_BOOT_PARTITION=1
Quoted 2 lines
So, me adding
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_TYPE=0xa2again 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
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_FATis not set
#CONFIG_SPL_LOAD_FITis not setCONFIG_SPL_RAW_IMAGE_SUPPORT=yCONFIG_SPL_SYS_MMCSD_RAW_MODE=yCONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
#CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITIONis not set #CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPEis not setCONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x200CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_DATA_PART_OFFSET=0x0#CONFIG_SPL_FS_EXT4is not setCONFIG_SYS_MMCSD_FS_BOOT_PARTITION=1Quoted 1 line
So, me adding
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_TYPE=0xa2again 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=ythe 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_TYPEis in the right place in the defconfig, not at the end.Both,
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE=yandCONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_DATA_PART_OFFSET=0x200are to be added.Both of these values are not visibly set in configs/socfpga_de10_standard_defconfig nor
arch/arm/mach-socfpga/Kconfigin the main branch. The meta-intel-fpga layer in Yocto does not set these either, howeverCONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_DATA_PART_OFFSET=0x0seems 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.
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_FATis not set
#CONFIG_SPL_LOAD_FITis not setCONFIG_SPL_RAW_IMAGE_SUPPORT=yCONFIG_SPL_SYS_MMCSD_RAW_MODE=yCONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
#CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITIONis not set #CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPEis not setCONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x200CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_DATA_PART_OFFSET=0x0#CONFIG_SPL_FS_EXT4is not setCONFIG_SYS_MMCSD_FS_BOOT_PARTITION=1Quoted 1 line
So, me adding
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_TYPE=0xa2againis
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=ythe 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_TYPEis in the right place in the defconfig, not at the end.Both,
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE=yandCONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_DATA_PART_OFFSET=0x200are to be added.
OK
Quoted 8 lines
Both of these values are not visibly set in configs/socfpga_de10_standard_defconfig
norarch/arm/mach-socfpga/Kconfigin the main branch. The meta-intel-fpga layer in Yocto does not set these either, howeverCONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_DATA_PART_OFFSET=0x0seems 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 !