From: Josua Mayer Date: Wed, 25 Oct 2023 08:22:53 +0000 (+0200) Subject: arm: mvebu: allow additional 4096 offset for bootable mmc image X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=a5539f976b9d5317ba893c6ba63afd9424498eeb;p=u-boot.git arm: mvebu: allow additional 4096 offset for bootable mmc image Disarm the error message forcing u-boot/spl image to be located at sector 0 on eMMC data-partition and microSD. Offset 0 makes sense on eMMC boot partitions only, data partition must use 4096 to avoid conflicting with MBR. Valid offsets when booting from microSD, reported by boot-rom v1.73: BootROM: Bad header at offset 00000200 BootROM: Bad header at offset 00004400 BootROM: Bad header at offset 00200000 BootROM: Bad header at offset 00400000 BootROM: Bad header at offset 00600000 BootROM: Bad header at offset 00800000 BootROM: Bad header at offset 00A00000 BootROM: Bad header at offset 00C00000 BootROM: Bad header at offset 00E00000 BootROM: Bad header at offset 01000000 BootROM: Bad header at offset 01200000 BootROM: Bad header at offset 01400000 BootROM: Bad header at offset 01600000 BootROM: Bad header at offset 01800000 BootROM: Bad header at offset 01A00000 BootROM: Bad header at offset 01C00000 BootROM: Bad header at offset 01E00000 BootROM: Bad header at offset 02000000 BootROM: Bad header at offset 02200000 BootROM: Bad header at offset 02400000 BootROM: Bad header at offset 02600000 BootROM: Bad header at offset 02800000 BootROM: Bad header at offset 02A00000 BootROM: Bad header at offset 02C00000 BootROM: Bad header at offset 02E00000 Valid offsets when booting from eMMC: BootROM: Bad header at offset 00000000 BootROM: Bad header at offset 00200000 Switching BootPartitions. BootROM: Bad header at offset 00000000 BootROM: Bad header at offset 00200000 Fixes: 2226ca17348 ("arm: mvebu: Load U-Boot proper binary in SPL code based on kwbimage header") Signed-off-by: Josua Mayer Reviewed-by: Stefan Roese --- diff --git a/arch/arm/mach-mvebu/spl.c b/arch/arm/mach-mvebu/spl.c index eaaa68a856..79f8877745 100644 --- a/arch/arm/mach-mvebu/spl.c +++ b/arch/arm/mach-mvebu/spl.c @@ -71,8 +71,9 @@ #error CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR must be set to 0 #endif #if !defined(CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_DATA_PART_OFFSET) || \ - CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_DATA_PART_OFFSET != 0 -#error CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_DATA_PART_OFFSET must be set to 0 + (CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_DATA_PART_OFFSET != 0 && \ + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_DATA_PART_OFFSET != 4096) +#error CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_DATA_PART_OFFSET must be set to either 0 or 4096 #endif #endif