From 3e02345729e6c661122a8eac4e344e341ff255ca Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Thu, 13 Mar 2025 22:37:16 +0000 Subject: [PATCH 01/61] 2025.04 RC4 --- ...identifiers-for-the-new-RPi-5-series.patch | 43 ----- rpi-fixes.patch | 156 ++++++++++++++++++ sources | 2 +- uboot-tools.spec | 14 +- 4 files changed, 165 insertions(+), 50 deletions(-) delete mode 100644 rpi-Add-identifiers-for-the-new-RPi-5-series.patch create mode 100644 rpi-fixes.patch diff --git a/rpi-Add-identifiers-for-the-new-RPi-5-series.patch b/rpi-Add-identifiers-for-the-new-RPi-5-series.patch deleted file mode 100644 index 66db2ca..0000000 --- a/rpi-Add-identifiers-for-the-new-RPi-5-series.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 49423505898eef1baefa2823408dad8321571353 Mon Sep 17 00:00:00 2001 -From: Peter Robinson -Date: Sun, 29 Dec 2024 14:43:33 +0000 -Subject: [PATCH] rpi: Add identifiers for the new RPi 5 series - -The Raspberry Pi foundation have released the Raspberry -Pi 500, CM5 an CM5 lite devices so add the assoicated -revision identifers so we can detect them. - -Signed-off-by: Peter Robinson ---- - board/raspberrypi/rpi/rpi.c | 15 +++++++++++++++ - 1 file changed, 15 insertions(+) - -diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c -index 18be244aa79..1e43c631898 100644 ---- a/board/raspberrypi/rpi/rpi.c -+++ b/board/raspberrypi/rpi/rpi.c -@@ -193,6 +193,21 @@ static const struct rpi_model rpi_models_new_scheme[] = { - DTB_DIR "bcm2712-rpi-5-b.dtb", - true, - }, -+ [0x18] = { -+ "Compute Module 5", -+ DTB_DIR "bcm2712-rpi-cm5-cm5io.dtb", -+ true, -+ }, -+ [0x19] = { -+ "500", -+ DTB_DIR "bcm2712-rpi-500.dtb", -+ true, -+ }, -+ [0x1A] = { -+ "Compute Module 5 Lite", -+ DTB_DIR "bcm2712-rpi-cm5l-cm5io.dtb", -+ true, -+ }, - }; - - static const struct rpi_model rpi_models_old_scheme[] = { --- -2.47.1 - diff --git a/rpi-fixes.patch b/rpi-fixes.patch new file mode 100644 index 0000000..352261b --- /dev/null +++ b/rpi-fixes.patch @@ -0,0 +1,156 @@ +From 27e0160320c13168ab5d703c5ec4bec87a6d2700 Mon Sep 17 00:00:00 2001 +From: Peter Robinson +Date: Sun, 29 Dec 2024 14:46:05 +0000 +Subject: [PATCH 1/4] rpi: Add identifiers for the new RPi 5 series + +The Raspberry Pi foundation have released the Raspberry +Pi 500, CM5 an CM5 lite devices so add the assoicated +revision identifers so we can detect them. + +Signed-off-by: Peter Robinson +Acked-by: Matthias Brugger +--- + board/raspberrypi/rpi/rpi.c | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c +index aa39afa338a..4d546892842 100644 +--- a/board/raspberrypi/rpi/rpi.c ++++ b/board/raspberrypi/rpi/rpi.c +@@ -193,6 +193,21 @@ static const struct rpi_model rpi_models_new_scheme[] = { + DTB_DIR "bcm2712-rpi-5-b.dtb", + true, + }, ++ [0x18] = { ++ "Compute Module 5", ++ DTB_DIR "bcm2712-rpi-cm5-cm5io.dtb", ++ true, ++ }, ++ [0x19] = { ++ "500", ++ DTB_DIR "bcm2712-rpi-500.dtb", ++ true, ++ }, ++ [0x1A] = { ++ "Compute Module 5 Lite", ++ DTB_DIR "bcm2712-rpi-cm5l-cm5io.dtb", ++ true, ++ }, + }; + + static const struct rpi_model rpi_models_old_scheme[] = { +-- +2.48.1 + +From 2d75c46be99c15fa186436c149b87ee97e0b8f44 Mon Sep 17 00:00:00 2001 +From: Martin Stolpe +Date: Wed, 23 Oct 2024 15:09:20 +0200 +Subject: [PATCH 2/4] rpi: Only add frame buffer node if CONFIG_FDT_SIMPLEFB is + set + +The functions fdt_simplefb_add_node and fdt_simplefb_enable_and_mem_rsv +are only available if CONFIG_FDT_SIMPLEFB is enabled. + +Signed-off-by: Martin Stolpe +Acked-by: Matthias Brugger +Signed-off-by: Peter Robinson +--- + board/raspberrypi/rpi/rpi.c | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c +index 4d546892842..fe6153b388b 100644 +--- a/board/raspberrypi/rpi/rpi.c ++++ b/board/raspberrypi/rpi/rpi.c +@@ -604,11 +604,13 @@ int ft_board_setup(void *blob, struct bd_info *bd) + + update_fdt_from_fw(blob, (void *)fw_dtb_pointer); + +- node = fdt_node_offset_by_compatible(blob, -1, "simple-framebuffer"); +- if (node < 0) +- fdt_simplefb_add_node(blob); +- else +- fdt_simplefb_enable_and_mem_rsv(blob); ++ if (CONFIG_IS_ENABLED(FDT_SIMPLEFB)) { ++ node = fdt_node_offset_by_compatible(blob, -1, "simple-framebuffer"); ++ if (node < 0) ++ fdt_simplefb_add_node(blob); ++ else ++ fdt_simplefb_enable_and_mem_rsv(blob); ++ } + + #ifdef CONFIG_EFI_LOADER + /* Reserve the spin table */ +-- +2.48.1 + +From fc7a3110184a3ca4c227675b20d3a4887210e36c Mon Sep 17 00:00:00 2001 +From: Fiona Klute +Date: Wed, 12 Feb 2025 12:39:01 +0100 +Subject: [PATCH 3/4] Raspberry Pi: Keep warnings from firmware in DT, if any + +The /chosen/user-warnings property is created by the RPi firmware if +there are warnings to report, keep it to make debugging easier. + +For example, if the firmware config.txt contains +"dtoverlay=error-example" and that example references an undefined +symbol "&nosuchdev" the warning can be read after boot: + +$ cat /proc/device-tree/chosen/user-warnings +dterror: can't find symbol 'nosuchdev' +Failed to resolve overlay 'error-example' + +Signed-off-by: Fiona Klute +Reviewed-by: Matthias Brugger +Signed-off-by: Peter Robinson +--- + board/raspberrypi/rpi/rpi.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c +index fe6153b388b..43efb0dbc1d 100644 +--- a/board/raspberrypi/rpi/rpi.c ++++ b/board/raspberrypi/rpi/rpi.c +@@ -594,6 +594,9 @@ void update_fdt_from_fw(void *fdt, void *fw_fdt) + /* kernel address randomisation seed as provided by the firmware */ + copy_property(fdt, fw_fdt, "/chosen", "kaslr-seed"); + ++ /* warnings from the firmware (if any) */ ++ copy_property(fdt, fw_fdt, "/chosen", "user-warnings"); ++ + /* address of the PHY device as provided by the firmware */ + copy_property(fdt, fw_fdt, "ethernet0/mdio@e14/ethernet-phy@1", "reg"); + } +-- +2.48.1 + +From e042d7593a0b7544259fd2d22240e78d18912746 Mon Sep 17 00:00:00 2001 +From: Fiona Klute +Date: Wed, 12 Feb 2025 12:39:02 +0100 +Subject: [PATCH 4/4] Raspberry Pi: Copy Bluetooth device address in DT + +The firmware sets local-bd-address, copy it when loading a new DT. + +Signed-off-by: Fiona Klute +Signed-off-by: Peter Robinson +--- + board/raspberrypi/rpi/rpi.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c +index 43efb0dbc1d..70d3c35499b 100644 +--- a/board/raspberrypi/rpi/rpi.c ++++ b/board/raspberrypi/rpi/rpi.c +@@ -599,6 +599,9 @@ void update_fdt_from_fw(void *fdt, void *fw_fdt) + + /* address of the PHY device as provided by the firmware */ + copy_property(fdt, fw_fdt, "ethernet0/mdio@e14/ethernet-phy@1", "reg"); ++ ++ /* Bluetooth device address as provided by the firmware */ ++ copy_property(fdt, fw_fdt, "/soc/serial@7e201000/bluetooth", "local-bd-address"); + } + + int ft_board_setup(void *blob, struct bd_info *bd) +-- +2.48.1 + diff --git a/sources b/sources index 0c37e78..25593f8 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (u-boot-2025.04-rc3.tar.bz2) = 2e0b022cf0ffb0b8019375fb5087b1e05f3503ed2b33aed38a04a9286794a4ac81f36c2a9ab8adcfd85762454b636a21e1f7a8fee4c4206f37852664dd4b9e01 +SHA512 (u-boot-2025.04-rc4.tar.bz2) = aaf75661178b597b530628396f291fc9cd562f714c83b87f9bd6d00f26d5bbcc336523bc5446c5f9acce715a67b6508f63a7767408e01a875efea9b460c8ca38 diff --git a/uboot-tools.spec b/uboot-tools.spec index a8e5452..f124e4a 100644 --- a/uboot-tools.spec +++ b/uboot-tools.spec @@ -1,4 +1,4 @@ -%global candidate rc3 +%global candidate rc4 %if 0%{?rhel} %bcond_with toolsonly %else @@ -10,7 +10,7 @@ Name: uboot-tools Version: 2025.04 -Release: 0.5%{?candidate:.%{candidate}}%{?dist} +Release: 0.6%{?candidate:.%{candidate}}%{?dist} Epoch: 1 Summary: U-Boot utilities # Automatically converted from old format: GPLv2+ BSD LGPL-2.1+ LGPL-2.0+ - review is highly recommended. @@ -39,7 +39,7 @@ Patch8: USB-PD-TCPM-improvements.patch # Device improvments # RPi -Patch10: rpi-Add-identifiers-for-the-new-RPi-5-series.patch +Patch10: rpi-fixes.patch # Rockchips improvements Patch11: rockchip-Enable-preboot-start-for-pci-usb.patch #Patch12: rockchip-Modernise-Geekbox-config.patch @@ -54,7 +54,6 @@ BuildRequires: libuuid-devel BuildRequires: make BuildRequires: ncurses-devel BuildRequires: openssl-devel -BuildRequires: openssl-devel-engine BuildRequires: perl-interpreter BuildRequires: python3-devel BuildRequires: python3-setuptools @@ -68,11 +67,11 @@ BuildRequires: crust-firmware BuildRequires: python3-pyelftools BuildRequires: xxd %endif -%endif -Requires: dtc %ifarch riscv64 BuildRequires: %{opensbi} %endif +%endif +Requires: dtc %description This package contains a few U-Boot utilities - mkimage for creating boot images @@ -269,6 +268,9 @@ install -p -m 0755 builds/tools/env/fw_printenv %{buildroot}%{_bindir} %endif %changelog +* Wed Mar 12 2025 Peter Robinson - 1:2025.04-0.6.rc4 +- Update to 2025.04 RC4 + * Wed Feb 26 2025 Peter Robinson - 1:2025.04-0.5.rc3 - Update to 2025.04 RC3 From 9de9b912a1d8d90b67caaf2d58805b9c21ad6c37 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Thu, 13 Mar 2025 22:54:22 +0000 Subject: [PATCH 02/61] Add back openssl-devel-engine which was dropped by accident from an experiment --- uboot-tools.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/uboot-tools.spec b/uboot-tools.spec index f124e4a..6e78d72 100644 --- a/uboot-tools.spec +++ b/uboot-tools.spec @@ -54,6 +54,7 @@ BuildRequires: libuuid-devel BuildRequires: make BuildRequires: ncurses-devel BuildRequires: openssl-devel +BuildRequires: openssl-devel-engine BuildRequires: perl-interpreter BuildRequires: python3-devel BuildRequires: python3-setuptools From a2fea382f502c04d47724e2b7f436a14f22d25a3 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Sun, 30 Mar 2025 11:28:07 +0100 Subject: [PATCH 03/61] Update to 2025.04 RC5 --- rockchip-Modernise-Geekbox-config.patch | 189 ------------------ rpi-fixes.patch | 156 --------------- sources | 2 +- uboot-tools.spec | 38 ++-- ...-SetVariableRT-with-volotile-storage.patch | 33 +++ 5 files changed, 54 insertions(+), 364 deletions(-) delete mode 100644 rockchip-Modernise-Geekbox-config.patch delete mode 100644 rpi-fixes.patch create mode 100644 uefi-enable-SetVariableRT-with-volotile-storage.patch diff --git a/rockchip-Modernise-Geekbox-config.patch b/rockchip-Modernise-Geekbox-config.patch deleted file mode 100644 index ee49fcf..0000000 --- a/rockchip-Modernise-Geekbox-config.patch +++ /dev/null @@ -1,189 +0,0 @@ -From 45d8808e95ddf0702ed78acde7678291ae52abdb Mon Sep 17 00:00:00 2001 -From: Peter Robinson -Date: Fri, 11 Oct 2024 17:14:26 +0100 -Subject: [PATCH] configs: rockchip: Modernise Geekbox config - -Modernise and move the Geekbox config to use SPL/TPL with -upstream TF-A, enable MMC/USB/Eth to make the device more -useful and work like other Rockchip devices. Update the -readme to reflect the changes to the build process. - -Signed-off-by: Peter Robinson ---- - arch/arm/dts/rk3368-geekbox-u-boot.dtsi | 10 ++++ - board/geekbuying/geekbox/README | 40 +++++++++++++- - configs/geekbox_defconfig | 71 ++++++++++++++++++++++++- - 3 files changed, 118 insertions(+), 3 deletions(-) - -diff --git a/arch/arm/dts/rk3368-geekbox-u-boot.dtsi b/arch/arm/dts/rk3368-geekbox-u-boot.dtsi -index cfc8b9340a8..55d007f7ab8 100644 ---- a/arch/arm/dts/rk3368-geekbox-u-boot.dtsi -+++ b/arch/arm/dts/rk3368-geekbox-u-boot.dtsi -@@ -26,6 +26,16 @@ - bootph-all; - }; - -+&dmc { -+ bootph-all; -+ -+ rockchip,memory-schedule = ; -+ rockchip,ddr-frequency = <800000000>; -+ rockchip,ddr-speed-bin = ; -+ -+ status = "okay"; -+}; -+ - &grf { - bootph-all; - }; -diff --git a/board/geekbuying/geekbox/README b/board/geekbuying/geekbox/README -index de980f2f233..bd4d8cdd084 100644 ---- a/board/geekbuying/geekbox/README -+++ b/board/geekbuying/geekbox/README -@@ -1 +1,39 @@ --see board/rockchip/sheep_rk3368/README -+Here is the step-by-step to boot to U-Boot on the Geekbox -+ -+Get the Source and build ATF -+============================ -+ -+ > git clone https://github.com/TrustedFirmware-A/trusted-firmware-a.git -+ > cd arm-trusted-firmware -+ > make CROSS_COMPILE=aarch64-linux-gnu- PLAT=rk3368 bl31 -+ -+Configure U-Boot -+================ -+ -+ > cd ../u-boot -+ > export BL31=../arm-trusted-firmware/build/rk3368/release/bl31.bin -+ > make geekbox_defconfig -+ -+Build the full U-Boot/ATF firmware stack -+======================================== -+ -+ > make CROSS_COMPILE=aarch64-unknown-elf- -+ -+Flash the image -+=============== -+ -+Copy the SPL to offset 32k and the FIT image containing the payloads -+(U-Boot proper, ATF, devicetree) to offset 256k card. -+ -+eMMC -+---- -+ -+rkdeveloptool allows to flash the on-board eMMC via the USB OTG interface with -+help of the Rockchip loader binary. -+ -+ > git clone https://github.com/rockchip-linux/rkdeveloptool -+ > cd rkdeveloptool -+ > autoreconf -i && && ./configure && make -+ > git clone https://github.com/rockchip-linux/rkbin.git -+ > ./rkdeveloptool db rkbin/rk33/rk3368_loader_v2.00.256.bin -+ > ./rkdeveloptool wl 64 ../u-boot-rockchip.bin -diff --git a/configs/geekbox_defconfig b/configs/geekbox_defconfig -index 8f4be79831a..1b116fa8602 100644 ---- a/configs/geekbox_defconfig -+++ b/configs/geekbox_defconfig -@@ -3,29 +3,96 @@ CONFIG_SKIP_LOWLEVEL_INIT=y - CONFIG_COUNTER_FREQUENCY=24000000 - CONFIG_ARCH_ROCKCHIP=y - CONFIG_TEXT_BASE=0x00200000 --CONFIG_SYS_MALLOC_F_LEN=0x1000 - CONFIG_NR_DRAM_BANKS=1 - CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y - CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x300000 - CONFIG_DEFAULT_DEVICE_TREE="rk3368-geekbox" -+CONFIG_SPL_TEXT_BASE=0x00000000 - CONFIG_ROCKCHIP_RK3368=y -+CONFIG_TPL_LIBCOMMON_SUPPORT=y -+CONFIG_TPL_LIBGENERIC_SUPPORT=y -+CONFIG_SPL_DRIVERS_MISC=y -+CONFIG_SPL_STACK=0x188000 -+CONFIG_SPL_HAS_BSS_LINKER_SECTION=y -+CONFIG_SPL_BSS_START_ADDR=0x400000 -+CONFIG_SPL_BSS_MAX_SIZE=0x20000 -+CONFIG_SPL_STACK_R=y -+CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x4000 -+CONFIG_SPL=y - CONFIG_TARGET_GEEKBOX=y - CONFIG_DEBUG_UART_BASE=0xFF690000 - CONFIG_DEBUG_UART_CLOCK=24000000 - CONFIG_SYS_LOAD_ADDR=0x800800 - CONFIG_DEBUG_UART=y -+CONFIG_FIT=y -+CONFIG_FIT_VERBOSE=y -+CONFIG_SPL_LOAD_FIT=y - CONFIG_DEFAULT_FDT_FILE="rockchip/rk3368-geekbox.dtb" - # CONFIG_DISPLAY_CPUINFO is not set - CONFIG_DISPLAY_BOARDINFO_LATE=y -+CONFIG_SPL_MAX_SIZE=0x40000 -+CONFIG_SPL_PAD_TO=0x7f8000 -+CONFIG_SPL_BOOTROM_SUPPORT=y -+# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set -+# CONFIG_SPL_SHARES_INIT_SP_ADDR is not set -+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x200 -+CONFIG_SPL_ATF=y -+CONFIG_TPL=y -+CONFIG_TPL_SYS_MALLOC_SIMPLE=y -+CONFIG_TPL_DRIVERS_MISC=y -+CONFIG_CMD_GPIO=y -+CONFIG_CMD_MMC=y -+CONFIG_CMD_REGULATOR=y -+CONFIG_CMD_USB=y -+CONFIG_SPL_OF_CONTROL=y -+CONFIG_TPL_OF_CONTROL=y -+CONFIG_OF_LIVE=y -+CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names interrupt-parent" -+CONFIG_TPL_OF_PLATDATA=y -+CONFIG_ENV_IS_IN_MMC=y - CONFIG_SYS_RELOC_GD_ENV_ADDR=y -+CONFIG_NET_RANDOM_ETHADDR=y -+CONFIG_TPL_DM=y - CONFIG_REGMAP=y -+CONFIG_SPL_REGMAP=y -+CONFIG_TPL_REGMAP=y - CONFIG_SYSCON=y --CONFIG_BOUNCE_BUFFER=y -+CONFIG_SPL_SYSCON=y -+CONFIG_TPL_SYSCON=y - CONFIG_CLK=y -+CONFIG_SPL_CLK=y -+CONFIG_TPL_CLK=y -+CONFIG_ROCKCHIP_GPIO=y -+CONFIG_SYS_I2C_ROCKCHIP=y -+CONFIG_MMC_DW=y -+CONFIG_MMC_DW_ROCKCHIP=y - CONFIG_PINCTRL=y -+CONFIG_PHY_REALTEK=y -+CONFIG_DM_ETH_PHY=y -+CONFIG_ETH_DESIGNWARE=y -+CONFIG_RGMII=y -+CONFIG_GMAC_ROCKCHIP=y -+CONFIG_PINCTRL=y -+CONFIG_SPL_PINCTRL=y -+CONFIG_DM_PMIC=y -+CONFIG_PMIC_RK8XX=y -+CONFIG_DM_REGULATOR_FIXED=y -+CONFIG_REGULATOR_RK8XX=y - CONFIG_RAM=y -+CONFIG_SPL_RAM=y -+CONFIG_TPL_RAM=y - CONFIG_DEBUG_UART_SHIFT=2 - CONFIG_DEBUG_UART_ANNOUNCE=y - CONFIG_SYS_NS16550_MEM32=y -+CONFIG_SYSINFO=y -+CONFIG_SYSINFO_SMBIOS=y - CONFIG_SYSRESET=y -+CONFIG_USB=y -+CONFIG_USB_EHCI_HCD=y -+CONFIG_USB_EHCI_GENERIC=y -+CONFIG_USB_DWC2=y -+CONFIG_USB_GADGET=y -+CONFIG_USB_GADGET_DWC2_OTG=y -+CONFIG_SPL_TINY_MEMSET=y -+CONFIG_LZO=y - CONFIG_ERRNO_STR=y --- -2.47.0 - diff --git a/rpi-fixes.patch b/rpi-fixes.patch deleted file mode 100644 index 352261b..0000000 --- a/rpi-fixes.patch +++ /dev/null @@ -1,156 +0,0 @@ -From 27e0160320c13168ab5d703c5ec4bec87a6d2700 Mon Sep 17 00:00:00 2001 -From: Peter Robinson -Date: Sun, 29 Dec 2024 14:46:05 +0000 -Subject: [PATCH 1/4] rpi: Add identifiers for the new RPi 5 series - -The Raspberry Pi foundation have released the Raspberry -Pi 500, CM5 an CM5 lite devices so add the assoicated -revision identifers so we can detect them. - -Signed-off-by: Peter Robinson -Acked-by: Matthias Brugger ---- - board/raspberrypi/rpi/rpi.c | 15 +++++++++++++++ - 1 file changed, 15 insertions(+) - -diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c -index aa39afa338a..4d546892842 100644 ---- a/board/raspberrypi/rpi/rpi.c -+++ b/board/raspberrypi/rpi/rpi.c -@@ -193,6 +193,21 @@ static const struct rpi_model rpi_models_new_scheme[] = { - DTB_DIR "bcm2712-rpi-5-b.dtb", - true, - }, -+ [0x18] = { -+ "Compute Module 5", -+ DTB_DIR "bcm2712-rpi-cm5-cm5io.dtb", -+ true, -+ }, -+ [0x19] = { -+ "500", -+ DTB_DIR "bcm2712-rpi-500.dtb", -+ true, -+ }, -+ [0x1A] = { -+ "Compute Module 5 Lite", -+ DTB_DIR "bcm2712-rpi-cm5l-cm5io.dtb", -+ true, -+ }, - }; - - static const struct rpi_model rpi_models_old_scheme[] = { --- -2.48.1 - -From 2d75c46be99c15fa186436c149b87ee97e0b8f44 Mon Sep 17 00:00:00 2001 -From: Martin Stolpe -Date: Wed, 23 Oct 2024 15:09:20 +0200 -Subject: [PATCH 2/4] rpi: Only add frame buffer node if CONFIG_FDT_SIMPLEFB is - set - -The functions fdt_simplefb_add_node and fdt_simplefb_enable_and_mem_rsv -are only available if CONFIG_FDT_SIMPLEFB is enabled. - -Signed-off-by: Martin Stolpe -Acked-by: Matthias Brugger -Signed-off-by: Peter Robinson ---- - board/raspberrypi/rpi/rpi.c | 12 +++++++----- - 1 file changed, 7 insertions(+), 5 deletions(-) - -diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c -index 4d546892842..fe6153b388b 100644 ---- a/board/raspberrypi/rpi/rpi.c -+++ b/board/raspberrypi/rpi/rpi.c -@@ -604,11 +604,13 @@ int ft_board_setup(void *blob, struct bd_info *bd) - - update_fdt_from_fw(blob, (void *)fw_dtb_pointer); - -- node = fdt_node_offset_by_compatible(blob, -1, "simple-framebuffer"); -- if (node < 0) -- fdt_simplefb_add_node(blob); -- else -- fdt_simplefb_enable_and_mem_rsv(blob); -+ if (CONFIG_IS_ENABLED(FDT_SIMPLEFB)) { -+ node = fdt_node_offset_by_compatible(blob, -1, "simple-framebuffer"); -+ if (node < 0) -+ fdt_simplefb_add_node(blob); -+ else -+ fdt_simplefb_enable_and_mem_rsv(blob); -+ } - - #ifdef CONFIG_EFI_LOADER - /* Reserve the spin table */ --- -2.48.1 - -From fc7a3110184a3ca4c227675b20d3a4887210e36c Mon Sep 17 00:00:00 2001 -From: Fiona Klute -Date: Wed, 12 Feb 2025 12:39:01 +0100 -Subject: [PATCH 3/4] Raspberry Pi: Keep warnings from firmware in DT, if any - -The /chosen/user-warnings property is created by the RPi firmware if -there are warnings to report, keep it to make debugging easier. - -For example, if the firmware config.txt contains -"dtoverlay=error-example" and that example references an undefined -symbol "&nosuchdev" the warning can be read after boot: - -$ cat /proc/device-tree/chosen/user-warnings -dterror: can't find symbol 'nosuchdev' -Failed to resolve overlay 'error-example' - -Signed-off-by: Fiona Klute -Reviewed-by: Matthias Brugger -Signed-off-by: Peter Robinson ---- - board/raspberrypi/rpi/rpi.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c -index fe6153b388b..43efb0dbc1d 100644 ---- a/board/raspberrypi/rpi/rpi.c -+++ b/board/raspberrypi/rpi/rpi.c -@@ -594,6 +594,9 @@ void update_fdt_from_fw(void *fdt, void *fw_fdt) - /* kernel address randomisation seed as provided by the firmware */ - copy_property(fdt, fw_fdt, "/chosen", "kaslr-seed"); - -+ /* warnings from the firmware (if any) */ -+ copy_property(fdt, fw_fdt, "/chosen", "user-warnings"); -+ - /* address of the PHY device as provided by the firmware */ - copy_property(fdt, fw_fdt, "ethernet0/mdio@e14/ethernet-phy@1", "reg"); - } --- -2.48.1 - -From e042d7593a0b7544259fd2d22240e78d18912746 Mon Sep 17 00:00:00 2001 -From: Fiona Klute -Date: Wed, 12 Feb 2025 12:39:02 +0100 -Subject: [PATCH 4/4] Raspberry Pi: Copy Bluetooth device address in DT - -The firmware sets local-bd-address, copy it when loading a new DT. - -Signed-off-by: Fiona Klute -Signed-off-by: Peter Robinson ---- - board/raspberrypi/rpi/rpi.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c -index 43efb0dbc1d..70d3c35499b 100644 ---- a/board/raspberrypi/rpi/rpi.c -+++ b/board/raspberrypi/rpi/rpi.c -@@ -599,6 +599,9 @@ void update_fdt_from_fw(void *fdt, void *fw_fdt) - - /* address of the PHY device as provided by the firmware */ - copy_property(fdt, fw_fdt, "ethernet0/mdio@e14/ethernet-phy@1", "reg"); -+ -+ /* Bluetooth device address as provided by the firmware */ -+ copy_property(fdt, fw_fdt, "/soc/serial@7e201000/bluetooth", "local-bd-address"); - } - - int ft_board_setup(void *blob, struct bd_info *bd) --- -2.48.1 - diff --git a/sources b/sources index 25593f8..5b48481 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (u-boot-2025.04-rc4.tar.bz2) = aaf75661178b597b530628396f291fc9cd562f714c83b87f9bd6d00f26d5bbcc336523bc5446c5f9acce715a67b6508f63a7767408e01a875efea9b460c8ca38 +SHA512 (u-boot-2025.04-rc5.tar.bz2) = bed5e3282f23ba235a2652903a41c178767b48ca49a57b8a4d0f6d911f7a2f24f4b15c11366a6b888d93ebb6bfa35c8af8465c6d24fdc7699423ee7e2ffa2c50 diff --git a/uboot-tools.spec b/uboot-tools.spec index 6e78d72..4eac11e 100644 --- a/uboot-tools.spec +++ b/uboot-tools.spec @@ -1,4 +1,4 @@ -%global candidate rc4 +%global candidate rc5 %if 0%{?rhel} %bcond_with toolsonly %else @@ -10,7 +10,7 @@ Name: uboot-tools Version: 2025.04 -Release: 0.6%{?candidate:.%{candidate}}%{?dist} +Release: 0.7%{?candidate:.%{candidate}}%{?dist} Epoch: 1 Summary: U-Boot utilities # Automatically converted from old format: GPLv2+ BSD LGPL-2.1+ LGPL-2.0+ - review is highly recommended. @@ -21,28 +21,27 @@ Source0: https://ftp.denx.de/pub/u-boot/u-boot-%{version}%{?candidate:-%{candid Source1: aarch64-boards Source2: riscv64-boards -# This is now legacy, most devices use bootflow, we keep this for the laggards -Patch1: uefi-distro-load-FDT-from-any-partition-on-boot-device.patch -# Identify VFAT partitions as ESP, allows EFI setvar on our images -Patch2: uefi-Add-all-options-for-EFI-System-Partitions.patch -# New function to find fdt for loading from disk -Patch3: uefi-initial-find_fdt_location-for-finding-the-DT-on-disk.patch # Fedora patches to enable/disable features -Patch4: disable-VBE-by-default.patch -Patch5: enable-bootmenu-by-default.patch +Patch1: disable-VBE-by-default.patch +Patch2: enable-bootmenu-by-default.patch +# This is now legacy, most devices use bootflow, we keep this for the laggards +Patch3: uefi-distro-load-FDT-from-any-partition-on-boot-device.patch +# Identify VFAT partitions as ESP, allows EFI setvar on our images +Patch4: uefi-Add-all-options-for-EFI-System-Partitions.patch +# New function to find fdt for loading from disk +Patch6: uefi-initial-find_fdt_location-for-finding-the-DT-on-disk.patch +# Enable UEFI SetVariable for devices without backed storage +Patch7: uefi-enable-SetVariableRT-with-volotile-storage.patch # Should be upstream but it's taking time -Patch6: Add-video-damage-tracking.patch +Patch8: Add-video-damage-tracking.patch # For HTTP boot installs -Patch7: Add-pmem-node-for-preserving-distro-ISO-s.patch -# USB-PD improvements -Patch8: USB-PD-TCPM-improvements.patch +Patch9: Add-pmem-node-for-preserving-distro-ISO-s.patch # Device improvments -# RPi -Patch10: rpi-fixes.patch # Rockchips improvements -Patch11: rockchip-Enable-preboot-start-for-pci-usb.patch -#Patch12: rockchip-Modernise-Geekbox-config.patch +Patch10: rockchip-Enable-preboot-start-for-pci-usb.patch +# USB-PD improvements +Patch11: USB-PD-TCPM-improvements.patch BuildRequires: bc BuildRequires: bison @@ -269,6 +268,9 @@ install -p -m 0755 builds/tools/env/fw_printenv %{buildroot}%{_bindir} %endif %changelog +* Tue Mar 25 2025 Peter Robinson - 1:2025.04-0.7.rc5 +- Update to 2025.04 RC5 + * Wed Mar 12 2025 Peter Robinson - 1:2025.04-0.6.rc4 - Update to 2025.04 RC4 diff --git a/uefi-enable-SetVariableRT-with-volotile-storage.patch b/uefi-enable-SetVariableRT-with-volotile-storage.patch new file mode 100644 index 0000000..ee9bcf4 --- /dev/null +++ b/uefi-enable-SetVariableRT-with-volotile-storage.patch @@ -0,0 +1,33 @@ +From fd736dd720b29fa69a4bb87492f3f94dc6076996 Mon Sep 17 00:00:00 2001 +From: Peter Robinson +Date: Tue, 25 Mar 2025 17:13:44 +0000 +Subject: [PATCH] efi: enable SetVariableRT with volotile storage + +Signed-off-by: Peter Robinson +--- + lib/efi_loader/Kconfig | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig +index d4f6b56afaa..3e522131b01 100644 +--- a/lib/efi_loader/Kconfig ++++ b/lib/efi_loader/Kconfig +@@ -108,6 +108,7 @@ choice + config EFI_VARIABLE_FILE_STORE + bool "Store non-volatile UEFI variables as file" + depends on FAT_WRITE ++ default y + help + Select this option if you want non-volatile UEFI variables to be + stored as file /ubootefi.var on the EFI system partition. +@@ -115,6 +116,7 @@ config EFI_VARIABLE_FILE_STORE + config EFI_RT_VOLATILE_STORE + bool "Allow variable runtime services in volatile storage (e.g RAM)" + depends on EFI_VARIABLE_FILE_STORE ++ default y + help + When EFI variables are stored on file we don't allow SetVariableRT, + since the OS doesn't know how to write that file. At the same time +-- +2.49.0 + From fb4c39b1e607e5fd0941525af3d2a236a713bb20 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Tue, 8 Apr 2025 14:18:38 +0100 Subject: [PATCH 04/61] 2025.04 GA --- sources | 2 +- uboot-tools.spec | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/sources b/sources index 5b48481..732b969 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (u-boot-2025.04-rc5.tar.bz2) = bed5e3282f23ba235a2652903a41c178767b48ca49a57b8a4d0f6d911f7a2f24f4b15c11366a6b888d93ebb6bfa35c8af8465c6d24fdc7699423ee7e2ffa2c50 +SHA512 (u-boot-2025.04.tar.bz2) = f2ce2d34880e347165656060ac2956050112ed4cd14cbca2ca736d2ad26f660bb09a17fe79b988f2702f0f65cf43d5263f9ff4d41338e3865962b7f9f01a0f0d diff --git a/uboot-tools.spec b/uboot-tools.spec index 4eac11e..2ee6a64 100644 --- a/uboot-tools.spec +++ b/uboot-tools.spec @@ -1,4 +1,4 @@ -%global candidate rc5 +#global candidate rc0 %if 0%{?rhel} %bcond_with toolsonly %else @@ -10,7 +10,7 @@ Name: uboot-tools Version: 2025.04 -Release: 0.7%{?candidate:.%{candidate}}%{?dist} +Release: 1%{?candidate:.%{candidate}}%{?dist} Epoch: 1 Summary: U-Boot utilities # Automatically converted from old format: GPLv2+ BSD LGPL-2.1+ LGPL-2.0+ - review is highly recommended. @@ -268,6 +268,9 @@ install -p -m 0755 builds/tools/env/fw_printenv %{buildroot}%{_bindir} %endif %changelog +* Tue Apr 08 2025 Peter Robinson - 1:2025.04-1 +- Update to 2025.04 GA + * Tue Mar 25 2025 Peter Robinson - 1:2025.04-0.7.rc5 - Update to 2025.04 RC5 From 510d8fcf30c8944aa8ab1b03a981116e0c4ddadd Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Sun, 20 Apr 2025 21:00:17 +0100 Subject: [PATCH 05/61] Fix for RPi5 serial console --- ...when-loading-kernel-with-non-boot-DT.patch | 161 ++++++++++++++++++ uboot-tools.spec | 9 +- 2 files changed, 168 insertions(+), 2 deletions(-) create mode 100644 rpi-uart-clock-when-loading-kernel-with-non-boot-DT.patch diff --git a/rpi-uart-clock-when-loading-kernel-with-non-boot-DT.patch b/rpi-uart-clock-when-loading-kernel-with-non-boot-DT.patch new file mode 100644 index 0000000..ade9652 --- /dev/null +++ b/rpi-uart-clock-when-loading-kernel-with-non-boot-DT.patch @@ -0,0 +1,161 @@ +From patchwork Tue Apr 15 08:30:14 2025 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Bruno Leite +X-Patchwork-Id: 2072903 +X-Patchwork-Delegate: pbrobinson@gmail.com +Return-Path: +X-Original-To: incoming@patchwork.ozlabs.org +Delivered-To: patchwork-incoming@legolas.ozlabs.org +Authentication-Results: legolas.ozlabs.org; + dkim=pass (2048-bit key; + unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 + header.s=20230601 header.b=NLOXFHyi; + dkim-atps=neutral +Authentication-Results: legolas.ozlabs.org; + spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de + (client-ip=85.214.62.61; helo=phobos.denx.de; + envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) +Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) + (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) + key-exchange X25519 server-signature ECDSA (secp384r1)) + (No client certificate requested) + by legolas.ozlabs.org (Postfix) with ESMTPS id 4ZcPCY0L1rz1yHt + for ; Tue, 15 Apr 2025 22:50:49 +1000 (AEST) +Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) + by phobos.denx.de (Postfix) with ESMTP id 308EB82AFB; + Tue, 15 Apr 2025 14:50:29 +0200 (CEST) +Authentication-Results: phobos.denx.de; + dmarc=pass (p=none dis=none) header.from=gmail.com +Authentication-Results: phobos.denx.de; + spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de +Authentication-Results: phobos.denx.de; + dkim=pass (2048-bit key; + unprotected) header.d=gmail.com header.i=@gmail.com header.b="NLOXFHyi"; + dkim-atps=neutral +Received: by phobos.denx.de (Postfix, from userid 109) + id 349F98056A; Tue, 15 Apr 2025 10:30:28 +0200 (CEST) +X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de +X-Spam-Level: +X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, + DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, + RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham + autolearn_force=no version=3.4.2 +Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com + [IPv6:2a00:1450:4864:20::22b]) + (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) + (No client certificate requested) + by phobos.denx.de (Postfix) with ESMTPS id 3962A82047 + for ; Tue, 15 Apr 2025 10:30:26 +0200 (CEST) +Authentication-Results: phobos.denx.de; + dmarc=pass (p=none dis=none) header.from=gmail.com +Authentication-Results: phobos.denx.de; + spf=pass smtp.mailfrom=brunosampaioleite@gmail.com +Received: by mail-lj1-x22b.google.com with SMTP id + 38308e7fff4ca-30bfc8faef9so49423241fa.1 + for ; Tue, 15 Apr 2025 01:30:26 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=gmail.com; s=20230601; t=1744705825; x=1745310625; darn=lists.denx.de; + h=content-transfer-encoding:mime-version:references:in-reply-to + :message-id:date:subject:cc:to:from:from:to:cc:subject:date + :message-id:reply-to; + bh=G/bK1K44Dr1qFbZickUlvWkto/6r+BtRySFxyVDIYKY=; + b=NLOXFHyi7dXqHhrg8fkx5lISJ9rd6xXpixrCEDfKShdvqjvn2vMkVHivrB/UmT5q/m + Rcn0ad8zpPX+B1FfTwwkq4froYJpiBB3hfDhWs7VhphrtvcoOdo1odSLFDY+94ycwMrH + SByxwk76lvnn/WPl/K20jk3AacL4eitsWe6coH11QAw1Ff7ub3lukIMOHwph9KvyBBCO + rDC59cJIVrN7JGycd5bVjEbPQL20S8ElhQFxzpA/Oay5mRcuWOz9kPtXDepqVY3OTeRD + xVYZBQmbfdH+ddX0djm3HK4NeFgarV9FrclE37evniLeATkMGoB6vWwtfQHQzGnZi9XM + 1yZQ== +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20230601; t=1744705825; x=1745310625; + h=content-transfer-encoding:mime-version:references:in-reply-to + :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc + :subject:date:message-id:reply-to; + bh=G/bK1K44Dr1qFbZickUlvWkto/6r+BtRySFxyVDIYKY=; + b=aJrgDOltnMKa4/yUhPGvvzqv8fUsRjhtiQXqF20Ymo2bHr0kbVeb5jFe/TzFShZYoD + bmirjua4chjbqAuDu0hPub/QpZdCyKrlFKWI/+yp82mTlCakauWD+2ouH+uTR3LgV9/T + p2etUHhRr/1cdNUumKjbHK5ePRPZ1fj4kTq3Tr7PFfE2F1HctVcGt+5Eg0eGdDxB/CNY + fzT82UD+QbEtpyLp3b1DL5m2kvMNPjVtsUMnaldTfwrA3UicBAXnx5/aNwK8mi3ZbF1p + zd+QdEDjuLtdboBfffvanhpOnx7DFBWHxiQYy3nIx9kGV9apFJZZw6g2w46mIHxJ9qpK + vs4A== +X-Gm-Message-State: AOJu0YwFtor9kanZ4bPXgxW0Caq1SXAjjr1eoMtteqd6a/rCRGtBSoCz + 2nTZsmUy7rN+RuLT0b0YkYdB4Nap8ZheIEJjBpYYy86I0HBvDOCEorH+8zHIOu0Q2A== +X-Gm-Gg: ASbGncuvhE42LjbCtWsarbjkyrOyVA/mrkKOUPBAgzW/qnUKh7MwX9QNl5kSLSTzn2x + NVqmx7hNTBoFrwXVi4qN6/9oQbYDvg5w3q4qaRjK1FSsBvwHor7Qrqso4bleSYBBbp89rvTNKGN + cQxKrjEuhwK1IGGp5Si31mh/uHdkNoNlXvJGgUhNC5jjedj0tGwWLzKuau775LircGiFhFkXlmg + vvKDSS9iaFj9jLuUnbu7i3HGC98ZSaO1UWogeOvncthddQXzEPMwtiiR4+HzAFh27h9pihboSgQ + bf41IZ0AmlDUKSrxJRPRtfUlOJ1TRA5TMFL2vAPYxty+pgqFrriC8oOsemfm5DvdxQNjoM2NG7/ + ZxkxfMxEZ +X-Google-Smtp-Source: + AGHT+IHMd8cQWJx/NJpA+NT/8JfqwmGZg8ekGgpeyeFGMd3DfCJ5kuQYxSAip7G9Y3zA2jvJMPH6xw== +X-Received: by 2002:a2e:b8c4:0:b0:309:1fee:378d with SMTP id + 38308e7fff4ca-31049a1cf35mr46597761fa.19.1744705825108; + Tue, 15 Apr 2025 01:30:25 -0700 (PDT) +Received: from brule-Precision-3590.prevas.se ([81.216.59.226]) + by smtp.gmail.com with ESMTPSA id + 38308e7fff4ca-30f464cc0a2sm19679971fa.31.2025.04.15.01.30.23 + (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); + Tue, 15 Apr 2025 01:30:24 -0700 (PDT) +From: Bruno Leite +To: u-boot@lists.denx.de +Cc: pbrobinson@gmail.com, Matthias Brugger , + clast@prevas.dk, ravi@prevas.dk, Bruno Leite , + Fiona Klute , Francois Berder , + Ilias Apalodimas , + Martin Stolpe , + Patrice Chotard , + Rasmus Villemoes , + Simon Glass , Tom Rini +Subject: [PATCH 1/1] rpi: copy over uart clock-frequency in DT +Date: Tue, 15 Apr 2025 10:30:14 +0200 +Message-ID: <20250415083017.3523317-2-brunosampaioleite@gmail.com> +X-Mailer: git-send-email 2.45.2 +In-Reply-To: <20250415083017.3523317-1-brunosampaioleite@gmail.com> +References: <20250415083017.3523317-1-brunosampaioleite@gmail.com> +MIME-Version: 1.0 +X-Mailman-Approved-At: Tue, 15 Apr 2025 14:50:26 +0200 +X-BeenThere: u-boot@lists.denx.de +X-Mailman-Version: 2.1.39 +Precedence: list +List-Id: U-Boot discussion +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +Errors-To: u-boot-bounces@lists.denx.de +Sender: "U-Boot" +X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de +X-Virus-Status: Clean + +From: Bruno Leite + +rpi5 firmware sets uart_clk clock-frequency in +the firmware and patches it to the DT, copy it +over when loading a new DT. + +Signed-off-by: Bruno Leite +Reviewed-by: Peter Robinson +Tested-by: Peter Robinson +--- + + board/raspberrypi/rpi/rpi.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c +index 70d3c35499b..5c84c324c71 100644 +--- a/board/raspberrypi/rpi/rpi.c ++++ b/board/raspberrypi/rpi/rpi.c +@@ -602,6 +602,9 @@ void update_fdt_from_fw(void *fdt, void *fw_fdt) + + /* Bluetooth device address as provided by the firmware */ + copy_property(fdt, fw_fdt, "/soc/serial@7e201000/bluetooth", "local-bd-address"); ++ ++ /* copy uart clk as provided by the firmware */ ++ copy_property(fdt, fw_fdt, "/clocks/clk-uart", "clock-frequency"); + } + + int ft_board_setup(void *blob, struct bd_info *bd) diff --git a/uboot-tools.spec b/uboot-tools.spec index 2ee6a64..a41fa66 100644 --- a/uboot-tools.spec +++ b/uboot-tools.spec @@ -10,7 +10,7 @@ Name: uboot-tools Version: 2025.04 -Release: 1%{?candidate:.%{candidate}}%{?dist} +Release: 2%{?candidate:.%{candidate}}%{?dist} Epoch: 1 Summary: U-Boot utilities # Automatically converted from old format: GPLv2+ BSD LGPL-2.1+ LGPL-2.0+ - review is highly recommended. @@ -41,7 +41,9 @@ Patch9: Add-pmem-node-for-preserving-distro-ISO-s.patch # Rockchips improvements Patch10: rockchip-Enable-preboot-start-for-pci-usb.patch # USB-PD improvements -Patch11: USB-PD-TCPM-improvements.patch +Patch11: USB-PD-TCPM-improvements.patch +# RPi fixes +Patch12: rpi-uart-clock-when-loading-kernel-with-non-boot-DT.patch BuildRequires: bc BuildRequires: bison @@ -268,6 +270,9 @@ install -p -m 0755 builds/tools/env/fw_printenv %{buildroot}%{_bindir} %endif %changelog +* Sun Apr 20 2025 Peter Robinson - 1:2025.04-2 +- Fix for RPi5 serial console + * Tue Apr 08 2025 Peter Robinson - 1:2025.04-1 - Update to 2025.04 GA From d0a36bf9ac20628c2c13016ebc8612c0c7d854ea Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Mon, 16 Jun 2025 11:43:10 +0100 Subject: [PATCH 06/61] 2025.07 RC4 --- ...mem-node-for-preserving-distro-ISO-s.patch | 1288 ----------------- disable-VBE-by-default.patch | 16 +- sources | 2 +- uboot-tools.spec | 21 +- ..._location-for-finding-the-DT-on-disk.patch | 38 +- 5 files changed, 43 insertions(+), 1322 deletions(-) delete mode 100644 Add-pmem-node-for-preserving-distro-ISO-s.patch diff --git a/Add-pmem-node-for-preserving-distro-ISO-s.patch b/Add-pmem-node-for-preserving-distro-ISO-s.patch deleted file mode 100644 index bc8620b..0000000 --- a/Add-pmem-node-for-preserving-distro-ISO-s.patch +++ /dev/null @@ -1,1288 +0,0 @@ -From patchwork Fri Feb 28 08:45:24 2025 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -X-Patchwork-Submitter: Sughosh Ganu -X-Patchwork-Id: 2053441 -X-Patchwork-Delegate: xypron.glpk@gmx.de -Return-Path: -X-Original-To: incoming@patchwork.ozlabs.org -Delivered-To: patchwork-incoming@legolas.ozlabs.org -Authentication-Results: legolas.ozlabs.org; - spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de - (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; - envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) -Received: from phobos.denx.de (phobos.denx.de - [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) - (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) - key-exchange X25519 server-signature ECDSA (secp384r1)) - (No client certificate requested) - by legolas.ozlabs.org (Postfix) with ESMTPS id 4Z41yQ5Fkdz1yKH - for ; Fri, 28 Feb 2025 19:46:06 +1100 (AEDT) -Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) - by phobos.denx.de (Postfix) with ESMTP id 2504E81100; - Fri, 28 Feb 2025 09:46:02 +0100 (CET) -Authentication-Results: phobos.denx.de; - dmarc=fail (p=none dis=none) header.from=linaro.org -Authentication-Results: phobos.denx.de; - spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de -Received: by phobos.denx.de (Postfix, from userid 109) - id B0BC2807D7; Fri, 28 Feb 2025 09:46:00 +0100 (CET) -X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de -X-Spam-Level: -X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00, - RCVD_IN_DNSWL_BLOCKED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, - RCVD_IN_VALIDITY_RPBL_BLOCKED,SPF_HELO_NONE,SPF_SOFTFAIL autolearn=no - autolearn_force=no version=3.4.2 -Received: from foss.arm.com (foss.arm.com [217.140.110.172]) - by phobos.denx.de (Postfix) with ESMTP id E55D680BA4 - for ; Fri, 28 Feb 2025 09:45:57 +0100 (CET) -Authentication-Results: phobos.denx.de; - dmarc=fail (p=none dis=none) header.from=linaro.org -Authentication-Results: phobos.denx.de; - spf=fail smtp.mailfrom=sughosh.ganu@linaro.org -Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) - by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 99830150C; - Fri, 28 Feb 2025 00:46:12 -0800 (PST) -Received: from a079122.blr.arm.com (a079122.arm.com [10.162.17.48]) - by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2C1F13F673; - Fri, 28 Feb 2025 00:45:53 -0800 (PST) -From: Sughosh Ganu -To: u-boot@lists.denx.de -Cc: Ilias Apalodimas , - Simon Glass , Tom Rini , - Heinrich Schuchardt , - Anton Antonov , - Tobias Waldekranz , Bin Meng , - Masahisa Kojima , - Sughosh Ganu -Subject: [PATCH v6 1/6] fdt: add support for adding pmem nodes -Date: Fri, 28 Feb 2025 14:15:24 +0530 -Message-Id: <20250228084529.127823-2-sughosh.ganu@linaro.org> -X-Mailer: git-send-email 2.34.1 -In-Reply-To: <20250228084529.127823-1-sughosh.ganu@linaro.org> -References: <20250228084529.127823-1-sughosh.ganu@linaro.org> -MIME-Version: 1.0 -X-BeenThere: u-boot@lists.denx.de -X-Mailman-Version: 2.1.39 -Precedence: list -List-Id: U-Boot discussion -List-Unsubscribe: , - -List-Archive: -List-Post: -List-Help: -List-Subscribe: , - -Errors-To: u-boot-bounces@lists.denx.de -Sender: "U-Boot" -X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de -X-Virus-Status: Clean - -From: Masahisa Kojima - -One of the problems OS installers face, when running in EFI, is that -the mounted ISO after calling ExitBootServices goes away. For some -distros this is a problem since they rely on finding some core packages -before continuing the installation. Distros have works around this -- -e.g Fedora has a special kernel command line parameter called -inst.stage2 [0]. - -ACPI has NFIT and NVDIMM support to provide ramdisks to the OS, but we -don't have anything in place for DTs. Linux and device trees have support -for persistent memory devices. So add a function that can inject a pmem -node in a DT, so we can use it when launhing OS installers with EFI. - -[0] -https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/7/html/installation_guide/chap-anaconda-boot-options#sect-boot-options-installer - -Signed-off-by: Masahisa Kojima -Signed-off-by: Sughosh Ganu ---- -Changes since V5: None - - boot/fdt_support.c | 41 ++++++++++++++++++++++++++++++++++++++++- - include/fdt_support.h | 14 ++++++++++++++ - 2 files changed, 54 insertions(+), 1 deletion(-) - -diff --git a/boot/fdt_support.c b/boot/fdt_support.c -index 49efeec3681..e20b9759138 100644 ---- a/boot/fdt_support.c -+++ b/boot/fdt_support.c -@@ -18,6 +18,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -464,7 +465,6 @@ void do_fixup_by_compat_u32(void *fdt, const char *compat, - do_fixup_by_compat(fdt, compat, prop, &tmp, 4, create); - } - --#ifdef CONFIG_ARCH_FIXUP_FDT_MEMORY - /* - * fdt_pack_reg - pack address and size array into the "reg"-suitable stream - */ -@@ -493,6 +493,7 @@ static int fdt_pack_reg(const void *fdt, void *buf, u64 *address, u64 *size, - return p - (char *)buf; - } - -+#ifdef CONFIG_ARCH_FIXUP_FDT_MEMORY - #if CONFIG_NR_DRAM_BANKS > 4 - #define MEMORY_BANKS_MAX CONFIG_NR_DRAM_BANKS - #else -@@ -2222,3 +2223,41 @@ int fdt_valid(struct fdt_header **blobp) - } - return 1; - } -+ -+int fdt_fixup_pmem_region(void *blob, ulong addr, u32 size) -+{ -+ u64 pmem_start[2] = { 0 }; -+ u64 pmem_size[2] = { 0 }; -+ char pmem_node[32] = {0}; -+ int nodeoffset, len; -+ int err; -+ u8 tmp[4 * 16]; /* Up to 64-bit address + 64-bit size */ -+ -+ if (!IS_ALIGNED(addr, SZ_2M) || !IS_ALIGNED(addr + size, SZ_2M)) { -+ printf("Start and end address must be 2MiB aligned\n"); -+ return -1; -+ } -+ -+ snprintf(pmem_node, sizeof(pmem_node), "pmem@%lx", addr); -+ nodeoffset = fdt_find_or_add_subnode(blob, 0, pmem_node); -+ if (nodeoffset < 0) -+ return nodeoffset; -+ -+ err = fdt_setprop_string(blob, nodeoffset, "compatible", "pmem-region"); -+ if (err) -+ return err; -+ err = fdt_setprop_empty(blob, nodeoffset, "volatile"); -+ if (err) -+ return err; -+ pmem_start[0] = addr; -+ pmem_size[0] = size; -+ len = fdt_pack_reg(blob, tmp, pmem_start, pmem_size, 1); -+ err = fdt_setprop(blob, nodeoffset, "reg", tmp, len); -+ if (err < 0) { -+ printf("WARNING: could not set pmem %s %s.\n", "reg", -+ fdt_strerror(err)); -+ return err; -+ } -+ -+ return 0; -+} -diff --git a/include/fdt_support.h b/include/fdt_support.h -index f0ad2e6b365..b72cd2920de 100644 ---- a/include/fdt_support.h -+++ b/include/fdt_support.h -@@ -507,4 +507,18 @@ void fdt_fixup_pstore(void *blob); - */ - int fdt_kaslrseed(void *blob, bool overwrite); - -+/** -+ * fdt_fixup_pmem_region() - add a pmem node on the device tree -+ * -+ * This functions adds/updates a pmem node to the device tree. -+ * Usually used with EFI installers to preserve installer -+ * images -+ * -+ * @blob: device tree provided by caller -+ * @addr: start address of the pmem node -+ * @size: size of the memory of the pmem node -+ * Return: 0 on success or < 0 on failure -+ */ -+int fdt_fixup_pmem_region(void *blob, ulong addr, u32 size); -+ - #endif /* ifndef __FDT_SUPPORT_H */ - -From patchwork Fri Feb 28 08:45:25 2025 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -X-Patchwork-Submitter: Sughosh Ganu -X-Patchwork-Id: 2053442 -X-Patchwork-Delegate: xypron.glpk@gmx.de -Return-Path: -X-Original-To: incoming@patchwork.ozlabs.org -Delivered-To: patchwork-incoming@legolas.ozlabs.org -Authentication-Results: legolas.ozlabs.org; - spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de - (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; - envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) -Received: from phobos.denx.de (phobos.denx.de - [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) - (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) - key-exchange X25519 server-signature ECDSA (secp384r1)) - (No client certificate requested) - by legolas.ozlabs.org (Postfix) with ESMTPS id 4Z41yc0t0Hz1yKH - for ; Fri, 28 Feb 2025 19:46:16 +1100 (AEDT) -Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) - by phobos.denx.de (Postfix) with ESMTP id 70EA880BA4; - Fri, 28 Feb 2025 09:46:06 +0100 (CET) -Authentication-Results: phobos.denx.de; - dmarc=fail (p=none dis=none) header.from=linaro.org -Authentication-Results: phobos.denx.de; - spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de -Received: by phobos.denx.de (Postfix, from userid 109) - id 7E3C9810ED; Fri, 28 Feb 2025 09:46:05 +0100 (CET) -X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de -X-Spam-Level: -X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00, - RCVD_IN_DNSWL_BLOCKED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, - RCVD_IN_VALIDITY_RPBL_BLOCKED,SPF_HELO_NONE,SPF_SOFTFAIL autolearn=no - autolearn_force=no version=3.4.2 -Received: from foss.arm.com (foss.arm.com [217.140.110.172]) - by phobos.denx.de (Postfix) with ESMTP id A11D3810EB - for ; Fri, 28 Feb 2025 09:46:01 +0100 (CET) -Authentication-Results: phobos.denx.de; - dmarc=fail (p=none dis=none) header.from=linaro.org -Authentication-Results: phobos.denx.de; - spf=fail smtp.mailfrom=sughosh.ganu@linaro.org -Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) - by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 58EBF113E; - Fri, 28 Feb 2025 00:46:16 -0800 (PST) -Received: from a079122.blr.arm.com (a079122.arm.com [10.162.17.48]) - by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E0A503F673; - Fri, 28 Feb 2025 00:45:57 -0800 (PST) -From: Sughosh Ganu -To: u-boot@lists.denx.de -Cc: Ilias Apalodimas , - Simon Glass , Tom Rini , - Heinrich Schuchardt , - Anton Antonov , - Tobias Waldekranz , Bin Meng , - Sughosh Ganu , - Heinrich Schuchardt -Subject: [PATCH v6 2/6] efi_loader: add a function to remove memory from the - EFI map -Date: Fri, 28 Feb 2025 14:15:25 +0530 -Message-Id: <20250228084529.127823-3-sughosh.ganu@linaro.org> -X-Mailer: git-send-email 2.34.1 -In-Reply-To: <20250228084529.127823-1-sughosh.ganu@linaro.org> -References: <20250228084529.127823-1-sughosh.ganu@linaro.org> -MIME-Version: 1.0 -X-BeenThere: u-boot@lists.denx.de -X-Mailman-Version: 2.1.39 -Precedence: list -List-Id: U-Boot discussion -List-Unsubscribe: , - -List-Archive: -List-Post: -List-Help: -List-Subscribe: , - -Errors-To: u-boot-bounces@lists.denx.de -Sender: "U-Boot" -X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de -X-Virus-Status: Clean - -From: Ilias Apalodimas - -With upcoming changes supporting pmem nodes, we need to remove the -pmem area from the EFI memory map. Add a function to do that. - -Signed-off-by: Ilias Apalodimas -Signed-off-by: Sughosh Ganu -Reviewed-by: Heinrich Schuchardt ---- -Changes since V5: None - - include/efi_loader.h | 18 ++++++++++++ - lib/efi_loader/efi_memory.c | 56 ++++++++++++++++++++++++++----------- - 2 files changed, 58 insertions(+), 16 deletions(-) - -diff --git a/include/efi_loader.h b/include/efi_loader.h -index 1d75d97ebbc..0ac00911598 100644 ---- a/include/efi_loader.h -+++ b/include/efi_loader.h -@@ -852,6 +852,24 @@ efi_status_t efi_get_memory_map(efi_uintn_t *memory_map_size, - /* Adds a range into the EFI memory map */ - efi_status_t efi_add_memory_map(u64 start, u64 size, int memory_type); - -+/** -+ * efi_update_memory_map() - update the memory map by adding/removing pages -+ * -+ * @start: start address, must be a multiple of -+ * EFI_PAGE_SIZE -+ * @pages: number of pages to add -+ * @memory_type: type of memory added -+ * @overlap_conventional: region may only overlap free(conventional) -+ * memory -+ * @remove: remove memory map -+ * Return: status code -+ */ -+efi_status_t efi_update_memory_map(u64 start, u64 pages, int memory_type, -+ bool overlap_conventional, bool remove); -+ -+/* Remove memory from the EFI memory map */ -+efi_status_t efi_remove_memory_map(u64 start, u64 size, int memory_type); -+ - /* Called by board init to initialize the EFI drivers */ - efi_status_t efi_driver_init(void); - /* Called when a block device is added */ -diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c -index 6d00b186250..3fec40b6de5 100644 ---- a/lib/efi_loader/efi_memory.c -+++ b/lib/efi_loader/efi_memory.c -@@ -258,7 +258,7 @@ static s64 efi_mem_carve_out(struct efi_mem_list *map, - } - - /** -- * efi_add_memory_map_pg() - add pages to the memory map -+ * efi_update_memory_map() - update the memory map by adding/removing pages - * - * @start: start address, must be a multiple of - * EFI_PAGE_SIZE -@@ -266,12 +266,11 @@ static s64 efi_mem_carve_out(struct efi_mem_list *map, - * @memory_type: type of memory added - * @overlap_conventional: region may only overlap free(conventional) - * memory -+ * @remove: remove memory map - * Return: status code - */ --static --efi_status_t efi_add_memory_map_pg(u64 start, u64 pages, -- int memory_type, -- bool overlap_conventional) -+efi_status_t efi_update_memory_map(u64 start, u64 pages, int memory_type, -+ bool overlap_conventional, bool remove) - { - struct efi_mem_list *lmem; - struct efi_mem_list *newlist; -@@ -279,9 +278,9 @@ efi_status_t efi_add_memory_map_pg(u64 start, u64 pages, - uint64_t carved_pages = 0; - struct efi_event *evt; - -- EFI_PRINT("%s: 0x%llx 0x%llx %d %s\n", __func__, -+ EFI_PRINT("%s: 0x%llx 0x%llx %d %s %s\n", __func__, - start, pages, memory_type, overlap_conventional ? -- "yes" : "no"); -+ "yes" : "no", remove ? "remove" : "add"); - - if (memory_type >= EFI_MAX_MEMORY_TYPE) - return EFI_INVALID_PARAMETER; -@@ -364,7 +363,10 @@ efi_status_t efi_add_memory_map_pg(u64 start, u64 pages, - } - - /* Add our new map */ -- list_add_tail(&newlist->link, &efi_mem); -+ if (!remove) -+ list_add_tail(&newlist->link, &efi_mem); -+ else -+ free(newlist); - - /* And make sure memory is listed in descending order */ - efi_mem_sort(); -@@ -401,7 +403,29 @@ efi_status_t efi_add_memory_map(u64 start, u64 size, int memory_type) - pages = efi_size_in_pages(size + (start & EFI_PAGE_MASK)); - start &= ~EFI_PAGE_MASK; - -- return efi_add_memory_map_pg(start, pages, memory_type, false); -+ return efi_update_memory_map(start, pages, memory_type, false, false); -+} -+ -+/** -+ * efi_remove_memory_map() - remove memory area to the memory map -+ * -+ * @start: start address of the memory area -+ * @size: length in bytes of the memory area -+ * @memory_type: type of memory removed -+ * -+ * Return: status code -+ * -+ * This function automatically aligns the start and size of the memory area -+ * to EFI_PAGE_SIZE. -+ */ -+efi_status_t efi_remove_memory_map(u64 start, u64 size, int memory_type) -+{ -+ u64 pages; -+ -+ pages = efi_size_in_pages(size + (start & EFI_PAGE_MASK)); -+ start &= ~EFI_PAGE_MASK; -+ -+ return efi_update_memory_map(start, pages, memory_type, false, true); - } - - /** -@@ -502,7 +526,7 @@ efi_status_t efi_allocate_pages(enum efi_allocate_type type, - - efi_addr = (u64)(uintptr_t)map_sysmem(addr, 0); - /* Reserve that map in our memory maps */ -- ret = efi_add_memory_map_pg(efi_addr, pages, memory_type, true); -+ ret = efi_update_memory_map(efi_addr, pages, memory_type, true, false); - if (ret != EFI_SUCCESS) { - /* Map would overlap, bail out */ - lmb_free_flags(addr, (u64)pages << EFI_PAGE_SHIFT, flags); -@@ -823,8 +847,8 @@ static void add_u_boot_and_runtime(void) - uboot_stack_size) & ~EFI_PAGE_MASK; - uboot_pages = ((uintptr_t)map_sysmem(gd->ram_top - 1, 0) - - uboot_start + EFI_PAGE_MASK) >> EFI_PAGE_SHIFT; -- efi_add_memory_map_pg(uboot_start, uboot_pages, EFI_BOOT_SERVICES_CODE, -- false); -+ efi_update_memory_map(uboot_start, uboot_pages, EFI_BOOT_SERVICES_CODE, -+ false, false); - #if defined(__aarch64__) - /* - * Runtime Services must be 64KiB aligned according to the -@@ -842,8 +866,8 @@ static void add_u_boot_and_runtime(void) - runtime_end = (uintptr_t)__efi_runtime_stop; - runtime_end = (runtime_end + runtime_mask) & ~runtime_mask; - runtime_pages = (runtime_end - runtime_start) >> EFI_PAGE_SHIFT; -- efi_add_memory_map_pg(runtime_start, runtime_pages, -- EFI_RUNTIME_SERVICES_CODE, false); -+ efi_update_memory_map(runtime_start, runtime_pages, -+ EFI_RUNTIME_SERVICES_CODE, false, false); - } - - int efi_memory_init(void) -@@ -878,11 +902,11 @@ int efi_map_update_notify(phys_addr_t addr, phys_size_t size, - pages = efi_size_in_pages(size + (efi_addr & EFI_PAGE_MASK)); - efi_addr &= ~EFI_PAGE_MASK; - -- status = efi_add_memory_map_pg(efi_addr, pages, -+ status = efi_update_memory_map(efi_addr, pages, - op == LMB_MAP_OP_RESERVE ? - EFI_BOOT_SERVICES_DATA : - EFI_CONVENTIONAL_MEMORY, -- false); -+ false, false); - if (status != EFI_SUCCESS) { - log_err("LMB Map notify failure %lu\n", - status & ~EFI_ERROR_MASK); - -From patchwork Fri Feb 28 08:45:26 2025 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -X-Patchwork-Submitter: Sughosh Ganu -X-Patchwork-Id: 2053443 -X-Patchwork-Delegate: xypron.glpk@gmx.de -Return-Path: -X-Original-To: incoming@patchwork.ozlabs.org -Delivered-To: patchwork-incoming@legolas.ozlabs.org -Authentication-Results: legolas.ozlabs.org; - spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de - (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; - envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) -Received: from phobos.denx.de (phobos.denx.de - [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) - (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) - key-exchange X25519 server-signature ECDSA (secp384r1)) - (No client certificate requested) - by legolas.ozlabs.org (Postfix) with ESMTPS id 4Z41ym1cNCz1yKH - for ; Fri, 28 Feb 2025 19:46:24 +1100 (AEDT) -Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) - by phobos.denx.de (Postfix) with ESMTP id BD37E810F1; - Fri, 28 Feb 2025 09:46:08 +0100 (CET) -Authentication-Results: phobos.denx.de; - dmarc=fail (p=none dis=none) header.from=linaro.org -Authentication-Results: phobos.denx.de; - spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de -Received: by phobos.denx.de (Postfix, from userid 109) - id 4D257810F1; Fri, 28 Feb 2025 09:46:07 +0100 (CET) -X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de -X-Spam-Level: -X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00, - RCVD_IN_DNSWL_BLOCKED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, - RCVD_IN_VALIDITY_RPBL_BLOCKED,SPF_HELO_NONE,SPF_SOFTFAIL autolearn=no - autolearn_force=no version=3.4.2 -Received: from foss.arm.com (foss.arm.com [217.140.110.172]) - by phobos.denx.de (Postfix) with ESMTP id 23B3B80FE1 - for ; Fri, 28 Feb 2025 09:46:05 +0100 (CET) -Authentication-Results: phobos.denx.de; - dmarc=fail (p=none dis=none) header.from=linaro.org -Authentication-Results: phobos.denx.de; - spf=fail smtp.mailfrom=sughosh.ganu@linaro.org -Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) - by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id CB084113E; - Fri, 28 Feb 2025 00:46:19 -0800 (PST) -Received: from a079122.blr.arm.com (a079122.arm.com [10.162.17.48]) - by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A01053F673; - Fri, 28 Feb 2025 00:46:01 -0800 (PST) -From: Sughosh Ganu -To: u-boot@lists.denx.de -Cc: Ilias Apalodimas , - Simon Glass , Tom Rini , - Heinrich Schuchardt , - Anton Antonov , - Tobias Waldekranz , Bin Meng , - Sughosh Ganu -Subject: [PATCH v6 3/6] efi_loader: preserve installer images in pmem -Date: Fri, 28 Feb 2025 14:15:26 +0530 -Message-Id: <20250228084529.127823-4-sughosh.ganu@linaro.org> -X-Mailer: git-send-email 2.34.1 -In-Reply-To: <20250228084529.127823-1-sughosh.ganu@linaro.org> -References: <20250228084529.127823-1-sughosh.ganu@linaro.org> -MIME-Version: 1.0 -X-BeenThere: u-boot@lists.denx.de -X-Mailman-Version: 2.1.39 -Precedence: list -List-Id: U-Boot discussion -List-Unsubscribe: , - -List-Archive: -List-Post: -List-Help: -List-Subscribe: , - -Errors-To: u-boot-bounces@lists.denx.de -Sender: "U-Boot" -X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de -X-Virus-Status: Clean - -From: Ilias Apalodimas - -One of the problems OS installers face, when running in EFI, is that -the mounted ISO after calling ExitBootServices goes away. For some -distros this is a problem since they rely on finding some core packages -before continuing the installation. Distros have works around this -- -e.g Fedora has a special kernel command line parameter called -inst.stage2 [0]. - -ACPI has NFIT and NVDIMM support to provide ramdisks to the OS, but we -don't have anything in place for DTs. Linux and device trees have support -for persistent memory devices. - -It's worth noting that for linux to instantiate the /dev/pmemX device, -the memory described in the pmem node has to be omitted from the EFI -memory map we hand over to the OS if ZONE_DEVICES and SPARSEMEM is -enabled. With those enabled the pmem driver ends up calling -devm_memremap_pages() instead of devm_memremap(). The latter works -whether the memory is omitted or marked as reserved, but mapping pages -only works if the memory is omitted. - -On top of that, depending on how the kernel is configured, that memory -area must be page aligned or 2MB aligned. PowerPC is an exception here -and requires 16MB alignment, but since we don't have EFI support for -it, limit the alignment to 2MB. - -Ensure that the ISO image is 2MB aligned and remove the region -occupied by the image from the EFI memory map. - -Signed-off-by: Ilias Apalodimas -Signed-off-by: Sughosh Ganu ---- -Changes since V5: None - - lib/efi_loader/efi_bootmgr.c | 22 +++++++++++++++++----- - 1 file changed, 17 insertions(+), 5 deletions(-) - -diff --git a/lib/efi_loader/efi_bootmgr.c b/lib/efi_loader/efi_bootmgr.c -index c6124c590d9..081eff057f4 100644 ---- a/lib/efi_loader/efi_bootmgr.c -+++ b/lib/efi_loader/efi_bootmgr.c -@@ -18,6 +18,8 @@ - #include - #include - #include -+#include -+#include - - static const struct efi_boot_services *bs; - static const struct efi_runtime_services *rs; -@@ -362,13 +364,16 @@ static efi_status_t prepare_loaded_image(u16 *label, ulong addr, ulong size, - } - - /* -- * TODO: expose the ramdisk to OS. -- * Need to pass the ramdisk information by the architecture-specific -- * methods such as 'pmem' device-tree node. -+ * Linux supports 'pmem' which allows OS installers to find, reclaim -+ * the mounted images and continue the installation since the contents -+ * of the pmem region are treated as local media. -+ * -+ * The memory regions used for it needs to be carved out of the EFI -+ * memory map. - */ -- ret = efi_add_memory_map(addr, size, EFI_RESERVED_MEMORY_TYPE); -+ ret = efi_remove_memory_map(addr, size, EFI_CONVENTIONAL_MEMORY); - if (ret != EFI_SUCCESS) { -- log_err("Memory reservation failed\n"); -+ log_err("Failed to reserve memory\n"); - goto err; - } - -@@ -490,6 +495,13 @@ static efi_status_t try_load_from_uri_path(struct efi_device_path_uri *uridp, - ret = EFI_INVALID_PARAMETER; - goto err; - } -+ /* -+ * Depending on the kernel configuration, pmem memory area must be page -+ * aligned or 2MB aligned. PowerPC is an exception here and requires -+ * 16MB alignment, but since we don't have EFI support for it, limit -+ * the alignment to 2MB. -+ */ -+ image_size = ALIGN(image_size, SZ_2M); - - /* - * If the file extension is ".iso" or ".img", mount it and try to load - -From patchwork Fri Feb 28 08:45:27 2025 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -X-Patchwork-Submitter: Sughosh Ganu -X-Patchwork-Id: 2053444 -X-Patchwork-Delegate: xypron.glpk@gmx.de -Return-Path: -X-Original-To: incoming@patchwork.ozlabs.org -Delivered-To: patchwork-incoming@legolas.ozlabs.org -Authentication-Results: legolas.ozlabs.org; - spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de - (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; - envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) -Received: from phobos.denx.de (phobos.denx.de - [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) - (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) - key-exchange X25519 server-signature ECDSA (secp384r1)) - (No client certificate requested) - by legolas.ozlabs.org (Postfix) with ESMTPS id 4Z41z21cqkz1yKH - for ; Fri, 28 Feb 2025 19:46:38 +1100 (AEDT) -Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) - by phobos.denx.de (Postfix) with ESMTP id B7A2B810FE; - Fri, 28 Feb 2025 09:46:11 +0100 (CET) -Authentication-Results: phobos.denx.de; - dmarc=fail (p=none dis=none) header.from=linaro.org -Authentication-Results: phobos.denx.de; - spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de -Received: by phobos.denx.de (Postfix, from userid 109) - id 9A8D9811C5; Fri, 28 Feb 2025 09:46:10 +0100 (CET) -X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de -X-Spam-Level: -X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00, - RCVD_IN_DNSWL_BLOCKED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, - RCVD_IN_VALIDITY_RPBL_BLOCKED,SPF_HELO_NONE,SPF_SOFTFAIL autolearn=no - autolearn_force=no version=3.4.2 -Received: from foss.arm.com (foss.arm.com [217.140.110.172]) - by phobos.denx.de (Postfix) with ESMTP id A52C180FE1 - for ; Fri, 28 Feb 2025 09:46:08 +0100 (CET) -Authentication-Results: phobos.denx.de; - dmarc=fail (p=none dis=none) header.from=linaro.org -Authentication-Results: phobos.denx.de; - spf=fail smtp.mailfrom=sughosh.ganu@linaro.org -Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) - by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 48F081688; - Fri, 28 Feb 2025 00:46:23 -0800 (PST) -Received: from a079122.blr.arm.com (a079122.arm.com [10.162.17.48]) - by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1E23D3F673; - Fri, 28 Feb 2025 00:46:04 -0800 (PST) -From: Sughosh Ganu -To: u-boot@lists.denx.de -Cc: Ilias Apalodimas , - Simon Glass , Tom Rini , - Heinrich Schuchardt , - Anton Antonov , - Tobias Waldekranz , Bin Meng , - Sughosh Ganu -Subject: [PATCH v6 4/6] blkmap: store type of blkmap slice in corresponding - structure -Date: Fri, 28 Feb 2025 14:15:27 +0530 -Message-Id: <20250228084529.127823-5-sughosh.ganu@linaro.org> -X-Mailer: git-send-email 2.34.1 -In-Reply-To: <20250228084529.127823-1-sughosh.ganu@linaro.org> -References: <20250228084529.127823-1-sughosh.ganu@linaro.org> -MIME-Version: 1.0 -X-BeenThere: u-boot@lists.denx.de -X-Mailman-Version: 2.1.39 -Precedence: list -List-Id: U-Boot discussion -List-Unsubscribe: , - -List-Archive: -List-Post: -List-Help: -List-Subscribe: , - -Errors-To: u-boot-bounces@lists.denx.de -Sender: "U-Boot" -X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de -X-Virus-Status: Clean - -Add information about the type of blkmap slice as an attribute in the -corresponding slice structure. Put information in the blkmap slice -structure to identify if it is associated with a memory or linear -mapped device. Which can then be used to take specific action based on -the type of the blkmap slice. - -Signed-off-by: Sughosh Ganu -Reviewed-by: Tobias Waldekranz -Reviewed-by: Ilias Apalodimas ---- -Changes since V5: None - - drivers/block/blkmap.c | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/drivers/block/blkmap.c b/drivers/block/blkmap.c -index 34eed1380dc..453510cca62 100644 ---- a/drivers/block/blkmap.c -+++ b/drivers/block/blkmap.c -@@ -16,6 +16,10 @@ - - struct blkmap; - -+/* Attributes of blkmap slice */ -+#define BLKMAP_SLICE_LINEAR BIT(0) -+#define BLKMAP_SLICE_MEM BIT(1) -+ - /** - * struct blkmap_slice - Region mapped to a blkmap - * -@@ -25,12 +29,14 @@ struct blkmap; - * @node: List node used to associate this slice with a blkmap - * @blknr: Start block number of the mapping - * @blkcnt: Number of blocks covered by this mapping -+ * @attr: Attributes of blkmap slice - */ - struct blkmap_slice { - struct list_head node; - - lbaint_t blknr; - lbaint_t blkcnt; -+ uint attr; - - /** - * @read: - Read from slice -@@ -169,6 +175,7 @@ int blkmap_map_linear(struct udevice *dev, lbaint_t blknr, lbaint_t blkcnt, - .slice = { - .blknr = blknr, - .blkcnt = blkcnt, -+ .attr = BLKMAP_SLICE_LINEAR, - - .read = blkmap_linear_read, - .write = blkmap_linear_write, -@@ -248,6 +255,7 @@ int __blkmap_map_mem(struct udevice *dev, lbaint_t blknr, lbaint_t blkcnt, - .slice = { - .blknr = blknr, - .blkcnt = blkcnt, -+ .attr = BLKMAP_SLICE_MEM, - - .read = blkmap_mem_read, - .write = blkmap_mem_write, - -From patchwork Fri Feb 28 08:45:28 2025 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -X-Patchwork-Submitter: Sughosh Ganu -X-Patchwork-Id: 2053445 -X-Patchwork-Delegate: xypron.glpk@gmx.de -Return-Path: -X-Original-To: incoming@patchwork.ozlabs.org -Delivered-To: patchwork-incoming@legolas.ozlabs.org -Authentication-Results: legolas.ozlabs.org; - spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de - (client-ip=85.214.62.61; helo=phobos.denx.de; - envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) -Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) - (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) - key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) - (No client certificate requested) - by legolas.ozlabs.org (Postfix) with ESMTPS id 4Z41zB6lfpz1yKH - for ; Fri, 28 Feb 2025 19:46:46 +1100 (AEDT) -Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) - by phobos.denx.de (Postfix) with ESMTP id 1822281111; - Fri, 28 Feb 2025 09:46:15 +0100 (CET) -Authentication-Results: phobos.denx.de; - dmarc=fail (p=none dis=none) header.from=linaro.org -Authentication-Results: phobos.denx.de; - spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de -Received: by phobos.denx.de (Postfix, from userid 109) - id A6651807D7; Fri, 28 Feb 2025 09:46:14 +0100 (CET) -X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de -X-Spam-Level: -X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00, - RCVD_IN_DNSWL_BLOCKED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, - RCVD_IN_VALIDITY_RPBL_BLOCKED,SPF_HELO_NONE,SPF_SOFTFAIL autolearn=no - autolearn_force=no version=3.4.2 -Received: from foss.arm.com (foss.arm.com [217.140.110.172]) - by phobos.denx.de (Postfix) with ESMTP id 7B487811C5 - for ; Fri, 28 Feb 2025 09:46:12 +0100 (CET) -Authentication-Results: phobos.denx.de; - dmarc=fail (p=none dis=none) header.from=linaro.org -Authentication-Results: phobos.denx.de; - spf=fail smtp.mailfrom=sughosh.ganu@linaro.org -Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) - by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3B092113E; - Fri, 28 Feb 2025 00:46:27 -0800 (PST) -Received: from a079122.blr.arm.com (a079122.arm.com [10.162.17.48]) - by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 103233F673; - Fri, 28 Feb 2025 00:46:08 -0800 (PST) -From: Sughosh Ganu -To: u-boot@lists.denx.de -Cc: Ilias Apalodimas , - Simon Glass , Tom Rini , - Heinrich Schuchardt , - Anton Antonov , - Tobias Waldekranz , Bin Meng , - Sughosh Ganu -Subject: [PATCH v6 5/6] blkmap: add an attribute to preserve the mem mapping -Date: Fri, 28 Feb 2025 14:15:28 +0530 -Message-Id: <20250228084529.127823-6-sughosh.ganu@linaro.org> -X-Mailer: git-send-email 2.34.1 -In-Reply-To: <20250228084529.127823-1-sughosh.ganu@linaro.org> -References: <20250228084529.127823-1-sughosh.ganu@linaro.org> -MIME-Version: 1.0 -X-BeenThere: u-boot@lists.denx.de -X-Mailman-Version: 2.1.39 -Precedence: list -List-Id: U-Boot discussion -List-Unsubscribe: , - -List-Archive: -List-Post: -List-Help: -List-Subscribe: , - -Errors-To: u-boot-bounces@lists.denx.de -Sender: "U-Boot" -X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de -X-Virus-Status: Clean - -Some blkmap memory mapped devices might have to be be relevant even -after U-Boot passes control to the next image as part of the platform -boot. An example of such a mapping would be an OS installer ISO image, -information for which has to be provided to the OS kernel. Use the -'preserve' attribute for such mappings. The code for adding a pmem -node to the device-tree then checks if this attribute is set, and adds -a node only for mappings which have this attribute. - -Signed-off-by: Sughosh Ganu -Reviewed-by: Tobias Waldekranz -Reviewed-by: Ilias Apalodimas ---- -Changes since V5: None - - cmd/blkmap.c | 9 +++++++-- - drivers/block/blkmap.c | 12 ++++++++---- - drivers/block/blkmap_helper.c | 2 +- - include/blkmap.h | 4 +++- - 4 files changed, 19 insertions(+), 8 deletions(-) - -diff --git a/cmd/blkmap.c b/cmd/blkmap.c -index 164f80f1387..86a123b1cd3 100644 ---- a/cmd/blkmap.c -+++ b/cmd/blkmap.c -@@ -62,13 +62,18 @@ static int do_blkmap_map_mem(struct map_ctx *ctx, int argc, char *const argv[]) - { - phys_addr_t addr; - int err; -+ bool preserve = false; - - if (argc < 2) - return CMD_RET_USAGE; - - addr = hextoul(argv[1], NULL); - -- err = blkmap_map_pmem(ctx->dev, ctx->blknr, ctx->blkcnt, addr); -+ if (argc == 3 && !strcmp(argv[2], "preserve")) -+ preserve = true; -+ -+ err = blkmap_map_pmem(ctx->dev, ctx->blknr, ctx->blkcnt, addr, -+ preserve); - if (err) { - printf("Unable to map %#llx at block 0x" LBAF ": %d\n", - (unsigned long long)addr, ctx->blknr, err); -@@ -221,7 +226,7 @@ U_BOOT_CMD_WITH_SUBCMDS( - "blkmap create