diff options
| author | Fabio Estevam <festevam@gmail.com> | 2025-10-06 17:10:56 -0300 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-10-09 10:58:07 +0100 |
| commit | 83e523af784d567a24a96615cca13c17d8f7c9e3 (patch) | |
| tree | a05b1eda82ae61310abe5c73d775e0ba5b745cd3 /meta/recipes-bsp | |
| parent | 966c7746037d79a3663cd9d3864051e74c60d01e (diff) | |
| download | poky-83e523af784d567a24a96615cca13c17d8f7c9e3.tar.gz | |
u-boot: upgrade 2025.07 -> 2025.10
Upgrade to U-Boot 2025.10.
Drop all the applied patches.
(From OE-Core rev: 237d980c114842f1e5bfa96228429bbf018ea2d6)
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-bsp')
| -rw-r--r-- | meta/recipes-bsp/u-boot/files/0001-Makefile-add-dependency-from-lib-to-arch-ARCH-lib.patch | 81 | ||||
| -rw-r--r-- | meta/recipes-bsp/u-boot/files/0001-nxp-Prepare-macros-for-KVM-changes.patch | 100 | ||||
| -rw-r--r-- | meta/recipes-bsp/u-boot/files/0002-arm-io.h-Fix-io-accessors-for-KVM.patch | 310 | ||||
| -rw-r--r-- | meta/recipes-bsp/u-boot/files/0003-qemu-arm-Enable-virtualizable-IO-accessors.patch | 41 | ||||
| -rw-r--r-- | meta/recipes-bsp/u-boot/u-boot-common.inc | 12 | ||||
| -rw-r--r-- | meta/recipes-bsp/u-boot/u-boot-tools_2025.10.bb (renamed from meta/recipes-bsp/u-boot/u-boot-tools_2025.07.bb) | 0 | ||||
| -rw-r--r-- | meta/recipes-bsp/u-boot/u-boot_2025.10.bb (renamed from meta/recipes-bsp/u-boot/u-boot_2025.07.bb) | 0 |
7 files changed, 3 insertions, 541 deletions
diff --git a/meta/recipes-bsp/u-boot/files/0001-Makefile-add-dependency-from-lib-to-arch-ARCH-lib.patch b/meta/recipes-bsp/u-boot/files/0001-Makefile-add-dependency-from-lib-to-arch-ARCH-lib.patch deleted file mode 100644 index 06fdaf5b0a..0000000000 --- a/meta/recipes-bsp/u-boot/files/0001-Makefile-add-dependency-from-lib-to-arch-ARCH-lib.patch +++ /dev/null | |||
| @@ -1,81 +0,0 @@ | |||
| 1 | From d0075e2d730a4fa48aa763a669e5edbc02c33a22 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Mikko Rapeli <mikko.rapeli@linaro.org> | ||
| 3 | Date: Thu, 31 Jul 2025 14:52:48 +0300 | ||
| 4 | Subject: [PATCH] Makefile: add dependency from lib to arch/$(ARCH)/lib | ||
| 5 | |||
| 6 | Top level Makefile starts separate "make" processes for each each | ||
| 7 | subdirectory. lib/efi_loader apps now depend on lib.a from | ||
| 8 | arch/$(ARCH)/lib if CONFIG_USE_PRIVATE_LIBGCC is enabled which creates | ||
| 9 | a race conditions since dependency from lib/efi_loader EFI apps to | ||
| 10 | arch/$(ARCH)/lib/lib.a is not explicit: | ||
| 11 | |||
| 12 | arm-poky-linux-gnueabi-ld.bfd: cannot find arch/arm/lib/lib.a: No such file or directory | ||
| 13 | make[3]: *** [scripts/Makefile.lib:512: lib/efi_loader/testapp_efi.so] Error 1 | ||
| 14 | |||
| 15 | This error was seen on yocto/OE-core CI builds after u-boot 2025.07 update: | ||
| 16 | |||
| 17 | https://lists.openembedded.org/g/openembedded-core/message/220004 | ||
| 18 | |||
| 19 | https://autobuilder.yoctoproject.org/valkyrie/api/v2/logs/2914600/raw_inline | ||
| 20 | |||
| 21 | | rm -f lib/efi_loader/built-in.o; arm-poky-linux-gnueabi-ar cDPrsT lib/efi_loader/built-in.o lib/efi_loader/efi_bootmgr.o lib/efi_loader/efi_bootbin.o lib/efi_loader | ||
| 22 | /efi_boottime.o lib/efi_loader/efi_helper.o lib/efi_loader/efi_console.o lib/efi_loader/efi_device_path.o lib/efi_loader/efi_device_path_to_text.o lib/efi_loader/efi_device_ | ||
| 23 | path_utilities.o lib/efi_loader/efi_dt_fixup.o lib/efi_loader/efi_fdt.o lib/efi_loader/efi_file.o lib/efi_loader/efi_hii.o lib/efi_loader/efi_hii_config.o lib/efi_loader/efi | ||
| 24 | _image_loader.o lib/efi_loader/efi_load_options.o lib/efi_loader/efi_memory.o lib/efi_loader/efi_root_node.o lib/efi_loader/efi_runtime.o lib/efi_loader/efi_setup.o lib/efi_ | ||
| 25 | loader/efi_string.o lib/efi_loader/efi_unicode_collation.o lib/efi_loader/efi_var_common.o lib/efi_loader/efi_var_mem.o lib/efi_loader/efi_variable.o lib/efi_loader/efi_var_ | ||
| 26 | file.o lib/efi_loader/efi_watchdog.o lib/efi_loader/efi_disk.o lib/efi_loader/efi_net.o lib/efi_loader/efi_smbios.o lib/efi_loader/efi_load_initrd.o lib/efi_loader/efi_confo | ||
| 27 | rmance.o | ||
| 28 | | arm-poky-linux-gnueabi-ld.bfd -nostdlib -zexecstack -znocombreloc -znorelro --no-warn-rwx-segments -L /srv/pokybuild/yocto-worker/oe-selftest-armhost/build/build-st- | ||
| 29 | 3119200/tmp/work/beaglebone_yocto-poky-linux-gnueabi/u-boot/2025.07/sources/u-boot-2025.07 -T arch/arm/lib/elf_arm_efi.lds -shared -Bsymbolic -s lib/efi_loader/helloworld.o | ||
| 30 | lib/efi_loader/efi_crt0.o lib/efi_loader/efi_reloc.o lib/efi_loader/efi_freestanding.o arch/arm/lib/lib.a -o lib/efi_loader/helloworld_efi.so | ||
| 31 | | arm-poky-linux-gnueabi-ld.bfd: cannot find arch/arm/lib/lib.a: No such file or directory | ||
| 32 | | make[3]: *** [scripts/Makefile.lib:512: lib/efi_loader/helloworld_efi.so] Error 1 | ||
| 33 | |||
| 34 | The different "make" processes share common scripts/Makefile.build | ||
| 35 | and scripts/Makefile.libs but since they are separate processes | ||
| 36 | the Makefile rules can't add a dependency from lib/uefi_loader targets | ||
| 37 | to arch/$(ARCH)/lib/lib.a. Or the file level dependency can be added but | ||
| 38 | then "make" produces a too sparse error message which does not mention | ||
| 39 | that one of the dependencies like arch/$(ARCH)/lib/lib.a was not found: | ||
| 40 | |||
| 41 | make[3]: *** No rule to make target 'lib/efi_loader/helloworld.efi', needed by '__build'. Stop. | ||
| 42 | |||
| 43 | Fix this dependency problem by building arch/$(ARCH)/lib before lib | ||
| 44 | if CONFIG_USE_PRIVATE_LIBGCC was enabled. | ||
| 45 | |||
| 46 | To reproduce the race condition more reliably, add a "sleep 10" delay | ||
| 47 | before linker command cmd_link_l_target with 2025.07 | ||
| 48 | or to $(lib-target): target in scripts/Makefile.build with master branch | ||
| 49 | after Kbuild update. | ||
| 50 | |||
| 51 | Fixes: 43d43241d1c9 ("scripts/Makefile.lib: add PLATFORM_LIBGCC to efi linking") | ||
| 52 | |||
| 53 | Cc: Adriano Cordova <adrianox@gmail.com> | ||
| 54 | Cc: Fabio Estevam <festevam@gmail.com> | ||
| 55 | Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org> | ||
| 56 | Reviewed-by: Fabio Estevam <festevam@gmail.com> | ||
| 57 | --- | ||
| 58 | Makefile | 5 +++++ | ||
| 59 | 1 file changed, 5 insertions(+) | ||
| 60 | |||
| 61 | Upstream-Status: Backport | ||
| 62 | |||
| 63 | diff --git a/Makefile b/Makefile | ||
| 64 | index c31bf7ecea97..b03f87a93fb9 100644 | ||
| 65 | --- a/Makefile | ||
| 66 | +++ b/Makefile | ||
| 67 | @@ -2131,6 +2131,11 @@ $(filter-out tools, $(u-boot-dirs)): tools | ||
| 68 | # is "yes"), so compile examples after U-Boot is compiled. | ||
| 69 | examples: $(filter-out examples, $(u-boot-dirs)) | ||
| 70 | |||
| 71 | +ifeq ($(CONFIG_USE_PRIVATE_LIBGCC),y) | ||
| 72 | +# lib/efi_loader apps depend on arch/$(ARCH)/lib for lib.a | ||
| 73 | +lib: $(filter arch/$(ARCH)/lib, $(u-boot-dirs)) | ||
| 74 | +endif | ||
| 75 | + | ||
| 76 | # The setlocalversion script comes from linux and expects a | ||
| 77 | # KERNELVERSION variable in the environment for figuring out which | ||
| 78 | # annotated tags are relevant. Pass UBOOTVERSION. | ||
| 79 | -- | ||
| 80 | 2.43.0 | ||
| 81 | |||
diff --git a/meta/recipes-bsp/u-boot/files/0001-nxp-Prepare-macros-for-KVM-changes.patch b/meta/recipes-bsp/u-boot/files/0001-nxp-Prepare-macros-for-KVM-changes.patch deleted file mode 100644 index fa34c8033e..0000000000 --- a/meta/recipes-bsp/u-boot/files/0001-nxp-Prepare-macros-for-KVM-changes.patch +++ /dev/null | |||
| @@ -1,100 +0,0 @@ | |||
| 1 | From 9be804cbfde1df715d79247b27de4b388c714cde Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Ilias Apalodimas <ilias.apalodimas@linaro.org> | ||
| 3 | Date: Wed, 18 Jun 2025 09:58:12 +0300 | ||
| 4 | Subject: [PATCH 1/3] nxp: Prepare macros for KVM changes | ||
| 5 | |||
| 6 | A following patch is replacing our IO accessors with | ||
| 7 | do { ... } while(0) ones in order to make them usable with KVM. | ||
| 8 | |||
| 9 | That leads to an error eventually looking like this: | ||
| 10 | arch/arm/include/asm/io.h:62:9: error: expected expression before 'do' | ||
| 11 | 62 | do { \ | ||
| 12 | | ^~ | ||
| 13 | arch/arm/include/asm/io.h:211:41: note: in expansion of macro '__raw_writel' | ||
| 14 | 211 | #define out_arch(type,endian,a,v) __raw_write##type(cpu_to_##endian(v),a) | ||
| 15 | | ^~~~~~~~~~~ | ||
| 16 | arch/arm/include/asm/io.h:223:25: note: in expansion of macro 'out_arch' | ||
| 17 | 223 | #define out_be32(a,v) out_arch(l,be32,a,v) | ||
| 18 | | ^~~~~~~~ | ||
| 19 | drivers/spi/fsl_dspi.c:127:17: note: in expansion of macro 'out_be32' | ||
| 20 | 127 | out_be32(addr, val) : out_le32(addr, val); | ||
| 21 | | ^~~~~~~~ | ||
| 22 | |||
| 23 | So adjust the current macros and code to be compatible with the upcoming | ||
| 24 | change. | ||
| 25 | |||
| 26 | Upstream-Status: Backport [https://github.com/u-boot/u-boot/commit/b56c0632ad62] | ||
| 27 | Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> | ||
| 28 | Reviewed-by: Tom Rini <trini@konsulko.com> | ||
| 29 | Signed-off-by: Fabio Estevam <festevam@gmail.com> | ||
| 30 | --- | ||
| 31 | drivers/spi/fsl_dspi.c | 6 ++++-- | ||
| 32 | include/fsl_ifc.h | 24 ++++++++++++------------ | ||
| 33 | 2 files changed, 16 insertions(+), 14 deletions(-) | ||
| 34 | |||
| 35 | diff --git a/drivers/spi/fsl_dspi.c b/drivers/spi/fsl_dspi.c | ||
| 36 | index f2393c041f44..545561ad1169 100644 | ||
| 37 | --- a/drivers/spi/fsl_dspi.c | ||
| 38 | +++ b/drivers/spi/fsl_dspi.c | ||
| 39 | @@ -123,8 +123,10 @@ static uint dspi_read32(uint flags, uint *addr) | ||
| 40 | |||
| 41 | static void dspi_write32(uint flags, uint *addr, uint val) | ||
| 42 | { | ||
| 43 | - flags & DSPI_FLAG_REGMAP_ENDIAN_BIG ? | ||
| 44 | - out_be32(addr, val) : out_le32(addr, val); | ||
| 45 | + if (flags & DSPI_FLAG_REGMAP_ENDIAN_BIG) | ||
| 46 | + out_be32(addr, val); | ||
| 47 | + else | ||
| 48 | + out_le32(addr, val); | ||
| 49 | } | ||
| 50 | |||
| 51 | static void dspi_halt(struct fsl_dspi_priv *priv, u8 halt) | ||
| 52 | diff --git a/include/fsl_ifc.h b/include/fsl_ifc.h | ||
| 53 | index 3ac226879303..1c363115beb2 100644 | ||
| 54 | --- a/include/fsl_ifc.h | ||
| 55 | +++ b/include/fsl_ifc.h | ||
| 56 | @@ -803,29 +803,29 @@ void init_final_memctl_regs(void); | ||
| 57 | ((struct fsl_ifc_fcm *)CFG_SYS_IFC_ADDR) | ||
| 58 | |||
| 59 | #define get_ifc_cspr_ext(i) \ | ||
| 60 | - (ifc_in32(&(IFC_FCM_BASE_ADDR)->cspr_cs[i].cspr_ext)) | ||
| 61 | + ifc_in32(&(IFC_FCM_BASE_ADDR)->cspr_cs[i].cspr_ext) | ||
| 62 | #define get_ifc_cspr(i) \ | ||
| 63 | - (ifc_in32(&(IFC_FCM_BASE_ADDR)->cspr_cs[i].cspr)) | ||
| 64 | + ifc_in32(&(IFC_FCM_BASE_ADDR)->cspr_cs[i].cspr) | ||
| 65 | #define get_ifc_csor_ext(i) \ | ||
| 66 | - (ifc_in32(&(IFC_FCM_BASE_ADDR)->csor_cs[i].csor_ext)) | ||
| 67 | + ifc_in32(&(IFC_FCM_BASE_ADDR)->csor_cs[i].csor_ext) | ||
| 68 | #define get_ifc_csor(i) \ | ||
| 69 | - (ifc_in32(&(IFC_FCM_BASE_ADDR)->csor_cs[i].csor)) | ||
| 70 | + ifc_in32(&(IFC_FCM_BASE_ADDR)->csor_cs[i].csor) | ||
| 71 | #define get_ifc_amask(i) \ | ||
| 72 | - (ifc_in32(&(IFC_FCM_BASE_ADDR)->amask_cs[i].amask)) | ||
| 73 | + ifc_in32(&(IFC_FCM_BASE_ADDR)->amask_cs[i].amask) | ||
| 74 | #define get_ifc_ftim(i, j) \ | ||
| 75 | - (ifc_in32(&(IFC_FCM_BASE_ADDR)->ftim_cs[i].ftim[j])) | ||
| 76 | + ifc_in32(&(IFC_FCM_BASE_ADDR)->ftim_cs[i].ftim[j]) | ||
| 77 | #define set_ifc_cspr_ext(i, v) \ | ||
| 78 | - (ifc_out32(&(IFC_FCM_BASE_ADDR)->cspr_cs[i].cspr_ext, v)) | ||
| 79 | + ifc_out32(&(IFC_FCM_BASE_ADDR)->cspr_cs[i].cspr_ext, v) | ||
| 80 | #define set_ifc_cspr(i, v) \ | ||
| 81 | - (ifc_out32(&(IFC_FCM_BASE_ADDR)->cspr_cs[i].cspr, v)) | ||
| 82 | + ifc_out32(&(IFC_FCM_BASE_ADDR)->cspr_cs[i].cspr, v) | ||
| 83 | #define set_ifc_csor_ext(i, v) \ | ||
| 84 | - (ifc_out32(&(IFC_FCM_BASE_ADDR)->csor_cs[i].csor_ext, v)) | ||
| 85 | + ifc_out32(&(IFC_FCM_BASE_ADDR)->csor_cs[i].csor_ext, v) | ||
| 86 | #define set_ifc_csor(i, v) \ | ||
| 87 | - (ifc_out32(&(IFC_FCM_BASE_ADDR)->csor_cs[i].csor, v)) | ||
| 88 | + ifc_out32(&(IFC_FCM_BASE_ADDR)->csor_cs[i].csor, v) | ||
| 89 | #define set_ifc_amask(i, v) \ | ||
| 90 | - (ifc_out32(&(IFC_FCM_BASE_ADDR)->amask_cs[i].amask, v)) | ||
| 91 | + ifc_out32(&(IFC_FCM_BASE_ADDR)->amask_cs[i].amask, v) | ||
| 92 | #define set_ifc_ftim(i, j, v) \ | ||
| 93 | - (ifc_out32(&(IFC_FCM_BASE_ADDR)->ftim_cs[i].ftim[j], v)) | ||
| 94 | + ifc_out32(&(IFC_FCM_BASE_ADDR)->ftim_cs[i].ftim[j], v) | ||
| 95 | |||
| 96 | enum ifc_chip_sel { | ||
| 97 | IFC_CS0, | ||
| 98 | -- | ||
| 99 | 2.34.1 | ||
| 100 | |||
diff --git a/meta/recipes-bsp/u-boot/files/0002-arm-io.h-Fix-io-accessors-for-KVM.patch b/meta/recipes-bsp/u-boot/files/0002-arm-io.h-Fix-io-accessors-for-KVM.patch deleted file mode 100644 index 558d753d4a..0000000000 --- a/meta/recipes-bsp/u-boot/files/0002-arm-io.h-Fix-io-accessors-for-KVM.patch +++ /dev/null | |||
| @@ -1,310 +0,0 @@ | |||
| 1 | From 2fc16d8de5bbe2a40ab25445936150c3250a9077 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Ilias Apalodimas <ilias.apalodimas@linaro.org> | ||
| 3 | Date: Wed, 18 Jun 2025 09:58:13 +0300 | ||
| 4 | Subject: [PATCH 2/3] arm: io.h: Fix io accessors for KVM | ||
| 5 | |||
| 6 | commit 2e2c2a5e72a8 ("arm: qemu: override flash accessors to use virtualizable instructions") | ||
| 7 | explains why we can't have instructions with multiple output registers | ||
| 8 | when running under QEMU + KVM and the instruction leads to an exception | ||
| 9 | to the hypervisor. | ||
| 10 | |||
| 11 | USB XHCI is such a case (MMIO) where a ldr w1, [x0], #4 is emitted for | ||
| 12 | xhci_start() which works fine with QEMU but crashes for QEMU + KVM. | ||
| 13 | |||
| 14 | These instructions cannot be emulated by KVM as they do not produce | ||
| 15 | syndrome information data that KVM can use to infer the destination | ||
| 16 | register, the faulting address, whether it was a load or store, or | ||
| 17 | if it's a 32 or 64 bit general-purpose register. | ||
| 18 | As a result an external abort is injected from QEMU, via ext_dabt_pending | ||
| 19 | to KVM and we end up throwing an exception that looks like | ||
| 20 | |||
| 21 | U-Boot 2025.07-rc4 (Jun 10 2025 - 12:00:15 +0000) | ||
| 22 | [...] | ||
| 23 | Register 8001040 NbrPorts 8 | ||
| 24 | Starting the controller | ||
| 25 | "Synchronous Abort" handler, esr 0x96000010, far 0x10100040 | ||
| 26 | elr: 000000000005b1c8 lr : 000000000005b1ac (reloc) | ||
| 27 | elr: 00000000476fc1c8 lr : 00000000476fc1ac | ||
| 28 | x0 : 0000000010100040 x1 : 0000000000000001 | ||
| 29 | x2 : 0000000000000000 x3 : 0000000000003e80 | ||
| 30 | x4 : 0000000000000000 x5 : 00000000477a5694 | ||
| 31 | x6 : 0000000000000038 x7 : 000000004666f360 | ||
| 32 | x8 : 0000000000000000 x9 : 00000000ffffffd8 | ||
| 33 | x10: 000000000000000d x11: 0000000000000006 | ||
| 34 | x12: 0000000046560a78 x13: 0000000046560dd0 | ||
| 35 | x14: 00000000ffffffff x15: 000000004666eed2 | ||
| 36 | x16: 00000000476ee2f0 x17: 0000000000000000 | ||
| 37 | x18: 0000000046660dd0 x19: 000000004666f480 | ||
| 38 | x20: 0000000000000000 x21: 0000000010100040 | ||
| 39 | x22: 0000000010100000 x23: 0000000000000000 | ||
| 40 | x24: 0000000000000000 x25: 0000000000000000 | ||
| 41 | x26: 0000000000000000 x27: 0000000000000000 | ||
| 42 | x28: 0000000000000000 x29: 000000004666f360 | ||
| 43 | |||
| 44 | Code: d5033fbf aa1503e0 5287d003 52800002 (b8004401) | ||
| 45 | Resetting CPU ... | ||
| 46 | |||
| 47 | There are two problems making this the default. | ||
| 48 | - It will emit ldr + add or str + add instead of ldr/str(post increment) | ||
| 49 | in somne cases | ||
| 50 | - Some platforms that depend on TPL/SPL grow in size enough so that the | ||
| 51 | binary doesn't fit anymore. | ||
| 52 | |||
| 53 | So let's add proper I/O accessors add a Kconfig option | ||
| 54 | to turn it off by default apart from our QEMU builds. | ||
| 55 | |||
| 56 | Upstream-Status: Backport [https://github.com/u-boot/u-boot/commit/dc512700ad46] | ||
| 57 | Reported-by: Mikko Rapeli <mikko.rapeli@linaro.org> | ||
| 58 | Tested-by: Mikko Rapeli <mikko.rapeli@linaro.org> | ||
| 59 | Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> | ||
| 60 | Signed-off-by: Fabio Estevam <festevam@gmail.com> | ||
| 61 | --- | ||
| 62 | arch/arm/Kconfig | 12 +++ | ||
| 63 | arch/arm/include/asm/io.h | 152 ++++++++++++++++++++++++++++---------- | ||
| 64 | 2 files changed, 124 insertions(+), 40 deletions(-) | ||
| 65 | |||
| 66 | diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig | ||
| 67 | index 6ff3f2750ea8..f6430a5aaf07 100644 | ||
| 68 | --- a/arch/arm/Kconfig | ||
| 69 | +++ b/arch/arm/Kconfig | ||
| 70 | @@ -108,6 +108,18 @@ config LNX_KRNL_IMG_TEXT_OFFSET_BASE | ||
| 71 | The value subtracted from CONFIG_TEXT_BASE to calculate the | ||
| 72 | TEXT_OFFSET value written to the Linux kernel image header. | ||
| 73 | |||
| 74 | +config KVM_VIRT_INS | ||
| 75 | + bool "Emit virtualizable instructions" | ||
| 76 | + help | ||
| 77 | + Instructions in the ARM ISA that have multiple output registers, | ||
| 78 | + can't be used if the instruction leads to an exception to the hypervisor. | ||
| 79 | + These instructions cannot be emulated by KVM because they do not produce | ||
| 80 | + syndrome information data that KVM can use to infer the destination | ||
| 81 | + register, the faulting address, whether it was a load or store, | ||
| 82 | + if it's a 32 or 64 bit general-purpose register amongst other things. | ||
| 83 | + Use this to produce virtualizable instructions if you plan to run U-Boot | ||
| 84 | + with KVM. | ||
| 85 | + | ||
| 86 | config NVIC | ||
| 87 | bool | ||
| 88 | |||
| 89 | diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h | ||
| 90 | index 89b1015bc4d3..85ec0e6937e8 100644 | ||
| 91 | --- a/arch/arm/include/asm/io.h | ||
| 92 | +++ b/arch/arm/include/asm/io.h | ||
| 93 | @@ -20,23 +20,108 @@ static inline void sync(void) | ||
| 94 | { | ||
| 95 | } | ||
| 96 | |||
| 97 | -/* Generic virtual read/write. */ | ||
| 98 | -#define __arch_getb(a) (*(volatile unsigned char *)(a)) | ||
| 99 | -#define __arch_getw(a) (*(volatile unsigned short *)(a)) | ||
| 100 | -#define __arch_getl(a) (*(volatile unsigned int *)(a)) | ||
| 101 | -#define __arch_getq(a) (*(volatile unsigned long long *)(a)) | ||
| 102 | +#ifdef CONFIG_ARM64 | ||
| 103 | +#define __W "w" | ||
| 104 | +#else | ||
| 105 | +#define __W | ||
| 106 | +#endif | ||
| 107 | + | ||
| 108 | +#if CONFIG_IS_ENABLED(SYS_THUMB_BUILD) | ||
| 109 | +#define __R "l" | ||
| 110 | +#define __RM "=l" | ||
| 111 | +#else | ||
| 112 | +#define __R "r" | ||
| 113 | +#define __RM "=r" | ||
| 114 | +#endif | ||
| 115 | |||
| 116 | -#define __arch_putb(v,a) (*(volatile unsigned char *)(a) = (v)) | ||
| 117 | -#define __arch_putw(v,a) (*(volatile unsigned short *)(a) = (v)) | ||
| 118 | -#define __arch_putl(v,a) (*(volatile unsigned int *)(a) = (v)) | ||
| 119 | -#define __arch_putq(v,a) (*(volatile unsigned long long *)(a) = (v)) | ||
| 120 | +#ifdef CONFIG_KVM_VIRT_INS | ||
| 121 | +/* | ||
| 122 | + * The __raw_writeX/__raw_readX below should be converted to static inline | ||
| 123 | + * functions. However doing so produces a lot of compilation warnings when | ||
| 124 | + * called with a raw address. Convert these once the callers have been fixed. | ||
| 125 | + */ | ||
| 126 | +#define __raw_writeb(val, addr) \ | ||
| 127 | + do { \ | ||
| 128 | + asm volatile("strb %" __W "0, [%1]" \ | ||
| 129 | + : \ | ||
| 130 | + : __R ((u8)(val)), __R (addr)); \ | ||
| 131 | + } while (0) | ||
| 132 | + | ||
| 133 | +#define __raw_readb(addr) \ | ||
| 134 | + ({ \ | ||
| 135 | + u32 __val; \ | ||
| 136 | + asm volatile("ldrb %" __W "0, [%1]" \ | ||
| 137 | + : __RM (__val) \ | ||
| 138 | + : __R (addr)); \ | ||
| 139 | + __val; \ | ||
| 140 | + }) | ||
| 141 | + | ||
| 142 | +#define __raw_writew(val, addr) \ | ||
| 143 | + do { \ | ||
| 144 | + asm volatile("strh %" __W "0, [%1]" \ | ||
| 145 | + : \ | ||
| 146 | + : __R ((u16)(val)), __R (addr)); \ | ||
| 147 | + } while (0) | ||
| 148 | + | ||
| 149 | +#define __raw_readw(addr) \ | ||
| 150 | + ({ \ | ||
| 151 | + u32 __val; \ | ||
| 152 | + asm volatile("ldrh %" __W "0, [%1]" \ | ||
| 153 | + : __RM (__val) \ | ||
| 154 | + : __R (addr)); \ | ||
| 155 | + __val; \ | ||
| 156 | + }) | ||
| 157 | + | ||
| 158 | +#define __raw_writel(val, addr) \ | ||
| 159 | + do { \ | ||
| 160 | + asm volatile("str %" __W "0, [%1]" \ | ||
| 161 | + : \ | ||
| 162 | + : __R ((u32)(val)), __R (addr)); \ | ||
| 163 | + } while (0) | ||
| 164 | + | ||
| 165 | +#define __raw_readl(addr) \ | ||
| 166 | + ({ \ | ||
| 167 | + u32 __val; \ | ||
| 168 | + asm volatile("ldr %" __W "0, [%1]" \ | ||
| 169 | + : __RM (__val) \ | ||
| 170 | + : __R (addr)); \ | ||
| 171 | + __val; \ | ||
| 172 | + }) | ||
| 173 | + | ||
| 174 | +#define __raw_writeq(val, addr) \ | ||
| 175 | + do { \ | ||
| 176 | + asm volatile("str %0, [%1]" \ | ||
| 177 | + : \ | ||
| 178 | + : __R ((u64)(val)), __R (addr)); \ | ||
| 179 | + } while (0) | ||
| 180 | + | ||
| 181 | +#define __raw_readq(addr) \ | ||
| 182 | + ({ \ | ||
| 183 | + u64 __val; \ | ||
| 184 | + asm volatile("ldr %0, [%1]" \ | ||
| 185 | + : __RM (__val) \ | ||
| 186 | + : __R (addr)); \ | ||
| 187 | + __val; \ | ||
| 188 | + }) | ||
| 189 | +#else | ||
| 190 | +/* Generic virtual read/write. */ | ||
| 191 | +#define __raw_readb(a) (*(volatile unsigned char *)(a)) | ||
| 192 | +#define __raw_readw(a) (*(volatile unsigned short *)(a)) | ||
| 193 | +#define __raw_readl(a) (*(volatile unsigned int *)(a)) | ||
| 194 | +#define __raw_readq(a) (*(volatile unsigned long long *)(a)) | ||
| 195 | + | ||
| 196 | +#define __raw_writeb(v, a) (*(volatile unsigned char *)(a) = (v)) | ||
| 197 | +#define __raw_writew(v, a) (*(volatile unsigned short *)(a) = (v)) | ||
| 198 | +#define __raw_writel(v, a) (*(volatile unsigned int *)(a) = (v)) | ||
| 199 | +#define __raw_writeq(v, a) (*(volatile unsigned long long *)(a) = (v)) | ||
| 200 | +#endif | ||
| 201 | |||
| 202 | static inline void __raw_writesb(unsigned long addr, const void *data, | ||
| 203 | int bytelen) | ||
| 204 | { | ||
| 205 | uint8_t *buf = (uint8_t *)data; | ||
| 206 | while(bytelen--) | ||
| 207 | - __arch_putb(*buf++, addr); | ||
| 208 | + __raw_writeb(*buf++, addr); | ||
| 209 | } | ||
| 210 | |||
| 211 | static inline void __raw_writesw(unsigned long addr, const void *data, | ||
| 212 | @@ -44,7 +129,7 @@ static inline void __raw_writesw(unsigned long addr, const void *data, | ||
| 213 | { | ||
| 214 | uint16_t *buf = (uint16_t *)data; | ||
| 215 | while(wordlen--) | ||
| 216 | - __arch_putw(*buf++, addr); | ||
| 217 | + __raw_writew(*buf++, addr); | ||
| 218 | } | ||
| 219 | |||
| 220 | static inline void __raw_writesl(unsigned long addr, const void *data, | ||
| 221 | @@ -52,40 +137,30 @@ static inline void __raw_writesl(unsigned long addr, const void *data, | ||
| 222 | { | ||
| 223 | uint32_t *buf = (uint32_t *)data; | ||
| 224 | while(longlen--) | ||
| 225 | - __arch_putl(*buf++, addr); | ||
| 226 | + __raw_writel(*buf++, addr); | ||
| 227 | } | ||
| 228 | |||
| 229 | static inline void __raw_readsb(unsigned long addr, void *data, int bytelen) | ||
| 230 | { | ||
| 231 | uint8_t *buf = (uint8_t *)data; | ||
| 232 | while(bytelen--) | ||
| 233 | - *buf++ = __arch_getb(addr); | ||
| 234 | + *buf++ = __raw_readb(addr); | ||
| 235 | } | ||
| 236 | |||
| 237 | static inline void __raw_readsw(unsigned long addr, void *data, int wordlen) | ||
| 238 | { | ||
| 239 | uint16_t *buf = (uint16_t *)data; | ||
| 240 | while(wordlen--) | ||
| 241 | - *buf++ = __arch_getw(addr); | ||
| 242 | + *buf++ = __raw_readw(addr); | ||
| 243 | } | ||
| 244 | |||
| 245 | static inline void __raw_readsl(unsigned long addr, void *data, int longlen) | ||
| 246 | { | ||
| 247 | uint32_t *buf = (uint32_t *)data; | ||
| 248 | while(longlen--) | ||
| 249 | - *buf++ = __arch_getl(addr); | ||
| 250 | + *buf++ = __raw_readl(addr); | ||
| 251 | } | ||
| 252 | |||
| 253 | -#define __raw_writeb(v,a) __arch_putb(v,a) | ||
| 254 | -#define __raw_writew(v,a) __arch_putw(v,a) | ||
| 255 | -#define __raw_writel(v,a) __arch_putl(v,a) | ||
| 256 | -#define __raw_writeq(v,a) __arch_putq(v,a) | ||
| 257 | - | ||
| 258 | -#define __raw_readb(a) __arch_getb(a) | ||
| 259 | -#define __raw_readw(a) __arch_getw(a) | ||
| 260 | -#define __raw_readl(a) __arch_getl(a) | ||
| 261 | -#define __raw_readq(a) __arch_getq(a) | ||
| 262 | - | ||
| 263 | /* | ||
| 264 | * TODO: The kernel offers some more advanced versions of barriers, it might | ||
| 265 | * have some advantages to use them instead of the simple one here. | ||
| 266 | @@ -98,15 +173,15 @@ static inline void __raw_readsl(unsigned long addr, void *data, int longlen) | ||
| 267 | |||
| 268 | #define smp_processor_id() 0 | ||
| 269 | |||
| 270 | -#define writeb(v,c) ({ u8 __v = v; __iowmb(); __arch_putb(__v,c); __v; }) | ||
| 271 | -#define writew(v,c) ({ u16 __v = v; __iowmb(); __arch_putw(__v,c); __v; }) | ||
| 272 | -#define writel(v,c) ({ u32 __v = v; __iowmb(); __arch_putl(__v,c); __v; }) | ||
| 273 | -#define writeq(v,c) ({ u64 __v = v; __iowmb(); __arch_putq(__v,c); __v; }) | ||
| 274 | +#define writeb(v, c) ({ u8 __v = v; __iowmb(); writeb_relaxed(__v, c); __v; }) | ||
| 275 | +#define writew(v, c) ({ u16 __v = v; __iowmb(); writew_relaxed(__v, c); __v; }) | ||
| 276 | +#define writel(v, c) ({ u32 __v = v; __iowmb(); writel_relaxed(__v, c); __v; }) | ||
| 277 | +#define writeq(v, c) ({ u64 __v = v; __iowmb(); writeq_relaxed(__v, c); __v; }) | ||
| 278 | |||
| 279 | -#define readb(c) ({ u8 __v = __arch_getb(c); __iormb(); __v; }) | ||
| 280 | -#define readw(c) ({ u16 __v = __arch_getw(c); __iormb(); __v; }) | ||
| 281 | -#define readl(c) ({ u32 __v = __arch_getl(c); __iormb(); __v; }) | ||
| 282 | -#define readq(c) ({ u64 __v = __arch_getq(c); __iormb(); __v; }) | ||
| 283 | +#define readb(c) ({ u8 __v = readb_relaxed(c); __iormb(); __v; }) | ||
| 284 | +#define readw(c) ({ u16 __v = readw_relaxed(c); __iormb(); __v; }) | ||
| 285 | +#define readl(c) ({ u32 __v = readl_relaxed(c); __iormb(); __v; }) | ||
| 286 | +#define readq(c) ({ u64 __v = readq_relaxed(c); __iormb(); __v; }) | ||
| 287 | |||
| 288 | /* | ||
| 289 | * Relaxed I/O memory access primitives. These follow the Device memory | ||
| 290 | @@ -121,13 +196,10 @@ static inline void __raw_readsl(unsigned long addr, void *data, int longlen) | ||
| 291 | #define readq_relaxed(c) ({ u64 __r = le64_to_cpu((__force __le64) \ | ||
| 292 | __raw_readq(c)); __r; }) | ||
| 293 | |||
| 294 | -#define writeb_relaxed(v, c) ((void)__raw_writeb((v), (c))) | ||
| 295 | -#define writew_relaxed(v, c) ((void)__raw_writew((__force u16) \ | ||
| 296 | - cpu_to_le16(v), (c))) | ||
| 297 | -#define writel_relaxed(v, c) ((void)__raw_writel((__force u32) \ | ||
| 298 | - cpu_to_le32(v), (c))) | ||
| 299 | -#define writeq_relaxed(v, c) ((void)__raw_writeq((__force u64) \ | ||
| 300 | - cpu_to_le64(v), (c))) | ||
| 301 | +#define writeb_relaxed(v, c) __raw_writeb((v), (c)) | ||
| 302 | +#define writew_relaxed(v, c) __raw_writew((__force u16)cpu_to_le16(v), (c)) | ||
| 303 | +#define writel_relaxed(v, c) __raw_writel((__force u32)cpu_to_le32(v), (c)) | ||
| 304 | +#define writeq_relaxed(v, c) __raw_writeq((__force u64)cpu_to_le64(v), (c)) | ||
| 305 | |||
| 306 | /* | ||
| 307 | * The compiler seems to be incapable of optimising constants | ||
| 308 | -- | ||
| 309 | 2.34.1 | ||
| 310 | |||
diff --git a/meta/recipes-bsp/u-boot/files/0003-qemu-arm-Enable-virtualizable-IO-accessors.patch b/meta/recipes-bsp/u-boot/files/0003-qemu-arm-Enable-virtualizable-IO-accessors.patch deleted file mode 100644 index 520c9226b4..0000000000 --- a/meta/recipes-bsp/u-boot/files/0003-qemu-arm-Enable-virtualizable-IO-accessors.patch +++ /dev/null | |||
| @@ -1,41 +0,0 @@ | |||
| 1 | From cb6120b4bfd8b24dde7e0d1eda882e203a849d3f Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Ilias Apalodimas <ilias.apalodimas@linaro.org> | ||
| 3 | Date: Wed, 18 Jun 2025 09:58:14 +0300 | ||
| 4 | Subject: [PATCH 3/3] qemu: arm: Enable virtualizable IO accessors | ||
| 5 | |||
| 6 | We recently added IO accessors that will work with KVM for any MMIO | ||
| 7 | access that casues an exception to the hypervisor. Enable them by | ||
| 8 | default for QEMU. | ||
| 9 | |||
| 10 | Upstream-Status: Backport [https://github.com/u-boot/u-boot/commit/fcc60481ae75] | ||
| 11 | Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> | ||
| 12 | Tested-by: Mikko Rapeli <mikko.rapeli@linaro.org> | ||
| 13 | Signed-off-by: Fabio Estevam <festevam@gmail.com> | ||
| 14 | --- | ||
| 15 | configs/qemu_arm64_defconfig | 1 + | ||
| 16 | configs/qemu_arm_defconfig | 1 + | ||
| 17 | 2 files changed, 2 insertions(+) | ||
| 18 | |||
| 19 | diff --git a/configs/qemu_arm64_defconfig b/configs/qemu_arm64_defconfig | ||
| 20 | index 72bd255eafa3..39afb837e411 100644 | ||
| 21 | --- a/configs/qemu_arm64_defconfig | ||
| 22 | +++ b/configs/qemu_arm64_defconfig | ||
| 23 | @@ -1,4 +1,5 @@ | ||
| 24 | CONFIG_ARM=y | ||
| 25 | +CONFIG_KVM_VIRT_INS=y | ||
| 26 | CONFIG_ARCH_QEMU=y | ||
| 27 | CONFIG_SYS_MALLOC_LEN=0x1000000 | ||
| 28 | CONFIG_BLOBLIST_SIZE_RELOC=0x2000 | ||
| 29 | diff --git a/configs/qemu_arm_defconfig b/configs/qemu_arm_defconfig | ||
| 30 | index f13001390d4d..92ba48f6af97 100644 | ||
| 31 | --- a/configs/qemu_arm_defconfig | ||
| 32 | +++ b/configs/qemu_arm_defconfig | ||
| 33 | @@ -1,4 +1,5 @@ | ||
| 34 | CONFIG_ARM=y | ||
| 35 | +CONFIG_KVM_VIRT_INS=y | ||
| 36 | CONFIG_ARM_SMCCC=y | ||
| 37 | CONFIG_ARCH_QEMU=y | ||
| 38 | CONFIG_SYS_MALLOC_LEN=0x1000000 | ||
| 39 | -- | ||
| 40 | 2.34.1 | ||
| 41 | |||
diff --git a/meta/recipes-bsp/u-boot/u-boot-common.inc b/meta/recipes-bsp/u-boot/u-boot-common.inc index ea55545db3..93ff0ca6ca 100644 --- a/meta/recipes-bsp/u-boot/u-boot-common.inc +++ b/meta/recipes-bsp/u-boot/u-boot-common.inc | |||
| @@ -12,15 +12,9 @@ PE = "1" | |||
| 12 | 12 | ||
| 13 | # We use the revision in order to avoid having to fetch it from the | 13 | # We use the revision in order to avoid having to fetch it from the |
| 14 | # repo during parse | 14 | # repo during parse |
| 15 | SRCREV = "e37de002fac3895e8d0b60ae2015e17bb33e2b5b" | 15 | SRCREV = "e50b1e8715011def8aff1588081a2649a2c6cd47" |
| 16 | 16 | ||
| 17 | SRC_URI = "\ | 17 | SRC_URI = "git://source.denx.de/u-boot/u-boot.git;protocol=https;branch=master;tag=v${PV}" |
| 18 | git://source.denx.de/u-boot/u-boot.git;protocol=https;branch=master;tag=v${PV} \ | ||
| 19 | file://0001-Makefile-add-dependency-from-lib-to-arch-ARCH-lib.patch \ | ||
| 20 | file://0001-nxp-Prepare-macros-for-KVM-changes.patch \ | ||
| 21 | file://0002-arm-io.h-Fix-io-accessors-for-KVM.patch \ | ||
| 22 | file://0003-qemu-arm-Enable-virtualizable-IO-accessors.patch \ | ||
| 23 | " | ||
| 24 | 18 | ||
| 25 | SRC_URI_RISCV = "\ | 19 | SRC_URI_RISCV = "\ |
| 26 | file://u-boot-riscv-isa_clear.cfg \ | 20 | file://u-boot-riscv-isa_clear.cfg \ |
diff --git a/meta/recipes-bsp/u-boot/u-boot-tools_2025.07.bb b/meta/recipes-bsp/u-boot/u-boot-tools_2025.10.bb index 7eaf721ca8..7eaf721ca8 100644 --- a/meta/recipes-bsp/u-boot/u-boot-tools_2025.07.bb +++ b/meta/recipes-bsp/u-boot/u-boot-tools_2025.10.bb | |||
diff --git a/meta/recipes-bsp/u-boot/u-boot_2025.07.bb b/meta/recipes-bsp/u-boot/u-boot_2025.10.bb index 25f264c961..25f264c961 100644 --- a/meta/recipes-bsp/u-boot/u-boot_2025.07.bb +++ b/meta/recipes-bsp/u-boot/u-boot_2025.10.bb | |||
