Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
cfa4c8d
G5P render, autoboot, META71C and boot-origin policy
brkosebay Nov 8, 2026
fd6e7fe
AOP sensors and certified warm reload
brkosebay Nov 8, 2026
28c7d41
PCI/NVMe: retain the stopped ANS handoff across kexec
brkosebay Nov 8, 2026
419fe19
Optional resident m1n1 EL3 PSCI
brkosebay Nov 8, 2026
a76d376
pinctrl/spi/input: quiesce S8000 peripherals for kexec
brkosebay Nov 8, 2026
6c1601e
Optional resident m1n1 EL3 PSCI
brkosebay Nov 8, 2026
ca3266c
AOP sensors and certified warm reload
brkosebay Nov 8, 2026
eb6a0b1
Quiet polled cover inputs and exclusive RTC event
brkosebay Nov 8, 2026
e4ea0b7
PCI/NVMe: retain the stopped ANS handoff across kexec
brkosebay Nov 8, 2026
33047d2
pinctrl/spi/input: quiesce S8000 peripherals for kexec
brkosebay Nov 8, 2026
1ca51ef
J71t guarded Mac current profile
brkosebay Nov 8, 2026
6fd2737
usb: keep per-device system and RAM serials stable across boots
brkosebay Nov 8, 2026
0886d8c
Warm Restart evidence, reset guard and pristine DT
brkosebay Nov 8, 2026
6525d20
Merge main into j71t/psci
brkosebay Nov 12, 2026
7d41c32
m1n1: Resident EL3 PSCI for A7-A9, on by default
brkosebay Nov 12, 2026
82666fd
Merge the j71t/psci branch into j71t/aop
brkosebay Nov 12, 2026
a54e204
j71t: AOP sensors with a retained firmware state for reload
brkosebay Nov 12, 2026
2496d64
Merge the j71t/aop branch into j71t/pmu-rtc
brkosebay Nov 12, 2026
190bb13
j71t: One owner for the PMU and RTC wake interrupts
brkosebay Nov 12, 2026
6e0deb0
Merge the j71t/pmu-rtc branch into j71t/warm-storage
brkosebay Nov 12, 2026
d2247b1
PCI/NVMe: Keep the ANS handoff across kexec, cold-reset when it fails
brkosebay Nov 12, 2026
39cea4b
Merge the j71t/warm-storage branch into j71t/warm-peripherals
brkosebay Nov 12, 2026
8286fdf
pinctrl/spi/input: Quiesce S8000 peripherals for kexec
brkosebay Nov 12, 2026
fa1cb2e
Merge the j71t/warm-peripherals branch into j71t/mac-current
brkosebay Nov 12, 2026
0674e1d
j71t: Guarded Mac current profile
brkosebay Nov 12, 2026
502c5ac
Merge the j71t/mac-current branch into j71t/usb-stable-serial
brkosebay Nov 12, 2026
bbe62ba
usb: Keep per-device system and RAM serials stable across boots
brkosebay Nov 12, 2026
28a9693
Merge the j71t/usb-stable-serial branch into j71t/warm-kernel
brkosebay Nov 12, 2026
57e91ab
kernel: Retain the tethered warm boot state across kexec
brkosebay Nov 12, 2026
92d22c8
watchdog: apple: Prefer a cold reset and guard the warm reset path
brkosebay Nov 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 50 additions & 2 deletions boot/initramfs/root/init
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ mount -t devtmpfs -o mode=0755,nosuid dev /dev
exec </dev/console >/dev/console 2>&1

stop() {
echo "<3>orchard initrd: $1; rescue shell" > /dev/kmsg
echo "orchard initrd: $1"
echo 'Starting a shell on the console; the system did not start.'
exec sh
Expand All @@ -31,8 +32,11 @@ done
[ ! -e /etc/orchard/usb-modules ] || for module in $(cat /etc/orchard/usb-modules); do
modprobe "$module" || echo "orchard initrd: could not load $module; no USB"
done
echo '<6>orchard initrd: storage load begin' > /dev/kmsg
for module in $(cat /etc/orchard/modules); do
echo "<6>orchard initrd: modprobe $module begin" > /dev/kmsg
modprobe "$module" || stop "could not load $module"
echo "<6>orchard initrd: modprobe $module complete" > /dev/kmsg
done

# An install boot: orchard's add-on, appended to this initrd by the CLI, writes the
Expand Down Expand Up @@ -87,8 +91,35 @@ done

mkdir -p /newroot
mount ${fstype:+-t "$fstype"} -o "$mode${flags:+,$flags}" "$device" /newroot || stop "could not mount $device"
echo '<6>orchard initrd: root mounted' > /dev/kmsg
[ -x "/newroot$init" ] || [ -L "/newroot$init" ] || stop "the root has no $init"

# Preserve the running boot's *pristine* tree before any package update can
# replace /boot or same-release module assets. The matching initrd embeds cold
# DTBs; warm boots name their retained stage instead. Never infer it by uname.
mkdir -p /run /newroot/run
mount -t tmpfs -o mode=0755,nosuid,nodev tmpfs /run
mkdir -p /run/orchard-kexec
warm_pristine=
for argument in $(cat /proc/cmdline); do
case "$argument" in orchard_warm.dtb=*) warm_pristine=${argument#orchard_warm.dtb=} ;; esac
done
if [ -n "$warm_pristine" ]; then
case "$warm_pristine" in
/var/tmp/orchard-warm.*/pristine.dtb)
case "$warm_pristine" in *..*) stop 'invalid warm DT provenance' ;; esac
cp "/newroot$warm_pristine" /run/orchard-kexec/pristine.dtb || stop 'missing warm pristine DT' ;;
*) stop 'invalid warm DT provenance' ;;
esac
elif [ -f /etc/orchard/pristine-map ]; then
board=$(tr '\000' '\n' < /proc/device-tree/compatible | head -1)
while read compatible file; do
[ "$compatible" != "$board" ] || cp "/etc/orchard/dtbs/$file" /run/orchard-kexec/pristine.dtb
done < /etc/orchard/pristine-map
fi
cat /proc/sys/kernel/random/boot_id > /run/orchard-kexec/boot-id
mount --move /run /newroot/run || stop 'cannot retain boot provenance'

