From 73d5a68fec9e68b2278d83625d6f8bbfcb33e2d5 Mon Sep 17 00:00:00 2001 From: Patrick Delaunay Date: Mon, 16 Jun 2025 13:27:47 +0200 Subject: [PATCH 01/16] lib/uuid.c: restore support of system partition type for ESP Add support of optional shortname for parameter 'type' of gpt command (limited by UUID_STR_LEN) and a separate 'description' for UID format "%pUs" used in 'part list' output. When 'description' is absent in list_guid[], the optional shortname is used as fallback. Many partition types for EFI have no shortcut yet, but only description as they are only used to display information. This patch also restores the "system" as short name for EFI System Partition (ESP). Fixes: d54e1004b8b1 ("lib/uuid.c: use unique name for PARTITION_SYSTEM_GUID") Tested-by: Patrice Chotard Signed-off-by: Patrick Delaunay --- lib/uuid.c | 162 ++++++++++++++++++++++++-------------------- test/common/print.c | 3 +- 2 files changed, 90 insertions(+), 75 deletions(-) diff --git a/lib/uuid.c b/lib/uuid.c index 6abbcf27b1f..a1c88b9a622 100644 --- a/lib/uuid.c +++ b/lib/uuid.c @@ -62,184 +62,197 @@ int uuid_str_valid(const char *uuid) return 1; } +/* + * Array of string (short and long) for known GUID of GPT partition type + * at least one string must be present, @type or @description + * + * @type : short name for the parameter 'type' of gpt command (max size UUID_STR_LEN = 36, + * no space), also used as fallback description when the next field is absent + * @description : long description associated to type GUID, used for %pUs + * @guid : known type GUID value + */ static const struct { - const char *string; + const char *type; + const char *description; efi_guid_t guid; } list_guid[] = { #ifndef USE_HOSTCC -#if defined(CONFIG_PARTITION_TYPE_GUID) || defined(CONFIG_CMD_EFIDEBUG) || \ - defined(CONFIG_EFI) - {"EFI System Partition", PARTITION_SYSTEM_GUID}, -#endif -#ifdef CONFIG_PARTITION_TYPE_GUID - {"mbr", LEGACY_MBR_PARTITION_GUID}, - {"msft", PARTITION_MSFT_RESERVED_GUID}, - {"data", PARTITION_BASIC_DATA_GUID}, - {"linux", PARTITION_LINUX_FILE_SYSTEM_DATA_GUID}, - {"raid", PARTITION_LINUX_RAID_GUID}, - {"swap", PARTITION_LINUX_SWAP_GUID}, - {"lvm", PARTITION_LINUX_LVM_GUID}, - {"u-boot-env", PARTITION_U_BOOT_ENVIRONMENT}, - {"cros-kern", PARTITION_CROS_KERNEL}, - {"cros-root", PARTITION_CROS_ROOT}, - {"cros-fw", PARTITION_CROS_FIRMWARE}, - {"cros-rsrv", PARTITION_CROS_RESERVED}, -#endif +#if CONFIG_IS_ENABLED(EFI_PARTITION) + {"mbr", NULL, LEGACY_MBR_PARTITION_GUID}, + {"msft", NULL, PARTITION_MSFT_RESERVED_GUID}, + {"data", NULL, PARTITION_BASIC_DATA_GUID}, + {"linux", NULL, PARTITION_LINUX_FILE_SYSTEM_DATA_GUID}, + {"raid", NULL, PARTITION_LINUX_RAID_GUID}, + {"swap", NULL, PARTITION_LINUX_SWAP_GUID}, + {"lvm", NULL, PARTITION_LINUX_LVM_GUID}, + {"u-boot-env", NULL, PARTITION_U_BOOT_ENVIRONMENT}, + {"cros-kern", NULL, PARTITION_CROS_KERNEL}, + {"cros-root", NULL, PARTITION_CROS_ROOT}, + {"cros-fw", NULL, PARTITION_CROS_FIRMWARE}, + {"cros-rsrv", NULL, PARTITION_CROS_RESERVED}, + { + "system", "EFI System Partition", + PARTITION_SYSTEM_GUID, + }, #if defined(CONFIG_CMD_EFIDEBUG) || defined(CONFIG_EFI) { - "Device Path", + NULL, "Device Path", + PARTITION_SYSTEM_GUID, + }, + { + NULL, "Device Path", EFI_DEVICE_PATH_PROTOCOL_GUID, }, { - "Device Path To Text", + NULL, "Device Path To Text", EFI_DEVICE_PATH_TO_TEXT_PROTOCOL_GUID, }, { - "Device Path Utilities", + NULL, "Device Path Utilities", EFI_DEVICE_PATH_UTILITIES_PROTOCOL_GUID, }, { - "Unicode Collation 2", + NULL, "Unicode Collation 2", EFI_UNICODE_COLLATION_PROTOCOL2_GUID, }, { - "Driver Binding", + NULL, "Driver Binding", EFI_DRIVER_BINDING_PROTOCOL_GUID, }, { - "Simple Text Input", + NULL, "Simple Text Input", EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID, }, { - "Simple Text Input Ex", + NULL, "Simple Text Input Ex", EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL_GUID, }, { - "Simple Text Output", + NULL, "Simple Text Output", EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL_GUID, }, { - "Block IO", + NULL, "Block IO", EFI_BLOCK_IO_PROTOCOL_GUID, }, { - "Disk IO", + NULL, "Disk IO", EFI_DISK_IO_PROTOCOL_GUID, }, { - "Simple File System", + NULL, "Simple File System", EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID, }, { - "Loaded Image", + NULL, "Loaded Image", EFI_LOADED_IMAGE_PROTOCOL_GUID, }, { - "Loaded Image Device Path", + NULL, "Loaded Image Device Path", EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL_GUID, }, { - "Graphics Output", + NULL, "Graphics Output", EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID, }, { - "HII String", + NULL, "HII String", EFI_HII_STRING_PROTOCOL_GUID, }, { - "HII Database", + NULL, "HII Database", EFI_HII_DATABASE_PROTOCOL_GUID, }, { - "HII Config Access", + NULL, "HII Config Access", EFI_HII_CONFIG_ACCESS_PROTOCOL_GUID, }, { - "HII Config Routing", + NULL, "HII Config Routing", EFI_HII_CONFIG_ROUTING_PROTOCOL_GUID, }, { - "Load File", + NULL, "Load File", EFI_LOAD_FILE_PROTOCOL_GUID, }, { - "Load File2", + NULL, "Load File2", EFI_LOAD_FILE2_PROTOCOL_GUID, }, { - "Random Number Generator", + NULL, "Random Number Generator", EFI_RNG_PROTOCOL_GUID, }, { - "Simple Network", + NULL, "Simple Network", EFI_SIMPLE_NETWORK_PROTOCOL_GUID, }, { - "PXE Base Code", + NULL, "PXE Base Code", EFI_PXE_BASE_CODE_PROTOCOL_GUID, }, { - "Device-Tree Fixup", + NULL, "Device-Tree Fixup", EFI_DT_FIXUP_PROTOCOL_GUID, }, { - "TCG2", + NULL, "TCG2", EFI_TCG2_PROTOCOL_GUID, }, { - "Firmware Management", + NULL, "Firmware Management", EFI_FIRMWARE_MANAGEMENT_PROTOCOL_GUID }, #if IS_ENABLED(CONFIG_EFI_HTTP_PROTOCOL) { - "HTTP", + NULL, "HTTP", EFI_HTTP_PROTOCOL_GUID, }, { - "HTTP Service Binding", + NULL, "HTTP Service Binding", EFI_HTTP_SERVICE_BINDING_PROTOCOL_GUID, }, { - "IPv4 Config2", + NULL, "IPv4 Config2", EFI_IP4_CONFIG2_PROTOCOL_GUID, }, #endif /* Configuration table GUIDs */ { - "ACPI table", + NULL, "ACPI table", EFI_ACPI_TABLE_GUID, }, { - "EFI System Resource Table", + NULL, "EFI System Resource Table", EFI_SYSTEM_RESOURCE_TABLE_GUID, }, { - "device tree", + NULL, "device tree", EFI_FDT_GUID, }, { - "SMBIOS table", + NULL, "SMBIOS table", SMBIOS_TABLE_GUID, }, { - "SMBIOS3 table", + NULL, "SMBIOS3 table", SMBIOS3_TABLE_GUID, }, { - "Runtime properties", + NULL, "Runtime properties", EFI_RT_PROPERTIES_TABLE_GUID, }, { - "TCG2 Final Events Table", + NULL, "TCG2 Final Events Table", EFI_TCG2_FINAL_EVENTS_TABLE_GUID, }, { - "EFI Conformance Profiles Table", + NULL, "EFI Conformance Profiles Table", EFI_CONFORMANCE_PROFILES_TABLE_GUID, }, #ifdef CONFIG_EFI_RISCV_BOOT_PROTOCOL { - "RISC-V Boot", + NULL, "RISC-V Boot", RISCV_EFI_BOOT_PROTOCOL_GUID, }, #endif @@ -247,35 +260,36 @@ static const struct { #ifdef CONFIG_CMD_NVEDIT_EFI /* signature database */ { - "EFI_GLOBAL_VARIABLE_GUID", + "EFI_GLOBAL_VARIABLE_GUID", NULL, EFI_GLOBAL_VARIABLE_GUID, }, { - "EFI_IMAGE_SECURITY_DATABASE_GUID", + "EFI_IMAGE_SECURITY_DATABASE_GUID", NULL, EFI_IMAGE_SECURITY_DATABASE_GUID, }, /* certificate types */ { - "EFI_CERT_SHA256_GUID", + "EFI_CERT_SHA256_GUID", NULL, EFI_CERT_SHA256_GUID, }, { - "EFI_CERT_X509_GUID", + "EFI_CERT_X509_GUID", NULL, EFI_CERT_X509_GUID, }, { - "EFI_CERT_TYPE_PKCS7_GUID", + "EFI_CERT_TYPE_PKCS7_GUID", NULL, EFI_CERT_TYPE_PKCS7_GUID, }, #endif #if defined(CONFIG_CMD_EFIDEBUG) || defined(CONFIG_EFI) - { "EFI_LZMA_COMPRESSED", EFI_LZMA_COMPRESSED }, - { "EFI_DXE_SERVICES", EFI_DXE_SERVICES }, - { "EFI_HOB_LIST", EFI_HOB_LIST }, - { "EFI_MEMORY_TYPE", EFI_MEMORY_TYPE }, - { "EFI_MEM_STATUS_CODE_REC", EFI_MEM_STATUS_CODE_REC }, - { "EFI_GUID_EFI_ACPI1", EFI_GUID_EFI_ACPI1 }, + { "EFI_LZMA_COMPRESSED", NULL, EFI_LZMA_COMPRESSED }, + { "EFI_DXE_SERVICES", NULL, EFI_DXE_SERVICES }, + { "EFI_HOB_LIST", NULL, EFI_HOB_LIST }, + { "EFI_MEMORY_TYPE", NULL, EFI_MEMORY_TYPE }, + { "EFI_MEM_STATUS_CODE_REC", NULL, EFI_MEM_STATUS_CODE_REC }, + { "EFI_GUID_EFI_ACPI1", NULL, EFI_GUID_EFI_ACPI1 }, #endif +#endif /* EFI_PARTITION */ #endif /* !USE_HOSTCC */ }; @@ -284,7 +298,8 @@ int uuid_guid_get_bin(const char *guid_str, unsigned char *guid_bin) int i; for (i = 0; i < ARRAY_SIZE(list_guid); i++) { - if (!strcmp(list_guid[i].string, guid_str)) { + if (list_guid[i].type && + !strcmp(list_guid[i].type, guid_str)) { memcpy(guid_bin, &list_guid[i].guid, 16); return 0; } @@ -298,7 +313,9 @@ const char *uuid_guid_get_str(const unsigned char *guid_bin) for (i = 0; i < ARRAY_SIZE(list_guid); i++) { if (!memcmp(list_guid[i].guid.b, guid_bin, 16)) { - return list_guid[i].string; + if (list_guid[i].description) + return list_guid[i].description; + return list_guid[i].type; } } return NULL; @@ -312,10 +329,9 @@ int uuid_str_to_bin(const char *uuid_str, unsigned char *uuid_bin, uint64_t tmp64; if (!uuid_str_valid(uuid_str)) { -#ifdef CONFIG_PARTITION_TYPE_GUID - if (!uuid_guid_get_bin(uuid_str, uuid_bin)) + if (IS_ENABLED(CONFIG_PARTITION_TYPE_GUID) && + !uuid_guid_get_bin(uuid_str, uuid_bin)) return 0; -#endif return -EINVAL; } diff --git a/test/common/print.c b/test/common/print.c index c48efc2783f..76ee851fe6a 100644 --- a/test/common/print.c +++ b/test/common/print.c @@ -45,8 +45,7 @@ static int print_guid(struct unit_test_state *uts) sprintf(str, "%pUL", guid); ut_asserteq_str("04030201-0605-0807-090A-0B0C0D0E0F10", str); sprintf(str, "%pUs", guid_esp); - if (IS_ENABLED(CONFIG_PARTITION_TYPE_GUID) || - IS_ENABLED(CONFIG_CMD_EFIDEBUG) || IS_ENABLED(CONFIG_EFI)) + if (IS_ENABLED(CONFIG_EFI_PARTITION)) ut_asserteq_str("EFI System Partition", str); else ut_asserteq_str("c12a7328-f81f-11d2-ba4b-00a0c93ec93b", str); From a3a5179b1c9eafee0850aa653384cb8c23a4f79f Mon Sep 17 00:00:00 2001 From: Patrick Delaunay Date: Mon, 16 Jun 2025 13:27:48 +0200 Subject: [PATCH 02/16] doc: cmd: gpt: add information on type partition Add information on type partition, copied from README.gpt. I also correct issue for gpt_parts variable and add example of "gpt read" usage. Signed-off-by: Patrick Delaunay Reviewed-by: Patrice Chotard --- doc/usage/cmd/gpt.rst | 93 ++++++++++++++++++++++++++++++++++++++----- 1 file changed, 84 insertions(+), 9 deletions(-) diff --git a/doc/usage/cmd/gpt.rst b/doc/usage/cmd/gpt.rst index 8534f78cbac..13e8783be9b 100644 --- a/doc/usage/cmd/gpt.rst +++ b/doc/usage/cmd/gpt.rst @@ -54,7 +54,7 @@ partition string * name= - The partition name, required * start= - The partition start offset in bytes, required - * size= - The partition size in bytes or "-" to expand it to the whole free area + * size= - The partition size in bytes or "-" for the last partition to expand it to the whole free area * bootable - Set the legacy bootable flag * uuid= - The partition UUID, optional if CONFIG_RANDOM_UUID=y is enabled * type= - The partition type GUID, requires CONFIG_PARTITION_TYPE_GUID=y @@ -63,6 +63,23 @@ partition string If 'uuid' is not specified, but CONFIG_RANDOM_UUID is enabled, a random UUID will be generated for the partition + If 'type' is not specified or without CONFIG_PARTITION_TYPE_GUID=y, + the used partition type GUID is PARTITION_BASIC_DATA_GUID. + + Some strings can be also used at the place of the known partition type GUID: + * "mbr" = LEGACY_MBR_PARTITION_GUID (024DEE41-33E7-11D3-9D69-0008C781F39F) + * "msft" = PARTITION_MSFT_RESERVED_GUID (E3C9E316-0B5C-4DB8-817D-F92DF00215AE) + * "data" = PARTITION_BASIC_DATA_GUID (EBD0A0A2-B9E5-4433-87C0-68B6B72699C7) + * "linux" = PARTITION_LINUX_FILE_SYSTEM_DATA_GUID (0FC63DAF-8483-4772-8E79-3D69D8477DE4) + * "raid" = PARTITION_LINUX_RAID_GUID (A19D880F-05FC-4D3B-A006-743F0F84911E) + * "swap" = PARTITION_LINUX_SWAP_GUID (0657FD6D-A4AB-43C4-84E5-0933C84B4F4F) + * "lvm" = PARTITION_LINUX_LVM_GUID (E6D6D379-F507-44C2-A23C-238F2A3DF928) + * "u-boot-env" = PARTITION_U_BOOT_ENVIRONMENT(3DE21764-95BD-54BD-A5C3-4ABE786F38A8) + * "system" = PARTITION_SYSTEM_GUID (C12A7328-F81F-11D2-BA4B-00A0C93EC93B) + + The GPT partitions layout and associated 'type' are also printed with the + :doc:`part command ` command by typing "part list". + gpt enumerate ~~~~~~~~~~~~~ @@ -162,16 +179,17 @@ Examples Create 6 partitions on a disk:: - => setenv gpt_parts 'uuid_disk=bec9fc2a-86c1-483d-8a0e-0109732277d7; - name=boot,start=4M,size=128M,bootable,type=ebd0a0a2-b9e5-4433-87c0-68b6b72699c7, - name=rootfs,size=3072M,type=0fc63daf-8483-4772-8e79-3d69d8477de4; - name=system-data,size=512M,type=0fc63daf-8483-4772-8e79-3d69d8477de4; - name=[ext],size=-,type=0fc63daf-8483-4772-8e79-3d69d8477de4; - name=user,size=-,type=0fc63daf-8483-4772-8e79-3d69d8477de4; - name=modules,size=100M,type=0fc63daf-8483-4772-8e79-3d69d8477de4; - name=ramdisk,size=8M,type=0fc63daf-8483-4772-8e79-3d69d8477de4 + => setenv gpt_parts 'uuid_disk=bec9fc2a-86c1-483d-8a0e-0109732277d7;\ + name=boot,start=4M,size=128M,bootable,type=ebd0a0a2-b9e5-4433-87c0-68b6b72699c7;\ + name=rootfs,size=3072M,type=0fc63daf-8483-4772-8e79-3d69d8477de4;\ + name=system-data,size=512M,type=0fc63daf-8483-4772-8e79-3d69d8477de4;\ + name=user,size=512M,type=0fc63daf-8483-4772-8e79-3d69d8477de4;\ + name=modules,size=100M,type=0fc63daf-8483-4772-8e79-3d69d8477de4;\ + name=ramdisk,size=8M,type=0fc63daf-8483-4772-8e79-3d69d8477de4;\ + name=[ext],size=-,type=0fc63daf-8483-4772-8e79-3d69d8477de4' => gpt write mmc 0 $gpt_parts +Last partition "[ext]" with '-' is extended up to the end of the disk Verify that the device matches the partition layout described in the variable $gpt_parts:: @@ -228,3 +246,60 @@ Swap the order of the 'boot' and 'rootfs' partition table entries:: => gpt setenv mmc 0 boot => echo ${gpt_partition_entry} 2 + +Other example: a disk with known partition types:: + + => setenv gpt_parts 'name=u-boot,size=32M,type=data;\ + name=env,size=1M,type=u-boot-env; + name=ESP,size=128M,type=system; + name=rootfs,size=3072M,type=linux; + name=swap,size=100M,type=swap; + name=user,size=-,type=linux' + => gpt write mmc 0 $gpt_parts + + => part list mmc 0 + Partition Map for mmc device 0 -- Partition Type: EFI + Part Start LBA End LBA Name + Attributes + Type GUID + Partition GUID + 1 0x00000022 0x00010021 "u-boot" + attrs: 0x0000000000000000 + type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7 + (data) + guid: 502d48f6-81c0-488f-bdc0-ad602498f3ce + 2 0x00010022 0x00010821 "env" + attrs: 0x0000000000000000 + type: 3de21764-95bd-54bd-a5c3-4abe786f38a8 + (u-boot-env) + guid: 9dc62338-459a-485e-bd8f-b3fbf728d9c0 + 3 0x00010822 0x00050821 "ESP" + attrs: 0x0000000000000000 + type: c12a7328-f81f-11d2-ba4b-00a0c93ec93b + (EFI System Partition) + guid: 8a3a1168-6af8-4ba7-a95d-9cd0d14e1b3d + 4 0x00050822 0x00650821 "rootfs" + attrs: 0x0000000000000000 + type: 0fc63daf-8483-4772-8e79-3d69d8477de4 + (linux) + guid: 411ffebc-8a19-469d-99a9-0982409a6851 + 5 0x00650822 0x00682821 "swap" + attrs: 0x0000000000000000 + type: 0657fd6d-a4ab-43c4-84e5-0933c84b4f4f + (swap) + guid: f8ec0410-95ec-4e3e-8b98-fb8cf271a201 + 6 0x00682822 0x01dacbde "user" + attrs: 0x0000000000000000 + type: 0fc63daf-8483-4772-8e79-3d69d8477de4 + (linux) + guid: c5543e1c-566d-4502-99ad-20545007e673 + +Modifying GPT partition layout from U-Boot:: + + => gpt read mmc 0 current_partitions + => env edit current_partitions + edit: uuid_disk=[...];name=part1,start=0x4000,size=0x4000,uuid=[...]; + name=part2,start=0xc000,size=0xc000,uuid=[...];[ . . . ] + + => gpt write mmc 0 $current_partitions + => gpt verify mmc 0 $current_partitions From 7a598e633a5376ddae6a96bfcdb28c8e7b422b0c Mon Sep 17 00:00:00 2001 From: Patrick Delaunay Date: Mon, 16 Jun 2025 13:27:49 +0200 Subject: [PATCH 03/16] test/py: tests: gpt: add test_gpt_write_part_type Add sandbox test on gpt command with partition type for known type. Signed-off-by: Patrick Delaunay Reviewed-by: Patrice Chotard --- test/py/tests/test_gpt.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/test/py/tests/test_gpt.py b/test/py/tests/test_gpt.py index cfc8f1319a9..e6d8792ac1f 100644 --- a/test/py/tests/test_gpt.py +++ b/test/py/tests/test_gpt.py @@ -330,6 +330,33 @@ def test_gpt_write(state_disk_image, ubman): output = ubman.run_command('gpt guid host 0') assert '375a56f7-d6c9-4e81-b5f0-09d41ca89efe' in output +@pytest.mark.boardspec('sandbox') +@pytest.mark.buildconfigspec('cmd_gpt') +@pytest.mark.buildconfigspec('cmd_part') +@pytest.mark.buildconfigspec('partition_type_guid') +@pytest.mark.requiredtool('sgdisk') +def test_gpt_write_part_type(state_disk_image, ubman): + """Test the gpt command with part type uuid.""" + + output = ubman.run_command('gpt write host 0 "name=part1,type=data,size=1M;name=part2,size=512K,type=system;name=part3,size=65536,type=u-boot-env;name=part4,size=65536,type=375a56f7-d6c9-4e81-b5f0-09d41ca89efe;name=part5,size=-,type=linux"') + assert 'Writing GPT: success!' in output + output = ubman.run_command('part list host 0') + assert '1\t0x00000022\t0x00000821\t"part1"' in output + assert 'ebd0a0a2-b9e5-4433-87c0-68b6b72699c7' in output + assert '(data)' in output + assert '2\t0x00000822\t0x00000c21\t"part2"' in output + assert 'c12a7328-f81f-11d2-ba4b-00a0c93ec93b' in output + assert '(EFI System Partition)' in output + assert '3\t0x00000c22\t0x00000ca1\t"part3"' in output + assert '3de21764-95bd-54bd-a5c3-4abe786f38a8' in output + assert '(u-boot-env)' in output + assert '4\t0x00000ca2\t0x00000d21\t"part4"' in output + assert 'ebd0a0a2-b9e5-4433-87c0-68b6b72699c7' in output + assert '(375a56f7-d6c9-4e81-b5f0-09d41ca89efe)' in output + assert '5\t0x00000d22\t0x00001fde\t"part5"' in output + assert '0fc63daf-8483-4772-8e79-3d69d8477de4' in output + assert '(linux)' in output + @pytest.mark.buildconfigspec('cmd_gpt') @pytest.mark.buildconfigspec('cmd_gpt_rename') @pytest.mark.buildconfigspec('cmd_part') From 668b2d791d94d4fd6a4be6d7dfa822b072017378 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 15 Jun 2025 12:47:51 +0200 Subject: [PATCH 04/16] arm64: renesas: Move early SPL stack into System RAM SRAM on R-Car V4H boards The CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xeb300000 does not make it into board .config on either R-Car V4H White Hawk or Sparrow Hawk, remove this configuration option. The early SPL stack is however pointing into the RT-VRAM and may corrupt payload loaded into the RT-VRAM by the BootROM. Set the early SPL stack at fixed location at the end of System RAM instead, where it cannot interfere with the payload loaded into RT-VRAM. Signed-off-by: Marek Vasut --- configs/r8a779g0_whitehawk_defconfig | 4 +++- configs/r8a779g3_sparrowhawk_defconfig | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/configs/r8a779g0_whitehawk_defconfig b/configs/r8a779g0_whitehawk_defconfig index 8dcf8e35ee0..5d9cfc97a97 100644 --- a/configs/r8a779g0_whitehawk_defconfig +++ b/configs/r8a779g0_whitehawk_defconfig @@ -26,7 +26,9 @@ CONFIG_PHY_MICREL_KSZ90X1=y CONFIG_RENESAS_RAVB=y CONFIG_BAUDRATE=921600 -CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xeb300000 +# CONFIG_SPL_SHARES_INIT_SP_ADDR is not set +CONFIG_SPL_HAVE_INIT_STACK=y +CONFIG_SPL_STACK=0xe6400000 CONFIG_SPL_DM_SPI=y CONFIG_SPL_TEXT_BASE=0xeb210000 CONFIG_SPL_STACK_R_ADDR=0x44000000 diff --git a/configs/r8a779g3_sparrowhawk_defconfig b/configs/r8a779g3_sparrowhawk_defconfig index 47fc536df81..7202828cd66 100644 --- a/configs/r8a779g3_sparrowhawk_defconfig +++ b/configs/r8a779g3_sparrowhawk_defconfig @@ -29,7 +29,9 @@ CONFIG_PHY_MICREL=y CONFIG_PHY_MICREL_KSZ90X1=y CONFIG_RENESAS_RAVB=y -CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xeb300000 +# CONFIG_SPL_SHARES_INIT_SP_ADDR is not set +CONFIG_SPL_HAVE_INIT_STACK=y +CONFIG_SPL_STACK=0xe6400000 CONFIG_SPL_DM_SPI=y CONFIG_SPL_TEXT_BASE=0xeb210000 CONFIG_SPL_STACK_R_ADDR=0x44000000 From 592b42aeadb74cea3e84a45ad87510d4b35b5bc4 Mon Sep 17 00:00:00 2001 From: Mikhail Kshevetskiy Date: Sat, 7 Jun 2025 01:39:23 +0300 Subject: [PATCH 05/16] arm/airoha: reset_cpu() does not take any params According to include/sysreset.h the reset_cpu() function does not take any args Signed-off-by: Mikhail Kshevetskiy Reviewed-by: Tom Rini --- arch/arm/mach-airoha/an7581/init.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-airoha/an7581/init.c b/arch/arm/mach-airoha/an7581/init.c index cefe9c6db9e..d149e0ee3c8 100644 --- a/arch/arm/mach-airoha/an7581/init.c +++ b/arch/arm/mach-airoha/an7581/init.c @@ -2,6 +2,7 @@ #include #include +#include #include #include @@ -21,7 +22,7 @@ int dram_init_banksize(void) return fdtdec_setup_memory_banksize(); } -void reset_cpu(ulong addr) +void reset_cpu(void) { psci_system_reset(); } From 3704b888a4cabac8daea20a4504d513bc47153ca Mon Sep 17 00:00:00 2001 From: Mikhail Kshevetskiy Date: Tue, 10 Jun 2025 12:56:30 +0300 Subject: [PATCH 06/16] common/spl: fix potential out of buffer access in spl_fit_get_image_name function The current code have two issues: 1) ineffective NULL pointer check str = strchr(str, '\0') + 1 if (!str || ... The str here will never be NULL (because we add 1 to result of strchr()) 2) strchr() may go out of the buffer for the special forms of name variable. It's better use memchr() function here. According to the code the property is a sequence of C-string like shown below: 'h', 'e', 'l', 'l', 'o', '\0', 'w', 'o', 'r', 'l', 'd', '\0', '!', '\0' index is the string number we are interested, so index = 0 => "hello", index = 1 => "world", index = 2 => "!" The issue will arrise if last string for some reason have no terminating '\0' character. This can happen for damaged or specially crafted dtb. Signed-off-by: Mikhail Kshevetskiy Reviewed-by: Tom Rini --- common/spl/spl_fit.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c index 86506d6905c..ab277bb2baa 100644 --- a/common/spl/spl_fit.c +++ b/common/spl/spl_fit.c @@ -86,11 +86,12 @@ static int spl_fit_get_image_name(const struct spl_fit_info *ctx, str = name; for (i = 0; i < index; i++) { - str = strchr(str, '\0') + 1; - if (!str || (str - name >= len)) { + str = memchr(str, '\0', name + len - str); + if (!str) { found = false; break; } + str++; } if (!found && CONFIG_IS_ENABLED(SYSINFO) && !sysinfo_get(&sysinfo)) { From 3eb43c54fadba457f22e415a2821145164efe662 Mon Sep 17 00:00:00 2001 From: Mikhail Kshevetskiy Date: Tue, 10 Jun 2025 12:56:31 +0300 Subject: [PATCH 07/16] common/spl: handle properly images with bad checksum load_simple_fit() returns -EPERM for the images with broken signatures. Unfortunately this may conflict with image loaging selection on the base of boot phase. See commit 873112db9ce68c38984ff25808dde726f8dd5573 ("spl: Support selecting images based on phase in simple FIT"). Thus loading of configurations { uboot { description = "u-boot"; firmware = "atf"; loadables = "atf", "tee", "uboot"; }; }; with damaged "tee" image may finish without errors. This may results in board bricking. This patch fixes commit 873112db9ce68c38984ff25808dde726f8dd5573 ("spl: Support selecting images based on phase in simple FIT") by replacing EPERM with EBADSLT places where it should be done. Signed-off-by: Mikhail Kshevetskiy --- common/spl/spl_fit.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c index ab277bb2baa..321954a1547 100644 --- a/common/spl/spl_fit.c +++ b/common/spl/spl_fit.c @@ -200,7 +200,7 @@ static int get_aligned_image_size(struct spl_load_info *info, int data_size, * the image gets loaded to the address pointed to by the * load_addr member in this struct, if load_addr is not 0 * - * Return: 0 on success, -EPERM if this image is not the correct phase + * Return: 0 on success, -EBADSLT if this image is not the correct phase * (for CONFIG_BOOTMETH_VBE_SIMPLE_FW), or another negative error number on * other error. */ @@ -236,7 +236,7 @@ static int load_simple_fit(struct spl_load_info *info, ulong fit_offset, return ret; } else { log_debug("- phase mismatch, skipping this image\n"); - return -EPERM; + return -EBADSLT; } } @@ -475,7 +475,7 @@ static int spl_fit_append_fdt(struct spl_image_info *spl_image, image_info.load_addr = (ulong)tmpbuffer; ret = load_simple_fit(info, offset, ctx, node, &image_info); - if (ret == -EPERM) + if (ret == -EBADSLT) continue; else if (ret < 0) break; @@ -835,7 +835,7 @@ int spl_load_simple_fit(struct spl_image_info *spl_image, image_info.load_addr = 0; ret = load_simple_fit(info, offset, &ctx, node, &image_info); - if (ret < 0 && ret != -EPERM) { + if (ret < 0 && ret != -EBADSLT) { printf("%s: can't load image loadables index %d (ret = %d)\n", __func__, index, ret); return ret; From 8bb9c275c484206c0314014d8215770aaac4cefe Mon Sep 17 00:00:00 2001 From: Mikhail Kshevetskiy Date: Tue, 10 Jun 2025 12:56:32 +0300 Subject: [PATCH 08/16] common/spl: improve error handling in spl_fit This fix a possible NULL pointer dereference. There is also a risk of memory leaking within the same portion of code. The leak will happen if loaded image is bad or damaged. In this case u-boot-spl will try booting from the other available media. Unfortunately resources allocated for previous boot media will NOT be freed. We can't fix that issue as the memory allocation mechanism used here is unknown. It can be different kinds of malloc() or something else. To somewhat reduce memory consumption, one can try to reuse previously allocated memory as it's done in board_spl_fit_buffer_addr() from test/image/spl_load.c. The corresponding comment was put to the code as well. Signed-off-by: Mikhail Kshevetskiy Reviewed-by: Anshul Dalal --- common/spl/spl_fit.c | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c index 321954a1547..b3824af475f 100644 --- a/common/spl/spl_fit.c +++ b/common/spl/spl_fit.c @@ -703,13 +703,51 @@ static int spl_simple_fit_read(struct spl_fit_info *ctx, */ size = get_aligned_image_size(info, size, 0); buf = board_spl_fit_buffer_addr(size, size, 1); + if (!buf) { + /* + * We assume that none of the board will ever use 0x0 as a + * valid load address. Theoretically some board could use it, + * but this is extremely unlikely. + */ + return -EIO; + } count = info->read(info, offset, size, buf); + if (!count) { + /* + * FIT could not be read. This means we should free the + * memory allocated by board_spl_fit_buffer_addr(). + * Unfortunately, we don't know what memory allocation + * mechanism was used: + * - For the SPL_SYS_MALLOC_SIMPLE case nothing could + * be done. The memory just could not be freed. + * - For statically allocated memory buffer we can try + * to reuse previously allocated memory (example: + * board_spl_fit_buffer_addr() function from the + * file test/image/spl_load.c). + * - For normall malloc() -- memory leak can't be easily + * avoided. To somehow reduce memory consumption the + * next calls of board_spl_fit_buffer_addr() could + * reallocate previously allocated buffer and use + * them again. This is somethat similar to the approach + * used for statically allocated buffer. + * + * Please note: + * - FIT images with data placed outside of the FIT + * structure will cause small memory leak (several + * kilobytes), + * - FIT images with data placed inside to the FIT + * structure may cause huge memory leak (up to + * several megabytes). Do NOT use such images! + */ + return -EIO; + } + ctx->fit = buf; debug("fit read offset %lx, size=%lu, dst=%p, count=%lu\n", offset, size, buf, count); - return (count == 0) ? -EIO : 0; + return 0; } static int spl_simple_fit_parse(struct spl_fit_info *ctx) From 418acf8c78ed21f2cfdfa2cf3471446ee96374b5 Mon Sep 17 00:00:00 2001 From: Tony Dinh Date: Fri, 20 Jun 2025 20:22:04 -0700 Subject: [PATCH 09/16] arm: kirkwood: Maintainer for RaidSonic ICY BOX ib62x0 board Add me as maintainer for the RaidSonic ICY BOX ib62x0. Signed-off-by: Tony Dinh --- board/raidsonic/ib62x0/MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/board/raidsonic/ib62x0/MAINTAINERS b/board/raidsonic/ib62x0/MAINTAINERS index 423aa0cf253..2822eb0d29d 100644 --- a/board/raidsonic/ib62x0/MAINTAINERS +++ b/board/raidsonic/ib62x0/MAINTAINERS @@ -1,5 +1,5 @@ IB62X0 BOARD -M: Luka Perkov +M: Tony Dinh S: Maintained F: board/raidsonic/ib62x0/ F: include/configs/ib62x0.h From 820bbf1d46f5d3fd30d306e955d2b4d1487c3484 Mon Sep 17 00:00:00 2001 From: Jerome Forissier Date: Tue, 17 Jun 2025 14:10:58 +0200 Subject: [PATCH 10/16] doc: cmd: wget: remove erroneous note The note about U-Boot not being able to verify server certificates is false now that WGET_CACERT and WGET_BUILTIN_CACERT have been added. Remove it. Signed-off-by: Jerome Forissier Reviewed-by: Heinrich Schuchardt --- doc/usage/cmd/wget.rst | 7 ------- 1 file changed, 7 deletions(-) diff --git a/doc/usage/cmd/wget.rst b/doc/usage/cmd/wget.rst index 44033aaff39..06df2842549 100644 --- a/doc/usage/cmd/wget.rst +++ b/doc/usage/cmd/wget.rst @@ -185,13 +185,6 @@ TCP Selective Acknowledgments in the legacy network stack can be enabled via CONFIG_PROT_TCP_SACK=y. This will improve the download speed. Selective Acknowledgments are enabled by default with lwIP. -.. note:: - - U-Boot currently has no way to verify certificates for HTTPS. - A place to store the root CA certificates is needed, and then MBed TLS would - need to walk the entire chain. Therefore, man-in-the middle attacks are - possible and HTTPS should not be relied upon for payload authentication. - Return value ------------ From c08cecf2d7632d2c7be9a9d260f74bb585d7a3e3 Mon Sep 17 00:00:00 2001 From: Sam Protsenko Date: Fri, 20 Jun 2025 13:50:10 -0500 Subject: [PATCH 11/16] board: samsung: e850-96: Load LDFW in board_late_init() As stated in 5e847f7729b3 ("efi_loader: call efi_init_early() earlier"): efi_init_early() creates an event hook for block device probing. It has to be called before any block device is probed. Indeed, efi_bl_init() registers EVT_DM_POST_PROBE event, which calls efi_disk_probe() whenever any block device is probed. And to make that hook work, the initialization of all block devices was put after efi_init_early() in initcall_run_r(): INITCALL(efi_init_early); INITCALL(initr_nand); INITCALL(initr_onenand); INITCALL(initr_mmc); Because LDFW firmware is being read from MMC, attempt to load LDFW in board_init() causes MMC driver to be probed. And because board_init() is executed before efi_init_early(), the hook mentioned above won't work for MMC devices anymore. So EFI disk objects won't be created, which in turn makes the EFI subsystem non-functional, showing next symptoms: - 'efidebug dh' output is empty - attempt to add boot devices in 'eficonfig' shows this message: "No block device found!" - 'bootefi selftest $fdtcontroladdr' shows this warning: "Cannot persist EFI variables without system partition" - booting GRUB with 'bootefi' runs minimal GRUB shell which doesn't see any block devices as well, probably because EFI vars weren't passed Load LDFW in board_late_init() instead, as it's called after efi_init_early(). This fixes the described problem and makes it possible to run EFI apps like GRUB correctly, add entries in 'eficonfig', and makes 'efivar --list' command in Linux rootfs actually show EFI variables. The only user of LDFW at the moment is the TRNG driver, and it's probed later, only when it's going to be used (e.g. on "rng" command). So it's fine to load LDFW in board_late_init(). Now the corresponding call order will look like this: efi_init_early() initr_mmc() mmc_probe() EVT_DM_POST_PROBE -> efi_disk_probe() board_late_init() load_ldfw() -> fs_read(), blk_dread() exynos_trng_probe() Fixes: ccfd8de541a8 ("board: samsung: e850-96: Report LDFW loading failures") Fixes: f04e58cc9788 ("board: samsung: e850-96: Load LDFW firmware on board init") Signed-off-by: Sam Protsenko --- board/samsung/e850-96/e850-96.c | 9 +++++++++ configs/e850-96_defconfig | 1 + 2 files changed, 10 insertions(+) diff --git a/board/samsung/e850-96/e850-96.c b/board/samsung/e850-96/e850-96.c index 0bef68d2fb2..3bbd95201b5 100644 --- a/board/samsung/e850-96/e850-96.c +++ b/board/samsung/e850-96/e850-96.c @@ -18,9 +18,18 @@ int dram_init_banksize(void) } int board_init(void) +{ + return 0; +} + +int board_late_init(void) { int err; + /* + * Do this in board_late_init() to make sure MMC is not probed before + * efi_init_early(). + */ err = load_ldfw(); if (err) printf("ERROR: LDFW loading failed (%d)\n", err); diff --git a/configs/e850-96_defconfig b/configs/e850-96_defconfig index 5facd418260..e4c6aa28e0b 100644 --- a/configs/e850-96_defconfig +++ b/configs/e850-96_defconfig @@ -19,6 +19,7 @@ CONFIG_ANDROID_BOOT_IMAGE=y CONFIG_BOOTSTD_FULL=y CONFIG_DEFAULT_FDT_FILE="exynos850-e850-96.dtb" # CONFIG_DISPLAY_CPUINFO is not set +CONFIG_BOARD_LATE_INIT=y CONFIG_CMD_BOOTEFI_SELFTEST=y CONFIG_CMD_ABOOTIMG=y CONFIG_CMD_NVEDIT_EFI=y From 9d169ac9733b5c3f208921a1d82f4fa8ff708258 Mon Sep 17 00:00:00 2001 From: Baruch Siach Date: Wed, 18 Jun 2025 19:04:35 +0300 Subject: [PATCH 12/16] net: designware: fix bus address dereference Device bus address might not be valid for direct access when the bus address and CPU address are not the same. Use dev_bus_to_phys() to translate bus address back to CPU address. Fixes: 3d98b8c504e15 ("net: designware: Invalidate RX buffer cache before freeing the DMA descriptor") Signed-off-by: Baruch Siach Reviewed-by: Ramon Fried --- drivers/net/designware.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/designware.c b/drivers/net/designware.c index 0f93c25e3fe..fce3ef910cb 100644 --- a/drivers/net/designware.c +++ b/drivers/net/designware.c @@ -716,7 +716,7 @@ static int _dw_free_pkt(struct dw_eth_dev *priv) ulong desc_start = (ulong)desc_p; ulong desc_end = desc_start + roundup(sizeof(*desc_p), ARCH_DMA_MINALIGN); - ulong data_start = desc_p->dmamac_addr; + ulong data_start = dev_bus_to_phys(priv->dev, desc_p->dmamac_addr); ulong data_end = data_start + roundup(CFG_ETH_BUFSIZE, ARCH_DMA_MINALIGN); /* Invalidate the descriptor buffer data */ From 961e260cdcd01d68c8dae87eef67e116f1a67aed Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Fri, 20 Jun 2025 00:38:17 +0800 Subject: [PATCH 13/16] lib: rsa: fix compilation error without openssl The symbol TOOLS_IMAGE_PRE_LOAD doesn't depend on TOOLS_LIBCRYPTO. If we choose to build tools without openssl, rsa_verify_openssl() will attempt to call the unavailable openssl library functions. Fixes: 942c8c8e6697 ("rsa: Add rsa_verify_openssl() to use openssl for host builds") Signed-off-by: Shiji Yang --- include/image.h | 2 +- lib/rsa/rsa-verify.c | 2 +- tools/image-host.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/image.h b/include/image.h index c1db8383459..5f4e23a0ae9 100644 --- a/include/image.h +++ b/include/image.h @@ -1688,7 +1688,7 @@ struct sig_header_s { */ int image_pre_load(ulong addr); -#if defined(USE_HOSTCC) +#if defined(USE_HOSTCC) && CONFIG_IS_ENABLED(LIBCRYPTO) /** * rsa_verify_openssl() - Verify a signature against some data with openssl API * diff --git a/lib/rsa/rsa-verify.c b/lib/rsa/rsa-verify.c index 4a0418a75f1..b65fbe44007 100644 --- a/lib/rsa/rsa-verify.c +++ b/lib/rsa/rsa-verify.c @@ -570,7 +570,7 @@ int rsa_verify(struct image_sign_info *info, uint8_t hash[info->crypto->key_len]; int ret; -#ifdef USE_HOSTCC +#if defined(USE_HOSTCC) && CONFIG_IS_ENABLED(LIBCRYPTO) if (!info->fdt_blob) return rsa_verify_openssl(info, region, region_count, sig, sig_len); #endif diff --git a/tools/image-host.c b/tools/image-host.c index a9b86902763..21dd7f2d922 100644 --- a/tools/image-host.c +++ b/tools/image-host.c @@ -19,7 +19,7 @@ #include #endif -#if CONFIG_IS_ENABLED(IMAGE_PRE_LOAD) +#if CONFIG_IS_ENABLED(IMAGE_PRE_LOAD) && CONFIG_IS_ENABLED(LIBCRYPTO) #include #include #endif @@ -1416,7 +1416,7 @@ int fit_check_sign(const void *fit, const void *key, } #endif -#if CONFIG_IS_ENABLED(IMAGE_PRE_LOAD) +#if CONFIG_IS_ENABLED(IMAGE_PRE_LOAD) && CONFIG_IS_ENABLED(LIBCRYPTO) /** * rsa_verify_openssl() - Verify a signature against some data with openssl API * From 1989eb65c50e2541373bc6657a85620ff0c6f573 Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Fri, 20 Jun 2025 00:38:18 +0800 Subject: [PATCH 14/16] tools/fit_check_sign: make the module dependent on CONFIG_FIT_SIGNATURE The function definition of fit_check_sign() is guarded by "#ifdef CONFIG_FIT_SIGNATURE" in "tools/image-host.c". If we try to build it without CONFIG_FIT_SIGNATURE, we will get an error: /usr/bin/ld: tools/fit_check_sign.o: in function `main': fit_check_sign.c:(.text.startup+0x165): undefined reference to `fit_check_sign' collect2: error: ld returned 1 exit status Fixes: 9c79c8fe70da ("tools/fit_check_sign: make key optional") Signed-off-by: Shiji Yang --- tools/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/Makefile b/tools/Makefile index 97ce1dbb17e..02297e8c93a 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -63,7 +63,8 @@ HOSTCFLAGS_img2srec.o := -pedantic hostprogs-y += mkenvimage mkenvimage-objs := mkenvimage.o os_support.o generated/lib/crc32.o -hostprogs-y += dumpimage mkimage fit_info fit_check_sign +hostprogs-y += dumpimage mkimage fit_info +hostprogs-$(CONFIG_FIT_SIGNATURE) += fit_check_sign hostprogs-$(CONFIG_TOOLS_LIBCRYPTO) += fdt_add_pubkey hostprogs-$(CONFIG_TOOLS_LIBCRYPTO) += preload_check_sign From 410d59095a9f2319585bd66152b31f72389dcdaf Mon Sep 17 00:00:00 2001 From: Jerome Forissier Date: Mon, 23 Jun 2025 13:10:11 -0600 Subject: [PATCH 15/16] arm: kirkwood: fix freeze on boot Commit 6fe50e395080 ("arm: asm/system.h: mrc and mcr need .arm if __thumb2__ is not set") is not a proper fix for the LTO link error mentioned in its description. It causes 32-bit arm instructions to be mixed with thumb instructions, which the Kirkwood SoCs do not support. For example, board_init_r() is mostly generated in Thumb-1 mode as expected since the build flags contain -mthumb -mthumb-interwork. The MCR instruction corresponding to writefr_extra_feature_reg() is also correcly emitted as a 32-bit ARM instruction (it cannot be encoded in Thumb-1 anyways). The problem is, the compiler inlines the MCR without generating the BX or BLX instruction which are needed to transition between the ARM and the Thumb-1 states. From the objdump output: 006186a0 : board_init_r(): /home/jerome/work/u-boot/common/board_r.c:799 6186a0: b5f0 push {r4, r5, r6, r7, lr} 6186a2: b0ab sub sp, #172 @ 0xac get_gd(): /home/jerome/work/u-boot/./arch/arm/include/asm/global_data.h:127 6186a4: 464a mov r2, r9 ... /home/jerome/work/u-boot/arch/arm/mach-kirkwood/cpu.c:242 619aae: 9b15 ldr r3, [sp, #84] @ 0x54 writefr_extra_feature_reg(): /home/jerome/work/u-boot/./arch/arm/include/asm/arch/cpu.h:100 619ab0: ee2f3f11 mcr 15, 1, r3, cr15, cr1, {0} ^^^^^^^^ 32-bit ARM instruction Further investigation is needed to understand how to fix the issue so that the code size is minimal for all boards. In the mean time, this fix disables LTO for the two problematic files (common/board_f.c and common/board_r.c). This makes the Kirkwood-based boards bootable again. The binary size is increased by 1048 bytes which is perfectly acceptable. Fixes: 6fe50e395080 ("arm: asm/system.h: mrc and mcr need .arm if __thumb2__ is not set") Reported-by: Tony Dinh Tested-by: Tony Dinh Signed-off-by: Jerome Forissier Signed-off-by: Tom Rini --- common/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/Makefile b/common/Makefile index 35991562a12..e589f307262 100644 --- a/common/Makefile +++ b/common/Makefile @@ -19,6 +19,10 @@ obj-y += version.o # # boards obj-y += board_f.o obj-y += board_r.o +ifdef CONFIG_$(PHASE_)SYS_THUMB_BUILD +CFLAGS_REMOVE_board_f.o := $(LTO_CFLAGS) +CFLAGS_REMOVE_board_r.o := $(LTO_CFLAGS) +endif obj-$(CONFIG_DISPLAY_BOARDINFO) += board_info.o obj-$(CONFIG_DISPLAY_BOARDINFO_LATE) += board_info.o From fb4a488eb91b089912ffbc9a74d0527f0f2c79ac Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Mon, 23 Jun 2025 14:10:06 -0600 Subject: [PATCH 16/16] Prepare v2025.07-rc5 Signed-off-by: Tom Rini --- Makefile | 2 +- doc/develop/release_cycle.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 451d8960ad1..6eb76d7abe8 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ VERSION = 2025 PATCHLEVEL = 07 SUBLEVEL = -EXTRAVERSION = -rc4 +EXTRAVERSION = -rc5 NAME = # *DOCUMENTATION* diff --git a/doc/develop/release_cycle.rst b/doc/develop/release_cycle.rst index fee7cca2628..408820e3cd5 100644 --- a/doc/develop/release_cycle.rst +++ b/doc/develop/release_cycle.rst @@ -79,7 +79,7 @@ For the next scheduled release, release candidates were made on:: * U-Boot |next_ver|-rc4 was released on Mon 09 June 2025. -.. * U-Boot |next_ver|-rc5 was released on Mon 23 June 2025. +* U-Boot |next_ver|-rc5 was released on Mon 23 June 2025. Please note that the following dates are planned only and may be deviated from as needed.