Merge remote-tracking branch 'upstream/master' into mac/17-platform-guard

This commit is contained in:
Marcelo Alcantara committed 2026-09-25 20:46:03 +10:00
commit d62c3d6840
39 files changed
+4549 -10

No files matched your search

+1
View File
@@ -58,6 +58,7 @@ jobs:
./tests/published-build-plan.sh
./tests/controller.sh
./tests/artifact-helpers.sh
./tests/limine-mkinitcpio-hook.sh
pacman -S --noconfirm --quiet rclone >/dev/null
./tests/publish-artifact.sh
'
+2
View File
@@ -170,6 +170,8 @@ These packages were already excluded from automatic AUR updates. The migration p
`linux-firmware-cirrus` is a deliberate hold: a self-retiring shim that ships Arch's linux-firmware-cirrus 20260910-2 payload to stable while stable's Arch snapshot is on 20260810-2 (Dell XPS 13 DX13260 / 1028:0e54 speaker firmware). It is versioned 20260810-3 so the genuine Arch package supersedes it as soon as the snapshot advances; bumping it to the Arch version would defeat that. Delete the recipe once stable's snapshot carries linux-firmware >= 20260910.
`m1n1-aurora` and `uboot-asahi` are deliberate holds: Apple Silicon boot code, pinned by hand like `linux-aurora`, and bumped only after a cold boot on the qualification Macs. `m1n1-aurora` pins an aurora-silicon/m1n1 commit plus a local patch. `uboot-asahi` follows asahi-alarm's recipe and patch set (asahi-alarm/PKGBUILDs), which a tag watch on AsahiLinux/u-boot cannot carry.
## Package-specific boundaries
- NVIDIA watches remain on the 580 driver branch.
+61 -3
View File
@@ -3,14 +3,16 @@ _pkgname="limine-entry-tool"
pkgname="limine-mkinitcpio-hook"
_gradle_version=9.7.1
pkgver=1.39.0
pkgrel=1
pkgrel=2
pkgdesc="Install kernels for the Limine bootloader."
arch=('x86_64' 'aarch64')
url="https://gitlab.com/Zesko/limine-entry-tool"
source=("${_pkgname}::git+${url}.git#tag=${pkgver}")
source_x86_64=("https://github.com/graalvm/graalvm-ce-builds/releases/download/graal-25.2.4/graalvm-community-jdk-25i2-25.0.4_linux-x64_bin.tar.gz")
source_aarch64=("https://github.com/graalvm/graalvm-ce-builds/releases/download/graal-25.2.4/graalvm-community-jdk-25i2-25.0.4_linux-aarch64_bin.tar.gz"
"https://services.gradle.org/distributions/gradle-${_gradle_version}-bin.zip")
"https://services.gradle.org/distributions/gradle-${_gradle_version}-bin.zip"
"limine-apple-gate"
"mkinitcpio-install.hook")
license=("GPL3")
provides=('limine-entry-tool')
options=(!debug !strip)
@@ -34,7 +36,9 @@ conflicts=('limine-entry-tool')
sha256sums=('6c4affb6fb6367a1222f7d0c54957a3142781d7894bbf61b1a274bd153e5d869')
sha256sums_x86_64=('3f4a89de8eaa96f2ed677f09957c7e872cd8467aad3537f8b5394c1b8c4b942e')
sha256sums_aarch64=('22286f7ecd21b9aedb3226b9bf797469e1bd3eefc491e12ef3dd49b452d230b7'
'acd53f1edaf02f1a8ff99879f8a34b302661a057d9b063ae9e35b552f804d20a')
'acd53f1edaf02f1a8ff99879f8a34b302661a057d9b063ae9e35b552f804d20a'
'199fa2122e4a20ed80e6cf5df235b4e50739593803522bfa65700b1ef242b9ce'
'9fc607e81d2f09aa0dfd313805277af92977535bd222f1e86caf5fbb28138cb4')
prepare() {
[[ -d "${_graalvm_version}" ]] && rm -rf "${_graalvm_version}"
@@ -77,4 +81,58 @@ package() {
# limine hook symlinks
ln -sf /usr/bin/limine-reset-enroll "$pkgdir/etc/boot/hooks/pre.d/10-limine-reset-enroll"
ln -sf /usr/bin/limine-enroll-config "$pkgdir/etc/boot/hooks/post.d/90-limine-enroll-config"
if [[ $CARCH == aarch64 ]]; then
_apple_silicon_hooks
fi
}
# An Apple Silicon Mac boots GRUB until Omarchy activates Limine, and keeps
# the kernel and initramfs that mkinitcpio's presets install under /boot
# after that too (GRUB, the boot check and the snapshot tools read them).
# The aarch64 hooks and mkinitcpio wrapper run through limine-apple-gate,
# which leaves every other machine as upstream ships it. On a Mac:
# - Limine's kernel and removal hooks wait until Limine is active;
# - mkinitcpio's own kernel hook, which Limine's takes over by name, runs from
# a copy of mkinitcpio 42's (mkinitcpio-install.hook: keep its triggers in
# step with mkinitcpio's), just before Limine's;
# - Limine's EFI deploy hook stays out: omarchy-mac-boot puts Limine in
# U-Boot's EFI/BOOT/BOOTAA64.EFI slot;
# - the wrapper is plain mkinitcpio: it would run limine-mkinitcpio after
# every preset build, mkinitcpio's kernel hook included.
_apple_silicon_hooks() {
local scripts=/usr/share/libalpm/scripts
local gate=$scripts/limine-apple-gate
local hooks="$pkgdir/usr/share/libalpm/hooks"
local kernel_hook="$pkgdir/etc/pacman.d/hooks/90-mkinitcpio-install.hook"
local mac_hook="$hooks/90-mkinitcpio-apple-install.hook"
local wrapper="$pkgdir/usr/local/bin/mkinitcpio"
install -Dm755 "$srcdir/limine-apple-gate" "$pkgdir$gate"
install -Dm644 "$srcdir/mkinitcpio-install.hook" "$mac_hook"
sed -i -e 's|^Description = .*|Description = Updating linux initcpios under /boot (Apple Silicon)...|' \
-e "s|^Exec = $scripts/mkinitcpio install\$|Exec = $gate --mac $scripts/mkinitcpio install|" "$mac_hook"
sed -i "s|^Exec = $scripts/limine-mkinitcpio-|Exec = $gate $scripts/limine-mkinitcpio-|" \
"$kernel_hook" "$hooks/60-limine-mkinitcpio-remove-pre.hook" "$hooks/90-limine-mkinitcpio-remove-post.hook"
sed -i "s|^Exec = /usr/bin/limine-install\$|Exec = $gate --not-mac /usr/bin/limine-install|" "$hooks/80-limine-efi-deploy.hook"
sed -i "1a $gate --mac \\&\\& exec /usr/bin/mkinitcpio \"\$@\"" "$wrapper"
local expected=(
"$mac_hook|Exec = $gate --mac $scripts/mkinitcpio install"
"$kernel_hook|Exec = $gate $scripts/limine-mkinitcpio-install"
"$hooks/60-limine-mkinitcpio-remove-pre.hook|Exec = $gate $scripts/limine-mkinitcpio-remove pre"
"$hooks/90-limine-mkinitcpio-remove-post.hook|Exec = $gate $scripts/limine-mkinitcpio-remove post"
"$hooks/80-limine-efi-deploy.hook|Exec = $gate --not-mac /usr/bin/limine-install"
)
local entry
for entry in "${expected[@]}"; do
[[ $(grep '^Exec = ' "${entry%%|*}") == "${entry#*|}" ]] || {
echo "${entry%%|*}: expected '${entry#*|}'" >&2
return 1
}
done
[[ $(sed -n 1,2p "$wrapper") == $'#!/usr/bin/env bash\n'"$gate --mac && exec /usr/bin/mkinitcpio \"\$@\"" ]] || {
echo "the mkinitcpio wrapper does not start with the Apple Silicon gate" >&2
return 1
}
}
@@ -0,0 +1,69 @@
#!/bin/bash
# The aarch64 package runs its pacman hooks and its mkinitcpio wrapper through
# this, so that only an Apple Silicon Mac behaves differently from upstream:
#
# limine-apple-gate COMMAND... COMMAND, except on a Mac that has not activated Limine
# limine-apple-gate --mac COMMAND... COMMAND on a Mac only
# limine-apple-gate --not-mac COMMAND... COMMAND everywhere but a Mac
# limine-apple-gate --mac succeeds on a Mac only
#
# A Mac boots GRUB until Omarchy activates Limine: the gate
# /var/lib/omarchy/limine.enabled and the /etc/default/limine the activation
# writes, the same test as omarchy-mac-limine-active. A command that does not
# run reads the targets pacman streams to it and succeeds quietly.
gate=/var/lib/omarchy/limine.enabled
limine_default=/etc/default/limine
compatible=(/proc/device-tree/compatible /sys/firmware/devicetree/base/compatible)
# Fixtures fake the machine for an unprivileged caller only; as root, which
# pacman hooks always are, the live system decides.
if ((EUID != 0)); then
gate=${OMARCHY_LIMINE_GATE:-$gate}
limine_default=${OMARCHY_LIMINE_DEFAULT:-$limine_default}
if [[ -n ${OMARCHY_PROC_ROOT:-}${OMARCHY_SYS_ROOT:-} ]]; then
compatible=()
[[ -z ${OMARCHY_PROC_ROOT:-} ]] || compatible+=("$OMARCHY_PROC_ROOT/device-tree/compatible")
[[ -z ${OMARCHY_SYS_ROOT:-} ]] || compatible+=("$OMARCHY_SYS_ROOT/firmware/devicetree/base/compatible")
fi
fi
# m1n1 names every Apple Silicon Mac "apple,<model>" in the root node's
# NUL-separated compatible list, as omarchy-hw-platform reads it.
is_mac() {
local source
for source in "${compatible[@]}"; do
[[ -r $source ]] && tr '\0' '\n' <"$source" | grep -q '^apple,' && return 0
done
return 1
}
# pacman writes NeedsTargets to a socket and fails the write if the hook has
# gone; hooks without NeedsTargets get no stdin at all.
pass() {
if [[ -S /dev/stdin || -p /dev/stdin ]]; then
cat >/dev/null
fi
exit 0
}
mode=limine
case ${1:-} in
--mac | --not-mac)
mode=${1#--}
shift
;;
esac
if (($# == 0)); then
[[ $mode == mac ]] && { is_mac; exit; }
echo "usage: limine-apple-gate [--mac|--not-mac] COMMAND [ARG]..." >&2
exit 2
fi
case $mode in
mac) is_mac || pass ;;
not-mac) ! is_mac || pass ;;
limine) ! is_mac || [[ -e $gate && -f $limine_default ]] || pass ;;
esac
exec "$@"
@@ -0,0 +1,38 @@
[Trigger]
Type = Path
Operation = Install
Operation = Upgrade
Operation = Remove
Target = usr/lib/initcpio/*
Target = usr/lib/firmware/*
Target = usr/lib/modules/*/extramodules/
Target = usr/src/*/dkms.conf
Target = usr/lib/systemd/systemd
Target = usr/lib/systemd/systemd-udevd
Target = usr/bin/cryptsetup
Target = usr/bin/lvm
Target = usr/bin/mdadm
Target = usr/bin/pdata_tools
Target = usr/lib/libcryptsetup.so
Target = usr/lib/libp11-kit.so
Target = usr/lib/libpcsclite.so
Target = usr/lib/modprobe.d/
[Trigger]
Type = Path
Operation = Install
Operation = Upgrade
Target = usr/lib/modules/*/vmlinuz
[Trigger]
Type = Package
Operation = Install
Operation = Upgrade
Target = mkinitcpio
Target = mkinitcpio-git
[Action]
Description = Updating linux initcpios...
When = PostTransaction
Exec = /usr/share/libalpm/scripts/mkinitcpio install
NeedsTargets
+1 -2
View File
@@ -1,6 +1,5 @@
{
"source": "local",
"skip_build": true,
"release_ring": "fast",
"channels": ["edge", "rc"]
"channels": ["edge"]
}
+6 -5
View File
@@ -5,12 +5,12 @@
# alt-mode and USB4 support for external monitors, variable refresh rate, and
# the ISP and AOP drivers. Those changes touch device trees, the type-C stack
# and DRM, so they cannot ship as a module: this is a whole alternative kernel
# for Macs on the Omarchy edge and rc channels. The stable channel keeps
# asahi-alarm's linux-asahi.
# for Macs on the Omarchy edge channel. It reaches rc and stable only after
# cold-boot qualification on M1 and M2.
_auroraver=7.1.12
_aurorarel=2
pkgrel=9
pkgrel=10
# Immutable pin on aurora-silicon/linux (branch aurora-wip). Every bump is a
# PR that moves _commit and the archive checksum; the pinned commit is cold-boot
@@ -88,8 +88,9 @@ _package_kernel() {
depends=(coreutils kmod initramfs $2 "m1n1>=$_m1n1_version")
optdepends=('crda: to set the correct wireless channels of your country'
'linux-firmware: firmware images needed for some devices')
provides=(WIREGUARD-MODULE linux=${pkgver} linux-asahi=${pkgver})
replaces=(wireguard-arch)
# No generic linux provide: on a shared aarch64 repository it would compete
# with linux-aarch64 for any dependency on linux.
provides=(WIREGUARD-MODULE linux-asahi=${pkgver})
conflicts=(linux-asahi)
local kernver="$(<$O/version)"
@@ -0,0 +1,5 @@
{
"source": "local",
"channels": ["edge"],
"sync": false
}
+54
View File
@@ -0,0 +1,54 @@
# m1n1 for linux-aurora. Aurora's device trees name the USB4 aliases
# usb4-N-acio, usb4-N-nhi and usb4-N-pcie-adapter; m1n1 v1.6.1 only looks up
# the usb4_N_* names, so without the alias fallback the USB4 tunables are
# never applied. The Asahi m1n1 stays with linux-asahi.
pkgname=m1n1-aurora
pkgver=1.6.1.aurora1
pkgrel=3
pkgdesc='Omarchy Aurora m1n1 with compatible USB4 tunable aliases'
arch=('aarch64')
url='https://github.com/aurora-silicon/m1n1'
license=('MIT' 'CC0-1.0' 'OFL-1.1-RFN' 'Zlib' 'BSD-2-Clause OR GPL-2.0-or-later' 'BSD-3-Clause OR GPL-2.0-or-later' 'MIT OR Apache-2.0')
provides=("m1n1=$pkgver")
conflicts=('m1n1')
makedepends=('clang' 'lld' 'llvm' 'rustup' 'make' 'patch')
options=('!strip' '!debug')
_commit=06a4601a351ebfd1abb6abba9a44c34e40d94776
source=("m1n1-${_commit}.tar.gz::https://github.com/aurora-silicon/m1n1/archive/${_commit}.tar.gz"
aurora-cio-aliases.patch
bootlogo_48.bin
bootlogo_128.bin
bootlogo_256.bin
)
sha256sums=('9d6972d3edaff856e985f2b1feb64fcf9b42fc5eecda7be64a242b49bbbe636d'
'4345a4e431642c4316595bdf023bc67d5c72e0374f3c8d59be81318710138f32'
'6668050653645711ad7523fe2abeb4cbe85a92c875f3eec754b6db23cea2191c'
'b19cb017645c7a9068ea0be9b6bb394131d7ca11b28093cf6caa1ffca74b0a4e'
'9c659b392aacfa31c62c638003d2257abfdbe17919b5c90cde4c4e62f87addab')
prepare() {
cd "m1n1-$_commit"
patch -p1 < "$srcdir/aurora-cio-aliases.patch"
for size in 48 128 256; do
cp "$srcdir/bootlogo_$size.bin" "data/bootlogo_$size.bin"
done
rustup toolchain install 1.89.0 --profile minimal --target aarch64-unknown-none-softfloat
}
build() {
cd "m1n1-$_commit"
RUSTUP_TOOLCHAIN=1.89.0 make RELEASE=1 USE_CLANG=1 ARCH=aarch64-linux-gnu \
M1N1_VERSION_TAG=v1.6.1-omarchy.aurora1
}
package() {
# asahi-scripts (update-m1n1 and its pacman hook) only exists in the
# asahi-alarm repository, which the builder does not configure. Declared
# here so makepkg does not try to install it at build time.
depends=('asahi-scripts>=20260127.1')
cd "m1n1-$_commit"
install -Dm644 build/m1n1.bin "$pkgdir/usr/lib/asahi-boot/m1n1.bin"
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
install -m644 3rdparty_licenses/* "$pkgdir/usr/share/licenses/$pkgname/"
}
+13
View File
@@ -0,0 +1,13 @@
# m1n1-aurora
m1n1 v1.6.1 from aurora-silicon/m1n1 (06a4601a351ebfd1abb6abba9a44c34e40d94776) with RC, NHI and PCIe adapter alias fallbacks for the USB4 tunables, plus the Omarchy boot logos. Aurora's device trees name those aliases `usb4-N-acio`, `usb4-N-nhi` and `usb4-N-pcie-adapter`; stock m1n1 only looks up the `usb4_N_*` names. Latest Aurora m1n1 main is not qualified.
## Pairing with linux-aurora
- It provides `m1n1=1.6.1.aurora1`, which satisfies linux-aurora's `m1n1>=1.6.1`, and conflicts with asahi-alarm's `m1n1`. pacman prefers a package literally named `m1n1` over a provider, so an Aurora transaction names `m1n1-aurora` explicitly and accepts its conflict with `m1n1` (`--ask 4` under `--noconfirm`).
- It owns `/usr/lib/asahi-boot/m1n1.bin`. asahi-scripts' `95-m1n1-install.hook` runs `update-m1n1` when that file, `/usr/lib/modules/*/dtbs/*` or U-Boot changes. `update-m1n1` writes m1n1, the device trees and gzipped U-Boot into `m1n1/boot.bin` on the system ESP. asahi-alarm's default takes the device trees from the newest `/lib/modules/*-ARCH/dtbs`, which is where linux-aurora installs its Apple DTBs. `/etc/default/update-m1n1` overrides are left alone.
- Raising linux-aurora's `_m1n1_version` above 1.6.1 needs an m1n1-aurora whose provided version satisfies it, released first.
## Qualification
Each bump is cold-boot qualified on the M1 Pro and M2 Max: package installation, the hook rebuilding `boot.bin`, the logo, physical boot and two external displays. A successful build is not hardware acceptance.
@@ -0,0 +1,28 @@
diff --git a/src/kboot.c b/src/kboot.c
index a5bd4f1..1089666 100644
--- a/src/kboot.c
+++ b/src/kboot.c
@@ -1249,17 +1249,23 @@ static int dt_set_acio_tunables(void)
memset(fdt_alias, 0, sizeof(fdt_alias));
snprintf(fdt_alias, sizeof(fdt_alias), "usb4_%d_rc", i);
+ if (!fdt_get_alias(dt, fdt_alias))
+ snprintf(fdt_alias, sizeof(fdt_alias), "usb4-%d-acio", i);
dt_copy_acio_tunables(adt_path, fdt_alias, usb4_rc_tunables,
sizeof(usb4_rc_tunables) / sizeof(*usb4_rc_tunables));
memset(fdt_alias, 0, sizeof(fdt_alias));
snprintf(fdt_alias, sizeof(fdt_alias), "usb4_%d_pcie_adapter", i);
+ if (!fdt_get_alias(dt, fdt_alias))
+ snprintf(fdt_alias, sizeof(fdt_alias), "usb4-%d-pcie-adapter", i);
dt_copy_acio_tunables(adt_path, fdt_alias, usb4_pcie_adapter_tunables,
sizeof(usb4_pcie_adapter_tunables) /
sizeof(*usb4_pcie_adapter_tunables));
memset(fdt_alias, 0, sizeof(fdt_alias));
snprintf(fdt_alias, sizeof(fdt_alias), "usb4_%d_nhi", i);
+ if (!fdt_get_alias(dt, fdt_alias))
+ snprintf(fdt_alias, sizeof(fdt_alias), "usb4-%d-nhi", i);
dt_copy_acio_tunables(adt_path, fdt_alias, usb4_nhi_tunables,
sizeof(usb4_nhi_tunables) / sizeof(*usb4_nhi_tunables));
dt_copy_usb4_drom(adt_path, fdt_alias);
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻j�榻jLine truncated
Binary file not shown.
@@ -0,0 +1 @@
{ "source": "local", "channels": ["edge"] }
+42
View File
@@ -0,0 +1,42 @@
# Maintainer: Scott Jones <scottajones@gmail.com>
# Ported from omarchy-mac/omarchy-pkgs-aarch64 pkgbuilds/omarchy-mac at 02ed7b250f7edcf7c5f748acaf7b21ef0a764e9d.
pkgname=omarchy-mac
# pkgver matches packages/omarchy-mac/version at _commit. Bump pkgrel to re-pin
# or rebuild the same add-on version; reset it to 1 when pkgver increases.
pkgver=0.1.0
pkgrel=5
pkgdesc='Apple Silicon configuration and support services for Omarchy'
arch=('aarch64')
url='https://github.com/omacom/omarchy-mac'
license=('MIT')
makedepends=('git' 'findutils')
checkdepends=('diffutils' 'python' 'systemd')
# An exact quattro-upstream commit, never a branch.
_commit=b4a79d83d1144c4de90b29a2d8b4090090d7a9d8
source=("omarchy-mac::git+https://github.com/omacom/omarchy-mac.git#commit=${_commit}")
sha256sums=('93676ce29791a29efe3b098fd8d129fa2248cd32d04253d9520a5b4c0697be6f')
prepare() {
# Tests and staging must not be able to read the surrounding desktop source.
rm -rf "$srcdir/addon"
cp -a "$srcdir/omarchy-mac/packages/omarchy-mac" "$srcdir/addon"
[[ $(<"$srcdir/addon/version") == "$pkgver" ]]
[[ $(git -C "$srcdir/omarchy-mac" rev-parse HEAD) == "$_commit" ]]
}
check() {
"$srcdir/addon/test/all"
}
package() {
# Runtime-only: the builder does not need the Omarchy desktop to stage or
# test the add-on.
depends=('omarchy' 'bash' 'coreutils' 'diffutils' 'grep' 'sed' 'gawk' 'systemd' 'pciutils' 'kmod'
'networkmanager' 'iwd' 'python' 'pipewire' 'pipewire-pulse' 'libpulse' 'wireplumber')
"$srcdir/addon/install" "$pkgdir"
install -Dm644 "$srcdir/addon/README.md" "$pkgdir/usr/share/doc/$pkgname/README.md"
install -Dm644 "$srcdir/addon/ORIGINS.md" "$pkgdir/usr/share/doc/$pkgname/ORIGINS.md"
printf '%s\n' "$_commit" >"$pkgdir/usr/share/omarchy-mac/source-revision"
}
+23
View File
@@ -0,0 +1,23 @@
# omarchy-mac
Apple Silicon runtime support for Omarchy: Wi-Fi resume recovery, the headset microphone mapping, the notch modprobe default and the NetworkManager Wi-Fi backend. The source is `packages/omarchy-mac/` in omacom/omarchy-mac, with its own version and tests. The recipe pins an exact `quattro-upstream` commit and packages only that directory; `prepare()` copies it away from the surrounding desktop tree before `check()` runs its tests.
Ported from Scott Jones's recipe in omarchy-mac/omarchy-pkgs-aarch64 (`pkgbuilds/omarchy-mac` at `02ed7b250f7edcf7c5f748acaf7b21ef0a764e9d`). It supersedes the unpublished `omarchy-settings-asahi` recipe.
## Scope
The package is aarch64-only and published to edge only. It widens to rc and stable only after M1 and M2 cold-boot qualification. It depends on the generic `omarchy` package and has no `provides`, so nothing generic can pull it onto non-Apple aarch64 machines. It ships no kernel, boot, installer or trust configuration; those belong to `omarchy-mac-boot`.
Installing the package enables no services, but its vendor configuration applies on the next service start or module load: the iwd Wi-Fi backend for NetworkManager, the `appledrm` notch option and the WirePlumber headset microphone policy. `omarchy-mac-setup-system` and `omarchy-mac-setup-user` enable the Wi-Fi resume and microphone units, and they exit unless `omarchy-hw-apple-silicon` reports Apple Silicon. Stock Omarchy does not yet ship that detector or call these entrypoints, so on a stock install the units stay disabled until the platform detector and profile work lands.
Runtime dependencies are declared in `package()`, so the builder stages and tests the add-on without installing the desktop.
## Updates
Updates are reviewed pins, never a branch. To release a change to the add-on:
1. Set `_commit` to the full `quattro-upstream` SHA and `pkgver` to `packages/omarchy-mac/version` at that commit.
2. Reset `pkgrel` to 1 when `pkgver` increases; bump it to re-pin or rebuild the same version.
3. Refresh `sha256sums` with `makepkg -g`.
Desktop-only commits on `quattro-upstream` do not need a new pin. `0.1.0-5` sorts above the `0.1.0-4.<run>` candidates the collaboration builder produced for test images.
@@ -0,0 +1,5 @@
{
"source": "local",
"channels": ["edge"],
"sync": false
}
@@ -0,0 +1,27 @@
From b8ea3cebde98866b7cbb4e8f9bb6dfdee529a549 Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Wed, 27 Aug 2025 00:23:28 +0100
Subject: [PATCH] Allwinner: fix booting on a number of devices
Revert "sunxi: enable MMU_PGPROT proper page table protection"
This reverts commit 16cfccda4dbf0b53473b8212897f5c63bfbeb6e1.
---
arch/arm/Kconfig | 1 -
1 file changed, 1 deletion(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 40368abc297..b8be270e4d7 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1207,7 +1207,6 @@ config ARCH_SUNXI
select DM_SPI_FLASH if SPI && MTD
select DM_KEYBOARD
select DM_SERIAL
- select MMU_PGPROT if ARM64
select OF_BOARD_SETUP
select OF_CONTROL
select PINCTRL
--
2.51.0
@@ -0,0 +1,738 @@
From patchwork Mon Jul 6 17:21:47 2026
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Torsten Duwe <duwe@lst.de>
X-Patchwork-Id: 2265604
Return-Path: <u-boot-bounces@lists.denx.de>
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 4gvB431Qwzz1xqc
for <incoming@patchwork.ozlabs.org>; Tue, 07 Jul 2026 03:21:55 +1000 (AEST)
Received: from h2850616.stratoserver.net (localhost [IPv6:::1])
by phobos.denx.de (Postfix) with ESMTP id 179C084942;
Mon, 6 Jul 2026 19:21:52 +0200 (CEST)
Authentication-Results: phobos.denx.de;
dmarc=fail (p=none dis=none) header.from=lst.de
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 82ADE8490A; Mon, 6 Jul 2026 19:21:51 +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=-1.9 required=5.0 tests=BAYES_00,
RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham
autolearn_force=no version=3.4.2
Received: from verein.lst.de (verein.lst.de [213.95.11.211])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by phobos.denx.de (Postfix) with ESMTPS id 9F24C846B4
for <u-boot@lists.denx.de>; Mon, 6 Jul 2026 19:21:49 +0200 (CEST)
Authentication-Results: phobos.denx.de;
dmarc=fail (p=none dis=none) header.from=lst.de
Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=duwe@lst.de
Received: by verein.lst.de (Postfix, from userid 2005)
id C934268B05; Mon, 6 Jul 2026 19:21:47 +0200 (CEST)
In-Reply-To: <20260706172028.C148E68BEB@verein.lst.de>
References: <20260706172028.C148E68BEB@verein.lst.de>
Subject: [PATCH v2 1/4] core: Skip parent device nodes without a DT reference
when looking for dma-ranges
To: Neil Armstrong <neil.armstrong@linaro.org>,
Andrew Goodbody <andrew.goodbody@linaro.org>, Bin Meng <bmeng.cn@gmail.com>,
Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>, Matthias Brugger <mbrugger@suse.com>,
Peter Robinson <pbrobinson@gmail.com>,
Mattijs Korpershoek <mkorpershoek@kernel.org>,
Marek Vasut <marek.vasut+renesas@mailbox.org>,
Heiko Schocher <hs@nabladev.com>, Svyatoslav Ryhel <clamor95@gmail.com>,
"Lucien.Jheng" <lucienzx159@gmail.com>, Rasmus Villemoes <ravi@prevas.dk>,
Martin Schwan <m.schwan@phytec.de>,
"Markus Schneider-Pargmann (TI.com)" <msp@baylibre.com>,
Prashant Kamble <prashant.kamble223@gmail.com>,
Denis Mukhin <dmukhin@ford.com>, Sughosh Ganu <sughosh.ganu@arm.com>,
u-boot@lists.denx.de
Message-Id: <20260706172147.C934268B05@verein.lst.de>
Date: Mon, 6 Jul 2026 19:21:47 +0200 (CEST)
From: duwe@lst.de (Torsten Duwe)
X-BeenThere: u-boot@lists.denx.de
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: U-Boot discussion <u-boot.lists.denx.de>
List-Unsubscribe: <https://lists.denx.de/options/u-boot>,
<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>
List-Archive: <https://lists.denx.de/pipermail/u-boot/>
List-Post: <mailto:u-boot@lists.denx.de>
List-Help: <mailto:u-boot-request@lists.denx.de?subject=help>
List-Subscribe: <https://lists.denx.de/listinfo/u-boot>,
<mailto:u-boot-request@lists.denx.de?subject=subscribe>
Errors-To: u-boot-bounces@lists.denx.de
Sender: "U-Boot" <u-boot-bounces@lists.denx.de>
X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de
X-Virus-Status: Clean
From: Torsten Duwe <duwe@suse.de>
If a device node got created dynamically, there is no guarantee that the
parent node has an associated device tree node which could specify dma
constraints. Especially PCI(e) enumeration adds intermediate "bus nodes",
also dynamically.
Try harder to find the correct configuration by walking up the tree until
a DT association is found.
Suggested-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Torsten Duwe <duwe@suse.de>
Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
---
drivers/core/device.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/drivers/core/device.c b/drivers/core/device.c
index d365204ba11..b6d00cf4714 100644
--- a/drivers/core/device.c
+++ b/drivers/core/device.c
@@ -459,7 +459,19 @@ static int device_get_dma_constraints(struct udevice *dev)
u64 size = 0;
int ret;
- if (!CONFIG_IS_ENABLED(DM_DMA) || !parent || !dev_has_ofnode(parent))
+ if (!CONFIG_IS_ENABLED(DM_DMA) || !parent)
+ return 0;
+
+ /* Look for the first node in the parent chain */
+ while (parent) {
+ if (dev_has_ofnode(parent))
+ break;
+
+ parent = dev_get_parent(parent);
+ }
+
+ /* No parents have a node, bail out */
+ if (!parent)
return 0;
/*
From patchwork Mon Jul 6 17:21:50 2026
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Torsten Duwe <duwe@lst.de>
X-Patchwork-Id: 2265605
Return-Path: <u-boot-bounces@lists.denx.de>
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)
(No client certificate requested)
by legolas.ozlabs.org (Postfix) with ESMTPS id 4gvB481pfXz1xqc
for <incoming@patchwork.ozlabs.org>; Tue, 07 Jul 2026 03:22:00 +1000 (AEST)
Received: from h2850616.stratoserver.net (localhost [IPv6:::1])
by phobos.denx.de (Postfix) with ESMTP id 9A59684994;
Mon, 6 Jul 2026 19:21:55 +0200 (CEST)
Authentication-Results: phobos.denx.de;
dmarc=fail (p=none dis=none) header.from=lst.de
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 EB7D384979; Mon, 6 Jul 2026 19:21:53 +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=-1.9 required=5.0 tests=BAYES_00,
RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham
autolearn_force=no version=3.4.2
Received: from verein.lst.de (verein.lst.de [213.95.11.211])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by phobos.denx.de (Postfix) with ESMTPS id EE61C846B4
for <u-boot@lists.denx.de>; Mon, 6 Jul 2026 19:21:51 +0200 (CEST)
Authentication-Results: phobos.denx.de;
dmarc=fail (p=none dis=none) header.from=lst.de
Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=duwe@lst.de
Received: by verein.lst.de (Postfix, from userid 2005)
id 464E868BEB; Mon, 6 Jul 2026 19:21:50 +0200 (CEST)
In-Reply-To: <20260706172028.C148E68BEB@verein.lst.de>
References: <20260706172028.C148E68BEB@verein.lst.de>
Subject: [PATCH v2 2/4] test: Add a unit test in phys_to_bus for dynamically
created device nodes
To: Neil Armstrong <neil.armstrong@linaro.org>,
Andrew Goodbody <andrew.goodbody@linaro.org>, Bin Meng <bmeng.cn@gmail.com>,
Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>, Matthias Brugger <mbrugger@suse.com>,
Peter Robinson <pbrobinson@gmail.com>,
Mattijs Korpershoek <mkorpershoek@kernel.org>,
Marek Vasut <marek.vasut+renesas@mailbox.org>,
Heiko Schocher <hs@nabladev.com>, Svyatoslav Ryhel <clamor95@gmail.com>,
"Lucien.Jheng" <lucienzx159@gmail.com>, Rasmus Villemoes <ravi@prevas.dk>,
Martin Schwan <m.schwan@phytec.de>,
"Markus Schneider-Pargmann (TI.com)" <msp@baylibre.com>,
Prashant Kamble <prashant.kamble223@gmail.com>,
Denis Mukhin <dmukhin@ford.com>, Sughosh Ganu <sughosh.ganu@arm.com>,
u-boot@lists.denx.de
Message-Id: <20260706172150.464E868BEB@verein.lst.de>
Date: Mon, 6 Jul 2026 19:21:50 +0200 (CEST)
From: duwe@lst.de (Torsten Duwe)
X-BeenThere: u-boot@lists.denx.de
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: U-Boot discussion <u-boot.lists.denx.de>
List-Unsubscribe: <https://lists.denx.de/options/u-boot>,
<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>
List-Archive: <https://lists.denx.de/pipermail/u-boot/>
List-Post: <mailto:u-boot@lists.denx.de>
List-Help: <mailto:u-boot-request@lists.denx.de?subject=help>
List-Subscribe: <https://lists.denx.de/listinfo/u-boot>,
<mailto:u-boot-request@lists.denx.de?subject=subscribe>
Errors-To: u-boot-bounces@lists.denx.de
Sender: "U-Boot" <u-boot-bounces@lists.denx.de>
X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de
X-Virus-Status: Clean
From: Torsten Duwe <duwe@suse.de>
In order to test whether device_get_dma_constraints() is now able to skip
device nodes without a DT association, temporarily remove those on 2 newly-
created nodes.
Signed-off-by: Torsten Duwe <duwe@suse.de>
---
This test indeed makes a different whether the previous change is
applied or not, but *only* reliably for the non-flat-tree case (!?).
On the flat tree, it always fails after (reverse) applying it.
Either the previous patch is incomplete, or, more likely, the test
assumptions here are not all valid. Suggestions welcome (especially
how to create device nodes from a device tree without a reference to
their origin ;-)
---
arch/sandbox/dts/test.dts | 9 +++++++++
test/dm/phys2bus.c | 25 ++++++++++++++++++++++++-
2 files changed, 33 insertions(+), 1 deletion(-)
diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts
index 0887de4333b..1d92e85c739 100644
--- a/arch/sandbox/dts/test.dts
+++ b/arch/sandbox/dts/test.dts
@@ -656,6 +656,15 @@
subnode@0 {
compatible = "denx,u-boot-fdt-test";
};
+ bus@7 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "denx,u-boot-test-bus";
+
+ subnode@8 {
+ compatible = "denx,u-boot-fdt-test";
+ };
+ };
};
mmio-bus@1 {
diff --git a/test/dm/phys2bus.c b/test/dm/phys2bus.c
index 67f33904943..858ed5410e2 100644
--- a/test/dm/phys2bus.c
+++ b/test/dm/phys2bus.c
@@ -15,7 +15,8 @@
static int dm_test_phys_to_bus(struct unit_test_state *uts)
{
- struct udevice *dev;
+ struct udevice *dev, *pdev;
+ ofnode psave, nsave;
ofnode node;
node = ofnode_path("/mmio-bus@0");
@@ -31,6 +32,29 @@ static int dm_test_phys_to_bus(struct unit_test_state *uts)
ut_asserteq_addr((void*)0x1003ffffULL, (void*)dev_phys_to_bus(dev, 0x3ffff));
ut_asserteq_addr((void*)0x3ffffULL, (void*)(ulong)dev_bus_to_phys(dev, 0x1003ffff));
+#if CONFIG_IS_ENABLED(OF_REAL)
+ /* dma-ranges are on the grandparent bus node,
+ * OF nodes neither here nor at parent
+ */
+ node = ofnode_path("/mmio-bus@0/bus@7");
+ ut_assert(ofnode_valid(node));
+ ut_assertok(uclass_get_device_by_ofnode(UCLASS_TEST_BUS, node, &pdev));
+
+ /* pretend the devices were discovered dynamically and have no OF node */
+ psave = pdev->node_;
+ pdev->node_.np = NULL;
+ node = ofnode_path("/mmio-bus@0/bus@7/subnode@8");
+ ut_assert(ofnode_valid(node));
+ nsave = dev->node_;
+ dev->node_.np = NULL;
+ ut_assertok(uclass_get_device_by_ofnode(UCLASS_TEST_FDT, node, &dev));
+
+ ut_asserteq_addr((void *)0x1003ffffULL, (void *)dev_phys_to_bus(dev, 0x3ffff));
+ ut_asserteq_addr((void *)0x3ffffULL, (void *)(ulong)dev_bus_to_phys(dev, 0x1003ffff));
+
+ pdev->node_ = psave;
+ dev->node_ = nsave;
+#endif
return 0;
}
DM_TEST(dm_test_phys_to_bus, UTF_SCAN_PDATA | UTF_SCAN_FDT);
From patchwork Mon Jul 6 17:21:52 2026
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Torsten Duwe <duwe@lst.de>
X-Patchwork-Id: 2265606
Return-Path: <u-boot-bounces@lists.denx.de>
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) server-digest SHA384)
(No client certificate requested)
by legolas.ozlabs.org (Postfix) with ESMTPS id 4gvB4H70Bdz1xqc
for <incoming@patchwork.ozlabs.org>; Tue, 07 Jul 2026 03:22:07 +1000 (AEST)
Received: from h2850616.stratoserver.net (localhost [IPv6:::1])
by phobos.denx.de (Postfix) with ESMTP id 00AF0849BA;
Mon, 6 Jul 2026 19:21:57 +0200 (CEST)
Authentication-Results: phobos.denx.de;
dmarc=fail (p=none dis=none) header.from=lst.de
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 25F8F849BA; Mon, 6 Jul 2026 19:21:56 +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=-1.9 required=5.0 tests=BAYES_00,
RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham
autolearn_force=no version=3.4.2
Received: from verein.lst.de (verein.lst.de [213.95.11.211])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by phobos.denx.de (Postfix) with ESMTPS id 06F20846B4
for <u-boot@lists.denx.de>; Mon, 6 Jul 2026 19:21:54 +0200 (CEST)
Authentication-Results: phobos.denx.de;
dmarc=fail (p=none dis=none) header.from=lst.de
Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=duwe@lst.de
Received: by verein.lst.de (Postfix, from userid 2005)
id 5257168BFE; Mon, 6 Jul 2026 19:21:52 +0200 (CEST)
In-Reply-To: <20260706172028.C148E68BEB@verein.lst.de>
References: <20260706172028.C148E68BEB@verein.lst.de>
Subject: [PATCH v2 3/4] nvme: Fix missing address translation for PCIe inbound
access
To: Neil Armstrong <neil.armstrong@linaro.org>,
Andrew Goodbody <andrew.goodbody@linaro.org>, Bin Meng <bmeng.cn@gmail.com>,
Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>, Matthias Brugger <mbrugger@suse.com>,
Peter Robinson <pbrobinson@gmail.com>,
Mattijs Korpershoek <mkorpershoek@kernel.org>,
Marek Vasut <marek.vasut+renesas@mailbox.org>,
Heiko Schocher <hs@nabladev.com>, Svyatoslav Ryhel <clamor95@gmail.com>,
"Lucien.Jheng" <lucienzx159@gmail.com>, Rasmus Villemoes <ravi@prevas.dk>,
Martin Schwan <m.schwan@phytec.de>,
"Markus Schneider-Pargmann (TI.com)" <msp@baylibre.com>,
Prashant Kamble <prashant.kamble223@gmail.com>,
Denis Mukhin <dmukhin@ford.com>, Sughosh Ganu <sughosh.ganu@arm.com>,
u-boot@lists.denx.de
Message-Id: <20260706172152.5257168BFE@verein.lst.de>
Date: Mon, 6 Jul 2026 19:21:52 +0200 (CEST)
From: duwe@lst.de (Torsten Duwe)
X-BeenThere: u-boot@lists.denx.de
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: U-Boot discussion <u-boot.lists.denx.de>
List-Unsubscribe: <https://lists.denx.de/options/u-boot>,
<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>
List-Archive: <https://lists.denx.de/pipermail/u-boot/>
List-Post: <mailto:u-boot@lists.denx.de>
List-Help: <mailto:u-boot-request@lists.denx.de?subject=help>
List-Subscribe: <https://lists.denx.de/listinfo/u-boot>,
<mailto:u-boot-request@lists.denx.de?subject=subscribe>
Errors-To: u-boot-bounces@lists.denx.de
Sender: "U-Boot" <u-boot-bounces@lists.denx.de>
X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de
X-Virus-Status: Clean
From: Torsten Duwe <duwe@suse.de>
U-Boot currently does not account for PCIe bridges with a non-zero
inbound access offset when talking NVMe, it only works on platforms
where this offset happens to be zero.
This patch enhances the NVMe driver with the ability to also handle
these cases. It also removes the unused function nvme_get_features().
Signed-off-by: Torsten Duwe <duwe@suse.de>
Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
---
I tried to consistently use uintptr_t when doing arithmetic on pointers
and dma_addr_t to hold, well, DMA addresses ;)
nvme_get_features mentions it's unused; so far it causes fruitless
maintenance work and causes dead extra bytes in das U-Boot binary.
It hasn't been neccessary for 9 years; one can revive it from git
once needed.
---
drivers/nvme/nvme.c | 71 +++++++++++++++++----------------------------
drivers/nvme/nvme.h | 3 ++
2 files changed, 29 insertions(+), 45 deletions(-)
diff --git a/drivers/nvme/nvme.c b/drivers/nvme/nvme.c
index 147a104149e..54284c0242b 100644
--- a/drivers/nvme/nvme.c
+++ b/drivers/nvme/nvme.c
@@ -8,10 +8,10 @@
#include <bootdev.h>
#include <cpu_func.h>
#include <dm.h>
-#include <errno.h>
#include <log.h>
#include <malloc.h>
#include <memalign.h>
+#include <phys2bus.h>
#include <time.h>
#include <dm/device-internal.h>
#include <linux/compat.h>
@@ -101,6 +101,8 @@ static int nvme_setup_prps(struct nvme_dev *dev, u64 *prp2,
printf("Error: malloc prp_pool fail\n");
return -ENOMEM;
}
+ dev->prp_pool_dma = dev_phys_to_bus(dev->udev,
+ (uintptr_t)dev->prp_pool);
dev->prp_entry_num = num_pages * (prps_per_page - 1) + 1;
}
@@ -108,8 +110,10 @@ static int nvme_setup_prps(struct nvme_dev *dev, u64 *prp2,
i = 0;
while (nprps) {
if ((i == (prps_per_page - 1)) && nprps > 1) {
- *(prp_pool + i) = cpu_to_le64((ulong)prp_pool +
- page_size);
+ dma_addr_t prp_pool_dma =
+ dev_phys_to_bus(dev->udev, (uintptr_t)prp_pool);
+ *(prp_pool + i) = cpu_to_le64(prp_pool_dma +
+ page_size);
i = 0;
prp_pool = (u64 *)((uintptr_t)prp_pool + page_size);
}
@@ -117,7 +121,7 @@ static int nvme_setup_prps(struct nvme_dev *dev, u64 *prp2,
dma_addr += page_size;
nprps--;
}
- *prp2 = (ulong)dev->prp_pool;
+ *prp2 = dev->prp_pool_dma;
flush_dcache_range((ulong)dev->prp_pool, (ulong)dev->prp_pool +
num_pages * page_size);
@@ -258,11 +262,15 @@ static struct nvme_queue *nvme_alloc_queue(struct nvme_dev *dev,
nvmeq->cqes = (void *)memalign(4096, NVME_CQ_ALLOCATION);
if (!nvmeq->cqes)
goto free_nvmeq;
+ nvmeq->cq_dma_addr = dev_phys_to_bus(dev->udev,
+ (uintptr_t)nvmeq->cqes);
memset((void *)nvmeq->cqes, 0, NVME_CQ_SIZE(depth));
nvmeq->sq_cmds = (void *)memalign(4096, NVME_SQ_SIZE(depth));
if (!nvmeq->sq_cmds)
goto free_queue;
+ nvmeq->sq_dma_addr = dev_phys_to_bus(dev->udev,
+ (uintptr_t)nvmeq->sq_cmds);
memset((void *)nvmeq->sq_cmds, 0, NVME_SQ_SIZE(depth));
nvmeq->dev = dev;
@@ -410,8 +416,8 @@ static int nvme_configure_admin_queue(struct nvme_dev *dev)
dev->ctrl_config |= NVME_CC_IOSQES | NVME_CC_IOCQES;
writel(aqa, &dev->bar->aqa);
- nvme_writeq((ulong)nvmeq->sq_cmds, &dev->bar->asq);
- nvme_writeq((ulong)nvmeq->cqes, &dev->bar->acq);
+ nvme_writeq(nvmeq->sq_dma_addr, &dev->bar->asq);
+ nvme_writeq(nvmeq->cq_dma_addr, &dev->bar->acq);
result = nvme_enable_ctrl(dev);
if (result)
@@ -437,7 +443,7 @@ static int nvme_alloc_cq(struct nvme_dev *dev, u16 qid,
memset(&c, 0, sizeof(c));
c.create_cq.opcode = nvme_admin_create_cq;
- c.create_cq.prp1 = cpu_to_le64((ulong)nvmeq->cqes);
+ c.create_cq.prp1 = cpu_to_le64(nvmeq->cq_dma_addr);
c.create_cq.cqid = cpu_to_le16(qid);
c.create_cq.qsize = cpu_to_le16(nvmeq->q_depth - 1);
c.create_cq.cq_flags = cpu_to_le16(flags);
@@ -454,7 +460,7 @@ static int nvme_alloc_sq(struct nvme_dev *dev, u16 qid,
memset(&c, 0, sizeof(c));
c.create_sq.opcode = nvme_admin_create_sq;
- c.create_sq.prp1 = cpu_to_le64((ulong)nvmeq->sq_cmds);
+ c.create_sq.prp1 = cpu_to_le64(nvmeq->sq_dma_addr);
c.create_sq.sqid = cpu_to_le16(qid);
c.create_sq.qsize = cpu_to_le16(nvmeq->q_depth - 1);
c.create_sq.sq_flags = cpu_to_le16(flags);
@@ -464,13 +470,13 @@ static int nvme_alloc_sq(struct nvme_dev *dev, u16 qid,
}
int nvme_identify(struct nvme_dev *dev, unsigned nsid,
- unsigned cns, dma_addr_t dma_addr)
+ unsigned cns, dma_addr_t cpu_addr)
{
struct nvme_command c;
u32 page_size = dev->page_size;
+ dma_addr_t dma_addr = dev_phys_to_bus(dev->udev, cpu_addr);
int offset = dma_addr & (page_size - 1);
int length = sizeof(struct nvme_id_ctrl);
- dma_addr_t orig_dma_addr = dma_addr;
int ret;
memset(&c, 0, sizeof(c));
@@ -488,49 +494,22 @@ int nvme_identify(struct nvme_dev *dev, unsigned nsid,
c.identify.cns = cpu_to_le32(cns);
- nvme_invalidate_cache_aligned((uintptr_t)orig_dma_addr,
+ nvme_invalidate_cache_aligned((uintptr_t)cpu_addr,
sizeof(struct nvme_id_ctrl));
ret = nvme_submit_admin_cmd(dev, &c, NULL);
if (!ret)
- nvme_invalidate_cache_aligned((uintptr_t)orig_dma_addr,
+ nvme_invalidate_cache_aligned((uintptr_t)cpu_addr,
sizeof(struct nvme_id_ctrl));
return ret;
}
-int nvme_get_features(struct nvme_dev *dev, unsigned fid, unsigned nsid,
- dma_addr_t dma_addr, u32 *result)
-{
- struct nvme_command c;
- int ret;
-
- memset(&c, 0, sizeof(c));
- c.features.opcode = nvme_admin_get_features;
- c.features.nsid = cpu_to_le32(nsid);
- c.features.prp1 = cpu_to_le64(dma_addr);
- c.features.fid = cpu_to_le32(fid);
-
- ret = nvme_submit_admin_cmd(dev, &c, result);
-
- /*
- * TODO: Add some cache invalidation when a DMA buffer is involved
- * in the request, here and before the command gets submitted. The
- * buffer size varies by feature, also some features use a different
- * field in the command packet to hold the buffer address.
- * Section 5.21.1 (Set Features command) in the NVMe specification
- * details the buffer requirements for each feature.
- *
- * At the moment there is no user of this function.
- */
-
- return ret;
-}
-
int nvme_set_features(struct nvme_dev *dev, unsigned fid, unsigned dword11,
- dma_addr_t dma_addr, u32 *result)
+ dma_addr_t cpu_addr, u32 *result)
{
struct nvme_command c;
+ dma_addr_t dma_addr = dev_phys_to_bus(dev->udev, cpu_addr);
memset(&c, 0, sizeof(c));
c.features.opcode = nvme_admin_set_features;
@@ -769,7 +748,7 @@ static ulong nvme_blk_rw(struct udevice *udev, lbaint_t blknr,
u64 prp2;
u64 total_len = blkcnt << desc->log2blksz;
u64 temp_len = total_len;
- uintptr_t temp_buffer = (uintptr_t)buffer;
+ uintptr_t dma_addr = dev_phys_to_bus(udev, (uintptr_t)buffer);
u64 slba = blknr;
u16 lbas = 1 << (dev->max_transfer_shift - ns->lba_shift);
@@ -797,19 +776,19 @@ static ulong nvme_blk_rw(struct udevice *udev, lbaint_t blknr,
}
if (nvme_setup_prps(dev, &prp2,
- lbas << ns->lba_shift, temp_buffer))
+ lbas << ns->lba_shift, dma_addr))
return -EIO;
c.rw.slba = cpu_to_le64(slba);
slba += lbas;
c.rw.length = cpu_to_le16(lbas - 1);
- c.rw.prp1 = cpu_to_le64(temp_buffer);
+ c.rw.prp1 = cpu_to_le64(dma_addr);
c.rw.prp2 = cpu_to_le64(prp2);
status = nvme_submit_sync_cmd(dev->queues[NVME_IO_Q],
&c, NULL, IO_TIMEOUT);
if (status)
break;
temp_len -= (u32)lbas << ns->lba_shift;
- temp_buffer += lbas << ns->lba_shift;
+ dma_addr += lbas << ns->lba_shift;
}
if (read)
@@ -884,6 +863,8 @@ int nvme_init(struct udevice *udev)
printf("Error: %s: Out of memory!\n", udev->name);
goto free_queue;
}
+
+ ndev->prp_pool_dma = dev_phys_to_bus(udev, (uintptr_t)ndev->prp_pool);
ndev->prp_entry_num = MAX_PRP_POOL >> 3;
ret = nvme_setup_io_queues(ndev);
diff --git a/drivers/nvme/nvme.h b/drivers/nvme/nvme.h
index bc1d612dde4..7c6ed4d9b55 100644
--- a/drivers/nvme/nvme.h
+++ b/drivers/nvme/nvme.h
@@ -619,6 +619,7 @@ struct nvme_dev {
u32 page_size;
u8 vwc;
u64 *prp_pool;
+ uintptr_t prp_pool_dma;
u32 prp_entry_num;
u32 nn;
};
@@ -637,7 +638,9 @@ enum nvme_queue_id {
struct nvme_queue {
struct nvme_dev *dev;
struct nvme_command *sq_cmds;
+ dma_addr_t sq_dma_addr;
struct nvme_completion *cqes;
+ dma_addr_t cq_dma_addr;
u32 __iomem *q_db;
u16 q_depth;
s16 cq_vector;
From patchwork Mon Jul 6 17:21:54 2026
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Torsten Duwe <duwe@lst.de>
X-Patchwork-Id: 2265607
Return-Path: <u-boot-bounces@lists.denx.de>
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)
(No client certificate requested)
by legolas.ozlabs.org (Postfix) with ESMTPS id 4gvB4R378Lz1xqc
for <incoming@patchwork.ozlabs.org>; Tue, 07 Jul 2026 03:22:15 +1000 (AEST)
Received: from h2850616.stratoserver.net (localhost [IPv6:::1])
by phobos.denx.de (Postfix) with ESMTP id 3FDAE8490A;
Mon, 6 Jul 2026 19:21:59 +0200 (CEST)
Authentication-Results: phobos.denx.de;
dmarc=fail (p=none dis=none) header.from=lst.de
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 17F418490A; Mon, 6 Jul 2026 19:21:58 +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=-1.9 required=5.0 tests=BAYES_00,
RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham
autolearn_force=no version=3.4.2
Received: from verein.lst.de (verein.lst.de [213.95.11.211])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by phobos.denx.de (Postfix) with ESMTPS id 1D593849A4
for <u-boot@lists.denx.de>; Mon, 6 Jul 2026 19:21:56 +0200 (CEST)
Authentication-Results: phobos.denx.de;
dmarc=fail (p=none dis=none) header.from=lst.de
Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=duwe@lst.de
Received: by verein.lst.de (Postfix, from userid 2005)
id B506B68CFE; Mon, 6 Jul 2026 19:21:54 +0200 (CEST)
In-Reply-To: <20260706172028.C148E68BEB@verein.lst.de>
References: <20260706172028.C148E68BEB@verein.lst.de>
Subject: [PATCH v2 4/4] configs: enable NVMe
To: Neil Armstrong <neil.armstrong@linaro.org>,
Andrew Goodbody <andrew.goodbody@linaro.org>, Bin Meng <bmeng.cn@gmail.com>,
Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>, Matthias Brugger <mbrugger@suse.com>,
Peter Robinson <pbrobinson@gmail.com>,
Mattijs Korpershoek <mkorpershoek@kernel.org>,
Marek Vasut <marek.vasut+renesas@mailbox.org>,
Heiko Schocher <hs@nabladev.com>, Svyatoslav Ryhel <clamor95@gmail.com>,
"Lucien.Jheng" <lucienzx159@gmail.com>, Rasmus Villemoes <ravi@prevas.dk>,
Martin Schwan <m.schwan@phytec.de>,
"Markus Schneider-Pargmann (TI.com)" <msp@baylibre.com>,
Prashant Kamble <prashant.kamble223@gmail.com>,
Denis Mukhin <dmukhin@ford.com>, Sughosh Ganu <sughosh.ganu@arm.com>,
u-boot@lists.denx.de
Message-Id: <20260706172154.B506B68CFE@verein.lst.de>
Date: Mon, 6 Jul 2026 19:21:54 +0200 (CEST)
From: duwe@lst.de (Torsten Duwe)
X-BeenThere: u-boot@lists.denx.de
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: U-Boot discussion <u-boot.lists.denx.de>
List-Unsubscribe: <https://lists.denx.de/options/u-boot>,
<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>
List-Archive: <https://lists.denx.de/pipermail/u-boot/>
List-Post: <mailto:u-boot@lists.denx.de>
List-Help: <mailto:u-boot-request@lists.denx.de?subject=help>
List-Subscribe: <https://lists.denx.de/listinfo/u-boot>,
<mailto:u-boot-request@lists.denx.de?subject=subscribe>
Errors-To: u-boot-bounces@lists.denx.de
Sender: "U-Boot" <u-boot-bounces@lists.denx.de>
X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de
X-Virus-Status: Clean
From: Torsten Duwe <duwe@suse.de>
Enable NVMe in the Raspberry Pi 64-Bit default config and scan for devices.
Signed-off-by: Torsten Duwe <duwe@suse.de>
Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
---
configs/rpi_arm64_defconfig | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/configs/rpi_arm64_defconfig b/configs/rpi_arm64_defconfig
index cdcf05ea6db..fb0fdce1d7f 100644
--- a/configs/rpi_arm64_defconfig
+++ b/configs/rpi_arm64_defconfig
@@ -16,7 +16,7 @@ CONFIG_BOOTSTD_DEFAULTS=y
CONFIG_OF_BOARD_SETUP=y
CONFIG_FDT_SIMPLEFB=y
CONFIG_USE_PREBOOT=y
-CONFIG_PREBOOT="pci enum; usb start;"
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_SYS_PBSIZE=1049
# CONFIG_DISPLAY_CPUINFO is not set
# CONFIG_DISPLAY_BOARDINFO is not set
@@ -44,6 +44,7 @@ CONFIG_MMC_SDHCI_SDMA=y
CONFIG_MMC_SDHCI_BCM2835=y
CONFIG_MMC_SDHCI_BCMSTB=y
CONFIG_BCMGENET=y
+CONFIG_NVME_PCI=y
CONFIG_PCI_BRCMSTB=y
CONFIG_PINCTRL=y
# CONFIG_PINCTRL_GENERIC is not set
@@ -0,0 +1,50 @@
From 4ee5ba36570d94ce27e4023f15b8b3a6b8b9daf9 Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Mon, 13 Oct 2025 21:41:13 +0100
Subject: [PATCH] config: JetsonTX2: Fix upstream device tree naming
The upstream naming for the Jetson TX2 is p2771-0000 so fix
the device tree name so the firmware will find the right
name on disk.
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
arch/arm/dts/Makefile | 2 +-
.../{tegra186-p2771-0000-500.dts => tegra186-p2771-0000.dts} | 0
configs/p2771-0000-500_defconfig | 2 +-
3 files changed, 2 insertions(+), 2 deletions(-)
rename arch/arm/dts/{tegra186-p2771-0000-500.dts => tegra186-p2771-0000.dts} (100%)
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 7c8cf3a5a1d..86a7b4fda35 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -134,7 +134,7 @@ dtb-$(CONFIG_ARCH_TEGRA) += \
tegra124-venice2.dtb \
tegra124-xiaomi-mocha.dtb \
tegra186-p2771-0000-000.dtb \
- tegra186-p2771-0000-500.dtb \
+ tegra186-p2771-0000.dtb \
tegra210-p2371-0000.dtb \
tegra210-p2371-2180.dtb \
tegra210-p2571.dtb \
diff --git a/arch/arm/dts/tegra186-p2771-0000-500.dts b/arch/arm/dts/tegra186-p2771-0000.dts
similarity index 100%
rename from arch/arm/dts/tegra186-p2771-0000-500.dts
rename to arch/arm/dts/tegra186-p2771-0000.dts
diff --git a/configs/p2771-0000-500_defconfig b/configs/p2771-0000-500_defconfig
index 42043277e2d..e1e5c47ddfa 100644
--- a/configs/p2771-0000-500_defconfig
+++ b/configs/p2771-0000-500_defconfig
@@ -7,7 +7,7 @@ CONFIG_TEXT_BASE=0x80080000
CONFIG_NR_DRAM_BANKS=1026
CONFIG_ENV_SIZE=0x2000
CONFIG_ENV_OFFSET=0xFFFFE000
-CONFIG_DEFAULT_DEVICE_TREE="tegra186-p2771-0000-500"
+CONFIG_DEFAULT_DEVICE_TREE="tegra186-p2771-0000"
CONFIG_SYS_BOOTM_LEN=0x800000
CONFIG_SYS_LOAD_ADDR=0x80080000
CONFIG_TEGRA186=y
--
2.51.0
+164
View File
@@ -0,0 +1,164 @@
# Omarchy's uboot-asahi: asahi-alarm's uboot-asahi (asahi-alarm/PKGBUILDs)
# with a silent console, no banner, no logo and no boot delay, so the Mac
# boots straight to the boot menu and the splash without U-Boot's text.
#
# Same name as asahi-alarm's, and nothing generic depends on it: it is only
# installed when named, or as an upgrade of an installed uboot-asahi.
# pacman takes a package from the first repository that carries its name:
# with [omarchy] ahead of [asahi-alarm] this build is installed and kept even
# after asahi-alarm moves on; with [asahi-alarm] ahead it is installed only as
# omarchy/uboot-asahi, kept over their build at the same pkgver, and replaced
# by a newer one. Keep pkgver and the patch set in step with asahi-alarm's and
# pkgrel above theirs. No epoch, which would outrank every future asahi-alarm
# release.
pkgname=uboot-asahi
_ver=2026.07
_asahirel=2
pkgver=${_ver}.asahi${_asahirel}
pkgrel=4
pkgdesc='U-Boot for Apple Silicon Macs (Omarchy build: silent console)'
_commit_id=asahi-v${_ver}-${_asahirel}
_srcname=u-boot-${_commit_id}
arch=('aarch64')
url='http://asahilinux.org'
license=('MIT' 'GPL2')
makedepends=( bc imagemagick )
source=(
"u-boot-${_commit_id}.tar.gz::https://github.com/AsahiLinux/u-boot/archive/${_commit_id}.tar.gz"
'disable-VBE-by-default.patch'
'enable-bootmenu-by-default.patch'
'uefi-distro-load-FDT-from-any-partition-on-boot-device.patch'
'uefi-Add-all-options-for-EFI-System-Partitions.patch'
'uefi-initial-find_fdt_location-for-finding-the-DT-on-disk.patch'
'uefi-enable-SetVariableRT-with-volotile-storage.patch'
'uefi-enable-https-boot-by-default.patch'
'pylibfdt-Replace-removed-SWIG-Python-2-compatibility-macros.patch'
'USB-PD-TCPM-improvements.patch'
'rockchip-Enable-preboot-start-for-pci-usb.patch'
'rockchip-rk3568-nanopi-r5-Drop-duplicated-extra-sdhc.patch'
'rockchip-rk356x-Stop-overriding-sdhci-mmc-aliases.patch'
'p3450-fix-board.patch'
'JetsonTX2-Fix-upstream-device-tree-naming.patch'
'Allwinner-fix-booting-on-a-number-of-devices.patch'
'Fix-NVMe-not-only-on-Raspberry-Pi-5.patch'
'raspberrypi-Add-quirk-for-RPi5-2Gb-rev-1.0.patch'
'openssl-no-engine.patch'
'quiet-console.patch'
)
sha256sums=('ff36bacdeb91c2bb911ce6fdd198fb1a943c47a6931f986cecd22443b04c1b06'
'501fe48668729525520253228945dc728c9bf2d9f0a41744711ca51a060e9c7b'
'9d1796f8c1492bb50c13f865b4bc6854f825218836e55ce36e348c4dd77caa74'
'0f980cf61fab268a6aa2440408548d3874aee1de6eb6e3be291690b1d2eb6904'
'16904a97fc62bba84bde3a18885156b8c202c366bb6a0e0dd54414c016695876'
'32d966701ebd7675092c1fd991e2444a0a1d08d83a10f34c88e05a3c19b41834'
'c77853d6c25b11b7ffca8d522e03bf8e1305b8637e27c5074ddeef3a22956bbf'
'f9106baa633f742f7fff396b5335a9c0ead4fa7416cdfd2fea743c1da433960d'
'1a152c1ddc46316ec94aa19be40b96e1e8bab71a82f1e11ca59c9f5ec86808a5'
'3dd92f1f51fccfbb1ceae701db68a6ae42916ddc2d4645b3a61486b582721a54'
'3ee57dcf7d36351de5905dadf41803cf2994bba40d77f4fe5e3fcd9131ddb54e'
'064e51eabf34d04cfade37115d3fd76c4e8005973faf4dedf410f0b5bbd1ea18'
'4aa93c1c3ae7fe20e844505d521b921b9649dae03b74ad847ebd6318f02f71a2'
'9cf3e7694efd82a0fe6725069b12971a4f32d05e4e9862089cbf1779a7d2df7c'
'77aff72eb2319d3a80e0ccb63bdfb7d1c503c91fb515acc9525d029b25bb1fdc'
'0bb2e47484d67935f1ef6107433f51747211a143f549b4ba60081a143026fb22'
'300ed1bd17136bed9ff2528dcdc029396e6c373c0606653dc7905625bb8511a7'
'dbc08bd374f299d92fc0e9022e37a1629055675bc874a904c1eefe5fb9699e2f'
'3ede37fd744d60d934a7d5186f0bcd13d67ae9a48d973283356bbe7451d337e4'
'9c3db1a504c5eeac54fadb1dadb45ac5ea36316c39fadb73836102ac4bf125f0')
b2sums=('8041a979068ea00ac8402dcf35b34277907e497b2de060edf43a1960abddcfb5449d963334eb2a8c9f9a869452be55bf4c728dbda7c381892a145de72f3a59aa'
'8fcba2b6c098125fc6ddee33b634af35bc6a8ae93c4f9cf3698f3f4455f97e22c6d8630c60776710770128f73377d2a9364c70dab6705707c1f3223e7493ce14'
'79709278b47f8e21e7376031c3dc472070c5b18b29b48eefc9d3a4d97b69104eae9325ed8fff8e7a509a89727c8335c90345807d72afacee069557e46ff5724c'
'34bebf1fe1126ff03d31abaca5908036268c231a77beebbe683cca3f80a4add12faf0e0ed27975c5fa1ba2a9994395ad0ee8115e9ecb8d3686975602981bf136'
'b4ede5b7eced7a3459a169f5d49712647cc7cc3aec9935eea6283522245b6c3cc300ed8fb81be0dd942dddefd3bda49530270ec3f9215d2f9a52efa4c3bc5ba9'
'b1cca3b2f31a1ab50f5fb637122d24593c23f99d773abba5a145d8701471dcb159de2bed937ea4a40b57501efb442c2ac5a2d49ab595f8b111320b11a182e710'
'2a61869cdefd59715d8d860e4860d52a6e3fc33f2b8511c5d6f78c68f7dda00195b29bf9a213668a3eedf445958b923bc7051fc38c6965c3b7803266cae16bb2'
'4bb6155f1db7a9df5e735cf353d5c1cc04525b5a2cd06fba93d3046a216a7210a6d0e1bf3e2deb07bbb58391d47804208e6e12b724000d68df9c5de5d2c52aae'
'faa1ee756bda5714c31105b40fded40167c31d8458bc2b460dda06ad42fec60b7a71ed32a26fb036f744c8496641e3f271a39fd85f4de3ad86f1b8e9efec2dd1'
'6cf5a8fe4631a60247df626e4fea6efadad4d2ccf62dd30330fa0a98546deee17a394d8b7fef8fa5446311f01c05a303f88818a4ffa6b49810c5ec06fae1aa46'
'06c2d9f2d1b9285faf10245a325bb3937f6c98170f069e9517bf1662c0f3f4ea8499c911169c60e474a97c54b74d96297ccf0268edb0a3e602f7d0302668484d'
'3905954cb92f54a9b1f479515a1f8b949b2692eeabad1955ec2c013bf920e2c79a2008408fc569f246c1184443baea4c96a63226cd32afd1149b681adb5b07d4'
'ab734d11f811c467bad6e417700c67188dd82593e636172ac75f36aded39eea095b7a432ab7b4d377d4bb5e824a99592fb99017b7437b6f9bfeeb1cf962f35a6'
'828275a8cdda2df5ef0698f12871cb24bcd758373d43907120495eb094fc1ddf6e25414384a52c56f2c5629a2b1702571fd368c02f1ae67ae25a2d59c0a850f3'
'08bd592cc066e2dc9216228384a6c1d650860479ae3fa8fbe4ac0b6cf8596a25e5c11bbb52a19e3c35a4de279b4746e30e376ba4273f0121c2889d7ebc6a938d'
'b018ec8f631f9ec15bb054f85b526fb4b4bb04b954ef9a038a6c9fd1230bbbb5af8d82b04d30c220820cb5f35c77ad1e3763835244da93486f3261fe12d1f06a'
'338e2cd0b3e36f523ec7bbc59b91418fd5b6ec73588a510f488168a579de83d2b3978bb7ad641ed3a0a931e1e1555b43a2cd59f63da389545afca1579df4f256'
'd63591d50862f07faf35e0adb52d73c669b4c29d046585878dcd4142faa049dd84088a9f21d34159f7103971b2b443d33f8a28ed77f4265f0e9d976bd66334f8'
'81a2b3b089267d636cc60f23a0f4f82ba36ecb5e210c84c7cbdf2af1b764e0c40ba3b22fec26bc7c8eab052cfa30893aac4b3c76b9a56d763841b8f7821820de'
'451006bb05bf4107347267dfb62b670d25d8991dcdb93c23221eca876bc8a2f9af7dc9e76e2c675aa44a34ef1a86deb00c128bf57f4096301f5a235ebfd69ca7')
prepare() {
cd "${srcdir}/$_srcname"
cat ../disable-VBE-by-default.patch | patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
cat ../enable-bootmenu-by-default.patch | patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
cat ../uefi-distro-load-FDT-from-any-partition-on-boot-device.patch | patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
cat ../uefi-Add-all-options-for-EFI-System-Partitions.patch | patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
cat ../uefi-initial-find_fdt_location-for-finding-the-DT-on-disk.patch | patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
cat ../uefi-enable-SetVariableRT-with-volotile-storage.patch | patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
cat ../uefi-enable-https-boot-by-default.patch | patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
cat ../pylibfdt-Replace-removed-SWIG-Python-2-compatibility-macros.patch | patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
cat ../USB-PD-TCPM-improvements.patch | patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
cat ../rockchip-Enable-preboot-start-for-pci-usb.patch | patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
cat ../rockchip-rk3568-nanopi-r5-Drop-duplicated-extra-sdhc.patch | patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
cat ../rockchip-rk356x-Stop-overriding-sdhci-mmc-aliases.patch | patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
cat ../p3450-fix-board.patch | patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
cat ../JetsonTX2-Fix-upstream-device-tree-naming.patch | patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
cat ../Allwinner-fix-booting-on-a-number-of-devices.patch | patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
cat ../Fix-NVMe-not-only-on-Raspberry-Pi-5.patch | patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
cat ../raspberrypi-Add-quirk-for-RPi5-2Gb-rev-1.0.patch | patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
cat ../openssl-no-engine.patch | patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
cat ../quiet-console.patch | patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
make apple_m1_defconfig
scripts/config --file .config \
-e OF_UPSTREAM_BUILD_VENDOR \
--set-str OF_UPSTREAM_VENDOR apple
# Silent console: nothing on the panel or the serial port from U-Boot
# itself (the banner, the environment load, the bootflow scan). The
# environment's silent=1 applies from relocation on; the console stays
# muted until that environment is read. The kernel's console is not
# touched, and the U-Boot logo is not drawn. No boot delay: with nothing
# shown there is nothing to interrupt.
scripts/config --file .config \
-e SILENT_CONSOLE \
-e SILENT_CONSOLE_UPDATE_ON_SET \
-e SILENT_CONSOLE_UPDATE_ON_RELOC \
-e SILENT_CONSOLE_UNTIL_ENV \
-e SILENT_U_BOOT_ONLY \
-d VIDEO_LOGO \
--set-val BOOTDELAY 0
make olddefconfig
}
build() {
cd "${srcdir}/$_srcname"
make
}
package() {
cd "${srcdir}"
tgtdir="$pkgdir/usr/lib/asahi-boot"
dtbdir="$_srcname/dts/upstream/src/arm64/apple"
install -Dt "$tgtdir" -m644 "$_srcname/u-boot-nodtb.bin"
install -d "$tgtdir/dtb"
# Exclude known non-Apple-Silicon DT families:
# t7000: A8-based iPhone 6 / 6 Plus
# t7001: A8X-based iPad Air 2
# t8010: A10-based iPhone 7 / 7 Plus, iPad 6 / 7, iPod touch 7
# t8011: A10X-based Apple TV 4K (1st gen), iPad Pro 10.5 / 12.9 (2nd gen)
# t8012: T2-based Intel Macs
# t8015: A11-based iPhone 8 / 8 Plus / X
find "$dtbdir" -maxdepth 1 -type f -name 't*.dtb' \
! -name 't7000-*.dtb' \
! -name 't7001-*.dtb' \
! -name 't8010-*.dtb' \
! -name 't8011-*.dtb' \
! -name 't8012-*.dtb' \
! -name 't8015-*.dtb' \
-exec install -m644 -t "$tgtdir/dtb" {} +
}
@@ -0,0 +1,717 @@
From patchwork Wed Feb 26 18:44:44 2025
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Sebastian Reichel <sebastian.reichel@collabora.com>
X-Patchwork-Id: 2052544
X-Patchwork-Delegate: marek.vasut@gmail.com
Return-Path: <u-boot-bounces@lists.denx.de>
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=collabora.com header.i=@collabora.com
header.a=rsa-sha256 header.s=mail header.b=IthL1Z+m;
dkim-atps=neutral
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 4Z33M03Hhjz1yCp
for <incoming@patchwork.ozlabs.org>; Thu, 27 Feb 2025 05:45:32 +1100 (AEDT)
Received: from h2850616.stratoserver.net (localhost [IPv6:::1])
by phobos.denx.de (Postfix) with ESMTP id BFF7680FF0;
Wed, 26 Feb 2025 19:45:16 +0100 (CET)
Authentication-Results: phobos.denx.de;
dmarc=pass (p=none dis=none) header.from=collabora.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=collabora.com header.i=@collabora.com
header.b="IthL1Z+m";
dkim-atps=neutral
Received: by phobos.denx.de (Postfix, from userid 109)
id 7614F810F9; Wed, 26 Feb 2025 19:45:13 +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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,
DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED,
SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2
Received: from bali.collaboradmins.com (bali.collaboradmins.com
[IPv6:2a01:4f8:201:9162::2])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
(No client certificate requested)
by phobos.denx.de (Postfix) with ESMTPS id 2173180FDE
for <u-boot@lists.denx.de>; Wed, 26 Feb 2025 19:45:08 +0100 (CET)
Authentication-Results: phobos.denx.de;
dmarc=pass (p=none dis=none) header.from=collabora.com
Authentication-Results: phobos.denx.de;
spf=pass smtp.mailfrom=sebastian.reichel@collabora.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com;
s=mail; t=1740595507;
bh=Fnp6a8opSCXiH5NJdu5uivbBBZF3pe1CXyluh8+n8/c=;
h=From:To:Cc:Subject:Date:In-Reply-To:References:From;
b=IthL1Z+mDeIRy9MWEa0lGyJWuHk/Pu+yUpLly7RG6NIpC0lCgla3ssiy2x+8/G+bz
DWjrKUMxgWtqfjfffRiKEJZ6Z2sAXJ1ePvDmMtbGoolWSrzsV2+cWh0byYrEBuVBe9
Vp0ye7gJ4Wt610s4QHa4xoYcm7h9KGmE3IEjb+XYFv1HMJIOoACl04BwkLctza1KBr
XlIqC+snvRP/yQxa2+6RYGXgQD5JnJxCM1orXVIJxyyJxTzb3XgNir60Gb4HI9724H
LDZy0Hq7NQ1zF0h1yVUOklDotw17isbNoI4K3JCExR+r7GsdESsGY6cwAbZY71iWlf
OsSSrV6TZtAMg==
Received: from jupiter.universe (dyndsl-091-249-076-032.ewe-ip-backbone.de
[91.249.76.32])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature RSA-PSS (4096 bits))
(No client certificate requested) (Authenticated sender: sre)
by bali.collaboradmins.com (Postfix) with ESMTPSA id A18CC17E0881;
Wed, 26 Feb 2025 19:45:07 +0100 (CET)
Received: by jupiter.universe (Postfix, from userid 1000)
id 32E35480034; Wed, 26 Feb 2025 19:45:07 +0100 (CET)
From: Sebastian Reichel <sebastian.reichel@collabora.com>
To: Marek Vasut <marex@denx.de>, u-boot@lists.denx.de,
Jonas Karlman <jonas@kwiboo.se>, Soeren Moch <smoch@web.de>
Cc: Tim Harvey <tharvey@gateworks.com>,
Philipp Tomsich <philipp.tomsich@vrull.eu>,
Anand Moon <linux.amoon@gmail.com>, Maxim Kiselev <bigunclemax@gmail.com>,
Sebastian Reichel <sebastian.reichel@collabora.com>
Subject: [PATCH v2 1/4] usb: tcpm: improve handling of some power-supplies
Date: Wed, 26 Feb 2025 19:44:44 +0100
Message-ID: <20250226184506.64114-2-sebastian.reichel@collabora.com>
X-Mailer: git-send-email 2.47.2
In-Reply-To: <20250226184506.64114-1-sebastian.reichel@collabora.com>
References: <20250226184506.64114-1-sebastian.reichel@collabora.com>
MIME-Version: 1.0
X-BeenThere: u-boot@lists.denx.de
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: U-Boot discussion <u-boot.lists.denx.de>
List-Unsubscribe: <https://lists.denx.de/options/u-boot>,
<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>
List-Archive: <https://lists.denx.de/pipermail/u-boot/>
List-Post: <mailto:u-boot@lists.denx.de>
List-Help: <mailto:u-boot-request@lists.denx.de?subject=help>
List-Subscribe: <https://lists.denx.de/listinfo/u-boot>,
<mailto:u-boot-request@lists.denx.de?subject=subscribe>
Errors-To: u-boot-bounces@lists.denx.de
Sender: "U-Boot" <u-boot-bounces@lists.denx.de>
X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de
X-Virus-Status: Clean
When the Rock 5B is booted with the current TCPM with its power supplied
by a "Cambrionix PDSync-C4" port it reaches the power-supply ready state.
Once that has happened the hub starts sending GetSinkCap messages, but
U-Boot already stopped processing PD messages. After retrying a bunch of
times the hub instead sends soft resets. Since U-Boot will also not
react to them, the USB hub will follow-up with a hard reset and that
cuts off the supply voltage.
Since the state machine is already prepared to handle GetSinkCap
messages, try to avoid this by handling incoming messages for another
50ms after reaching the ready state.
Fixes: 1db4c0ac77e3 ("usb: tcpm: add core framework")
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
---
drivers/usb/tcpm/tcpm.c | 31 ++++++++++++++++++++++++++-----
1 file changed, 26 insertions(+), 5 deletions(-)
diff --git a/drivers/usb/tcpm/tcpm.c b/drivers/usb/tcpm/tcpm.c
index 0aee57cb2f4a..b754b4dcd0b5 100644
--- a/drivers/usb/tcpm/tcpm.c
+++ b/drivers/usb/tcpm/tcpm.c
@@ -2229,6 +2229,17 @@ static int tcpm_port_init(struct udevice *dev)
return 0;
}
+static inline void tcpm_poll_one_event(struct udevice *dev)
+{
+ const struct dm_tcpm_ops *drvops = dev_get_driver_ops(dev);
+ struct tcpm_port *port = dev_get_uclass_plat(dev);
+
+ drvops->poll_event(dev);
+ port->poll_event_cnt++;
+ udelay(500);
+ tcpm_check_and_run_delayed_work(dev);
+}
+
static void tcpm_poll_event(struct udevice *dev)
{
const struct dm_tcpm_ops *drvops = dev_get_driver_ops(dev);
@@ -2242,15 +2253,25 @@ static void tcpm_poll_event(struct udevice *dev)
(port->state == SNK_READY || port->state == SRC_READY))
break;
- drvops->poll_event(dev);
- port->poll_event_cnt++;
- udelay(500);
- tcpm_check_and_run_delayed_work(dev);
+ tcpm_poll_one_event(dev);
}
- if (port->state != SNK_READY && port->state != SRC_READY)
+ /*
+ * Some power-supplies send GetSinkCap shortly after they are ready.
+ * If they do not receive a response after a few retries they will issue
+ * a soft-reset followed by a hard reset, which kills the board power.
+ * Let's poll for 50ms after reaching the ready state to check if the
+ * power-supply wants something from us.
+ */
+ if (port->state == SNK_READY) {
+ port->poll_event_cnt = 0;
+
+ while (port->poll_event_cnt < 100)
+ tcpm_poll_one_event(dev);
+ } else {
dev_warn(dev, "TCPM: exit in state %s\n",
tcpm_states[port->state]);
+ }
/*
* At this time, call the callback function of the respective pd chip
From patchwork Wed Feb 26 18:44:45 2025
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Sebastian Reichel <sebastian.reichel@collabora.com>
X-Patchwork-Id: 2052546
X-Patchwork-Delegate: marek.vasut@gmail.com
Return-Path: <u-boot-bounces@lists.denx.de>
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=collabora.com header.i=@collabora.com
header.a=rsa-sha256 header.s=mail header.b=hgX6o5vZ;
dkim-atps=neutral
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 4Z33MJ5sFGz1yCp
for <incoming@patchwork.ozlabs.org>; Thu, 27 Feb 2025 05:45:48 +1100 (AEDT)
Received: from h2850616.stratoserver.net (localhost [IPv6:::1])
by phobos.denx.de (Postfix) with ESMTP id 69A29811C5;
Wed, 26 Feb 2025 19:45:17 +0100 (CET)
Authentication-Results: phobos.denx.de;
dmarc=pass (p=none dis=none) header.from=collabora.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=collabora.com header.i=@collabora.com
header.b="hgX6o5vZ";
dkim-atps=neutral
Received: by phobos.denx.de (Postfix, from userid 109)
id 832B180FB9; Wed, 26 Feb 2025 19:45: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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,
DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED,
RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED,
SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2
Received: from bali.collaboradmins.com (bali.collaboradmins.com
[148.251.105.195])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
(No client certificate requested)
by phobos.denx.de (Postfix) with ESMTPS id 2178380FF0
for <u-boot@lists.denx.de>; Wed, 26 Feb 2025 19:45:08 +0100 (CET)
Authentication-Results: phobos.denx.de;
dmarc=pass (p=none dis=none) header.from=collabora.com
Authentication-Results: phobos.denx.de;
spf=pass smtp.mailfrom=sebastian.reichel@collabora.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com;
s=mail; t=1740595507;
bh=H/gQCZCWVmLNRIaBLvWsE35SaDMWvta2+rTkymkHQJE=;
h=From:To:Cc:Subject:Date:In-Reply-To:References:From;
b=hgX6o5vZwM72CR2hgo76tgo2eE00qHM7oNja381ACl8gIUUVioy8RTeqXtum89tBf
aIwKm/oNQNvGxy92pX5/1Jg/MwYZKS8jDukz6ZgsLKu22rJXf58FFoV095AcEkUMB2
lrO4KJgFW/x1FK8GmSVSXXH+iUYJLkzsfZKgHKoQYHZcVXJRgFjHR5ytGKsA/fq4el
7Wrx3lmLNjL7fYlDF5AyY+Wl6hqzjDq58nFedXHv8TEHx6fzfB0IBzOL/F8bGqVcyy
lal7bjJvMPoA9zfgIC77R1neWktg5FSro75YciSRSj9lmMNCmESnSPCgsZ4wBW0V6f
ppD77gOtjDfLQ==
Received: from jupiter.universe (dyndsl-091-249-076-032.ewe-ip-backbone.de
[91.249.76.32])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature RSA-PSS (4096 bits))
(No client certificate requested) (Authenticated sender: sre)
by bali.collaboradmins.com (Postfix) with ESMTPSA id 9725D17E087F;
Wed, 26 Feb 2025 19:45:07 +0100 (CET)
Received: by jupiter.universe (Postfix, from userid 1000)
id 34511480037; Wed, 26 Feb 2025 19:45:07 +0100 (CET)
From: Sebastian Reichel <sebastian.reichel@collabora.com>
To: Marek Vasut <marex@denx.de>, u-boot@lists.denx.de,
Jonas Karlman <jonas@kwiboo.se>, Soeren Moch <smoch@web.de>
Cc: Tim Harvey <tharvey@gateworks.com>,
Philipp Tomsich <philipp.tomsich@vrull.eu>,
Anand Moon <linux.amoon@gmail.com>, Maxim Kiselev <bigunclemax@gmail.com>,
Sebastian Reichel <sebastian.reichel@collabora.com>
Subject: [PATCH v2 2/4] usb: tcpm: avoid resets for missing source capability
messages
Date: Wed, 26 Feb 2025 19:44:45 +0100
Message-ID: <20250226184506.64114-3-sebastian.reichel@collabora.com>
X-Mailer: git-send-email 2.47.2
In-Reply-To: <20250226184506.64114-1-sebastian.reichel@collabora.com>
References: <20250226184506.64114-1-sebastian.reichel@collabora.com>
MIME-Version: 1.0
X-BeenThere: u-boot@lists.denx.de
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: U-Boot discussion <u-boot.lists.denx.de>
List-Unsubscribe: <https://lists.denx.de/options/u-boot>,
<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>
List-Archive: <https://lists.denx.de/pipermail/u-boot/>
List-Post: <mailto:u-boot@lists.denx.de>
List-Help: <mailto:u-boot-request@lists.denx.de?subject=help>
List-Subscribe: <https://lists.denx.de/listinfo/u-boot>,
<mailto:u-boot-request@lists.denx.de?subject=subscribe>
Errors-To: u-boot-bounces@lists.denx.de
Sender: "U-Boot" <u-boot-bounces@lists.denx.de>
X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de
X-Virus-Status: Clean
The current TCPM code implements source capability message handling
according to the USB-PD specification. Unfortunately some USB PD
sources do not properly follow the specification and do not send
source capability messages after a soft reset when they already
negotiated a specific contract before. The currently implemented way
(and what is described in the specificiation) to resolve this problem
is triggering a hard reset.
But a hard reset is fatal on batteryless platforms powered via USB-C PD,
since that removes VBUS for some time. Since this is triggered at boot
time, the system may get stuck in a boot loop.
For example I noticed the following behaviour on a Radxa Rock 5B
combined with an affected power-supply:
1. The system is booted up with current code
2. A reboot is requested
3. U-Boot TCPM / fusb302 driver sends soft reset and waits for the
source capability message
4. No new source capability message is send by the power-supply
after the soft reset
5. U-Boot sends a hard reset
6. The board resets, but the fusb302 registers are not reset. This
is because of a hardware glitch. The serial pins are high when
no data is exchanged. Apparently the RK3588 has protection diodes,
which leak some voltage into the power-domain. The Rock 5B serial
pins and the fusb302 are using the same 3.3V power domain and the
leaked voltage is enough to keep the fusb302 registers alive.
7. After the hard reset the power-supply sends another source capability
message, which is auto-acked by fusb302 (because the register state
is kept) even though the U-Boot driver has not yet probed. Once the
U-Boot driver probes it sends another soft reset and waits for a new
source capability message, which never arrives.
Fortunately the affected power-supplies (I have two setups showing this
behaviour) support sending a source capability message when explicitly
being asked. Thus an easy workaround to handle this is deviating from
the USB-PD specification and sending a Get_Source_Cap message and
waiting some time longer before doing the hard reset.
Note, that I recently added the same workaround to the Linux kernel
with a slightly different rationale (since it needs to take over from
U-Boot).
Fixes: 1db4c0ac77e3 ("usb: tcpm: add core framework")
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
---
drivers/usb/tcpm/tcpm-internal.h | 1 +
drivers/usb/tcpm/tcpm.c | 32 +++++++++++++++++++++++++++++---
2 files changed, 30 insertions(+), 3 deletions(-)
diff --git a/drivers/usb/tcpm/tcpm-internal.h b/drivers/usb/tcpm/tcpm-internal.h
index 561442090027..4861f4d13866 100644
--- a/drivers/usb/tcpm/tcpm-internal.h
+++ b/drivers/usb/tcpm/tcpm-internal.h
@@ -30,6 +30,7 @@
S(SNK_DISCOVERY_DEBOUNCE), \
S(SNK_DISCOVERY_DEBOUNCE_DONE), \
S(SNK_WAIT_CAPABILITIES), \
+ S(SNK_WAIT_CAPABILITIES_TIMEOUT), \
S(SNK_NEGOTIATE_CAPABILITIES), \
S(SNK_TRANSITION_SINK), \
S(SNK_TRANSITION_SINK_VBUS), \
diff --git a/drivers/usb/tcpm/tcpm.c b/drivers/usb/tcpm/tcpm.c
index b754b4dcd0b5..786d92fa4c6f 100644
--- a/drivers/usb/tcpm/tcpm.c
+++ b/drivers/usb/tcpm/tcpm.c
@@ -1424,7 +1424,8 @@ static inline enum tcpm_state hard_reset_state(struct tcpm_port *port)
return ERROR_RECOVERY;
if (port->pwr_role == TYPEC_SOURCE)
return SRC_UNATTACHED;
- if (port->state == SNK_WAIT_CAPABILITIES)
+ if (port->state == SNK_WAIT_CAPABILITIES ||
+ port->state == SNK_WAIT_CAPABILITIES_TIMEOUT)
return SNK_READY;
return SNK_UNATTACHED;
}
@@ -1650,10 +1651,35 @@ static void run_state_machine(struct udevice *dev)
tcpm_set_state(dev, SOFT_RESET_SEND,
PD_T_SINK_WAIT_CAP);
} else {
- tcpm_set_state(dev, hard_reset_state(port),
- PD_T_SINK_WAIT_CAP);
+ if (!port->self_powered)
+ tcpm_set_state(dev, SNK_WAIT_CAPABILITIES_TIMEOUT,
+ PD_T_SINK_WAIT_CAP);
+ else
+ tcpm_set_state(dev, hard_reset_state(port),
+ PD_T_SINK_WAIT_CAP);
}
break;
+ case SNK_WAIT_CAPABILITIES_TIMEOUT:
+ /*
+ * There are some USB PD sources in the field, which do not
+ * properly implement the specification and fail to start
+ * sending Source Capability messages after a soft reset. The
+ * specification suggests to do a hard reset when no Source
+ * capability message is received within PD_T_SINK_WAIT_CAP,
+ * but that might effectively kil the machine's power source.
+ *
+ * This slightly diverges from the specification and tries to
+ * recover from this by explicitly asking for the capabilities
+ * using the Get_Source_Cap control message before falling back
+ * to a hard reset. The control message should also be supported
+ * and handled by all USB PD source and dual role devices
+ * according to the specification.
+ */
+ if (tcpm_pd_send_control(dev, PD_CTRL_GET_SOURCE_CAP))
+ tcpm_set_state_cond(dev, hard_reset_state(port), 0);
+ else
+ tcpm_set_state(dev, hard_reset_state(port), PD_T_SINK_WAIT_CAP);
+ break;
case SNK_NEGOTIATE_CAPABILITIES:
port->pd_capable = true;
port->hard_reset_count = 0;
From patchwork Wed Feb 26 18:44:46 2025
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Sebastian Reichel <sebastian.reichel@collabora.com>
X-Patchwork-Id: 2052545
X-Patchwork-Delegate: marek.vasut@gmail.com
Return-Path: <u-boot-bounces@lists.denx.de>
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=collabora.com header.i=@collabora.com
header.a=rsa-sha256 header.s=mail header.b=BxTv7Lfo;
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) server-digest SHA384)
(No client certificate requested)
by legolas.ozlabs.org (Postfix) with ESMTPS id 4Z33M971h7z1yCp
for <incoming@patchwork.ozlabs.org>; Thu, 27 Feb 2025 05:45:41 +1100 (AEDT)
Received: from h2850616.stratoserver.net (localhost [IPv6:::1])
by phobos.denx.de (Postfix) with ESMTP id 1B09C8118B;
Wed, 26 Feb 2025 19:45:17 +0100 (CET)
Authentication-Results: phobos.denx.de;
dmarc=pass (p=none dis=none) header.from=collabora.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=collabora.com header.i=@collabora.com
header.b="BxTv7Lfo";
dkim-atps=neutral
Received: by phobos.denx.de (Postfix, from userid 109)
id 4399E810F9; Wed, 26 Feb 2025 19:45: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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,
DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED,
SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2
Received: from bali.collaboradmins.com (bali.collaboradmins.com
[IPv6:2a01:4f8:201:9162::2])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
(No client certificate requested)
by phobos.denx.de (Postfix) with ESMTPS id 2163F80FB9
for <u-boot@lists.denx.de>; Wed, 26 Feb 2025 19:45:08 +0100 (CET)
Authentication-Results: phobos.denx.de;
dmarc=pass (p=none dis=none) header.from=collabora.com
Authentication-Results: phobos.denx.de;
spf=pass smtp.mailfrom=sebastian.reichel@collabora.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com;
s=mail; t=1740595507;
bh=7OaDpd2idE5ETWAiOZte0kuOU6ZYitEVWkDgDmqaQU8=;
h=From:To:Cc:Subject:Date:In-Reply-To:References:From;
b=BxTv7LfoAae43YSXPquVPmmwStgQirXCxaSBD0fo554R5O/si/Iif5L+zXXJocATJ
z7+I7ZKbknkTeVyzoRDCXvXIVz2bFdTRWQN4Z2iwJbVI1covAv/Gn4wIE2Q6hbNKbU
qV5AKg7gvrKkbztbo7N9bHNjkrlAbd8B4Ew3SR8FM46DMAOwNzVsoX3rLMcPtlWzHj
4OBKCx22H/4ASIWjMbYoDE09DyQ+CPOf8JcX8OPwFcH9j6vW6cEWvyjiAyDj6LnwOq
KD+ZYVIkWhkIzAkE2NHB2IpA4xlxW8i18BJzNBD8N1eBx/HCgb0camb4KanY1Hta/d
4ipLyuFaCkMog==
Received: from jupiter.universe (dyndsl-091-249-076-032.ewe-ip-backbone.de
[91.249.76.32])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest
SHA256)
(No client certificate requested) (Authenticated sender: sre)
by bali.collaboradmins.com (Postfix) with ESMTPSA id 816AA17E0861;
Wed, 26 Feb 2025 19:45:07 +0100 (CET)
Received: by jupiter.universe (Postfix, from userid 1000)
id 361F2480038; Wed, 26 Feb 2025 19:45:07 +0100 (CET)
From: Sebastian Reichel <sebastian.reichel@collabora.com>
To: Marek Vasut <marex@denx.de>, u-boot@lists.denx.de,
Jonas Karlman <jonas@kwiboo.se>, Soeren Moch <smoch@web.de>
Cc: Tim Harvey <tharvey@gateworks.com>,
Philipp Tomsich <philipp.tomsich@vrull.eu>,
Anand Moon <linux.amoon@gmail.com>, Maxim Kiselev <bigunclemax@gmail.com>,
Sebastian Reichel <sebastian.reichel@collabora.com>
Subject: [PATCH v2 3/4] usb: tcpm: print error on hard reset
Date: Wed, 26 Feb 2025 19:44:46 +0100
Message-ID: <20250226184506.64114-4-sebastian.reichel@collabora.com>
X-Mailer: git-send-email 2.47.2
In-Reply-To: <20250226184506.64114-1-sebastian.reichel@collabora.com>
References: <20250226184506.64114-1-sebastian.reichel@collabora.com>
MIME-Version: 1.0
X-BeenThere: u-boot@lists.denx.de
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: U-Boot discussion <u-boot.lists.denx.de>
List-Unsubscribe: <https://lists.denx.de/options/u-boot>,
<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>
List-Archive: <https://lists.denx.de/pipermail/u-boot/>
List-Post: <mailto:u-boot@lists.denx.de>
List-Help: <mailto:u-boot-request@lists.denx.de?subject=help>
List-Subscribe: <https://lists.denx.de/listinfo/u-boot>,
<mailto:u-boot-request@lists.denx.de?subject=subscribe>
Errors-To: u-boot-bounces@lists.denx.de
Sender: "U-Boot" <u-boot-bounces@lists.denx.de>
X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de
X-Virus-Status: Clean
A USB-PD hard reset involves removing the voltage from VBUS for some
time. So basically it has the same effect as removing the USB-C plug
for a short moment. If the machine is powered from the USB-C port and
does not have a fallback supply (e.g. a battery), this will result in
a full machine reset due to power loss.
Ideally we want to avoid triggering a hard reset on these boards. A
non-working USB-C port is probably better than unplanned reboots. But
boards with a backup supply should do the hard reset to get everything
working again.
In theory it would be enough to check the self_powered property, but
it seems the property might not be configured consistently enough in
system firmwares.
USB-PD hard resets should happen rarely in general, so let's at least
print an error message before the potential board reset happens. This
is also useful, since it immediately gives away which device triggered
the hard reset.
Fixes: 1db4c0ac77e3 ("usb: tcpm: add core framework")
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
---
drivers/usb/tcpm/tcpm.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/usb/tcpm/tcpm.c b/drivers/usb/tcpm/tcpm.c
index 786d92fa4c6f..909fe2ef4fcb 100644
--- a/drivers/usb/tcpm/tcpm.c
+++ b/drivers/usb/tcpm/tcpm.c
@@ -1711,6 +1711,8 @@ static void run_state_machine(struct udevice *dev)
/* Hard_Reset states */
case HARD_RESET_SEND:
+ if (!port->self_powered && port->port_type == TYPEC_PORT_SNK)
+ dev_err(dev, "Initiating hard-reset, which might result in machine power-loss.\n");
tcpm_pd_transmit(dev, TCPC_TX_HARD_RESET, NULL);
tcpm_set_state(dev, HARD_RESET_START, 0);
port->wait_dr_swap_message = false;
From patchwork Wed Feb 26 18:44:47 2025
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Sebastian Reichel <sebastian.reichel@collabora.com>
X-Patchwork-Id: 2052542
X-Patchwork-Delegate: marek.vasut@gmail.com
Return-Path: <u-boot-bounces@lists.denx.de>
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=collabora.com header.i=@collabora.com
header.a=rsa-sha256 header.s=mail header.b=K4mNmlOy;
dkim-atps=neutral
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 4Z33Lk40FPz1yCp
for <incoming@patchwork.ozlabs.org>; Thu, 27 Feb 2025 05:45:18 +1100 (AEDT)
Received: from h2850616.stratoserver.net (localhost [IPv6:::1])
by phobos.denx.de (Postfix) with ESMTP id DAFC780FF2;
Wed, 26 Feb 2025 19:45:12 +0100 (CET)
Authentication-Results: phobos.denx.de;
dmarc=pass (p=none dis=none) header.from=collabora.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=collabora.com header.i=@collabora.com
header.b="K4mNmlOy";
dkim-atps=neutral
Received: by phobos.denx.de (Postfix, from userid 109)
id 56A22810F9; Wed, 26 Feb 2025 19:45:11 +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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,
DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED,
SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2
Received: from bali.collaboradmins.com (bali.collaboradmins.com
[IPv6:2a01:4f8:201:9162::2])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
(No client certificate requested)
by phobos.denx.de (Postfix) with ESMTPS id 217E080FF2
for <u-boot@lists.denx.de>; Wed, 26 Feb 2025 19:45:08 +0100 (CET)
Authentication-Results: phobos.denx.de;
dmarc=pass (p=none dis=none) header.from=collabora.com
Authentication-Results: phobos.denx.de;
spf=pass smtp.mailfrom=sebastian.reichel@collabora.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com;
s=mail; t=1740595507;
bh=FeXZr6pfjIqGXvnsLHDigD702EmgVNH91IWVsD16udQ=;
h=From:To:Cc:Subject:Date:In-Reply-To:References:From;
b=K4mNmlOycXzLuJnNeDxyXLVCeZWNr//ycRqDt3ld9634ThDvJ0+y49X3z2nYW+fei
HCqH2AoFiXj7khjiFpwCA4xOlYaTrF9yb0M9ApRxJ8vGuslNIK2k9osj8IJMoWmY8S
fEez4H6Wso4VamCnXKCze2G5np5mhola5QxSnIJ2CXdFP9TM1x54P+XyeJMX6IZK0X
lpZ0R8mACHGgXnkBASRMbo0CnLfSVrUgA83A0FHT7UgxfW8399wHol/FBakg5WS8nt
47154TDW4ikoGF4dHBeD0KemJSR7I4F+nnUVQfgg8sXZKVm4yilBT+yx3WWBVCjQDl
3igqfexnaUKnA==
Received: from jupiter.universe (dyndsl-091-249-076-032.ewe-ip-backbone.de
[91.249.76.32])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest
SHA256)
(No client certificate requested) (Authenticated sender: sre)
by bali.collaboradmins.com (Postfix) with ESMTPSA id 7FBB317E065A;
Wed, 26 Feb 2025 19:45:07 +0100 (CET)
Received: by jupiter.universe (Postfix, from userid 1000)
id 37B6A480039; Wed, 26 Feb 2025 19:45:07 +0100 (CET)
From: Sebastian Reichel <sebastian.reichel@collabora.com>
To: Marek Vasut <marex@denx.de>, u-boot@lists.denx.de,
Jonas Karlman <jonas@kwiboo.se>, Soeren Moch <smoch@web.de>
Cc: Tim Harvey <tharvey@gateworks.com>,
Philipp Tomsich <philipp.tomsich@vrull.eu>,
Anand Moon <linux.amoon@gmail.com>, Maxim Kiselev <bigunclemax@gmail.com>,
Sebastian Reichel <sebastian.reichel@collabora.com>
Subject: [PATCH v2 4/4] usb: tcpm: improve data role mismatch error recovery
Date: Wed, 26 Feb 2025 19:44:47 +0100
Message-ID: <20250226184506.64114-5-sebastian.reichel@collabora.com>
X-Mailer: git-send-email 2.47.2
In-Reply-To: <20250226184506.64114-1-sebastian.reichel@collabora.com>
References: <20250226184506.64114-1-sebastian.reichel@collabora.com>
MIME-Version: 1.0
X-BeenThere: u-boot@lists.denx.de
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: U-Boot discussion <u-boot.lists.denx.de>
List-Unsubscribe: <https://lists.denx.de/options/u-boot>,
<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>
List-Archive: <https://lists.denx.de/pipermail/u-boot/>
List-Post: <mailto:u-boot@lists.denx.de>
List-Help: <mailto:u-boot-request@lists.denx.de?subject=help>
List-Subscribe: <https://lists.denx.de/listinfo/u-boot>,
<mailto:u-boot-request@lists.denx.de?subject=subscribe>
Errors-To: u-boot-bounces@lists.denx.de
Sender: "U-Boot" <u-boot-bounces@lists.denx.de>
X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de
X-Virus-Status: Clean
On Radxa ROCK 5B I managed to get U-Boot into an endless loop of
printing
fusb302 usb-typec@22: TCPM: data role mismatch, initiating error recovery
messages by changing the data role in Linux and then rebooting the
system. This is happening because the external device (A cheap USB-C hub
powered through a USB-C PD power-supply) kept its state and the error
recovery path for non self-powered devices is not enough to change it.
Avoid this by swapping our own data role when the error recovery stage
is reached for a port, which is not self-powered. Right now data support
is limited anyways and once proper support is added we can use the data
role swap request to get the desired data direction after the initial
negotiation completed.
Fixes: 1db4c0ac77e3 ("usb: tcpm: add core framework")
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
---
drivers/usb/tcpm/tcpm.c | 30 +++++++++++++++++++++++++++---
1 file changed, 27 insertions(+), 3 deletions(-)
diff --git a/drivers/usb/tcpm/tcpm.c b/drivers/usb/tcpm/tcpm.c
index 909fe2ef4fcb..12d66d470f9a 100644
--- a/drivers/usb/tcpm/tcpm.c
+++ b/drivers/usb/tcpm/tcpm.c
@@ -833,6 +833,28 @@ static void tcpm_pd_ctrl_request(struct udevice *dev,
}
}
+static void tcpm_recover_data_role_mismatch(struct udevice *dev)
+{
+ struct tcpm_port *port = dev_get_uclass_plat(dev);
+
+ dev_err(dev, "TCPM: data role mismatch, initiating error recovery\n");
+ if (port->self_powered) {
+ tcpm_set_state(dev, ERROR_RECOVERY, 0);
+ return;
+ }
+
+ /*
+ * The error recovery will not help for devices, which are not
+ * self-powered because the error recovery avoids killing the board
+ * power. Since this can happen early on sending
+ * a DR_SWAP request is not sensible. Instead let's change our own
+ * data role. It can be swapped back once USB-PD reached the ready
+ * state.
+ */
+ tcpm_set_roles(dev, true, port->pwr_role,
+ port->data_role == TYPEC_HOST ? TYPEC_DEVICE : TYPEC_HOST);
+}
+
static void tcpm_pd_rx_handler(struct udevice *dev,
const struct pd_message *msg)
{
@@ -867,9 +889,11 @@ static void tcpm_pd_rx_handler(struct udevice *dev,
remote_is_host = !!(le16_to_cpu(msg->header) & PD_HEADER_DATA_ROLE);
local_is_host = port->data_role == TYPEC_HOST;
if (remote_is_host == local_is_host) {
- dev_err(dev, "TCPM: data role mismatch, initiating error recovery\n");
- tcpm_set_state(dev, ERROR_RECOVERY, 0);
- } else {
+ tcpm_recover_data_role_mismatch(dev);
+ local_is_host = port->data_role == TYPEC_HOST;
+ }
+
+ if (remote_is_host != local_is_host) {
if (cnt)
tcpm_pd_data_request(dev, msg);
else
@@ -0,0 +1,32 @@
From d9e3a49bc2a29922da5bddd95772279f6edba802 Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Fri, 18 Aug 2023 13:28:05 +0100
Subject: [PATCH] disable VBE by default
The VBE protocol needs explicit device support and as
such isn't particularly useful by itself without that,
it also adds size and the potential of an attack vector
so devices that wish to use this protocol should
explicitly opt in to it like all other large features
in U-Boot.
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
boot/Kconfig | 1 -
1 file changed, 1 deletion(-)
diff --git a/boot/Kconfig b/boot/Kconfig
index 30eb5b328d7..e8c3fbcb11d 100644
--- a/boot/Kconfig
+++ b/boot/Kconfig
@@ -635,7 +635,6 @@ config BOOTMETH_QFW
config BOOTMETH_VBE
bool "Bootdev support for Verified Boot for Embedded"
depends on FIT
- default y
select BOOTMETH_GLOBAL
select EVENT
help
--
2.49.0
@@ -0,0 +1,49 @@
From a956480a6d52ae90ef4a46275c2ee29a4074de36 Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Fri, 18 Aug 2023 23:10:42 +0100
Subject: [PATCH] enable bootmenu by default
We want the boot menu on all Fedora devices as it makes
it a whole lot more user friendly.
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
boot/Kconfig | 2 ++
cmd/Kconfig | 1 +
2 files changed, 3 insertions(+)
diff --git a/boot/Kconfig b/boot/Kconfig
index 467b09e2350..ad67b1f65a6 100644
--- a/boot/Kconfig
+++ b/boot/Kconfig
@@ -1281,6 +1281,7 @@ config BOOTDELAY
config AUTOBOOT_KEYED
bool "Stop autobooting via specific input key / string"
+ default y
help
This option enables stopping (aborting) of the automatic
boot feature only by issuing a specific input key or
@@ -1433,6 +1434,7 @@ config AUTOBOOT_MENUKEY
config AUTOBOOT_MENU_SHOW
bool "Show a menu on boot"
+ default y
depends on CMD_BOOTMENU
help
This enables the boot menu, controlled by environment variables
diff --git a/cmd/Kconfig b/cmd/Kconfig
index 43ca10f69cc..3d39f2914cc 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -413,6 +413,7 @@ source lib/efi_selftest/Kconfig
config CMD_BOOTMENU
bool "bootmenu"
+ default y
select MENU
select CHARSET
help
--
2.41.0
@@ -0,0 +1,178 @@
From 88a0fe6c1fda46c8bacd861044f39930ce1c9bc0 Mon Sep 17 00:00:00 2001
From: Davide Cavalca <dcavalca@meta.com>
Date: Sun, 29 Sep 2024 17:20:59 -0700
Subject: [PATCH] lib: allow building when OpenSSL ENGINE is disabled
Recent OpenSSL releases deprecate ENGINE, and some distributions have
started to remove it altogether. Gate the logic using it behind a
feature check so that we'll build regardless.
Signed-off-by: Davide Cavalca <dcavalca@meta.com>
---
lib/aes/aes-encrypt.c | 2 ++
lib/rsa/rsa-sign.c | 22 ++++++++++++++++++++++
2 files changed, 24 insertions(+)
diff --git a/lib/aes/aes-encrypt.c b/lib/aes/aes-encrypt.c
index e74e35eaa2..7758438c32 100644
--- a/lib/aes/aes-encrypt.c
+++ b/lib/aes/aes-encrypt.c
@@ -16,7 +16,9 @@
#include <openssl/err.h>
#include <openssl/ssl.h>
#include <openssl/evp.h>
+#ifndef OPENSSL_NO_ENGINE
#include <openssl/engine.h>
+#endif
#include <uboot_aes.h>
#if OPENSSL_VERSION_NUMBER >= 0x10000000L
diff --git a/lib/rsa/rsa-sign.c b/lib/rsa/rsa-sign.c
index 2304030e32..bb9c93ea65 100644
--- a/lib/rsa/rsa-sign.c
+++ b/lib/rsa/rsa-sign.c
@@ -19,7 +19,9 @@
#include <openssl/err.h>
#include <openssl/ssl.h>
#include <openssl/evp.h>
+#ifndef OPENSSL_NO_ENGINE
#include <openssl/engine.h>
+#endif
static int rsa_err(const char *msg)
{
@@ -89,6 +91,7 @@ err_cert:
return ret;
}
+#ifndef OPENSSL_NO_ENGINE
/**
* rsa_engine_get_pub_key() - read a public key from given engine
*
@@ -157,6 +160,7 @@ static int rsa_engine_get_pub_key(const char *keydir, const char *name,
return 0;
}
+#endif
/**
* rsa_get_pub_key() - read a public key
@@ -170,8 +174,10 @@ static int rsa_engine_get_pub_key(const char *keydir, const char *name,
static int rsa_get_pub_key(const char *keydir, const char *name,
ENGINE *engine, EVP_PKEY **evpp)
{
+#ifndef OPENSSL_NO_ENGINE
if (engine)
return rsa_engine_get_pub_key(keydir, name, engine, evpp);
+#endif
return rsa_pem_get_pub_key(keydir, name, evpp);
}
@@ -217,6 +223,7 @@ static int rsa_pem_get_priv_key(const char *keydir, const char *name,
return 0;
}
+#ifndef OPENSSL_NO_ENGINE
/**
* rsa_engine_get_priv_key() - read a private key from given engine
*
@@ -293,6 +300,7 @@ static int rsa_engine_get_priv_key(const char *keydir, const char *name,
return 0;
}
+#endif
/**
* rsa_get_priv_key() - read a private key
@@ -306,9 +314,11 @@ static int rsa_engine_get_priv_key(const char *keydir, const char *name,
static int rsa_get_priv_key(const char *keydir, const char *name,
const char *keyfile, ENGINE *engine, EVP_PKEY **evpp)
{
+#ifndef OPENSSL_NO_ENGINE
if (engine)
return rsa_engine_get_priv_key(keydir, name, keyfile, engine,
evpp);
+#endif
return rsa_pem_get_priv_key(keydir, name, keyfile, evpp);
}
@@ -325,6 +335,7 @@ static int rsa_init(void)
return 0;
}
+#ifndef OPENSSL_NO_ENGINE
static int rsa_engine_init(const char *engine_id, ENGINE **pe)
{
const char *key_pass;
@@ -380,6 +391,7 @@ static void rsa_engine_remove(ENGINE *e)
ENGINE_free(e);
}
}
+#endif
static int rsa_sign_with_key(EVP_PKEY *pkey, struct padding_algo *padding_algo,
struct checksum_algo *checksum_algo,
@@ -471,11 +483,13 @@ int rsa_sign(struct image_sign_info *info,
if (ret)
return ret;
+#ifndef OPENSSL_NO_ENGINE
if (info->engine_id) {
ret = rsa_engine_init(info->engine_id, &e);
if (ret)
return ret;
}
+#endif
ret = rsa_get_priv_key(info->keydir, info->keyname, info->keyfile,
e, &pkey);
@@ -486,17 +500,21 @@ int rsa_sign(struct image_sign_info *info,
if (ret)
goto err_sign;
+#ifndef OPENSSL_NO_ENGINE
EVP_PKEY_free(pkey);
if (info->engine_id)
rsa_engine_remove(e);
return ret;
+#endif
err_sign:
EVP_PKEY_free(pkey);
err_priv:
+#ifndef OPENSSL_NO_ENGINE
if (info->engine_id)
rsa_engine_remove(e);
+#endif
return ret;
}
@@ -636,11 +654,13 @@ int rsa_add_verify_data(struct image_sign_info *info, void *keydest)
ENGINE *e = NULL;
debug("%s: Getting verification data\n", __func__);
+#ifndef OPENSSL_NO_ENGINE
if (info->engine_id) {
ret = rsa_engine_init(info->engine_id, &e);
if (ret)
return ret;
}
+#endif
ret = rsa_get_pub_key(info->keydir, info->keyname, e, &pkey);
if (ret)
goto err_get_pub_key;
@@ -717,8 +737,10 @@ done:
err_get_params:
EVP_PKEY_free(pkey);
err_get_pub_key:
+#ifndef OPENSSL_NO_ENGINE
if (info->engine_id)
rsa_engine_remove(e);
+#endif
if (ret)
return ret;
--
2.46.2
@@ -0,0 +1,25 @@
From c9b65320d64a60cde74c4c1f9cb4a05198a456c2 Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Wed, 10 Sep 2025 13:27:52 +0100
Subject: [PATCH] further size reductions
---
configs/p3450-0000_defconfig | 2 ++
1 file changed, 2 insertions(+)
diff --git a/configs/p3450-0000_defconfig b/configs/p3450-0000_defconfig
index 2ebcf8b83fc..a5e717a02ed 100644
--- a/configs/p3450-0000_defconfig
+++ b/configs/p3450-0000_defconfig
@@ -27,6 +27,8 @@ CONFIG_CONSOLE_MUX=y
CONFIG_SYS_STDIO_DEREGISTER=y
CONFIG_SYS_PROMPT="Tegra210 (P3450-0000) # "
# CONFIG_BOOTM_PLAN9 is not set
+# CONFIG_SYS_DTC_PAD_BYTES is not set
+# CONFIG_LEGACY_IMAGE_FORMAT is not set
# CONFIG_BOOTM_RTEMS is not set
# CONFIG_BOOTM_VXWORKS is not set
# CONFIG_CMD_ELF is not set
--
2.51.0
@@ -0,0 +1,234 @@
From patchwork Tue Aug 11 13:34:33 2026
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Patchwork-Submitter: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
X-Patchwork-Id: 2283713
Return-Path: <u-boot-bounces@lists.u-boot-project.org>
X-Original-To: incoming@patchwork.ozlabs.org
Delivered-To: patchwork-incoming@legolas.ozlabs.org
Authentication-Results: legolas.ozlabs.org;
dkim=fail reason="signature verification failed" (2048-bit key;
unprotected) header.d=lists.u-boot-project.org
header.i=@lists.u-boot-project.org header.a=rsa-sha256 header.s=default
header.b=N2mjzMfT;
dkim-atps=neutral
Authentication-Results: legolas.ozlabs.org;
spf=pass (sender SPF authorized) smtp.mailfrom=lists.u-boot-project.org
(client-ip=140.211.166.137; helo=smtp4.osuosl.org;
envelope-from=u-boot-bounces@lists.u-boot-project.org;
receiver=patchwork.ozlabs.org)
Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137])
(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 4hKCMS4PSRz1xtl
for <incoming@patchwork.ozlabs.org>; Tue, 11 Aug 2026 23:36:36 +1000 (AEST)
Received: from localhost (localhost [127.0.0.1])
by smtp4.osuosl.org (Postfix) with ESMTP id A0013402ED;
Tue, 11 Aug 2026 13:36:34 +0000 (UTC)
X-Virus-Scanned: amavis at osuosl.org
Received: from smtp4.osuosl.org ([127.0.0.1])
by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP
id p3bOda34E2S1; Tue, 11 Aug 2026 13:36:34 +0000 (UTC)
X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142;
helo=lists1.osuosl.org;
envelope-from=u-boot-bounces@lists.u-boot-project.org; receiver=<UNKNOWN>
DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org C8D6040520
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=lists.u-boot-project.org ; s=default; t=1786455393;
bh=cBVuDcRfAz5FmVboiaFLD22qM9rj4tnKRC4LViq6X68=;
h=From:To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive:
List-Post:List-Help:List-Subscribe:From;
b=N2mjzMfTYSqmTzk5FULwaFpMrGP5bVx/I9fHulmwzUjiqqJ9tTuxFgg7YCzUy5gHA
nOaWzLi5SSXsmRZgFXcjHu42Dlk9xTHR2qq/4dS0Jbc0rahx6+PQT1YjAWBHDpsl26
WZH2MDE/Gv/VVK7wjRp2lYfVtOs39dZAWUSyvYaH8vRwIKUb696ujmQYkGRa4RSkVO
WoL+nEFC1B1XaZWlY7HLMogdXPKXD4VqvBU86Oc/lzjf/NAZAjtkKnBLCG8TC2l2AY
E/TYLlN3XJYwSxHLzMqMCU0/TSwwT1z4kgibHFNq8XUpt1VwMloPxSTvHz9JvZNYOs
wwM5F4y6KhaDw==
Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142])
by smtp4.osuosl.org (Postfix) with ESMTP id C8D6040520;
Tue, 11 Aug 2026 13:36:33 +0000 (UTC)
X-Original-To: u-boot@lists.u-boot-project.org
Delivered-To: u-boot@lists.u-boot-project.org
Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136])
by lists1.osuosl.org (Postfix) with ESMTP id 38B5E259
for <u-boot@lists.u-boot-project.org>; Tue, 11 Aug 2026 13:34:51 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
by smtp3.osuosl.org (Postfix) with ESMTP id 2B001607C7
for <u-boot@lists.u-boot-project.org>; Tue, 11 Aug 2026 13:34:51 +0000 (UTC)
X-Virus-Scanned: amavis at osuosl.org
Received: from smtp3.osuosl.org ([127.0.0.1])
by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP
id eGFQZMQurFKG for <u-boot@lists.u-boot-project.org>;
Tue, 11 Aug 2026 13:34:50 +0000 (UTC)
X-Comment: SPF check N/A for local connections - client-ip=85.214.62.61;
helo=phobos.denx.de; envelope-from=jaipaul.cheernam@est.tech;
receiver=<UNKNOWN>
DMARC-Filter: OpenDMARC Filter v1.4.2 smtp3.osuosl.org DCF5E607BD
DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org DCF5E607BD
Received: from phobos.denx.de (phobos.denx.de [85.214.62.61])
by smtp3.osuosl.org (Postfix) with ESMTPS id DCF5E607BD
for <u-boot@lists.u-boot-project.org>; Tue, 11 Aug 2026 13:34:49 +0000 (UTC)
Received: by phobos.denx.de (Postfix, from userid 109)
id 1444784A30; Tue, 11 Aug 2026 15:34:47 +0200 (CEST)
Received: from MRWPR03CU001.outbound.protection.outlook.com
(mail-francesouthazlp170110003.outbound.protection.outlook.com
[IPv6:2a01:111:f403:c207::3])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
(No client certificate requested)
by phobos.denx.de (Postfix) with ESMTPS id D7A5C849A1
for <u-boot@lists.denx.de>; Tue, 11 Aug 2026 15:34:44 +0200 (CEST)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
b=F/iYm8I1iNna6pUS6fgZzFjCemWpknd0tJi480HHtcO6J5oiHNQHuS8TUlSvhc+RIG6xiOAg2WmQnvfUJCgjWzvLxQdJ8wGHLOg/TvimuL/XDMdwtYzqUN6b4PC3SYhJZk3sRSEZj6+3q5TRszIXJDsKEPqWkQE5oOVP9n1FY9ysY6EsjQMakTDpQ/RpkUkYgn50oLOyLLsDl3H0VSmZGfHqX0QOkwYIW/T8k3Fx/sLrlSiTfKiCPwrdnhwz7ABjlA79EvSU6/TvI/nefnSXeyUhYj0S6rPUadLIvlHFLjaFZ93ldV9COTfx96z44ltNtyAmvkIlMc6g22V3Dv8hAg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
s=arcselector10001;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
bh=cBVuDcRfAz5FmVboiaFLD22qM9rj4tnKRC4LViq6X68=;
b=kO0F3iz0TnoDLl3Fiv7ulw2CObdD+lulFmKuohamR8N6FEc5UzGf7TInNwu6ce7RXGSVuFd7hfaEsq6r/o3PhBgHar8MJtVXKc+dvUPG5YuOV7nTz6qTe9trkJKfQmaFIuzBrRusEp8J4y32eMnjVSFzFXNV2eI9S3+WCoakNjmNFR8JoZWsaeqgxsTl6CGsWOYvktuUErx0GcRg4AgQmZU2EiDiD3VVrXKk+AlQY4GOTcgDJSHsqmrqn/xlr1O+9o2xvoc0RJMvz9upXok7Jo2eNeoty0UCLuSLzfxRnVJJriUkIOxFFdTQjuVzoeQMNSB7k6iXu8tgDwbcBiyzkg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
smtp.mailfrom=est.tech; dmarc=pass action=none header.from=est.tech;
dkim=pass header.d=est.tech; arc=none
Received: from DU7PPF66507B2D7.EURP189.PROD.OUTLOOK.COM (2603:10a6:18:3::ad4)
by VI1P18901MB0623.EURP189.PROD.OUTLOOK.COM (2603:10a6:800:125::14)
with Microsoft SMTP Server (version=TLS1_2,
cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.315.11; Tue, 11 Aug
2026 13:34:41 +0000
Received: from DU7PPF66507B2D7.EURP189.PROD.OUTLOOK.COM
([fe80::7ab2:c6af:6760:5c85]) by DU7PPF66507B2D7.EURP189.PROD.OUTLOOK.COM
([fe80::7ab2:c6af:6760:5c85%7]) with mapi id 15.21.0315.008; Tue, 11 Aug 2026
13:34:41 +0000
From: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
To: u-boot@lists.denx.de
Cc: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
Subject: [PATCH] pylibfdt: Replace removed SWIG Python 2 compatibility macros
Date: Tue, 11 Aug 2026 15:34:33 +0200
Message-Id: <20260811133433.18852-1-jaipaul.cheernam@est.tech>
X-Mailer: git-send-email 2.39.5 (Apple Git-154)
X-ClientProxiedBy: LO4P265CA0183.GBRP265.PROD.OUTLOOK.COM
(2603:10a6:600:311::6) To DU7PPF66507B2D7.EURP189.PROD.OUTLOOK.COM
(2603:10a6:18:3::ad4)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU7PPF66507B2D7:EE_|VI1P18901MB0623:EE_
X-MS-Office365-Filtering-Correlation-Id: 8a2304be-1609-4ac3-d596-08def7ad4c24
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
ARA:13230040|366016|23010399003|376014|1800799024|6133799003|10067099003|56012099006|11063799006|18002099003;
X-Microsoft-Antispam-Message-Info:
ADZCK8hJVm6F3wH0lN+1CH3ycpX/oWr0C7rdxob6unX1/P+tCnAEcRYEgIIPZwnHqbQDW5p6JD2T3EG67ZpnAdgv+1d2HZMQepsfe3LElh3IHx0BPlzA3Vty6psoCgoWs4SMcNTrIVV3UqBrl3s/ttqDI2opVebhHDoAf8Z50f5xlclKz2O8gSMv8FOB9NyfaRUwtlAVgkE428WD6Wia/D/e92aD33o3Z4r2Pz7UzkUhLPLrNeVcSYh94xaUrbMlilcRmFygJWWpgeZsh+7a8kFV/eb42A37qzZ5DcE2yO5PZaA4ckohcSQ2QCA+BnKRUKh3rxkKmCeVglTgdpKg9qvpxmE+Ndzo97z6t8EimCMtdnMQxkDIA6yZiqO7xc2qjdfQ7azC4KZ3h0xq4J04c+HxOzwrQ6t/1IZd0XkN9IrgCyVRhOPL593gaeMD9Iapy4fOTZuQTL6PmUjCMNC7KNiyzyg2gtgWYist7MODeGSDNRUBR3X4hOON3nYYRXl/t+WsxRKhD5ykRF0EUEGh140FdrrFz00eXO6LIIbJUyaf1ud/SBpIw15warKR5ojDTyGUIuhg+toVhwib8/OGuFI5VxDdfgfCPVncMzarvbqXd3nx8r/NAjbPGYY9yKoOEoJ4CVfWa5NbVK3z/aCJlrnBCNTiYc8m29cvV3Ch808=
X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;
IPV:NLI; SFV:NSPM; H:DU7PPF66507B2D7.EURP189.PROD.OUTLOOK.COM; PTR:;
CAT:NONE;
SFS:(13230040)(366016)(23010399003)(376014)(1800799024)(6133799003)(10067099003)(56012099006)(11063799006)(18002099003);
DIR:OUT; SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
v1SJ9iF1FZ4Ddch8PL37hr0CiYoSTtojtB+aom++qNSm/JaqntarQvycHwKOYPL0X3VIS0vCDGJSC3b6gdCPlWLoGPlNDQJYLlTHOfds4mIdrbG5HCQ8X4EoM9uDG/9vWdsUSeRJnh1D8Q1gwPU2JRfArF7684CnJny/jZyepPyTurvWXmjo6skYOwzuRosHH9ZCocSL2xHtHu2N0HirNE+qvbo53SlhzUhQzvvoLlOHVHnSdJDTDRUfPTF3lginIWrs2IzeZkaZIbuV4+/dW5CfSJWX0Y/tHWJZ5Ny7Lbc+uG5kOidZBfaCN8UfKqZ5RTC1dkx0X6BKwkuKC3/unMfJIZAQg8Q5QmhF1uftv3XcyCrH0gNCyyVAl7lLegxBbzWJdGZPbfLh2STTurHhzeJ3hJtClRfwKE03a+TYu+44Ekc0nUdTCdn7Hpf6hnBnTmScp1QWP/toxL70lv4JhkNeZLia+I7vw7Elk6PIK1KWHY2Wlm1sGSiI2jlDnRBpPSDakUhEPWcFI+jz2XzJZ9+sBh/bzsmPqLeH71fS1cDiOyQG5lG0OWoewtDfmk4QE1ViS8UTY6oeE1lL7RNarDf+KoDL75rAwUtJATqdEqfaY1fxnRrVfaawTZIL4jYe56ITk7NiAhZ2aJXJ9WvxvXsu2Q4f+RMBoMuYSuf/B4Eil873iPGk7f9KcFV0F9e7xVcnb6bMZ2xOOxFcuZ/FVblgRYviX75D9uroJan3ZJIBqmgQL1Mq2rfIAMctUIcTYWBg8qFOVymFr22cxfzoD/puCigGWDWKl2bRk8s4WaN7PuznMXOrdvs3d9FMEQfy5oyxE4dpv/527M2l0Lqa5bGEK4y20y7FYfu/js6Ja5t38S1ZgQV3SIEqvAzCHWbYOBgMg/969p32OF20GFx7ZxF+rWXJ5QLbfimyrZ0jw+nuPvaA1BmvtjCgBLM24eIvdJuHhRjEqaCBEGwGutPeikNcxQ2x45eMlXc1OPZymG5DLgq2FMyUyQAoCrZ70YMCO3yNThR+Vfh8qc/qNpl7pLwIqvT7/5x9ZYPBINAjWwOuutEdBTH2D15WAsKB8IcxVMpjpEhaNNAMEEr3qaahViyCwFhx8GZY39yQRdbyb7dweQK/2hPFY/M2TSiGPLbxGIVOxu048L2ePB1ZMCT9v6/7pzft7L9LKOAmj5fj7zMIm9IzfaYRiPbT9KkGvcbOQ85BMLZdw4QJYUpUt9PKf6zxidBmSUfD8WAObbMF8wW9NFRSEeEdh5CMh1lRyEnFsvCFJov8+CJAcK0kYeXjJwcbaDiAKIWGk8MF8lPWIZk/cFpbsetUN6W5LQT+oxa4qttRPpjixTvJFK9i8NUHuPtZzJ0Knv9rt/4VmG7oziwVngajIkj5ByXT21gg1iX8EEqLJznzX5pHeKWV9UAvgm+fmT+zhrgV4LL+ySkPaSSNJz9eBvp3qxU4486MXyw0ISCob64j6LkZ2tYGULV2PF8caUN+J5l1cUu2ySXr7Pt4LyoMKMk/7QEJgUqzxB4T//af1ASXB0//pNSTXgPbo4eCPFtqTkVDD+KxXRJsNyGVmSJGfDE67Y7mF28SQidNW7gguYRcn7DJHFxNm1/Co6kVsDf4Xp9BOQ2HROs67mxZqicBzEqifFMBNigrr4qcA9Qcaqpkewrz9/7zW8TBs/5v6KWQHbMKffzp6PPtnwX/rVrK3VBd8TusgBYky7Q2scVbONq4qDA/ErH5tWob1bBCIPdzl9ngXrCgsknnFHs=
X-OriginatorOrg: est.tech
X-MS-Exchange-CrossTenant-Network-Message-Id:
8a2304be-1609-4ac3-d596-08def7ad4c24
X-MS-Exchange-CrossTenant-AuthSource: DU7PPF66507B2D7.EURP189.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2026 13:34:41.3741 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: d2585e63-66b9-44b6-a76e-4f4b217d97fd
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName:
9S3MTmbV8NoDKIO+2csvXOXSX+h+vv/3+dsv/aYgYwFK6nBqKPXaQTK18nwZ9STbTS8eocOH32TrCptEz96k1m5bWAyhRvMPyQD1xqNBHC4=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1P18901MB0623
X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de
X-Virus-Status: Clean
X-Mailman-Approved-At: Tue, 11 Aug 2026 13:36:32 +0000
X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=est.tech; s=selector1;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
bh=cBVuDcRfAz5FmVboiaFLD22qM9rj4tnKRC4LViq6X68=;
b=pqeWauqz6d5LeBvZqnf0Vhya3rUJMPVJBkYn0KjHe11y8MAnCj2YKA4NsHfxYgJwkrtzBngWWBmMuUwulnTUPfh3czsocU/HiR1U+jCVAcvcPj55A0JETJ4yzxa5edLmeRYJuzsnnkbx/PCnabanIJQNikIQiZPSYzLujjk5w+8uDoqw9b5fy+0DrexXTt4ygBBpl5++UWUu/ZM79h7yIW1OIMNbg9SdLZVbjdgFl1jrxU0e8eJEGgOVWAwAHQ4vChd/Fanm6NkU/8YU99cRqrLXjjOZedJF5ZbuxnLqfQev0dTeHnqf7PnTtRKIXcexkdiggESk1fsx72bytELfag==
X-Mailman-Original-Authentication-Results: smtp3.osuosl.org;
dmarc=none (p=none dis=none)
header.from=est.tech
X-Mailman-Original-Authentication-Results: smtp3.osuosl.org;
spf=fail smtp.mailfrom=est.tech
X-Mailman-Original-Authentication-Results: smtp3.osuosl.org;
dkim=pass (2048-bit key,
unprotected) header.d=est.tech header.i=@est.tech header.a=rsa-sha256
header.s=selector1 header.b=pqeWauqz
X-Mailman-Original-Authentication-Results: phobos.denx.de;
dmarc=none (p=none dis=none)
header.from=est.tech
X-Mailman-Original-Authentication-Results: phobos.denx.de; spf=pass
smtp.mailfrom=jaipaul.cheernam@est.tech
X-Mailman-Original-Authentication-Results: phobos.denx.de;
dkim=pass (2048-bit key;
unprotected) header.d=est.tech header.i=@est.tech header.b="pqeWauqz";
dkim-atps=neutral
X-Mailman-Original-Authentication-Results: dkim=none (message not signed)
header.d=none;dmarc=none action=none header.from=est.tech;
X-BeenThere: u-boot@lists.u-boot-project.org
X-Mailman-Version: 2.1.30
Precedence: list
List-Id: U-Boot discussion <u-boot.lists.u-boot-project.org>
List-Unsubscribe: <https://lists.u-boot-project.org/mailman/options/u-boot>,
<mailto:u-boot-request@lists.u-boot-project.org?subject=unsubscribe>
List-Archive: <http://lists.u-boot-project.org/pipermail/u-boot/>
List-Post: <mailto:u-boot@lists.u-boot-project.org>
List-Help: <mailto:u-boot-request@lists.u-boot-project.org?subject=help>
List-Subscribe: <https://lists.u-boot-project.org/mailman/listinfo/u-boot>,
<mailto:u-boot-request@lists.u-boot-project.org?subject=subscribe>
Errors-To: u-boot-bounces@lists.u-boot-project.org
Sender: "U-Boot" <u-boot-bounces@lists.u-boot-project.org>
SWIG 4.5.0 removed Python 2 compatibility macros (PyInt_*, PyString_*)
from its runtime header pyhead.swg (see commit 79f7a2b7cb7d). Replace
them with their Python 3 C API equivalents:
- PyString_FromString -> PyUnicode_FromString
- PyString_AsString -> PyBytes_AsString
- PyInt_AsLong -> PyLong_AsLong
The replacements are safe since the macros were already aliased to
these exact functions in SWIG's Python 3 code path.
This is a backport of dtc commit 5008d1d6a356 ("pylibfdt: Replace
removed SWIG Python 2 compatibility macros").
Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
Reviewed-by: Jérémie Dautheribes <jeremie.dautheribes@bootlin.com>
Tested-by: Jérémie Dautheribes <jeremie.dautheribes@bootlin.com>
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
---
scripts/dtc/pylibfdt/libfdt.i_shipped | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/scripts/dtc/pylibfdt/libfdt.i_shipped b/scripts/dtc/pylibfdt/libfdt.i_shipped
index e4659489..326a15c7 100644
--- a/scripts/dtc/pylibfdt/libfdt.i_shipped
+++ b/scripts/dtc/pylibfdt/libfdt.i_shipped
@@ -1033,7 +1033,7 @@ typedef uint32_t fdt32_t;
PyObject *buff;
if ($1) {
- resultobj = PyString_FromString(
+ resultobj = PyUnicode_FromString(
fdt_string(fdt1, fdt32_to_cpu($1->nameoff)));
buff = PyByteArray_FromStringAndSize(
(const char *)($1 + 1), fdt32_to_cpu($1->len));
@@ -1064,13 +1064,13 @@ typedef uint32_t fdt32_t;
}
$1 = PyBytes_AsString($input);
%#else
- $1 = PyString_AsString($input); /* char *str */
+ $1 = PyBytes_AsString($input); /* char *str */
%#endif
}
/* typemaps used for fdt_next_node() */
%typemap(in, numinputs=1) int *depth (int depth) {
- depth = (int) PyInt_AsLong($input);
+ depth = (int) PyLong_AsLong($input);
$1 = &depth;
}
+40
View File
@@ -0,0 +1,40 @@
From: Marcelo Alcantara <maralc@gmail.com>
Subject: [PATCH] apple: keep the console silent on Macs
Omarchy boots the Mac to a splash, not a terminal: with CONFIG_SILENT_CONSOLE
the console is muted whenever the 'silent' variable is set, so the default
environment sets it. Only U-Boot is silenced (CONFIG_SILENT_U_BOOT_ONLY);
the kernel command line is untouched.
---
board/apple/mac/mac.env | 1 +
1 file changed, 1 insertion(+)
diff --git a/board/apple/mac/mac.env b/board/apple/mac/mac.env
--- a/board/apple/mac/mac.env
+++ b/board/apple/mac/mac.env
@@ -2,3 +2,4 @@ stdin=serial,usbkbd,spikbd,mtpkbd
stdout=vidconsole,serial
stderr=vidconsole,serial
boot_targets=nvme usb
+silent=1
The banner "U-Boot 2026.07 ..." is announced on the video console after
relocation through console_puts_select(), which never looks at the silent
flag; a silent console stays silent for the banner too.
---
common/console.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/common/console.c b/common/console.c
--- a/common/console.c
+++ b/common/console.c
@@ -1022,6 +1022,9 @@ int console_announce_r(void)
#if !CONFIG_IS_ENABLED(PRE_CONSOLE_BUFFER)
char buf[DISPLAY_OPTIONS_BANNER_LENGTH];
+ if (IS_ENABLED(CONFIG_SILENT_CONSOLE) && (gd->flags & GD_FLG_SILENT))
+ return 0;
+
display_options_get_banner(false, buf, sizeof(buf));
console_puts_select(stdout, false, buf);
@@ -0,0 +1,32 @@
From 72fd4fdb54721a31d2b4e9f95fdd3b3e398bb2c0 Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Sun, 12 Apr 2026 01:14:12 +0100
Subject: [PATCH] board/raspberrypi: Add quirk for RPi5 2Gb rev 1.0
All 2Gb Raspberry Pi 5s use the BCM2712D0 silicon, but
the early boards were still rev 1.0 so we need a quirk
to ensure the correct device tree is used.
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
board/raspberrypi/rpi/rpi.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c
index b0a1484c0fa..ff9cab6521b 100644
--- a/board/raspberrypi/rpi/rpi.c
+++ b/board/raspberrypi/rpi/rpi.c
@@ -371,6 +371,10 @@ static void set_fdtfile(void)
const char *fdtfile;
int rev = revision & 0x0f;
+ /* 2GB Pi 5B board rev 1.0 always has BCM2712D0 silicon */
+ if (revision == 0xb04170)
+ rev = 1;
+
if (env_get("fdtfile"))
return;
--
2.53.0
@@ -0,0 +1,860 @@
From a6909a16b4cc301f1007d9e75d02abb6d06a1ea7 Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Thu, 28 May 2026 21:29:29 +0100
Subject: [PATCH] rockchip: Enable preboot start for pci/usb
Enable the preboot so nvme works OOTB
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
configs/anbernic-rgxx3-rk3566_defconfig | 2 ++
configs/bpi-r2-pro-rk3568_defconfig | 2 ++
configs/cm3588-nas-rk3588_defconfig | 2 ++
configs/coolpi-4b-rk3588s_defconfig | 2 ++
configs/coolpi-cm5-evb-rk3588_defconfig | 2 ++
configs/evb-rk3568_defconfig | 2 ++
configs/evb-rk3588_defconfig | 2 ++
configs/firefly-rk3399_defconfig | 2 ++
configs/generic-rk3568_defconfig | 2 ++
configs/generic-rk3588_defconfig | 2 ++
configs/jaguar-rk3588_defconfig | 2 ++
configs/lubancat-2-rk3568_defconfig | 2 ++
configs/nanopc-t4-rk3399_defconfig | 2 ++
configs/nanopc-t6-rk3588_defconfig | 2 ++
configs/nanopi-r5c-rk3568_defconfig | 2 ++
configs/nanopi-r5s-rk3568_defconfig | 2 ++
configs/nanopi-r6c-rk3588s_defconfig | 2 ++
configs/nanopi-r6s-rk3588s_defconfig | 2 ++
configs/neu6a-io-rk3588_defconfig | 2 ++
configs/neu6b-io-rk3588_defconfig | 2 ++
configs/nova-rk3588s_defconfig | 2 ++
configs/odroid-m1-rk3568_defconfig | 2 ++
configs/odroid-m1s-rk3566_defconfig | 2 ++
configs/odroid-m2-rk3588s_defconfig | 2 ++
configs/orangepi-3b-rk3566_defconfig | 2 ++
configs/orangepi-5-max-rk3588_defconfig | 2 ++
configs/orangepi-5-plus-rk3588_defconfig | 2 ++
configs/orangepi-5-rk3588s_defconfig | 2 ++
configs/orangepi-5-ultra-rk3588_defconfig | 2 ++
configs/pinebook-pro-rk3399_defconfig | 1 +
configs/pinetab2-rk3566_defconfig | 2 ++
configs/powkiddy-x55-rk3566_defconfig | 2 ++
configs/quartz64-a-rk3566_defconfig | 2 ++
configs/quartz64-b-rk3566_defconfig | 4 ++++
configs/quartzpro64-rk3588_defconfig | 2 ++
configs/radxa-cm3-io-rk3566_defconfig | 2 ++
configs/radxa-e25-rk3568_defconfig | 2 ++
configs/radxa-zero-3-rk3566_defconfig | 2 ++
configs/roc-pc-mezzanine-rk3399_defconfig | 2 ++
configs/rock-3a-rk3568_defconfig | 2 ++
configs/rock-3b-rk3568_defconfig | 2 ++
configs/rock-3c-rk3566_defconfig | 2 ++
configs/rock-4c-plus-rk3399_defconfig | 2 ++
configs/rock-4se-rk3399_defconfig | 2 ++
configs/rock-5-itx-rk3588_defconfig | 2 ++
configs/rock-5c-rk3588s_defconfig | 2 ++
configs/rock-pi-4-rk3399_defconfig | 2 ++
configs/rock-pi-4c-rk3399_defconfig | 2 ++
configs/rock-pi-n10-rk3399pro_defconfig | 2 ++
configs/rock5a-rk3588s_defconfig | 2 ++
configs/rock5b-rk3588_defconfig | 2 ++
configs/rock960-rk3399_defconfig | 2 ++
configs/rockpro64-rk3399_defconfig | 2 ++
configs/sige7-rk3588_defconfig | 2 ++
configs/soquartz-blade-rk3566_defconfig | 2 ++
configs/soquartz-cm4-rk3566_defconfig | 2 ++
configs/soquartz-model-a-rk3566_defconfig | 2 ++
configs/tiger-rk3588_defconfig | 2 ++
configs/toybrick-rk3588_defconfig | 2 ++
configs/turing-rk1-rk3588_defconfig | 2 ++
60 files changed, 121 insertions(+)
diff --git a/configs/anbernic-rgxx3-rk3566_defconfig b/configs/anbernic-rgxx3-rk3566_defconfig
index 854de8b00a4..cd91f18ba80 100644
--- a/configs/anbernic-rgxx3-rk3566_defconfig
+++ b/configs/anbernic-rgxx3-rk3566_defconfig
@@ -12,6 +12,8 @@ CONFIG_SYS_LOAD_ADDR=0xc00800
CONFIG_DEBUG_UART_BASE=0xFE660000
CONFIG_DEBUG_UART_CLOCK=24000000
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
# CONFIG_EFI_LOADER is not set
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
diff --git a/configs/bpi-r2-pro-rk3568_defconfig b/configs/bpi-r2-pro-rk3568_defconfig
index c5199a39448..603e07f2456 100644
--- a/configs/bpi-r2-pro-rk3568_defconfig
+++ b/configs/bpi-r2-pro-rk3568_defconfig
@@ -9,6 +9,8 @@ CONFIG_SYS_LOAD_ADDR=0xc00800
CONFIG_DEBUG_UART_BASE=0xFE660000
CONFIG_DEBUG_UART_CLOCK=24000000
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_SPL_FIT_SIGNATURE=y
diff --git a/configs/cm3588-nas-rk3588_defconfig b/configs/cm3588-nas-rk3588_defconfig
index 5b5ef8d5ac1..53147d115dd 100644
--- a/configs/cm3588-nas-rk3588_defconfig
+++ b/configs/cm3588-nas-rk3588_defconfig
@@ -12,6 +12,8 @@ CONFIG_DEBUG_UART_BASE=0xFEB50000
CONFIG_DEBUG_UART_CLOCK=24000000
CONFIG_PCI=y
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_SPL_FIT_SIGNATURE=y
diff --git a/configs/coolpi-4b-rk3588s_defconfig b/configs/coolpi-4b-rk3588s_defconfig
index e6772622403..75e0b373ce9 100644
--- a/configs/coolpi-4b-rk3588s_defconfig
+++ b/configs/coolpi-4b-rk3588s_defconfig
@@ -17,6 +17,8 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y
CONFIG_SPL_SPI=y
CONFIG_PCI=y
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_SPL_FIT_SIGNATURE=y
diff --git a/configs/coolpi-cm5-evb-rk3588_defconfig b/configs/coolpi-cm5-evb-rk3588_defconfig
index 4326e116849..a005e4441d3 100644
--- a/configs/coolpi-cm5-evb-rk3588_defconfig
+++ b/configs/coolpi-cm5-evb-rk3588_defconfig
@@ -17,6 +17,8 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y
CONFIG_SPL_SPI=y
CONFIG_PCI=y
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_SPL_FIT_SIGNATURE=y
diff --git a/configs/evb-rk3568_defconfig b/configs/evb-rk3568_defconfig
index 4a5a7454e10..7ec199a08af 100644
--- a/configs/evb-rk3568_defconfig
+++ b/configs/evb-rk3568_defconfig
@@ -9,6 +9,8 @@ CONFIG_SYS_LOAD_ADDR=0xc00800
CONFIG_DEBUG_UART_BASE=0xFE660000
CONFIG_DEBUG_UART_CLOCK=24000000
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_SPL_FIT_SIGNATURE=y
diff --git a/configs/evb-rk3588_defconfig b/configs/evb-rk3588_defconfig
index c7f6256a626..cfa73c660e7 100644
--- a/configs/evb-rk3588_defconfig
+++ b/configs/evb-rk3588_defconfig
@@ -10,6 +10,8 @@ CONFIG_SYS_LOAD_ADDR=0xc00800
CONFIG_DEBUG_UART_BASE=0xFEB50000
CONFIG_DEBUG_UART_CLOCK=24000000
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_SPL_FIT_SIGNATURE=y
diff --git a/configs/firefly-rk3399_defconfig b/configs/firefly-rk3399_defconfig
index 83b9de5feb9..2ba8f5029c3 100644
--- a/configs/firefly-rk3399_defconfig
+++ b/configs/firefly-rk3399_defconfig
@@ -14,6 +14,8 @@ CONFIG_DEBUG_UART_BASE=0xFF1A0000
CONFIG_DEBUG_UART_CLOCK=24000000
CONFIG_PCI=y
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-firefly.dtb"
CONFIG_DISPLAY_BOARDINFO_LATE=y
CONFIG_SPL_MAX_SIZE=0x40000
diff --git a/configs/generic-rk3568_defconfig b/configs/generic-rk3568_defconfig
index a33c3af9255..20966793568 100644
--- a/configs/generic-rk3568_defconfig
+++ b/configs/generic-rk3568_defconfig
@@ -14,6 +14,8 @@ CONFIG_DEBUG_UART_CLOCK=24000000
CONFIG_SPL_SPI_FLASH_SUPPORT=y
CONFIG_SPL_SPI=y
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_SPL_FIT_SIGNATURE=y
diff --git a/configs/generic-rk3588_defconfig b/configs/generic-rk3588_defconfig
index ac450e6d757..b5424ac9f16 100644
--- a/configs/generic-rk3588_defconfig
+++ b/configs/generic-rk3588_defconfig
@@ -10,6 +10,8 @@ CONFIG_SYS_LOAD_ADDR=0xc00800
CONFIG_DEBUG_UART_BASE=0xFEB50000
CONFIG_DEBUG_UART_CLOCK=24000000
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_SPL_FIT_SIGNATURE=y
diff --git a/configs/jaguar-rk3588_defconfig b/configs/jaguar-rk3588_defconfig
index ed3883b4f9c..47dbd834f30 100644
--- a/configs/jaguar-rk3588_defconfig
+++ b/configs/jaguar-rk3588_defconfig
@@ -16,6 +16,8 @@ CONFIG_DEBUG_UART_BASE=0xfeb50000
CONFIG_DEBUG_UART_CLOCK=24000000
CONFIG_PCI=y
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_SPL_FIT_SIGNATURE=y
diff --git a/configs/lubancat-2-rk3568_defconfig b/configs/lubancat-2-rk3568_defconfig
index 7548bf60b06..2fb8a432503 100644
--- a/configs/lubancat-2-rk3568_defconfig
+++ b/configs/lubancat-2-rk3568_defconfig
@@ -9,6 +9,8 @@ CONFIG_SYS_LOAD_ADDR=0xc00800
CONFIG_DEBUG_UART_BASE=0xFE660000
CONFIG_DEBUG_UART_CLOCK=24000000
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_EFI_VAR_BUF_SIZE=16384
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
diff --git a/configs/nanopc-t4-rk3399_defconfig b/configs/nanopc-t4-rk3399_defconfig
index f8ae436a1ee..7aa8e1a8d42 100644
--- a/configs/nanopc-t4-rk3399_defconfig
+++ b/configs/nanopc-t4-rk3399_defconfig
@@ -15,6 +15,8 @@ CONFIG_DEBUG_UART_BASE=0xFF1A0000
CONFIG_DEBUG_UART_CLOCK=24000000
CONFIG_PCI=y
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-nanopc-t4.dtb"
CONFIG_DISPLAY_BOARDINFO_LATE=y
CONFIG_SPL_MAX_SIZE=0x40000
diff --git a/configs/nanopc-t6-rk3588_defconfig b/configs/nanopc-t6-rk3588_defconfig
index ba9a5adece7..eaf7fa5a0fc 100644
--- a/configs/nanopc-t6-rk3588_defconfig
+++ b/configs/nanopc-t6-rk3588_defconfig
@@ -18,6 +18,8 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y
CONFIG_SPL_SPI=y
CONFIG_PCI=y
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_SPL_FIT_SIGNATURE=y
diff --git a/configs/nanopi-r5c-rk3568_defconfig b/configs/nanopi-r5c-rk3568_defconfig
index e75a24dadc8..159ef033932 100644
--- a/configs/nanopi-r5c-rk3568_defconfig
+++ b/configs/nanopi-r5c-rk3568_defconfig
@@ -11,6 +11,8 @@ CONFIG_DEBUG_UART_BASE=0xFE660000
CONFIG_DEBUG_UART_CLOCK=24000000
CONFIG_PCI=y
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="usb start;"
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_SPL_FIT_SIGNATURE=y
diff --git a/configs/nanopi-r5s-rk3568_defconfig b/configs/nanopi-r5s-rk3568_defconfig
index c971f376b38..60b5e8fa014 100644
--- a/configs/nanopi-r5s-rk3568_defconfig
+++ b/configs/nanopi-r5s-rk3568_defconfig
@@ -11,6 +11,8 @@ CONFIG_DEBUG_UART_BASE=0xFE660000
CONFIG_DEBUG_UART_CLOCK=24000000
CONFIG_PCI=y
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="usb start;"
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_SPL_FIT_SIGNATURE=y
diff --git a/configs/nanopi-r6c-rk3588s_defconfig b/configs/nanopi-r6c-rk3588s_defconfig
index 861e3234d29..bb6e2082e3b 100644
--- a/configs/nanopi-r6c-rk3588s_defconfig
+++ b/configs/nanopi-r6c-rk3588s_defconfig
@@ -12,6 +12,8 @@ CONFIG_DEBUG_UART_BASE=0xFEB50000
CONFIG_DEBUG_UART_CLOCK=24000000
CONFIG_PCI=y
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_SPL_FIT_SIGNATURE=y
diff --git a/configs/nanopi-r6s-rk3588s_defconfig b/configs/nanopi-r6s-rk3588s_defconfig
index 743dfca441b..903ec56ad6f 100644
--- a/configs/nanopi-r6s-rk3588s_defconfig
+++ b/configs/nanopi-r6s-rk3588s_defconfig
@@ -12,6 +12,8 @@ CONFIG_DEBUG_UART_BASE=0xFEB50000
CONFIG_DEBUG_UART_CLOCK=24000000
CONFIG_PCI=y
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_SPL_FIT_SIGNATURE=y
diff --git a/configs/neu6a-io-rk3588_defconfig b/configs/neu6a-io-rk3588_defconfig
index 19f129e96f0..08ed699b01d 100644
--- a/configs/neu6a-io-rk3588_defconfig
+++ b/configs/neu6a-io-rk3588_defconfig
@@ -10,6 +10,8 @@ CONFIG_SYS_LOAD_ADDR=0xc00800
CONFIG_DEBUG_UART_BASE=0xFEB50000
CONFIG_DEBUG_UART_CLOCK=24000000
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_SPL_FIT_SIGNATURE=y
diff --git a/configs/neu6b-io-rk3588_defconfig b/configs/neu6b-io-rk3588_defconfig
index 2cf5aeccf51..8cafd779a1c 100644
--- a/configs/neu6b-io-rk3588_defconfig
+++ b/configs/neu6b-io-rk3588_defconfig
@@ -10,6 +10,8 @@ CONFIG_SYS_LOAD_ADDR=0xc00800
CONFIG_DEBUG_UART_BASE=0xFEB50000
CONFIG_DEBUG_UART_CLOCK=24000000
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_SPL_FIT_SIGNATURE=y
diff --git a/configs/nova-rk3588s_defconfig b/configs/nova-rk3588s_defconfig
index f7d7492ff46..5abb6ebbe18 100644
--- a/configs/nova-rk3588s_defconfig
+++ b/configs/nova-rk3588s_defconfig
@@ -11,6 +11,8 @@ CONFIG_DEBUG_UART_BASE=0xFEB50000
CONFIG_DEBUG_UART_CLOCK=24000000
CONFIG_PCI=y
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_SPL_FIT_SIGNATURE=y
diff --git a/configs/odroid-m1-rk3568_defconfig b/configs/odroid-m1-rk3568_defconfig
index b00985b0405..19d7af53c7f 100644
--- a/configs/odroid-m1-rk3568_defconfig
+++ b/configs/odroid-m1-rk3568_defconfig
@@ -17,6 +17,8 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y
CONFIG_SPL_SPI=y
CONFIG_PCI=y
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_SPL_FIT_SIGNATURE=y
diff --git a/configs/odroid-m1s-rk3566_defconfig b/configs/odroid-m1s-rk3566_defconfig
index d59882a2a59..20f6dc3c26e 100644
--- a/configs/odroid-m1s-rk3566_defconfig
+++ b/configs/odroid-m1s-rk3566_defconfig
@@ -11,6 +11,8 @@ CONFIG_DEBUG_UART_BASE=0xFE660000
CONFIG_DEBUG_UART_CLOCK=24000000
CONFIG_PCI=y
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_SPL_FIT_SIGNATURE=y
diff --git a/configs/odroid-m2-rk3588s_defconfig b/configs/odroid-m2-rk3588s_defconfig
index e71e61ddb0b..561c2b28b7a 100644
--- a/configs/odroid-m2-rk3588s_defconfig
+++ b/configs/odroid-m2-rk3588s_defconfig
@@ -11,6 +11,8 @@ CONFIG_DEBUG_UART_BASE=0xFEB50000
CONFIG_DEBUG_UART_CLOCK=24000000
CONFIG_PCI=y
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_SPL_FIT_SIGNATURE=y
diff --git a/configs/orangepi-3b-rk3566_defconfig b/configs/orangepi-3b-rk3566_defconfig
index 1cd78789fa1..dcf182231da 100644
--- a/configs/orangepi-3b-rk3566_defconfig
+++ b/configs/orangepi-3b-rk3566_defconfig
@@ -18,6 +18,8 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y
CONFIG_SPL_SPI=y
CONFIG_PCI=y
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_SPL_FIT_SIGNATURE=y
diff --git a/configs/orangepi-5-max-rk3588_defconfig b/configs/orangepi-5-max-rk3588_defconfig
index 0861df962cf..744aad89c4a 100644
--- a/configs/orangepi-5-max-rk3588_defconfig
+++ b/configs/orangepi-5-max-rk3588_defconfig
@@ -18,6 +18,8 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y
CONFIG_SPL_SPI=y
CONFIG_PCI=y
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_SPL_FIT_SIGNATURE=y
diff --git a/configs/orangepi-5-plus-rk3588_defconfig b/configs/orangepi-5-plus-rk3588_defconfig
index 52523f87aec..e3bb4e43da9 100644
--- a/configs/orangepi-5-plus-rk3588_defconfig
+++ b/configs/orangepi-5-plus-rk3588_defconfig
@@ -18,6 +18,8 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y
CONFIG_SPL_SPI=y
CONFIG_PCI=y
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_SPL_FIT_SIGNATURE=y
diff --git a/configs/orangepi-5-rk3588s_defconfig b/configs/orangepi-5-rk3588s_defconfig
index e0eba389289..33fe68add7b 100644
--- a/configs/orangepi-5-rk3588s_defconfig
+++ b/configs/orangepi-5-rk3588s_defconfig
@@ -17,6 +17,8 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y
CONFIG_SPL_SPI=y
CONFIG_PCI=y
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_SPL_FIT_SIGNATURE=y
diff --git a/configs/orangepi-5-ultra-rk3588_defconfig b/configs/orangepi-5-ultra-rk3588_defconfig
index fb7f4432983..62419609695 100644
--- a/configs/orangepi-5-ultra-rk3588_defconfig
+++ b/configs/orangepi-5-ultra-rk3588_defconfig
@@ -18,6 +18,8 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y
CONFIG_SPL_SPI=y
CONFIG_PCI=y
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_SPL_FIT_SIGNATURE=y
diff --git a/configs/pinebook-pro-rk3399_defconfig b/configs/pinebook-pro-rk3399_defconfig
index cbf95b4692f..9e4d1b1061d 100644
--- a/configs/pinebook-pro-rk3399_defconfig
+++ b/configs/pinebook-pro-rk3399_defconfig
@@ -22,6 +22,7 @@ CONFIG_PCI=y
CONFIG_DEBUG_UART=y
CONFIG_BOOTDELAY=3
CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-pinebook-pro.dtb"
CONFIG_DISPLAY_BOARDINFO_LATE=y
CONFIG_SPL_MAX_SIZE=0x40000
diff --git a/configs/pinetab2-rk3566_defconfig b/configs/pinetab2-rk3566_defconfig
index f284dadb99d..d87849f0a45 100644
--- a/configs/pinetab2-rk3566_defconfig
+++ b/configs/pinetab2-rk3566_defconfig
@@ -18,6 +18,8 @@ CONFIG_DEBUG_UART_CLOCK=24000000
CONFIG_SPL_SPI_FLASH_SUPPORT=y
CONFIG_SPL_SPI=y
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_SPL_FIT_SIGNATURE=y
diff --git a/configs/powkiddy-x55-rk3566_defconfig b/configs/powkiddy-x55-rk3566_defconfig
index 37a359c91a9..70bc5ab6402 100644
--- a/configs/powkiddy-x55-rk3566_defconfig
+++ b/configs/powkiddy-x55-rk3566_defconfig
@@ -9,6 +9,8 @@ CONFIG_SYS_LOAD_ADDR=0xc00800
CONFIG_DEBUG_UART_BASE=0xFE660000
CONFIG_DEBUG_UART_CLOCK=24000000
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_SPL_FIT_SIGNATURE=y
diff --git a/configs/quartz64-a-rk3566_defconfig b/configs/quartz64-a-rk3566_defconfig
index 780fd581f0a..7938b5c0d1b 100644
--- a/configs/quartz64-a-rk3566_defconfig
+++ b/configs/quartz64-a-rk3566_defconfig
@@ -18,6 +18,8 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y
CONFIG_SPL_SPI=y
CONFIG_PCI=y
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_SPL_FIT_SIGNATURE=y
diff --git a/configs/quartz64-b-rk3566_defconfig b/configs/quartz64-b-rk3566_defconfig
index 4d92a67cd73..fe8a168373d 100644
--- a/configs/quartz64-b-rk3566_defconfig
+++ b/configs/quartz64-b-rk3566_defconfig
@@ -1,4 +1,6 @@
CONFIG_ARM=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_SKIP_LOWLEVEL_INIT=y
CONFIG_COUNTER_FREQUENCY=24000000
CONFIG_ARCH_ROCKCHIP=y
@@ -17,6 +19,8 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y
CONFIG_SPL_SPI=y
CONFIG_PCI=y
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_SPL_FIT_SIGNATURE=y
diff --git a/configs/quartzpro64-rk3588_defconfig b/configs/quartzpro64-rk3588_defconfig
index 0ad74e8bbef..b9cbddfae77 100644
--- a/configs/quartzpro64-rk3588_defconfig
+++ b/configs/quartzpro64-rk3588_defconfig
@@ -12,6 +12,8 @@ CONFIG_DEBUG_UART_BASE=0xFEB50000
CONFIG_DEBUG_UART_CLOCK=24000000
CONFIG_PCI=y
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_SPL_FIT_SIGNATURE=y
diff --git a/configs/radxa-cm3-io-rk3566_defconfig b/configs/radxa-cm3-io-rk3566_defconfig
index 875f0b76fa5..2523dccd6a3 100644
--- a/configs/radxa-cm3-io-rk3566_defconfig
+++ b/configs/radxa-cm3-io-rk3566_defconfig
@@ -9,6 +9,8 @@ CONFIG_SYS_LOAD_ADDR=0xc00800
CONFIG_DEBUG_UART_BASE=0xFE660000
CONFIG_DEBUG_UART_CLOCK=24000000
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_SPL_FIT_SIGNATURE=y
diff --git a/configs/radxa-e25-rk3568_defconfig b/configs/radxa-e25-rk3568_defconfig
index 779d540e22d..7e003e74520 100644
--- a/configs/radxa-e25-rk3568_defconfig
+++ b/configs/radxa-e25-rk3568_defconfig
@@ -11,6 +11,8 @@ CONFIG_DEBUG_UART_BASE=0xFE660000
CONFIG_DEBUG_UART_CLOCK=24000000
CONFIG_PCI=y
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_SPL_FIT_SIGNATURE=y
diff --git a/configs/radxa-zero-3-rk3566_defconfig b/configs/radxa-zero-3-rk3566_defconfig
index f5cf09a5e4a..7db7e3fcd3d 100644
--- a/configs/radxa-zero-3-rk3566_defconfig
+++ b/configs/radxa-zero-3-rk3566_defconfig
@@ -11,6 +11,8 @@ CONFIG_SYS_LOAD_ADDR=0xc00800
CONFIG_DEBUG_UART_BASE=0xFE660000
CONFIG_DEBUG_UART_CLOCK=24000000
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_SPL_FIT_SIGNATURE=y
diff --git a/configs/roc-pc-mezzanine-rk3399_defconfig b/configs/roc-pc-mezzanine-rk3399_defconfig
index 8b4d8c1b0aa..54baa07aeae 100644
--- a/configs/roc-pc-mezzanine-rk3399_defconfig
+++ b/configs/roc-pc-mezzanine-rk3399_defconfig
@@ -21,6 +21,8 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y
CONFIG_SPL_SPI=y
CONFIG_PCI=y
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
# CONFIG_ANDROID_BOOT_IMAGE is not set
CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-roc-pc-mezzanine.dtb"
CONFIG_DISPLAY_BOARDINFO_LATE=y
diff --git a/configs/rock-3a-rk3568_defconfig b/configs/rock-3a-rk3568_defconfig
index e753185610f..19d303e7f70 100644
--- a/configs/rock-3a-rk3568_defconfig
+++ b/configs/rock-3a-rk3568_defconfig
@@ -16,6 +16,8 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y
CONFIG_SPL_SPI=y
CONFIG_PCI=y
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_SPL_FIT_SIGNATURE=y
diff --git a/configs/rock-3b-rk3568_defconfig b/configs/rock-3b-rk3568_defconfig
index c3bf48b9e34..0cfa8eba168 100644
--- a/configs/rock-3b-rk3568_defconfig
+++ b/configs/rock-3b-rk3568_defconfig
@@ -16,6 +16,8 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y
CONFIG_SPL_SPI=y
CONFIG_PCI=y
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_SPL_FIT_SIGNATURE=y
diff --git a/configs/rock-3c-rk3566_defconfig b/configs/rock-3c-rk3566_defconfig
index 417aa33a663..61d0e1b8c6a 100644
--- a/configs/rock-3c-rk3566_defconfig
+++ b/configs/rock-3c-rk3566_defconfig
@@ -16,6 +16,8 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y
CONFIG_SPL_SPI=y
CONFIG_PCI=y
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_SPL_FIT_SIGNATURE=y
diff --git a/configs/rock-4c-plus-rk3399_defconfig b/configs/rock-4c-plus-rk3399_defconfig
index 0f6bdfdfb06..f31cb061a83 100644
--- a/configs/rock-4c-plus-rk3399_defconfig
+++ b/configs/rock-4c-plus-rk3399_defconfig
@@ -17,6 +17,8 @@ CONFIG_DEBUG_UART_CLOCK=24000000
CONFIG_SPL_SPI_FLASH_SUPPORT=y
CONFIG_SPL_SPI=y
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_EFI_CAPSULE_ON_DISK=y
CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y
# CONFIG_ANDROID_BOOT_IMAGE is not set
diff --git a/configs/rock-4se-rk3399_defconfig b/configs/rock-4se-rk3399_defconfig
index 7f22aede912..caf8e02bece 100644
--- a/configs/rock-4se-rk3399_defconfig
+++ b/configs/rock-4se-rk3399_defconfig
@@ -18,6 +18,8 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y
CONFIG_SPL_SPI=y
CONFIG_PCI=y
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_EFI_CAPSULE_ON_DISK=y
CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y
# CONFIG_ANDROID_BOOT_IMAGE is not set
diff --git a/configs/rock-5-itx-rk3588_defconfig b/configs/rock-5-itx-rk3588_defconfig
index cb014de4188..e26a126533c 100644
--- a/configs/rock-5-itx-rk3588_defconfig
+++ b/configs/rock-5-itx-rk3588_defconfig
@@ -18,6 +18,8 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y
CONFIG_SPL_SPI=y
CONFIG_PCI=y
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_SPL_FIT_SIGNATURE=y
diff --git a/configs/rock-5c-rk3588s_defconfig b/configs/rock-5c-rk3588s_defconfig
index 3d044a81498..27234c250d1 100644
--- a/configs/rock-5c-rk3588s_defconfig
+++ b/configs/rock-5c-rk3588s_defconfig
@@ -12,6 +12,8 @@ CONFIG_DEBUG_UART_BASE=0xFEB50000
CONFIG_DEBUG_UART_CLOCK=24000000
CONFIG_PCI=y
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_SPL_FIT_SIGNATURE=y
diff --git a/configs/rock-pi-4-rk3399_defconfig b/configs/rock-pi-4-rk3399_defconfig
index e5c9072c27f..35852c017da 100644
--- a/configs/rock-pi-4-rk3399_defconfig
+++ b/configs/rock-pi-4-rk3399_defconfig
@@ -18,6 +18,8 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y
CONFIG_SPL_SPI=y
CONFIG_PCI=y
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_EFI_CAPSULE_ON_DISK=y
CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y
# CONFIG_ANDROID_BOOT_IMAGE is not set
diff --git a/configs/rock-pi-4c-rk3399_defconfig b/configs/rock-pi-4c-rk3399_defconfig
index 4be7b0f8130..eeee446a5bd 100644
--- a/configs/rock-pi-4c-rk3399_defconfig
+++ b/configs/rock-pi-4c-rk3399_defconfig
@@ -18,6 +18,8 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y
CONFIG_SPL_SPI=y
CONFIG_PCI=y
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_EFI_CAPSULE_ON_DISK=y
CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y
# CONFIG_ANDROID_BOOT_IMAGE is not set
diff --git a/configs/rock-pi-n10-rk3399pro_defconfig b/configs/rock-pi-n10-rk3399pro_defconfig
index 602a723ea7d..3dcc2932ae3 100644
--- a/configs/rock-pi-n10-rk3399pro_defconfig
+++ b/configs/rock-pi-n10-rk3399pro_defconfig
@@ -13,6 +13,8 @@ CONFIG_DEBUG_UART_BASE=0xFF1A0000
CONFIG_DEBUG_UART_CLOCK=24000000
CONFIG_PCI=y
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
# CONFIG_ANDROID_BOOT_IMAGE is not set
CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399pro-rock-pi-n10.dtb"
# CONFIG_CONSOLE_MUX is not set
diff --git a/configs/rock5a-rk3588s_defconfig b/configs/rock5a-rk3588s_defconfig
index 24b2eef35f2..c5830054921 100644
--- a/configs/rock5a-rk3588s_defconfig
+++ b/configs/rock5a-rk3588s_defconfig
@@ -10,6 +10,8 @@ CONFIG_SYS_LOAD_ADDR=0xc00800
CONFIG_DEBUG_UART_BASE=0xFEB50000
CONFIG_DEBUG_UART_CLOCK=24000000
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_SPL_FIT_SIGNATURE=y
diff --git a/configs/rock5b-rk3588_defconfig b/configs/rock5b-rk3588_defconfig
index da5fb3a2c30..053346fc035 100644
--- a/configs/rock5b-rk3588_defconfig
+++ b/configs/rock5b-rk3588_defconfig
@@ -18,6 +18,8 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y
CONFIG_SPL_SPI=y
CONFIG_PCI=y
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_SPL_FIT_SIGNATURE=y
diff --git a/configs/rock960-rk3399_defconfig b/configs/rock960-rk3399_defconfig
index db121f03ae6..e55f1b6a034 100644
--- a/configs/rock960-rk3399_defconfig
+++ b/configs/rock960-rk3399_defconfig
@@ -12,6 +12,8 @@ CONFIG_DEBUG_UART_BASE=0xFF1A0000
CONFIG_DEBUG_UART_CLOCK=24000000
CONFIG_PCI=y
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-rock960.dtb"
CONFIG_SYS_PBSIZE=1052
CONFIG_DISPLAY_BOARDINFO_LATE=y
diff --git a/configs/rockpro64-rk3399_defconfig b/configs/rockpro64-rk3399_defconfig
index 1d2bff35fc0..ea8e90b9f6a 100644
--- a/configs/rockpro64-rk3399_defconfig
+++ b/configs/rockpro64-rk3399_defconfig
@@ -20,6 +20,8 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y
CONFIG_SPL_SPI=y
CONFIG_PCI=y
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-rockpro64.dtb"
CONFIG_DISPLAY_BOARDINFO_LATE=y
CONFIG_SPL_MAX_SIZE=0x40000
diff --git a/configs/sige7-rk3588_defconfig b/configs/sige7-rk3588_defconfig
index 00b9759715b..1b837bd554c 100644
--- a/configs/sige7-rk3588_defconfig
+++ b/configs/sige7-rk3588_defconfig
@@ -13,6 +13,8 @@ CONFIG_DEBUG_UART_CLOCK=24000000
CONFIG_SPL_SPI=y
CONFIG_PCI=y
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_SPL_FIT_SIGNATURE=y
diff --git a/configs/soquartz-blade-rk3566_defconfig b/configs/soquartz-blade-rk3566_defconfig
index 7de159a8881..4137f0459b5 100644
--- a/configs/soquartz-blade-rk3566_defconfig
+++ b/configs/soquartz-blade-rk3566_defconfig
@@ -11,6 +11,8 @@ CONFIG_DEBUG_UART_BASE=0xFE660000
CONFIG_DEBUG_UART_CLOCK=24000000
CONFIG_PCI=y
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_SPL_FIT_SIGNATURE=y
diff --git a/configs/soquartz-cm4-rk3566_defconfig b/configs/soquartz-cm4-rk3566_defconfig
index 4455ee5b5aa..ad63ba0204f 100644
--- a/configs/soquartz-cm4-rk3566_defconfig
+++ b/configs/soquartz-cm4-rk3566_defconfig
@@ -11,6 +11,8 @@ CONFIG_DEBUG_UART_BASE=0xFE660000
CONFIG_DEBUG_UART_CLOCK=24000000
CONFIG_PCI=y
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_SPL_FIT_SIGNATURE=y
diff --git a/configs/soquartz-model-a-rk3566_defconfig b/configs/soquartz-model-a-rk3566_defconfig
index abdab514496..9e01345bdaa 100644
--- a/configs/soquartz-model-a-rk3566_defconfig
+++ b/configs/soquartz-model-a-rk3566_defconfig
@@ -11,6 +11,8 @@ CONFIG_DEBUG_UART_BASE=0xFE660000
CONFIG_DEBUG_UART_CLOCK=24000000
CONFIG_PCI=y
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_SPL_FIT_SIGNATURE=y
diff --git a/configs/tiger-rk3588_defconfig b/configs/tiger-rk3588_defconfig
index 105e8e10e0b..bcc2ae302a5 100644
--- a/configs/tiger-rk3588_defconfig
+++ b/configs/tiger-rk3588_defconfig
@@ -17,6 +17,8 @@ CONFIG_DEBUG_UART_CLOCK=24000000
# CONFIG_DEBUG_UART_BOARD_INIT is not set
CONFIG_PCI=y
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_SPL_FIT_SIGNATURE=y
diff --git a/configs/toybrick-rk3588_defconfig b/configs/toybrick-rk3588_defconfig
index 14b231ae3e2..7af393731cd 100644
--- a/configs/toybrick-rk3588_defconfig
+++ b/configs/toybrick-rk3588_defconfig
@@ -10,6 +10,8 @@ CONFIG_SYS_LOAD_ADDR=0xc00800
CONFIG_DEBUG_UART_BASE=0xFEB50000
CONFIG_DEBUG_UART_CLOCK=24000000
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_SPL_FIT_SIGNATURE=y
diff --git a/configs/turing-rk1-rk3588_defconfig b/configs/turing-rk1-rk3588_defconfig
index 0b3efec23e6..515db2a2b0c 100644
--- a/configs/turing-rk1-rk3588_defconfig
+++ b/configs/turing-rk1-rk3588_defconfig
@@ -12,6 +12,8 @@ CONFIG_DEBUG_UART_BASE=0xFEBC0000
CONFIG_DEBUG_UART_CLOCK=24000000
CONFIG_PCI=y
CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="pci enum; usb start; nvme scan;"
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_SPL_FIT_SIGNATURE=y
--
2.54.0
@@ -0,0 +1,39 @@
From aef38432fbc93621b434836b95b10c28aa880e84 Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Tue, 9 Dec 2025 20:51:06 +0000
Subject: [PATCH 1/2] rockchip: rk3568-nanopi-r5: Drop duplicated/extra sdhci
The pinctrl settings are now upstream, with the upstream
voltage supplies, and the HS200 mode is confirmed to work
fine but the HS400 mode had reported issues so let's just
consume what the upstream DT has now as it's all known good.
Reported-by: Dusty Mabe <dusty@dustymabe.com>
Tested-by: Dusty Mabe <dusty@dustymabe.com>
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
arch/arm/dts/rk3568-nanopi-r5s-u-boot.dtsi | 8 --------
1 file changed, 8 deletions(-)
diff --git a/arch/arm/dts/rk3568-nanopi-r5s-u-boot.dtsi b/arch/arm/dts/rk3568-nanopi-r5s-u-boot.dtsi
index 64c43374c04..7e24be1a5e7 100644
--- a/arch/arm/dts/rk3568-nanopi-r5s-u-boot.dtsi
+++ b/arch/arm/dts/rk3568-nanopi-r5s-u-boot.dtsi
@@ -12,14 +12,6 @@
/delete-property/ vpcie3v3-supply;
};
-&sdhci {
- cap-mmc-highspeed;
- mmc-hs200-1_8v;
- mmc-hs400-1_8v;
- mmc-hs400-enhanced-strobe;
- pinctrl-0 = <&emmc_bus8 &emmc_clk &emmc_cmd &emmc_datastrobe>;
-};
-
&vcc5v0_usb_host {
/delete-property/ regulator-always-on;
/delete-property/ regulator-boot-on;
--
2.52.0
@@ -0,0 +1,33 @@
From 29efc0396809384cf37bfcfb01c62e63216fa998 Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Tue, 9 Dec 2025 21:13:46 +0000
Subject: [PATCH 2/2] rockchip: rk356x: Stop overriding sdhci/mmc aliases
Upstream device tree has rules where the aliases are board
specific settings, no SoC settings. Looking at upstream
rk356x boards there's a lot of variation in the setting of
mmc0/mmc1 based on the device so we should not be overriding
this here and now we sync to upstream we should just consume
those settings, to do otherwise confuses users.
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
arch/arm/dts/rk356x-u-boot.dtsi | 2 --
1 file changed, 2 deletions(-)
diff --git a/arch/arm/dts/rk356x-u-boot.dtsi b/arch/arm/dts/rk356x-u-boot.dtsi
index 738b9673d35..f25c7970208 100644
--- a/arch/arm/dts/rk356x-u-boot.dtsi
+++ b/arch/arm/dts/rk356x-u-boot.dtsi
@@ -7,8 +7,6 @@
/ {
aliases {
- mmc0 = &sdhci;
- mmc1 = &sdmmc0;
spi4 = &sfc;
};
--
2.52.0
@@ -0,0 +1,57 @@
From 86782e882e9542f5f402e00cd87efb36ad0552d3 Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Sat, 2 Mar 2024 11:17:42 +0000
Subject: [PATCH v4] disk: dos: Add all options for EFI System Partitions
The EFI spec states that the ESP can be any of FAT12/16/32 but for
compatibility doesn't necssarily require the partition to be the
EFI partition table ID of 0xef. A number of arm devices will not
find their firmware on a FAT partition with an ID of 0xef so also
allow the original FAT12/16/32 partition IDs as they are also
permissable for an ESP.
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
v2:
- Add 0x0c option
- Make hex constants consistent
- Move from if to switch statement
v3:
- Fix switch brain fart
v4:
- Drop boot_ind out of switch
disk/part_dos.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/disk/part_dos.c b/disk/part_dos.c
index 567ead7511d..a35181dff4f 100644
--- a/disk/part_dos.c
+++ b/disk/part_dos.c
@@ -40,10 +40,21 @@ static int get_bootable(dos_partition_t *p)
{
int ret = 0;
- if (p->sys_ind == 0xef)
+ switch (p->sys_ind) {
+ case 0x01:
+ case 0x06:
+ case 0x0b:
+ case 0x0c:
+ case 0xef:
ret |= PART_EFI_SYSTEM_PARTITION;
+ break;
+ default:
+ break;
+ }
+
if (p->boot_ind == 0x80)
ret |= PART_BOOTABLE;
+
return ret;
}
--
2.44.0
@@ -0,0 +1,87 @@
From 4306c538d4a00dd1aa46c55c3c4005c2b0bf7cd5 Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Thu, 24 Nov 2022 12:57:55 +0000
Subject: [PATCH] distro: load FDT from any partition on boot device
In the EFI_LOADER boot path, we were only checking the FAT partition
containing the EFI payload for dtb files. But this is somewhat of a
fiction. In reality there will be one small (V)FAT partition containing
grub (or whatever the payload may be), and a second boot partition
containing kernel/initrd/fdt (typically ext4). It is this second
partition where we should be looking for a FDT to load.
So instead scan all the partitions of the disk containing the EFI
payload. This matches where grub looks for kernel/initrd (barring
custom grub.cfg, in which case the user can use grub's 'devicetree'
command to load the correct FDT).
The other option is somehow passing the ${fdtfile} to grub so that it
can load the FDT based on selected kernel version location (which grub
knows) and SoC/board specific ${fdtfile} (which grub does not know).
Signed-off-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
include/config_distro_bootcmd.h | 37 +++++++++++++++++++++------------
1 file changed, 24 insertions(+), 13 deletions(-)
diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h
index fcb319a20ae..e71004fad9c 100644
--- a/include/config_distro_bootcmd.h
+++ b/include/config_distro_bootcmd.h
@@ -155,28 +155,39 @@
"fi\0" \
\
"load_efi_dtb=" \
- "load ${devtype} ${devnum}:${distro_bootpart} " \
- "${fdt_addr_r} ${prefix}${efi_fdtfile}\0" \
+ "load ${devtype} ${devnum}:${dtb_devp} " \
+ "${fdt_addr_r} ${prefix}${efi_fdtfile} && " \
+ "run boot_efi_binary\0" \
\
"efi_dtb_prefixes=/ /dtb/ /dtb/current/\0" \
- "scan_dev_for_efi=" \
+ "scan_dev_for_dtb=" \
"setenv efi_fdtfile ${fdtfile}; " \
BOOTENV_EFI_SET_FDTFILE_FALLBACK \
BOOTENV_RUN_EXTENSION_INIT \
- "for prefix in ${efi_dtb_prefixes}; do " \
- "if test -e ${devtype} " \
- "${devnum}:${distro_bootpart} " \
- "${prefix}${efi_fdtfile}; then " \
- "run load_efi_dtb; " \
- BOOTENV_RUN_EXTENSION_APPLY \
- "fi;" \
- "done;" \
- "run boot_efi_bootmgr;" \
+ "part list ${devtype} ${devnum} dtb_devplist; " \
+ "env exists dtb_devplist || setenv dtb_devplist " \
+ "${distro_bootpart}; " \
+ "for dtb_devp in ${dtb_devplist}; do " \
+ "for prefix in ${efi_dtb_prefixes}; do " \
+ "if test -e ${devtype} " \
+ "${devnum}:${dtb_devp} " \
+ "${prefix}${efi_fdtfile};"\
+ " then " \
+ "echo Found DTB ${devtype} " \
+ "${devnum}:${dtb_devp} " \
+ "${prefix}${efi_fdtfile};"\
+ "run load_efi_dtb; " \
+ BOOTENV_RUN_EXTENSION_APPLY \
+ "fi;" \
+ "done; " \
+ "done; " \
+ "run boot_efi_binary\0" \
+ "scan_dev_for_efi=" \
"if test -e ${devtype} ${devnum}:${distro_bootpart} " \
"efi/boot/"BOOTEFI_NAME"; then " \
"echo Found EFI removable media binary " \
"efi/boot/"BOOTEFI_NAME"; " \
- "run boot_efi_binary; " \
+ "run scan_dev_for_dtb; " \
"echo EFI LOAD FAILED: continuing...; " \
"fi; " \
"setenv efi_fdtfile\0"
--
2.38.1
@@ -0,0 +1,33 @@
From fd736dd720b29fa69a4bb87492f3f94dc6076996 Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Tue, 25 Mar 2025 17:13:44 +0000
Subject: [PATCH] efi: enable SetVariableRT with volotile storage
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
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
@@ -0,0 +1,82 @@
From 7eabab2fda12b7a4417e5c7f29a507dfa9e7fffd Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Sun, 3 May 2026 09:24:34 +0100
Subject: [PATCH] enable https boot by default
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
cmd/Kconfig | 1 +
lib/efi_loader/Kconfig | 1 +
lib/mbedtls/Kconfig | 3 ++-
net/Kconfig | 3 ++-
4 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/cmd/Kconfig b/cmd/Kconfig
index c71c6824a19..8ff14adffe1 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -2289,6 +2289,7 @@ config CMD_WGET
config WGET_HTTPS
bool "wget https"
+ default y
depends on CMD_WGET
depends on PROT_TCP_LWIP
depends on MBEDTLS_LIB
diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig
index 4cb13ae7c8a..20733429962 100644
--- a/lib/efi_loader/Kconfig
+++ b/lib/efi_loader/Kconfig
@@ -609,6 +609,7 @@ config EFI_BOOTMGR
config EFI_HTTP_BOOT
bool "EFI HTTP Boot support"
+ default y
depends on NET
depends on CMDLINE
select CMD_NET
diff --git a/lib/mbedtls/Kconfig b/lib/mbedtls/Kconfig
index 789721ee6cd..7a241c2bc26 100644
--- a/lib/mbedtls/Kconfig
+++ b/lib/mbedtls/Kconfig
@@ -2,7 +2,7 @@
choice
prompt "Crypto libraries (U-Boot Proper)"
- default LEGACY_HASHING_AND_CRYPTO
+ default MBEDTLS_LIB
help
Select crypto libraries.
LEGACY_HASHING_AND_CRYPTO for legacy crypto libraries,
@@ -15,6 +15,7 @@ config LEGACY_HASHING_AND_CRYPTO
config MBEDTLS_LIB
bool "MbedTLS libraries"
+ default y
select MBEDTLS_LIB_X509
endchoice
diff --git a/net/Kconfig b/net/Kconfig
index e712a0dd2ac..3158d37dff7 100644
--- a/net/Kconfig
+++ b/net/Kconfig
@@ -16,7 +16,7 @@ if NET
choice
prompt "Networking stack"
- default NET_LEGACY
+ default NET_LWIP
config NET_LEGACY
bool "Legacy U-Boot networking stack"
@@ -27,6 +27,7 @@ config NET_LEGACY
config NET_LWIP
bool "Use lwIP for networking stack"
+ default y
select NETDEVICES
help
Include networking support based on the lwIP (lightweight IP)
--
2.54.0
@@ -0,0 +1,190 @@
From 56a985cec8592a8de88e7f254df82f5d444a5ecc Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Thu, 28 May 2026 22:08:07 +0100
Subject: [PATCH] initial find_fdt_location for finding the DT on disk
The old distro boot looked for a DT on the first boot partition
in the /dtb or /dtb/current directories, and Fedora extended this
to look not just on the boot partition but all the partitions on
that disk.
The new ways of booting, both bootstd and bootefi bootmgr processes
don't properly look for those options. This provides a function
to search for the DTB on disk so that if the other DT mechanisms
don't work this will look for one on disk to provide a working DT
so that devices will continue to work as they did previously.
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
cmd/bootmenu.c | 5 ++
include/efi_loader.h | 2 +
lib/efi_loader/efi_helper.c | 106 +++++++++++++++++++++++++++++++++++-
3 files changed, 112 insertions(+), 1 deletion(-)
diff --git a/cmd/bootmenu.c b/cmd/bootmenu.c
index 528afd221d0..a10ea35a687 100644
--- a/cmd/bootmenu.c
+++ b/cmd/bootmenu.c
@@ -502,6 +502,11 @@ static void handle_uefi_bootnext(void)
u16 bootnext;
efi_status_t ret;
efi_uintn_t size;
+ const char *fdt_opt;
+
+ /* Find the DTB on disk */
+ log_debug("We will load the DTB\n");
+ fdt_opt = find_fdt_location();
/* Initialize EFI drivers */
ret = efi_init_obj_list();
diff --git a/include/efi_loader.h b/include/efi_loader.h
index 3a4d502631c..b11f8a2cb42 100644
--- a/include/efi_loader.h
+++ b/include/efi_loader.h
@@ -574,6 +574,8 @@ struct efi_register_notify_event {
struct list_head handles;
};
+/* Find the FDT on any partition */
+char *find_fdt_location(void);
/* called at pre-initialization */
int efi_init_early(void);
/* Initialize efi execution environment */
diff --git a/lib/efi_loader/efi_helper.c b/lib/efi_loader/efi_helper.c
index 44b806aadc4..61e982091b9 100644
--- a/lib/efi_loader/efi_helper.c
+++ b/lib/efi_loader/efi_helper.c
@@ -15,6 +15,7 @@
#include <mapmem.h>
#include <dm.h>
#include <fs.h>
+#include <part.h>
#include <efi.h>
#include <efi_api.h>
#include <efi_load_initrd.h>
@@ -98,6 +99,99 @@ int efi_get_pxe_arch(void)
return -EINVAL;
}
+/* We need to pass a blk device in and return a location, or a loaded DT */
+char *find_fdt_location(void)
+{
+ const char *fdt_filename;
+ /* FIXME: dynamic size */
+ char fdt_fullpath[60];
+ const char *prefix;
+ struct udevice *blk;
+ /* FIXME: Fedora really only cares about first 2*/
+ int MAX_PART = 8;
+ int part;
+ struct disk_partition info;
+ int fdtext;
+ int ret;
+ int retfdt;
+ int retload;
+ loff_t fdtsize;
+ ulong pbraddr;
+ loff_t len_read;
+
+ /* step one logic: we have the DT name we're hunting for */
+ fdt_filename = env_get("fdtfile");
+ if (fdt_filename) {
+ log_debug("FFL: We're looking for the DTB now!: %s\n", fdt_filename);
+
+ /* probe all block disks to search for fdt */
+ uclass_foreach_dev_probe(UCLASS_BLK, blk) {
+ log_debug("FFL: dev name: %s\n", blk->name);
+ struct blk_desc *desc;
+ desc = dev_get_uclass_plat(blk);
+ /* we should get a partition count here for looping */
+ /* For loop for each partition */
+ /* Need to also deal with zero part whole disk - part_get_info_whole_disk */
+ for (part = 1; part <= MAX_PART; part++) {
+ log_debug("FFL: part num: %d\n", part);
+ ret = part_get_info(desc, part, &info);
+ /* if we have partition check it for DT */
+ if (ret < 0) {
+ log_debug("FFL: no partition\n");
+ } else {
+ log_debug("FFL: we have a partition\n");
+ /* we should have a case/for prefix in =/ /dtb/ /dtb/current/ */
+ /* but for now we hard code if for Fedora */
+ prefix = "/dtb";
+ snprintf(fdt_fullpath, sizeof(fdt_fullpath), "%s/%s", prefix, fdt_filename);
+ log_debug("FFL: full name: %s\n", fdt_fullpath);
+ /* search for DT on partition and either find and exit or continue */
+ if (fs_set_blk_dev_with_part(desc, part) == 0){
+ log_debug("FFL: set block part pass\n");
+ fdtext = fs_exists(fdt_fullpath);
+ if (fdtext) {
+ /* we have a fdt!*/
+ if (fs_set_blk_dev_with_part(desc, part) == 0){
+ retfdt = fs_size(fdt_fullpath, &fdtsize);
+ if (retfdt == 0) {
+ log_debug("FFL: we have found a DT on disk, size %lld\n", fdtsize);
+ /* Get the main fdt and map it */
+ const char *fdt_pbr;
+ fdt_pbr = env_get("fdt_addr_r");
+ pbraddr = hextoul(fdt_pbr, NULL);
+ log_debug("FFL: fdr addr: %s\n", fdt_pbr);
+ if (fs_set_blk_dev_with_part(desc, part) == 0){
+ retload = fs_read(fdt_fullpath, pbraddr, 0, fdtsize, &len_read);
+ if (retload == 0) {
+ log_debug("FFL: we have a loaded DT, size %lld we can return\n", fdtsize);
+ log_info("Found DTB: %s\n", fdt_filename);
+ return fdt_pbr;
+ } else {
+ log_debug("FFL: DT load failed\n");
+ }
+ }
+ } else {
+ log_debug("FFL: we DON'T have a DT with size\n");
+ }
+ }
+ } else {
+ /* we don't have a fdt!*/
+ log_debug("FFL: we DON'T have a DT\n");
+ }
+ } else {
+ log_debug("FFL: set block part FAIL\n");
+ }
+ }
+ }
+ }
+ } else {
+ log_debug("FFL: fdt_filename not defined!!\n");
+ }
+
+ /* We didn't find a FDT */
+ return NULL;
+}
+
/**
* efi_create_current_boot_var() - Return Boot#### name were #### is replaced by
* the value of BootCurrent
@@ -558,11 +652,21 @@ efi_status_t efi_install_fdt(void *fdt)
const char *fdt_opt;
uintptr_t fdt_addr;
+ /* Check if there is device tree loaded from disk */
+ fdt_opt = find_fdt_location();
+ if (fdt_opt)
+ log_info("Found DTB on disk\n");
+
/* Check if there is a hardware device tree */
- fdt_opt = env_get("fdt_addr");
+ if (!fdt_opt) {
+ fdt_opt = env_get("fdt_addr");
+ if (fdt_opt)
+ log_info("Found DTB: Prior firmware\n");
+ }
/* Use our own device tree as fallback */
if (!fdt_opt) {
fdt_opt = env_get("fdtcontroladdr");
+ log_info("Using DT from U-Boot\n");
if (!fdt_opt) {
log_err("need device tree\n");
return EFI_NOT_FOUND;
--
2.54.0
+532
View File
@@ -0,0 +1,532 @@
#!/bin/bash
# limine-mkinitcpio-hook: the x86_64 package is upstream's as before. On
# aarch64, limine-apple-gate leaves every machine but an Apple Silicon Mac as
# the x86_64 package behaves; a Mac keeps /boot current through mkinitcpio's
# own kernel hook, and Limine waits until Omarchy activates it.
#
# The package() of the PKGBUILD runs over an upstream-shaped source tree
# (LIMINE_ENTRY_TOOL_SRC may name a real limine-entry-tool checkout instead),
# and pacman transactions replay through the packaged hooks on fixture machines.
set -euo pipefail
REPO_ROOT=$(realpath "${BASH_SOURCE[0]%/*}/..")
RECIPE=$REPO_ROOT/pkgbuilds/limine-mkinitcpio-hook
GATE=$RECIPE/limine-apple-gate
TEST_ROOT=$(mktemp -d)
trap 'rm -rf "$TEST_ROOT"' EXIT
fail() {
echo "not ok - $1" >&2
[[ $# -lt 2 ]] || printf '%s\n' "$2" >&2
exit 1
}
pass() {
echo "ok - $1"
}
# pacman hands NeedsTargets to a hook over a socket, and a hook that stops
# reading early fails the write ("unable to write to pipe").
SOCKET_FEED='
import socket, subprocess, sys
parent, child = socket.socketpair()
hook = subprocess.Popen(sys.argv[1:], stdin=child)
child.close()
try:
parent.sendall(sys.stdin.buffer.read())
parent.shutdown(socket.SHUT_WR)
except OSError as error:
print("unable to write to pipe (%s)" % error.strerror, file=sys.stderr)
hook.wait()
sys.exit(141)
sys.exit(hook.wait())
'
socket_feed() { python3 -c "$SOCKET_FEED" "$@"; }
apple_tree() { printf 'apple,j316s\0apple,t6000\0apple,arm-platform\0'; }
live_is_mac() {
local source
for source in /proc/device-tree/compatible /sys/firmware/devicetree/base/compatible; do
[[ -r $source ]] && tr '\0' '\n' <"$source" | grep -q '^apple,' && return 0
done
return 1
}
# The gate trusts fixtures only from an unprivileged caller: as root it reads
# the live machine. Check that, then carry on as nobody.
if ((EUID == 0)); then
if ! live_is_mac; then
mkdir -p "$TEST_ROOT/root-proc/device-tree"
apple_tree >"$TEST_ROOT/root-proc/device-tree/compatible"
out=$(OMARCHY_PROC_ROOT=$TEST_ROOT/root-proc bash "$GATE" echo ran </dev/null)
[[ $out == ran ]] || fail "as root the gate ignores a fixture device tree" "$out"
pass "as root the gate reads the live machine, not fixtures"
fi
rm -rf "$TEST_ROOT"
exec setpriv --reuid=nobody --regid=nobody --clear-groups -- bash "$REPO_ROOT/tests/limine-mkinitcpio-hook.sh"
fi
# ---------------------------------------------------------------------------
# Sources: the local aarch64 sources are pinned, x86_64 has none.
bash -n "$RECIPE/PKGBUILD"
bash -n "$GATE"
mapfile -t sources < <(CARCH=aarch64 bash -c 'source "$1"; printf "%s\n" "${source_aarch64[@]}"' _ "$RECIPE/PKGBUILD")
mapfile -t sums < <(CARCH=aarch64 bash -c 'source "$1"; printf "%s\n" "${sha256sums_aarch64[@]}"' _ "$RECIPE/PKGBUILD")
((${#sources[@]} == ${#sums[@]})) || fail "every aarch64 source has a checksum"
local_sources=0
for i in "${!sources[@]}"; do
[[ ${sources[i]} == *://* ]] && continue
((++local_sources))
[[ $(sha256sum "$RECIPE/${sources[i]}" | cut -d' ' -f1) == "${sums[i]}" ]] ||
fail "the PKGBUILD pins ${sources[i]} by its sha256"
done
((local_sources == 2)) || fail "limine-apple-gate and mkinitcpio-install.hook are the aarch64 local sources"
x86_sources=$(CARCH=x86_64 bash -c 'source "$1"; printf "%s\n" "${source[@]}" "${source_x86_64[@]}"' _ "$RECIPE/PKGBUILD")
[[ $x86_sources != *limine-apple-gate* && $x86_sources != *mkinitcpio-install.hook* ]] ||
fail "x86_64 builds take no Apple Silicon source"
grep -Fxq 'Exec = /usr/share/libalpm/scripts/mkinitcpio install' "$RECIPE/mkinitcpio-install.hook" ||
fail "mkinitcpio-install.hook is mkinitcpio's own kernel hook"
pass "the Apple Silicon sources are aarch64-only and pinned by checksum"
# ---------------------------------------------------------------------------
# package() for both architectures over the same upstream tree.
SRC=$TEST_ROOT/src
upstream=$SRC/limine-entry-tool
mkdir -p "$upstream/build/native/nativeCompile"
if [[ -n ${LIMINE_ENTRY_TOOL_SRC:-} ]]; then
cp -a "$LIMINE_ENTRY_TOOL_SRC/install" "$LIMINE_ENTRY_TOOL_SRC/README.md" "$LIMINE_ENTRY_TOOL_SRC/CHANGELOG.md" "$upstream/"
else
tool=$upstream/install/arch-linux/limine-entry-tool
hook=$upstream/install/arch-linux/limine-mkinitcpio-hook
mkdir -p "$tool/etc/boot/hooks/pre.d" "$tool/usr/bin" "$tool/usr/lib/limine" "$tool/usr/share/libalpm/hooks" \
"$hook/etc/pacman.d/hooks" "$hook/usr/bin" "$hook/usr/local/bin" "$hook/usr/share/libalpm/hooks" "$hook/usr/share/libalpm/scripts"
echo '# README' >"$upstream/README.md"
echo '# CHANGELOG' >"$upstream/CHANGELOG.md"
echo 'ESP_PATH=""' >"$tool/etc/limine-entry-tool.conf"
echo 'ESP_PATH=""' >"$hook/etc/limine-entry-tool.conf"
for name in limine-install limine-entry-tool limine-reset-enroll limine-enroll-config; do
printf '#!/usr/bin/env bash\n' >"$tool/usr/bin/$name"
done
printf '#!/usr/bin/env bash\n' >"$tool/usr/lib/limine/limine-common-functions"
for name in limine-mkinitcpio limine-update; do
printf '#!/usr/bin/env bash\n' >"$hook/usr/bin/$name"
done
for name in limine-mkinitcpio-install limine-mkinitcpio-remove; do
printf '#!/usr/bin/env bash\n' >"$hook/usr/share/libalpm/scripts/$name"
done
cat >"$tool/usr/share/libalpm/hooks/80-limine-efi-deploy.hook" <<'HOOK'
[Trigger]
Operation = Install
Operation = Upgrade
Type = Package
Target = limine
Target = limine-git
Target = limine-dev
[Action]
Description = Deploying Limine after upgrade...
When = PostTransaction
Exec = /usr/bin/limine-install --no-efi-register
HOOK
cat >"$hook/usr/share/libalpm/hooks/80-limine-efi-deploy.hook" <<'HOOK'
[Trigger]
Operation = Install
Operation = Upgrade
Type = Package
Target = limine
Target = limine-git
Target = limine-dev
Target = limine-mkinitcpio-hook
Target = limine-mkinitcpio-hook-git
[Action]
Description = Deploying Limine after upgrade...
When = PostTransaction
Exec = /usr/bin/limine-install
HOOK
cat >"$hook/usr/share/libalpm/hooks/60-limine-mkinitcpio-remove-pre.hook" <<'HOOK'
[Trigger]
Type = Path
Operation = Remove
Target = usr/lib/modules/*/modules.builtin
[Action]
Description = Record kernels marked for removal in Limine
When = PreTransaction
Exec = /usr/share/libalpm/scripts/limine-mkinitcpio-remove pre
NeedsTargets
HOOK
cat >"$hook/usr/share/libalpm/hooks/90-limine-mkinitcpio-remove-post.hook" <<'HOOK'
[Trigger]
Type = Path
Operation = Remove
Target = usr/lib/modules/*/modules.builtin
[Action]
Description = Clean Limine boot entries of removed kernels
When = PostTransaction
Exec = /usr/share/libalpm/scripts/limine-mkinitcpio-remove post
HOOK
cat >"$hook/etc/pacman.d/hooks/90-mkinitcpio-install.hook" <<'HOOK'
[Trigger]
Type = Path
Operation = Install
Operation = Upgrade
Operation = Remove
Target = usr/lib/initcpio/*
Target = usr/lib/firmware/*
Target = usr/lib/modules/*/extramodules/
Target = usr/src/*/dkms.conf
Target = usr/lib/systemd/systemd
Target = usr/bin/cryptsetup
Target = usr/bin/lvm
[Trigger]
Type = Path
Operation = Install
Operation = Upgrade
Target = usr/lib/modules/*/modules.builtin
[Trigger]
Type = Package
Operation = Install
Operation = Upgrade
Target = mkinitcpio
Target = mkinitcpio-git
[Action]
Description = Updating linux initcpios...
When = PostTransaction
Exec = /usr/share/libalpm/scripts/limine-mkinitcpio-install
NeedsTargets
HOOK
cat >"$hook/usr/local/bin/mkinitcpio" <<'WRAPPER'
#!/usr/bin/env bash
/usr/bin/mkinitcpio "$@"
_color_reset=""
_color_yellow=""
colors="$(tput colors 2>/dev/null || echo 0)"
if ((colors >= 8)); then
_color_reset="\033[0m"
_color_yellow="\033[1;33m"
fi
if [[ " $* " == *" -P "* || " $* " == *" --allpresets "* || " $* " == *" -p "* || " $* " == *" --preset "* ]]; then
printf '%b==> WARNING: This does not update Limine boot entries.%b\n' "${_color_yellow}" "${_color_reset}" >&2
printf "%b Use 'limine-mkinitcpio' or 'limine-update' instead.%b\n" "${_color_yellow}" "${_color_reset}" >&2
read -rp "==> Would you like to run 'limine-mkinitcpio' now? [Y/n]: " answer
case "${answer,,}" in
"" | "y" | "yes")
/usr/bin/limine-mkinitcpio
;;
*)
# nothing
;;
esac
fi
WRAPPER
fi
printf 'native image\n' >"$upstream/build/native/nativeCompile/limine-entry-tool"
chmod -R u+w,go+rX "$upstream"
find "$upstream/install" -path '*/bin/*' -type f -exec chmod 755 {} + -o -path '*/scripts/*' -type f -exec chmod 755 {} +
ln -s "$RECIPE/limine-apple-gate" "$RECIPE/mkinitcpio-install.hook" "$SRC/"
# makepkg runs package() with errexit.
build_package() {
local arch=$1 out=$2
mkdir -p "$out"
CARCH=$arch srcdir=$SRC pkgdir=$out bash -euo pipefail -c 'source "$1"; package' _ "$RECIPE/PKGBUILD" ||
fail "package() succeeds for $arch"
}
PKG_X86=$TEST_ROOT/pkg-x86_64
PKG_ARM=$TEST_ROOT/pkg-aarch64
build_package x86_64 "$PKG_X86"
build_package aarch64 "$PKG_ARM"
manifest() {
(cd "$1" && find . \( -type f -o -type l \) -printf '%p %m %l\n' | LC_ALL=C sort) |
while read -r path mode target; do
if [[ -n $target ]]; then
echo "$path $mode -> $target"
else
echo "$path $mode $(sha256sum "$1/$path" | cut -d' ' -f1)"
fi
done
}
scripts=/usr/share/libalpm/scripts
gate=$scripts/limine-apple-gate
upstream_hook=$upstream/install/arch-linux/limine-mkinitcpio-hook
for file in etc/pacman.d/hooks/90-mkinitcpio-install.hook usr/local/bin/mkinitcpio \
usr/share/libalpm/hooks/{60-limine-mkinitcpio-remove-pre,80-limine-efi-deploy,90-limine-mkinitcpio-remove-post}.hook; do
cmp -s "$upstream_hook/$file" "$PKG_X86/$file" || fail "x86_64 ships upstream's $file unchanged"
done
[[ ! -e $PKG_X86$gate && ! -e $PKG_X86/usr/share/libalpm/hooks/90-mkinitcpio-apple-install.hook ]] ||
fail "x86_64 ships no Apple Silicon file"
pass "x86_64 packages upstream's hooks and wrapper unchanged"
differences=$(diff <(manifest "$PKG_X86") <(manifest "$PKG_ARM") || true)
changed=$(sed -n 's/^> \(\S*\) .*/\1/p' <<<"$differences")
expected=$(printf '%s\n' ./etc/pacman.d/hooks/90-mkinitcpio-install.hook \
./usr/local/bin/mkinitcpio \
./usr/share/libalpm/hooks/60-limine-mkinitcpio-remove-pre.hook \
./usr/share/libalpm/hooks/80-limine-efi-deploy.hook \
./usr/share/libalpm/hooks/90-limine-mkinitcpio-remove-post.hook \
./usr/share/libalpm/hooks/90-mkinitcpio-apple-install.hook \
./usr/share/libalpm/scripts/limine-apple-gate)
[[ $changed == "$expected" ]] || fail "aarch64 differs from x86_64 only in the gated hooks, the wrapper and the gate" "$changed"
[[ -z $(sed -n 's/^< \(\S*\) .*/\1/p' <<<"$differences" | grep -vxF "$expected") ]] ||
fail "aarch64 keeps every x86_64 file"
[[ $(stat -c %a "$PKG_ARM$gate") == 755 ]] || fail "the gate is executable"
diff <(grep -v '^Exec = \|^Description = ' "$RECIPE/mkinitcpio-install.hook") \
<(grep -v '^Exec = \|^Description = ' "$PKG_ARM/usr/share/libalpm/hooks/90-mkinitcpio-apple-install.hook") >/dev/null ||
fail "the Mac's kernel hook keeps mkinitcpio's triggers"
[[ $(sed -n 2p "$PKG_ARM/usr/local/bin/mkinitcpio") == "$gate --mac && exec /usr/bin/mkinitcpio \"\$@\"" ]] ||
fail "the aarch64 wrapper is plain mkinitcpio on a Mac"
pass "aarch64 routes Limine's hooks and the wrapper through the gate and adds the Mac's kernel hook"
# ---------------------------------------------------------------------------
# Fixture machines, read through OMARCHY_PROC_ROOT, OMARCHY_LIMINE_GATE and
# OMARCHY_LIMINE_DEFAULT.
machine() {
local name=$1 compatible=$2 dir=$TEST_ROOT/machines/$1
mkdir -p "$dir/proc" "$dir/state"
if [[ -n $compatible ]]; then
mkdir -p "$dir/proc/device-tree"
printf "$compatible" >"$dir/proc/device-tree/compatible"
fi
}
machine x86 ''
machine generic-aarch64 'linux,dummy-virt\0'
machine qualcomm 'lenovo,thinkpad-t14s\0qcom,x1e78100\0qcom,x1e80100\0'
machine mac-dormant 'apple,j316s\0apple,t6000\0apple,arm-platform\0'
machine mac-marker-only 'apple,j316s\0apple,t6000\0apple,arm-platform\0'
machine mac-active 'apple,j316s\0apple,t6000\0apple,arm-platform\0'
: >"$TEST_ROOT/machines/mac-marker-only/state/limine.enabled"
: >"$TEST_ROOT/machines/mac-active/state/limine.enabled"
echo 'ESP_PATH="/boot/efi"' >"$TEST_ROOT/machines/mac-active/state/limine"
on() {
local dir=$TEST_ROOT/machines/$1
shift
(
export OMARCHY_PROC_ROOT=$dir/proc OMARCHY_LIMINE_GATE=$dir/state/limine.enabled OMARCHY_LIMINE_DEFAULT=$dir/state/limine
"$@"
)
}
status() {
local rc=0
"$@" || rc=$?
echo "$rc"
}
for m in x86 generic-aarch64 qualcomm; do
[[ $(on "$m" status bash "$GATE" --mac) == 1 ]] || fail "$m is not a Mac"
[[ $(printf 'a\nb\n' | on "$m" bash "$GATE" cat) == $'a\nb' ]] || fail "$m runs Limine's hooks with their targets"
[[ $(on "$m" status bash "$GATE" bash -c 'exit 7' </dev/null) == 7 ]] || fail "$m keeps the hook's status"
[[ -z $(printf 'a\n' | on "$m" bash "$GATE" --mac cat 2>&1) ]] || fail "$m skips the Mac's hooks quietly"
[[ $(on "$m" bash "$GATE" --not-mac echo ran </dev/null) == ran ]] || fail "$m deploys Limine's EFI binary"
done
for m in mac-dormant mac-marker-only mac-active; do
[[ $(on "$m" status bash "$GATE" --mac) == 0 ]] || fail "$m is a Mac"
[[ $(printf 'a\n' | on "$m" bash "$GATE" --mac cat) == a ]] || fail "$m runs the Mac's hooks with their targets"
[[ -z $(printf 'a\n' | on "$m" bash "$GATE" --not-mac cat 2>&1) ]] || fail "$m leaves Limine's EFI binary to omarchy-mac-boot"
done
for m in mac-dormant mac-marker-only; do
out=$(printf 'usr/lib/modules/7.1.0/modules.builtin\n' | on "$m" bash "$GATE" bash -c 'echo ran; exit 100' 2>&1) ||
fail "$m passes over Limine's hooks successfully"
[[ -z $out ]] || fail "$m passes over Limine's hooks quietly" "$out"
[[ -z $(on "$m" bash "$GATE" echo ran <&- 2>&1) ]] || fail "$m passes over a hook without targets"
done
# A linux-firmware upgrade streams thousands of targets, more than a socket holds.
many_targets() { printf 'usr/lib/firmware/fixture/%s.bin\n' $(seq 60000); }
many_targets | on mac-dormant socket_feed bash "$GATE" true || fail "a dormant Mac reads every target of a hook it passes over"
many_targets | on x86 socket_feed bash "$GATE" --mac true || fail "other machines read every target of the Mac's hooks"
many_targets | on mac-active socket_feed bash "$GATE" --not-mac true || fail "a Mac reads every target of the deploy hook"
many_targets | on mac-dormant bash "$GATE" true || fail "a dormant Mac reads every target piped to a hook it passes over"
[[ $(printf 'a\n' | on mac-active bash "$GATE" bash -c 'echo "ran $1"; cat' _ post) == $'ran post\na' ]] ||
fail "an active Mac runs Limine's hooks with their arguments and targets"
[[ $(on mac-active status bash "$GATE" bash -c 'exit 7' </dev/null) == 7 ]] || fail "an active Mac keeps the hook's status"
[[ $(on x86 status bash "$GATE" </dev/null 2>/dev/null) == 2 ]] || fail "the gate needs a command"
pass "the gate runs Limine's hooks everywhere but a Mac that has not activated Limine"
# ---------------------------------------------------------------------------
# pacman: hooks from /usr/share/libalpm/hooks, overridden by name from
# /etc/pacman.d/hooks, run in name order, each with the targets of the
# transaction its triggers match (sorted, over a socket for NeedsTargets,
# else no stdin).
# Transactions are lines of "<Operation> <Path|Package> <target>".
fake_root() {
local pkg=$1 root=$2 name
cp -a "$pkg" "$root"
cp "$RECIPE/mkinitcpio-install.hook" "$root/usr/share/libalpm/hooks/90-mkinitcpio-install.hook"
for name in usr/share/libalpm/scripts/limine-mkinitcpio-install usr/share/libalpm/scripts/limine-mkinitcpio-remove \
usr/bin/limine-install usr/share/libalpm/scripts/mkinitcpio usr/bin/mkinitcpio usr/bin/limine-mkinitcpio; do
rm -f "$root/$name"
printf '#!/bin/bash\n{ printf %%s %q; if (($#)); then printf " %%s" "$@"; fi; echo; if [[ -S /dev/stdin || -p /dev/stdin ]]; then sed "s/^/ /"; fi; } >>"$SIM_LOG"\n' \
"${name##*/}" >"$root/$name"
chmod 755 "$root/$name"
done
}
run_hook() {
local root=$1 hook=$2 when=$3 transaction=$4
local line section='' hook_when='' exec_line='' needs=0 type='' ops='' targets=''
local -a triggers=()
while IFS= read -r line || [[ -n $line ]]; do
case $line in
'[Trigger]' | '[Action]')
[[ $section != Trigger ]] || triggers+=("$type|$ops|$targets")
section=${line//[][]/} type='' ops=' ' targets=''
;;
NeedsTargets) needs=1 ;;
*' = '*)
case $section/${line%% = *} in
Trigger/Type) type=${line#* = } ;;
Trigger/Operation) ops+="${line#* = } " ;;
Trigger/Target) targets+="${line#* = } " ;;
Action/When) hook_when=${line#* = } ;;
Action/Exec) exec_line=${line#* = } ;;
esac
;;
esac
done <"$hook"
[[ $hook_when == "$when" ]] || return 0
local op kind target trigger t_type t_ops t_targets pattern
local -a matched=() patterns=()
while read -r op kind target; do
for trigger in "${triggers[@]}"; do
IFS='|' read -r t_type t_ops t_targets <<<"$trigger"
[[ $t_type == "$kind" && $t_ops == *" $op "* ]] || continue
read -ra patterns <<<"$t_targets"
for pattern in "${patterns[@]}"; do
# shellcheck disable=SC2053
if [[ $target == $pattern ]]; then
matched+=("$target")
break 2
fi
done
done
done <"$transaction"
((${#matched[@]})) || return 0
local word
local -a argv=() command=()
read -ra argv <<<"$exec_line"
for word in "${argv[@]}"; do
if [[ $word == /* && -e $root$word ]]; then command+=("$root$word"); else command+=("$word"); fi
done
if ((needs)); then
printf '%s\n' "${matched[@]}" | LC_ALL=C sort -u | socket_feed "${command[@]}"
else
"${command[@]}" <&-
fi
}
run_transaction() {
local root=$1 transaction=$2 when name
local -A hooks=()
for name in "$root"/usr/share/libalpm/hooks/*.hook "$root"/etc/pacman.d/hooks/*.hook; do
[[ -e $name ]] && hooks[${name##*/}]=$name
done
for when in PreTransaction PostTransaction; do
while read -r name; do
run_hook "$root" "${hooks[$name.hook]}" "$when" "$transaction"
done < <(printf '%s\n' "${!hooks[@]}" | sed 's/\.hook$//' | LC_ALL=C sort)
done
}
fake_root "$PKG_X86" "$TEST_ROOT/root-x86_64"
fake_root "$PKG_ARM" "$TEST_ROOT/root-aarch64"
transaction() {
local name=$1
shift
printf '%s\n' "$@" >"$TEST_ROOT/tx-$name"
}
transaction kernel \
'Install Path usr/lib/modules/7.1.0-asahi/vmlinuz' \
'Install Path usr/lib/modules/7.1.0-asahi/modules.builtin' \
'Install Path usr/lib/modules/7.1.0-asahi/pkgbase' \
'Remove Path usr/lib/modules/7.0.0-asahi/vmlinuz' \
'Remove Path usr/lib/modules/7.0.0-asahi/modules.builtin' \
'Remove Path usr/lib/modules/7.0.0-asahi/pkgbase' \
'Upgrade Package linux-asahi'
transaction firmware 'Upgrade Path usr/lib/firmware/brcm/fixture.bin' 'Upgrade Package linux-firmware'
transaction modprobe 'Upgrade Path usr/lib/modprobe.d/' 'Install Path usr/lib/modprobe.d/omarchy-mac.conf' 'Upgrade Package omarchy-mac'
transaction limine 'Upgrade Path usr/share/limine/BOOTAA64.EFI' 'Upgrade Package limine'
replay() {
local arch=$1 m=$2 name=$3
export SIM_LOG=$TEST_ROOT/log
: >"$SIM_LOG"
local out
out=$(on "$m" run_transaction "$TEST_ROOT/root-$arch" "$TEST_ROOT/tx-$name" 2>&1) || fail "$name on $arch/$m replays"
[[ -z $out ]] || fail "$name on $arch/$m prints nothing of the gate's" "$out"
cat "$SIM_LOG"
}
limine_kernel=$'limine-mkinitcpio-remove pre\n usr/lib/modules/7.0.0-asahi/modules.builtin\nlimine-mkinitcpio-remove post\nlimine-mkinitcpio-install\n usr/lib/modules/7.1.0-asahi/modules.builtin'
stock_kernel=$'mkinitcpio install\n usr/lib/modules/7.1.0-asahi/vmlinuz'
limine_firmware=$'limine-mkinitcpio-install\n usr/lib/firmware/brcm/fixture.bin'
stock_firmware=$'mkinitcpio install\n usr/lib/firmware/brcm/fixture.bin'
stock_modprobe=$'mkinitcpio install\n usr/lib/modprobe.d/'
declare -A want=(
[kernel/other]=$limine_kernel
[firmware/other]=$limine_firmware
[modprobe/other]=''
[limine/other]='limine-install'
[kernel/mac-dormant]=$stock_kernel
[firmware/mac-dormant]=$stock_firmware
[modprobe/mac-dormant]=$stock_modprobe
[limine/mac-dormant]=''
[kernel/mac-active]=$'limine-mkinitcpio-remove pre\n usr/lib/modules/7.0.0-asahi/modules.builtin\nlimine-mkinitcpio-remove post\n'"$stock_kernel"$'\nlimine-mkinitcpio-install\n usr/lib/modules/7.1.0-asahi/modules.builtin'
[firmware/mac-active]=$stock_firmware$'\n'$limine_firmware
[modprobe/mac-active]=$stock_modprobe
[limine/mac-active]=''
)
want[kernel/mac-marker-only]=${want[kernel/mac-dormant]}
for name in kernel firmware modprobe limine; do
got=$(replay x86_64 x86 "$name")
[[ $got == "${want[$name/other]}" ]] || fail "x86_64: $name transaction runs upstream's hooks" "$got"
for m in generic-aarch64 qualcomm; do
got=$(replay aarch64 "$m" "$name")
[[ $got == "${want[$name/other]}" ]] || fail "aarch64 $m: $name transaction runs as on x86_64" "$got"
done
done
pass "x86_64, generic aarch64 and Snapdragon transactions run Limine's hooks as upstream ships them"
for m in mac-dormant mac-marker-only mac-active; do
for name in kernel firmware modprobe limine; do
[[ -v want[$name/$m] ]] || continue
got=$(replay aarch64 "$m" "$name")
[[ $got == "${want[$name/$m]}" ]] || fail "$m: $name transaction" "$got"
done
done
pass "a dormant Mac defers to mkinitcpio's own hook; an active Mac also writes Limine's entries after it"
# ---------------------------------------------------------------------------
# The wrapper, as sudo mkinitcpio -P and mkinitcpio's hook script call it
# (/usr/local/bin first in PATH, stdin at its end).
wrapper() {
local root=$1 m=$2
sed "s|/usr/|$root/usr/|g" "$root/usr/local/bin/mkinitcpio" >"$TEST_ROOT/wrapper"
export SIM_LOG=$TEST_ROOT/log
: >"$SIM_LOG"
on "$m" bash "$TEST_ROOT/wrapper" -P </dev/null >/dev/null 2>&1 || true
cat "$SIM_LOG"
}
upstream_wrapper=$'mkinitcpio -P\nlimine-mkinitcpio'
[[ $(wrapper "$TEST_ROOT/root-x86_64" x86) == "$upstream_wrapper" ]] || fail "x86_64 keeps upstream's wrapper"
for m in generic-aarch64 qualcomm; do
[[ $(wrapper "$TEST_ROOT/root-aarch64" "$m") == "$upstream_wrapper" ]] || fail "$m keeps upstream's wrapper"
done
for m in mac-dormant mac-active; do
[[ $(wrapper "$TEST_ROOT/root-aarch64" "$m") == 'mkinitcpio -P' ]] || fail "$m runs plain mkinitcpio"
done
pass "the mkinitcpio wrapper is upstream's everywhere but a Mac, where it is plain mkinitcpio"