# USB for the host: network (usb0) and a serial console (ttyGS0), named after
# the system, so `orchard devices` sees it. What runs on them is the system's.
usb_gadget() {
Expand All @@ -97,13 +128,29 @@ usb_gadget() {
[ ! -e "$g" ] || return 0
name=$(sed -n 's/^NAME=//p' /newroot/etc/os-release /newroot/usr/lib/os-release 2>/dev/null | head -1 | tr -d "\"'")
board=$(tr '\000' '\n' < /proc/device-tree/compatible | head -1)
# Opt-in compatibility identity in macOS's 2400 mA capability table.
# This requests a host grant; it does not set a charger limit. Keep the
# generic composite personality (no iOS/usbmux or preferred-config API).
pid=0x4145
device_class=0x00 device_subclass=0x00 device_protocol=0x00
if [ "$board" = apple,j71t ] &&
[ "$(cat /newroot/etc/orchard/mac-usb-current 2>/dev/null)" = 1 ]; then
pid=0x1014
# Standard IAD device: macOS defers its CDC composite match here,
# allowing the generic composite driver to deliver the grant.
device_class=0xef device_subclass=0x02 device_protocol=0x01
fi
serial=$(sh /etc/orchard/usb-identity) || return 1
mkdir "$g" &&
echo 0x05ac > "$g/idVendor" &&
echo 0x4145 > "$g/idProduct" &&
echo "$pid" > "$g/idProduct" &&
echo "$device_class" > "$g/bDeviceClass" &&
echo "$device_subclass" > "$g/bDeviceSubClass" &&
echo "$device_protocol" > "$g/bDeviceProtocol" &&
mkdir -p "$g/strings/0x409" "$g/configs/c.1/strings/0x409" &&
echo 'Orchard Linux' > "$g/strings/0x409/manufacturer" &&
echo "${name:-Linux}" > "$g/strings/0x409/product" &&
echo "BOOT:$(cat /proc/sys/kernel/random/boot_id) BOARD:${board#apple,}" > "$g/strings/0x409/serialnumber" &&
echo "$serial" > "$g/strings/0x409/serialnumber" &&
echo 'USB network and serial' > "$g/configs/c.1/strings/0x409/configuration" &&
echo 500 > "$g/configs/c.1/MaxPower" &&
mkdir "$g/functions/ncm.usb0" "$g/functions/acm.usb0" &&
Expand All @@ -112,6 +159,7 @@ usb_gadget() {
basename "$(ls -d /sys/class/udc/* | head -1)" > "$g/UDC"
}
usb_gadget || echo 'orchard initrd: no USB gadget; continuing without USB'
echo '<6>orchard initrd: USB setup complete; switching root' > /dev/kmsg

for name in dev proc sys; do
mount --move "/$name" "/newroot/$name"
Expand Down
13 changes: 13 additions & 0 deletions boot/m1n1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,16 @@ gives the same tree as Hoolock's tip before updating `sources.toml`.

Scratch stays in ignored `boot/m1n1/.work/<device>/`. `--resume` reuses it only
if the recorded patch set is unchanged.

## Resident PSCI on A7-A9

Orchard patch 0015 adds the resident EL3 PSCI monitor (CPU_ON, CPU_OFF,
AFFINITY_INFO); 0016-0019 make it the default whenever m1n1 is entered at EL3
and add SYSTEM_RESET (warm reboot back into m1n1, which boots the default BLS
entry with the last launch's DTB) and SYSTEM_OFF (halt). Any PSCI-aware
kernel reboots, powers off and kexecs through its ordinary paths; m1n1 takes
IPI-stopped CPUs back by trapping EL1 WFI/WFE to EL3. EL1/EL2 entries keep
the spin table. Payload variables (append to `m1n1.bin`, e.g. with
`psci-loader`): `psci=0` turns PSCI off, `psci_reset=0` keeps only the CPU
lifecycle (no WFI/WFE traps), `psci_reset=proxy` stops in the proxy after a
reset. 0020 marks retained hardware in the device tree after a re-entry.
Loading
Loading