206 KiB
Redmi K40 (alioth)
UFS root with launchd, a stable lock screen, touch input and a published GPU device driving the staged Metal accelerator; the desktop draws on the parity pin but SpringBoard loses its Metal device at the client IOVA window, and there is no Wi-Fi.
Source record: porting.toml, e4f9243be178bb6af46feef63e8b05019cefb65b.
This page is generated from the device record.
| Area | Status |
|---|---|
| Configuration | implemented |
| Firmware and boot | implemented |
| CPU and interrupts | device-verified |
| Memory and DMA | implemented |
| Storage and root | device-verified |
| Display | implemented |
| Input | implemented |
| GPU | device-verified |
| Network | planned |
| Audio | planned |
| Power | planned |
| Image assembly | device-verified |
| Diagnostics | device-verified |
| baseband | planned |
| bluetooth | planned |
Configuration
implemented
Components: ArmDTPlatform, ArmCpu, SoftwareAES, XnuPrelink, DarwinBoot, AppleKeyStoreState.
Hardware and dependencies
- Four profile files merged in a fixed order: profiles/arch/arm64/profile.toml, the SoC profile from the feed checkout out/feeds/UniXNU-sm8250-common-HASH/soc.toml, profiles/os/ipados-17.7.11-21H461/profile.toml, then this repository's board.toml.
- feeds.toml pins the SoC repository (FFT-infra/UniXNU-sm8250-common, a67a9bf3) and two driver sources, ShengUfs and QcomXnuUsbDebug. The device branches ArmCpu, Adreno650 and AdrenoMetal are submodules of this repository, at FFT-infra/ArmCpu@9bcf890, FFT-infra/Adreno650@84f4b44 and FFT-infra/AdrenoMetal@8459f90. The OS profile pins XNU d8b80295 and the IPSW iPad_Pro_HFR_17.7.11_21H461.
- unixnu.lock records the resolved git sources, so a checkout resolves to the same commits without moving.
Configuration
- schema_version = 2. [board]: name alioth, soc SM8250, soc_source sm8250, os_profile ipados-17.7.11-21H461, kit alioth. [components] include names twelve components; ShengUfs pulls VirtioMmioBlock and VerifiedRoot, and ShengHidInput pulls ShengNovatekTouch, so status resolves fifteen.
- profiles.merge is a recursive dictionary merge and replaces a list wholesale: the board's config_fragments, patch_series and archives are the whole lists, not additions to the arch profile's.
- configs/alioth_defconfig holds 29 CONFIG_XNU_ switches. unixnu defconfig writes them into out/DEVICE/OS/CONFIG/.config, and build kernel reads .config, never the defconfig.
- Patch order is the four series in sequence: arch 57 entries, soc 2 (native-smp-secondary, native-smp-type-clusters), os 9 (including two QcomXnuUsbDebug and two XnuPrelink component patches), device 0. status --json reports all 68 in that order.
Procedure
- ./unixnu defconfig alioth_defconfig -D ../UniXNU-alioth. Run it after every edit of configs/alioth_defconfig: build kernel reads .config and does not notice a changed defconfig.
- ./unixnu fetch -D ../UniXNU-alioth updates submodules, shallow-fetches the git sources and writes unixnu.lock.
- ./unixnu status --json -D ../UniXNU-alioth prints the four profile paths, the merged board, the catalog entry and the resolved module for each component, and the patch order.
- ./unixnu tree -D ../UniXNU-alioth assembles the build tree. Compare the modules it links with what status reports.
- Acceptance, from the UniXNU checkout: python3 scripts/porting-record.py check --device ../UniXNU-alioth, which prints 13 structured areas checked.
Development findings
- 2026-11-08: the round build moved to scripts/build-round.sh, which derives the device, base and workspace paths from its own location. board.toml and feeds.toml keep the same selections. No hardware behavior change.
- 2026-11-08: board.toml trust_cache_sha256 changed from f5449ea4f6aa8820e87ce9c1d53960c291667f0c3c5d5be13c8c9d8b9ff181cc to c2b71ada8e5c476d8895f02625d80c43699cc697b8ca48ed9f6f80473eab481e after rebuilding the Metal plugin and its three-module owner trust bundle. The accompanying comment records CDHashes cddc5705 (plugin), 3bdcdfff (daemon) and a9c5a07a (Turnip). payload.py accepts only the named bundle; a rebuild must update both the pin and this finding.
- 2026-11-07: the resolver reads this repository before the base repository (feeds.py steps 5 and 6), so a driver under this repository's drivers/ overrides the base submodule of the same name. ArmCpu, Adreno650 and AdrenoMetal are linked that way; the base repository's AdrenoMetal submodule follows upstream again, and scripts/build-adreno-metal-plugin.py reads this repository's drivers/AdrenoMetal. QcomXnuUsbDebug stays a catalog component because the OS profile patch series names it and the other alioth device records and munch select it; this device pins its branch through feeds.toml instead of a submodule. A clean checkout with local.toml removed resolves ArmCpu df4f831 and Adreno650 6effc73 from this repository.
- Array values replace and dictionaries merge. profiles.merge deep-copies the overlay over the base and recurses only when both sides are dictionaries, so a board list is the final list. That is why board.toml repeats the arch profile's patch_series and archives in full instead of adding to them.
- Measured 2026-10-30: status prints a catalog revision beside the module it resolved, and the two disagree twice. ShengUfs shows e2b32cc4 (UniXNU/ShengUfs) while the module is ab54059 (FFT-infra/NativeUfs-alioth from feeds.toml); ShengHidInput shows 5f3a37ce while the device submodule is f35c4ff1. The build compiles the resolved module, so a catalog pin does not describe the image. This replaces the earlier claim that components.toml names the revisions the build compiles.
- The images that reached the desktop were not built from those pins either: every build script passes --local-module driver:ShengUfs=../NativeUfs-alioth (94a3dd6a) and driver:ArmCpu=../ArmCpu-alioth (a9c4585d), both ahead of what status reports without those flags. Repeating status with the same two --local-module flags shows the difference.
- The earlier claim that components.toml is kept equal to the working tree after every pin move is withdrawn for the same reason: it is equal to the working tree, and the working tree is not what the images were built from.
- kits/ArmSmmu4K in this repository is a symbolic link to ../../UniXNU/kits/ArmSmmu4K, not a copy, so the device repository carries none of its bytes. The catalog entry ArmSmmu4K names 3ba92451, which is the gitlink the main repository commits. An earlier finding called the device copy byte-identical, and that was wrong.
- On the Mac, ./unixnu needs /opt/homebrew/bin/python3.13: the system python3 has no tomllib, so the driver stops with ModuleNotFoundError before it parses anything.
- board.toml repeats the profile's 31 prelink roots in a [kernel.prelink] block so a board change can append to it. profiles.py merge() replaces a non-dict value wholesale, so the list has to be whole. As committed, the root set equals the profile's. The working tree carries four more (IOUSBDeviceFamily, AppleEmbeddedUSB, AppleUSBDeviceMux, AppleSynopsysOTGDevice), uncommitted and never booted: the USB stack analysis records that an offline prelink with them resolves and links, and that no hardware boot has tried them.
- The GPU driver that is compiled is reference/repo/Adreno650, which has no remote this project can push to, and it carried an uncommitted working-tree change through every image from u252 to u270: the two client text lines per process. It is committed there now (d7bfe27) so the source at least matches what shipped, but the repository still cannot be reproduced by anyone else. Moving that driver into a pushable fork is a prerequisite for any further change to it, including the pool argument rename.
- The board's own driver forks are pinned by this device repository, not by the main repository's submodules: GopFramebuffer and QcomXnuUsbDebug moved to feeds.toml with their exact commits, because porting/device-repository gives board driver submodules to the device repository and AGENTS.md does not list .gitmodules among the main repository's allowed edits. build script and tree resolve both through feeds/. AdrenoMetal is a submodule of this repository, and scripts/build-adreno-metal-plugin.py reads it there.
- The ShengUfs and ShengHidInput catalog rows deliberately do not name the scripts this board compiles with, and that is the answer to the question this area used to carry. The catalog names build-arm-driver.py for ShengUfs, while the board's kernel archives invoke build-storage-bindings.py --component NativeUfs --archive libShengUfs.a and build-sheng-hid-input.py. Both are the archive form: the driver object is compiled by the component build and the board supplies the binding layer against the kernelcache symbols, which is how the reference board builds them too. Editing uniXNU's components.toml to name a device-side script would put a board detail into a shared catalog, which the device-repository rules forbid, so the rows stay upstream and the divergence is recorded here instead.
- sheng-build-tag is no longer kept in board.toml. Every image build rewrote it, which touched this area's paths on every commit and made the record check demand a finding each time; the tag now arrives as --kernel-arg NAME=VALUE, which payload.py replaces over the board's argument of the same name.
Completion criteria
- All source pins resolve, every selected component has a record, and status shows the intended overrides and patch order.
- Measured 2026-11-07: status --json resolves the device branches from drivers/ArmCpu and drivers/Adreno650, the base components and 68 patches from the four profile files, and porting-record.py check passes with 15 areas.
Current limits
- The base repository's own submodules still name UniXNU/ArmCpu, UniXNU/Adreno740 and UniXNU/AdrenoMetal. The resolver takes this repository's drivers/ directories first, so a clean checkout builds the device branches, but a reader must not take the base gitlinks as the image source.
Next action
- Both halves of the previous step are now closed, and neither needed a code change. The two SoC patches are committed to `UniXNU-sm8250-common`'s `patches/xnu/` and listed in its series file; and the catalog rows stay as they are, because the divergence is the documented archive form rather than a defect (see the finding below).
Evidence
source: The 29 kernel switches unixnu defconfig writes into .config, the file build kernel actually reads.source: The SoC source and the four driver sources pinned by commit, including the two forks that exist only for this board.
Firmware and boot
implemented
Hardware and dependencies
- The `uefi-alioth` repository, a Mu-Silicium port for this board; upstream is Project-Silicium/Mu-Silicium. The board platform is Platforms/Xiaomi/aliothPkg/, the SoC support is Silicon/Qualcomm/KonaPkg/, and the EDK II tree is the Mu_Basecore submodule.
- The firmware volume is 3 MiB at 0x9FC00000 (Resources/Configs/alioth.toml [uefi_fd], base 0x9FC00000, size 0x300000), which MemoryMapLib places between Display Reserved (0x9C000000+0x02400000) and UEFI Stack (0x9FF90000+0x00040000).
- The frame buffer is the phone's own cont_splash_region: 0x9C000000, 0x2300000 bytes, 1080x2400 at 32 bpp with 4320-byte rows. The firmware hands it over in the memory map and UniXNU republishes it to the OS.
- Firmware versions, which porting/steps asks for in its first step. What is recorded: the vendor kernel this port was read against is Linux 4.19.312 (reference/k40-kernel/Makefile VERSION 4 PATCHLEVEL 19 SUBLEVEL 312). What is not: the phone's own stock firmware build, that is XBL/ABL, the modem, the ADSP and the other DSP images, has no version recorded anywhere in this repository and no dump of it is kept. That is an outstanding input rather than a completed one, and it matters because a vendor firmware update can move the reserved regions and the PAS image layouts this port reads.
- No Android vendor blob is consumed. proprietary-files.txt records that the UEFI firmware, the device tree, the kernel and kexts, both root volumes and the Data seed are all built from source or taken from the target IPSW.
Configuration
- [firmware] in board.toml: config alioth, dsc Platforms/Xiaomi/aliothPkg/alioth.dsc, fd Build/aliothPkg/{target}_CLANGPDB/FV/SILICIUM_UEFI.fd, preflight scripts/check-alioth.py.
- patches = Resources/MuPatches/Gic-Spurious.patch, applied to the EDK2 tree for the build and reverted in a finally block. It masks an unhandled level interrupt after acknowledging it, because such a source re-fires immediately and starves the CPU.
- submodules = Common/Mu, Common/Mu_OEM_Sample, Silicium-ACPI, Silicon/Silicium/OpensslPkg/Library/OpensslLib/openssl: the four the board needs on top of the separately provided Mu_Basecore.
- [firmware.defines]: ENABLE_SECUREBOOT 1, DEVICE_MODEL 1 (Redmi K40 / M2012K11AC), MEMORY_PROTECTION TRUE, SHIP_MODE FALSE, BUILDID_STRING alioth-research.
- The DSC [Components] lists AcpiTables, UniXNU, UniXNUDxe, ShengBootMemoryDxe, UniXNURamDiskDxe and DarwinBoot. alioth.fdf pulls Include/APRIORI.inc, Include/DXE.inc and Include/RAW.inc, and DXE.inc adds DiskIoDxe, PartitionDxe, Fat and EnglishDxe.
Procedure
- ./unixnu build firmware -D ../UniXNU-alioth --uefi ../uefi-alioth, run from the UniXNU checkout. firmware.py reads git log of the Mu-Silicium tree, applies the board patches to the EDK2 checkout, runs the EDK II build with -a AARCH64 -b DEBUG -t CLANGPDB and the board defines, then reverts the patches.
- The driver refuses to finish unless the FD exists and is exactly 0x300000 bytes, which is the [uefi_fd] size bootimg also enforces.
- Then build payload and run ./unixnu bootimg --dtb ../uefi-alioth/Resources/DTBs/alioth.dtb. bootimg compiles BootShim.S with -DFD_BASE=0x9FC00000 -DFD_SIZE=0x300000, appends the FD, gzips the pair, appends the device tree and packs the Android image.
- Check the firmware before a boot attempt: UNIXNU_UEFI=<uefi checkout> python3 scripts/check-alioth.py from the device repository, which verifies the DSC/FDF/DXE.inc module list, the memory descriptors, the boot image geometry and that every Binaries/alioth input exists.
- Inspect Build/aliothPkg/DEBUG_CLANGPDB/FV/FVMAIN.Fv.txt for the module list, and boot/boot.json ramdisk_bytes for the payload section of the boot image.
Development findings
- Measured 2026-10-31: the FD builds to 3,145,728 bytes (0x300000). FvMain is declared with NumBlocks = 0, so it grows to fit its content instead of capping at a stored size; the 240 bytes free an earlier build reported were the remainder of the last 4 KiB block, not a limit. After the Advanced Logger wiring the inner FV is 0x8b2000 bytes (0x8b1778 used) inside FVMAIN_COMPACT, which is 0x300000 bytes at 0x18f3c0.
- The required-integration gap that AGENTS.md records is not real, measured 2026-10-30. alioth.dsc does not name DiskIoDxe or Fat in its own [Components] block, but it includes KonaPkg/KonaPkg.dsc.inc, which includes QcomPkg/QcomPkg.dsc.inc, which includes SiliciumPkg/SiliciumPkg.dsc.inc, and that file's [Components] lists DiskIoDxe, PartitionDxe, EnglishDxe and Fat at lines 437-450. Both places the guide asks for therefore exist; the gap was read from the board DSC alone, without following the include chain.
- The FD's disk modules do not all come from the same source, and the GenSec lines say which. The DSC compiles DiskIoDxe and Fat from the EDK2 checkout, and the build log shows both. The FDF then overrides two of them: DXE.inc names Binaries/alioth/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf and .../PartitionDxe/PartitionDxe.inf, whose PE32 sections point at the prebuilt .efi files, so the compiled DiskIoDxe is built and discarded. Fat and EnglishDxe enter the volume from the compiled output. The prebuilt DiskIoDxe is 45,060 bytes against the compiled 27,136.
- Advanced Logger integrated 2026-10-31. alioth.dsc lists AdvancedLogDxe in [Components] and alioth.fdf in [FV.FvMain]; the DSC maps AdvancedLoggerAccessLib, QrEncoderLib, AssertLib and AdvancedLoggerHdwPortLibNull, and points DebugLib and AdvancedLoggerLib at BaseDebugLibAdvancedLogger plus the DxeCore/Dxe instances for DXE_CORE, DXE_DRIVER and UEFI_APPLICATION. The DxeCore instance is what installs gAdvancedLoggerProtocolGuid (AdvancedLoggerLib/DxeCore/AdvancedLoggerLib.c:480); without it the driver's Depex never resolves. PcdUniXNUDeviceModel is alioth and board.toml sets [payload] tools = true. The driver's FILE_GUID 8D4E7F50-3A2C-4C9A-9E1B-50C4C8472D41 sits at 0x00700FB8 in FvMain. Not yet booted.
- The board preflight reads UNIXNU_UEFI from the environment, not from --uefi, so a firmware build driven through unixnu works but a bare scripts/check-alioth.py invocation fails without that export. The driver sets it when it runs the preflight itself.
- On orb, CLANG_BIN must point at a plain toolchain: the nix clang wrapper injects --gcc-toolchain, and EDK II CLANGPDB compiles with -Werror, which makes the unused-argument warning fatal. The one-second failure and the error 7000 / F002 lines are the tell.
- bootimg packs the FD as-is and does not check what is inside it. A firmware volume built before UniXNU.efi existed produced a boot image with no boot manager, which returned to fastboot in about 20 seconds and looked like a kernel fault. Rebuild the firmware after any package build.
Completion criteria
- The firmware volume builds, enters UniXNU, publishes the frame buffer and preserves the documented memory reservations.
- Measured 2026-10-30: the FD is 0x300000 bytes and carries the boot manager, its registrar, the payload block device and the XNU loader; the preflight passes with 36 memory descriptors, 97 vendor inputs and 0 missing, and the frame buffer at 0x9C000000+0x2300000 lies inside Display Reserved.
Current limits
- The firmware log export is a manual channel: Tools -> Advanced Logger pages the log as QR codes and a second device with a camera must scan them (log-capture step 2), so it does not run inside the unattended round. The integration builds and is packed into the FD, but it has not been booted on the board, so firmware-stage logs are still unavailable in practice until one round opens the menu.
- DiskIoDxe and PartitionDxe enter the volume as prebuilt PE32 files from Binaries/alioth while the same modules are also compiled and discarded, so the firmware contains code whose source is not the one the build just produced. Whether the prebuilt pair matches the checkout is unchecked.
- The UEFI firmware has been booted on the board, but no device log of that boot was kept in this repository, so this area is implemented rather than device-verified.
Next action
- Boot the image once and open Tools -> Advanced Logger with a second phone scanning, then record the first firmware log here. After that, decide whether the FDF should keep overriding DiskIoDxe and PartitionDxe with the prebuilt pair or take the compiled ones.
Evidence
source: Records that the firmware, device tree, kernel, root volumes and Data seed are built from source or taken from the IPSW, so there is no vendor blob to download.source: Refuses a firmware tree whose DSC, FDF or DXE.inc lacks the required modules, whose memory descriptors are unaligned or overlapping, whose boot image geometry differs from the board contract, or whose Binaries/alioth inputs are absent.
CPU and interrupts
device-verified
Hardware and dependencies
- kona: four Cortex-A55 (cpu0-3) and four Cortex-A77 (cpu4-7), MPIDR core number in Affinity1 so phys ids are 0x000-0x700. Interrupts and timers come from the ArmCpu component; secondary start is PSCI CPU_ON over smc.
Configuration
- board.toml: sheng-smp=1 starts secondary CPUs, armcpu-spi-ipi=1 routes IPIs through software-pended SPIs, armcpu-self-ipi=1 makes each core signal itself so XNU enables its IPI (a component argument, not one of the documented boot arguments), armcpu-diagnostics=1 reports the bring-up. sheng-gpu-dynfreq is not on the command line: the merged line measures 988 bytes of the 1000 unixnu.com/zh/xnu/boot-arguments allows, and the switch therefore lives in GpuProbe.cpp with a default of 0. dts: unixnu,cluster-type E on cpu0-3 and P on cpu4-7.
Procedure
- Apply both SoC patches (native-smp-secondary, native-smp-type-clusters) through the SoC repository's patch series, then build kernel, payload and boot image and boot over USB. Verify in the build tree that MAX_CPUS is 8 in the BCM2837 block, MAX_CPU_CLUSTERS is 2 and __ARM_AMP__ survives the later #undef.
Development findings
- The deaf core is not a driver probe. With every kernel thread this package starts named, the thread a stopped core holds reads pr=31, the user-thread default, and has no name; no kernel thread runs below priority 80, so at that point in the boot it is the init thread inside its first exec of launchd. The probes are ruled out by their own readings: in two failing boots the GPU probe's thread had not started, in another the SMMU read back ID2 immediately before the bring-up, and making the UFS poll's delay a real spin left the block count at 611. A deaf redistributor reads IGROUPR0 = 0 and IPRIORITYR0 = 0x80808080, identical to every healthy core on this part, so the interrupt is withheld by a section that runs with interrupts masked, not by the GIC's group or priority. Which section is not yet known: the thread's creation continuation is recorded, its current PC is not.
- The CPU IRQ row carried the literal text sleep-disabled=1, so it read as a measurement of a state nothing on this board samples. It was removed rather than guessed at; the row still reports the phase, the quiesce and halt counts and the IPI phase, which are readings.
- SMP is live on all eight cores and the E/P split reaches the scheduler, which is what porting/platform asks for. Evidence from the u260 boot: the per-process CPU rows read c0 through c7 for each process (p54: 4661, 22904, 16537, 15363, 27199, 26747, 27027, 27437), so every secondary core entered and took work; the P cluster (c4 to c7) carries several times the E cluster's count, which is the UI workload landing in the P domain; and CPU IRQ reads phase=0 quiesce=0 halt=0 with the IPI phase reached. The cluster tags come from dts/alioth.dts, which must stay paired with the SoC series' native-smp-type-clusters.patch -- without it the topology parser writes past cluster_phys_to_logical and the kernel dies before the console.
- The wakeups monitor fires on every process within a minute of kernel time, and the numbers are self-consistent rather than a clock artefact: 45029 wakes over 28 s reads 1608 a second, which is the same interval the count implies, against a limit of 150 a second (45000 over 300 s). A 24 MHz default against this SoC's 19.2 MHz counter was suspected and is ruled out: the generated ADT carries timebase-frequency 19200000 on all eight cpu nodes, each state=running (u265), and pe_identify_machine copies that value. So the wakes are real. The processes are iOS daemons (healthd, kbd, homed, searchd, biomed) polling on a clock this kernel runs, and whether that is their own design or an IPC/timer service answering too eagerly is the open question.
- Without native-smp-secondary.patch the reset vector masks MPIDR with 0xFF, which is Aff0 and is zero for every kona core, so every secondary core picked the boot CPU's cpu_data and reset handler. The boot either panicked with Invalid kernel stack pointer or hard-locked with interrupts off in early initialisation.
- unixnu,cluster-type must never ship without native-smp-type-clusters.patch. With MAX_CPU_CLUSTERS still 1 the topology parser takes phys_cluster_id = (cluster_type == P), which is 1, and writes cluster_phys_to_logical[1] past the end of a one-element stack array. Release builds do not assert: the kernel dies before the console comes up. scripts/check-smp-topology.py refuses that combination.
- Both patches are private to UniXNU-pipa, not present in UniXNU/UniXNU. They live in the SM8250 SoC repository because the topology they describe is a property of the SoC, which is why the pins differ from the SM8550 device's.
Completion criteria
- Every enabled CPU reaches its entry checkpoint and timer/IPI handling works on each enabled CPU.
- Measured 2026-11-08: the deaf core is not a driver probe. With every kernel thread this package starts named, the thread a stopped core holds reads pr=31 (the user-thread default; no kernel thread is below 80) and has no name, so at that point in the boot it is the init thread inside its first exec of launchd. The GPU probe, the SMMU prerequisite reads and the UFS transfer poll are each ruled out by their own readings: the probe's thread had not started in two of the failing boots, the SMMU read back ID2 before the bring-up in another, and making the poll's delay a real spin left the block count at 611.
- Measured 2026-11-06: with the GPU busy-counter poll off, every boot keeps all eight cores (CORES deaf=00, wd=0/00 for whole rounds), the per-core timer and SGI counts climb on all eight, and the page monitor turns once a second instead of stopping at seven. Before that fix one core stopped taking timer interrupts about seven seconds into every boot.
Current limits
- Secondary CPUs have been brought up on hardware and the per-core counters now report, but every core is not usable at once: some stop taking timer interrupts while armcpu_smp_step still reads 7 for them.
- A deaf core's redistributor reads IGROUPR0 = 0 and IPRIORITYR0 = 0x80808080, identical to every healthy core on this part, so the group and priority are not what withholds the interrupt; the core is inside a section that runs with interrupts masked. Which section is not yet known: the thread's creation continuation is recorded but its current PC is not, and the IPI that would sample it was added after the last failure.
- The two SoC patches are no longer lost on a fetch: native-smp-secondary.patch and native-smp-type-clusters.patch are tracked in `UniXNU-sm8250-common`'s `patches/xnu/` and listed in its series file, committed on that repository's gmu-freq branch (origin FFT-infra/UniXNU-sm8250-common). The earlier text here said the opposite and was stale.
- unixnu,cluster-type is still declared in the board DTS rather than the SoC DTSI.
- armcpu_smp_step reports 7 (running) for every secondary, but that step is bring-up progress only: it does not say the core still takes interrupts. One core per boot used to stop taking them about ten seconds in. That is fixed: the GPU busy-counter poll (sheng-gpu-dynfreq, default on) read a GMU register that never returned, and the core executing it stopped taking interrupts for good. the timer PPI is pending and enabled, never active, and WAKER reads 0, so the core is awake and simply does not take an enabled interrupt. The core follows the thread, not the other way round: both w9 rounds froze the core that held tid 111 at state TH_RUN, and it was c5 in one round and c4 in the next. Every thread asleep on that core is lost as a consequence, because with cpu_idle_latency 0 at machine_routines.c:2484 IOSleep blocks on assert_wait_deadline and its deadline lives on that core's timer queue; the touch loop froze in exactly the rounds where it last ran on the deaf core, and ran normally in the round where the deaf core was somewhere else.
- A single-core image does not run: three boots with sheng-smp=0 stopped at 'BOOTLOG beat 0 phase 5' with no SUPER row, so there is no cheap uniprocessor control for the SMP question.
Next action
- Re-enable the GPU busy-counter poll only through a caller that holds the GPU powered. The switch is now a contract, not a setting: native_gpu_freq_tick returns unless native_gpu_freq_powered is set, nothing sets it, and the 1 Hz call from boot_log_tick is gone, so no diagnostic path can read a GMU register again. native_gpu_freq_tick is off now (board.toml sheng-gpu-dynfreq=0) and with it off two whole rounds kept all eight cores, the desktop came up at t=80s and the touch loop kept counting, so the poll was the thing stopping a core taking interrupts. What is still missing is the owner: per unixnu.com/zh/porting/drivers a driver interface must name its clock and power owner, and here the only owner is the Adreno driver, which is a pinned shared component (unixnu.com/zh/porting/device-repository forbids editing it in place). The route is a change in that component repository, a feeds.toml pin update, and a new source version recorded here. gColdOk && gx_on only proves the GX rail is up; it never proved the GMU clock. Then measure, in one round, whether the read path is safe elsewhere too: gpuBusyTicks is the only GMU read shown to wedge a core so far, and the wide GMU window reads in the same file have not been tested separately.
Evidence
device: w11 named the wedged thread boot_progress (ac=6f/4, pr=92) in both rounds, one with a desktop and one without. w12 read ms=4 ts=4 mon=7 in both: the monitor ran seven rounds, and boot_log_tick had returned from the DPU probe and never written step 5, so the call it never returned from is native_gpu_freq_tick. w13, with sheng-gpu-dynfreq=0, kept every core for two whole rounds (deaf=00, wd=0/00, no GICR row), the monitor ran past 190 rounds, the desktop was up at t=80s with sw=124/124/0 and 149/149/0, the touch frame count kept climbing, and the user confirmed the screen and the touch on the board. Command:fastboot boot tmp/boot-w11.img, then tmp/boot-w12.img, then tmp/boot-w13.img, and read the GICR and CORES rows on the USB console. Revision:70ba9427932897d7fbba34ed875136e9f577b95f.device: Both rounds lose exactly one core and both hold the same thread id at state 4 (TH_RUN): c5 in the first round, c4 in the second, frozen at 12155/1100 and 191714/6874 from t=20s to the end of the round. The suspects printed beside it hold state 0x84 (TH_RUN|TH_IDLE) and recover, and the second round shows the touch loop healthy (tf 2834 to 11715, tc=6) while c4 stays frozen, so the wedged thread is not the touch thread. The previous round's claim that a lost sleeper is the root cause is therefore reversed: losing sleepers is the consequence. Command:fastboot boot tmp/boot-w9.img twice and read the ac= field of the GICR row on the USB console. Revision:259c22987589765deb60bcedfefd8e7fac1f8bd7.device: The suspect core reads timer PPI pending, enabled, not active, WAKER 0 in every sample of three boots (c6, c5, and c2 with cpus=4); the touch loop froze at 839 and 840 frames in the two rounds where tc equalled the deaf core, and kept running in the two where it did not. The 2026-11-05 known-good image re-run byte for byte produced no desktop in either boot. Command:fastboot boot tmp/boot-w4.img and read the GICR row on the USB console. Revision:6858cb1d087c474861b1cf73cc9bd9e12c69dada.source: Refuses a device tree that declares cluster-type without the cluster patch applied and MAX_CPU_CLUSTERS >= 2, the combination that killed three boots silently.device: One core stayed at 5472/198 timer/SGI interrupts across two separate boots while another took 2.6 million timer interrupts and 557k SGIs in 190 s; total IPIs 1.9M in 190 s with 120k sent and never taken. sheng-smp=0 stops the boot at BOOTLOG beat 0 phase 5. Command:fastboot boot tmp/boot-s10.img and read the CPUT and CPUTM rows on the USB console. Revision:ab53842422feadf058a0575b6e5a968623c6c052.
Memory and DMA
implemented
Hardware and dependencies
- 8 GiB of DRAM in one bank from 0x80000000, size 0x200000000, which is the [payload] dram_size and the /memory node of dts/alioth.dts. The generated ADT carries dram-base 0x80000000 and dram-size 0x200000000, and devicetree.py refuses a dram_size that differs from the hardware DTS.
- The firmware's own reserved regions come from the stock device tree at uefi-alioth/Resources/DTBs/alioth.dtb, 33 reserved-memory children: cont_splash_region 0x9C000000+0x2300000, disp_rdump_region 0xB0400000+0x1000000, dfps_data_region 0x9E300000+0x100000, pil_gpu_region 0x8681A000+0x2000, removed_region 0x80B00000+0x5300000, hyp_region 0x80000000+0x600000.
- Two SMMU instances: the apps SMMU at 0x15000000 (0x100000, plus an implementation window at 0x15182000) with qcom,skip-init, and the GPU SMMU at 0x3DA0000 (0x10000) with qcom,skip-init and qcom,no-dynamic-asid. Both inherit the bootloader's state and neither is initialised by its driver.
- The UFS host is at 0x1D84000 (0x3000) with its PHY at 0x1D87000; the DWC3 controller the USB console uses is at 0xA600000 and its stream is SID 0 through the apps SMMU (iommus = <&apps_smmu 0 0>).
Configuration
- [payload] dram_size 0x200000000 and [payload.adt] owned_memory_size 0x100000000: DarwinBoot copies the kernel into a 4 GiB contiguous window and writes /chosen/darwinboot-memory-size; the generator accepts 256 MiB to 8 GiB in 2 MiB steps.
- [payload.adt] packed_data_ramdisk = true, so /chosen/memory-map carries PackedRAMDisk and the kernel reads the DBRDISK1 extent table instead of copying the whole seed. The Data seed is 3 GiB logical, packed to 1.2 MB.
- [userdata] first_lba 0x2a8000, last_lba 0x3b037fa, lba_bytes 4096, with the OS and Cryptex1,SystemOS windows. That is the UFS LUN 0 range read from the phone's GPT, and it is the only region the storage driver writes.
- SMMU ownership is split three ways: the apps SMMU at 0x15000000 belongs to XNU, which maps it in NativeUfs.cpp and programs the UFS streams; the GPU SMMU at 0x3DA0000 belongs to the board's GPU kit, which maps 64 KiB of it in GpuProbe.cpp; and the GPU and GMU contexts are routed by the board, not by ArmSmmu4K, so the kit stays upstream.
- UFS streams: board.toml passes native-ufs-stream=0xe0 and native-ufs-stream2=0x4e0, because NativeUfs defaults to sheng's 0x60 and SM8250 routes the UFS host through both 0xe0 and 0x4e0. The driver reuses the bypass context the bootloader already programmed rather than building one.
- Cache policy: the MMIO windows are mapped kIOMapInhibitCache, and the SMMU context for a UFS stream is S1_TRANS_S2_BYPASS with SCTLR.M clear, so the transport is physical pass-through, with CBA2R VA64 set because a 32-bit-only bypass rejects addresses above 32 bits.
Procedure
- dtc -I dts -O dtb -i ../UniXNU-sm8250-common/dts -o out/device-tree/hardware.dtb dts/alioth.dts, which is what ./unixnu build payload runs before it generates the ADT.
- dtc -I dtb -O dts out/device-tree/hardware.dtb to read back the merged tree: one memory bank, one reserved-memory node (splash_region), eight enabled CPUs and the UFS nodes.
- Read the generated sidecar out of the payload with mcopy -i payload/payload.img ::/EFI/UniXNU/Payloads/kernel.macho.adt, then check for dram-base, dram-size, darwinboot-memory-size, PackedRAMDisk and TrustCache.
- On the board, read the storage rows on the console and the GPUROW lines for the SMMU: GPUROW13/14 carry the GMU routes and GPUROW18 carries the GPU context's four routes.
Development findings
- The GPU SMMU's free-slot test compares the whole S2CR word against 0x00020000, and this part's unused slots read 0x000203ff, which is FAULT with CBNDX 0xff left in the low byte. Every slot came back busy and no route was written, so Attach returned e00002ca. The board now rewrites the slots it is about to use to the canonical FAULT word, and only where the type is already FAULT; clearing a slot to zero turns FAULT into TRANSLATE and makes it look busy again. Measured: routes 2, phase 5 with 13 writes, SCTLR enabled, GMU firmware in 16 blocks.
- The two SMMUs are owned by different code and that split is deliberate. Moving the slot normalisation into ArmSmmu4K was measured to produce byte-identical rows, so the board keeps the change because it is one site, it is reversible, and the kit stays where upstream maintains it.
- Firmware leaves an SMR entry for SID 0 pointing at context bank 5 with SCTLR 0xe0 (M clear) and TTBR0 zero: the USB stream is programmed but no table exists under it. QcomXnuUsbDebug reclaims that slot only when translation is off and there is no table, and still refuses a bank holding a live mapping.
- The UFS bypass is adopted, not built. After hand-off the apps SMMU has USFCFG set, so an unmatched stream faults; there is no stream-match entry for the UFS host; and a TYPE=BYPASS S2CR reads back as FAULT. NativeUfs therefore reuses an existing bypass context and writes VA64 before exposing a new stream, because ARM IHI 0062D.c requires it for inputs above 32 bits even with SCTLR.M clear. Two sCR0 readings are on record and they differ in one bit: 0x002f0406 in the driver's comment from 2026-10-17, 0x00270406 in reference.md section 16.1. Both pass the kit's (scr0 & 0x407) == 0x406 test; the difference is not explained and neither is treated as the authoritative one.
- sCR0 has no SMMUEN bit on this part: bit 0 is CLIENTPD and 0 means translation is enabled, which is SMMUv3's CR0 bit and not this unit's. The kit's global() test is (scr0 & 0x407) == 0x406, and the recorded readings pass it. Reading SMMUEN as zero and calling the unit disabled was wrong.
- The reserved-memory node in dts/alioth.dts holds only splash_region, and that is all the kernel needs: the other 32 regions are the bootloader's, described in the firmware DTB, and UniXNU receives the frame buffer through the UEFI memory map rather than through the DTS. The handoff contract is therefore two trees: the small one the ADT is generated from, and the firmware one the bootloader reads.
Completion criteria
- Every handoff region is accounted for and each enabled DMA engine reaches its allocated range with the documented cache policy.
- Measured: the ADT carries one 8 GiB DRAM range, a 4 GiB owned window and a packed Data ramdisk; the UFS transport runs through the bootloader's bypass context on streams 0xe0 and 0x4e0; the GPU SMMU routes the GMU and GPU contexts after the board's slot normalisation.
Current limits
- The apps SMMU's bank 0 is not reachable: CBAR[0], CBA2R[0], CB0 SCTLR and ATS1PR each take the machine down about two seconds after the access, while CBAR[1], CBA2R[1] and CB1 in the same 4 KiB page read and write normally. Whether bank 0 belongs to the secure world is not verified.
- SMR slot 5 (0x8000007f) reads back zero, and writing 0xff sticks. Whether the stream table refuses a new valid route or slot 5 is reserved is unverified.
- Two differences from the vendor driver are recorded but unfixed in ArmSmmu4K: S2CR writes carry no SHCFG, and SMR matching supports no mask range.
Next action
- Decide whether bank 0 belongs to the secure world, with one boot that reads 0x9000 and 0x8000 separately, then record the result here and in the GPU area.
Evidence
source: One 8 GiB DRAM bank from 0x80000000, and the one reserved region the board itself declares: splash_region@9c000000, 0x2300000 bytes, which is where the bootloader places the payload ramdisk and which the phone's own tree also names cont_splash_region.device: routes 2, phase 5 with 13 writes, rb 1, en 1; GMU firmware 16 blocks, version 20010008, cm3 1, HFI acked c6 -- the GPU SMMU routes only after the board writes the canonical FAULT word. Command:boot a pipa-gpu=7 image with the slot normalisation and read GPUROW13/14/15 from the serial console capture. Revision:7946cba83f32b768075a071a5d47bb0a2fd3eeb2.
Storage and root
device-verified
Components: ShengUfs, VerifiedRoot, VirtioMmioBlock, RamBlock.
Hardware and dependencies
- UFS 3.1 host on SM8250, bound through ShengUfs, plus the two authenticated volume windows (OS and SystemOS) inside userdata.
- The ShengUfs component ID resolves to the community repository `FFT-infra/NativeUfs-alioth`, the maintainer's fork, not to `UniXNU/ShengUfs`. The official component ID stays; the source identity is recorded here.
- The Data seed is a raw APFS container: scripts/prepare-owner-data-fixture.py requires NXSB at 0x20, so the ADT reserves RAMDisk rather than PackedRAMDisk.
Configuration
- CONFIG_XNU_NATIVE_UFS=y, CONFIG_XNU_VERIFIED_ROOT_PROBE=y, CONFIG_XNU_OWNER_ROOT_AUDIT=y, CONFIG_XNU_OWNER_ROOT_TRUST=y.
- CONFIG_XNU_NATIVE_RAM_BLOCK=y and CONFIG_XNU_OWNER_DATA_MOUNT=y; the Data mount must go through the RamBlock IOKit device, not /dev/md0.
Procedure
- ./unixnu build payload --data-ramdisk <seed>, then bootimg, then fastboot flash boot_b.
- The panel reports UFS read progress and the RAMDisk capacity; the USB console carries exit records.
Development findings
- UFS reads run through ShengUfs and the panel reports verified blocks; the root is published only with an owner-signed policy, so CONFIG_XNU_VERIFIED_ROOT_PROBE must stay on or IOFindBSDRoot times out ten times and panics.
- The Data mount fails with ENOENT through /dev/md0 (measured 2026-10-26, panic screen offline scratch Data mount failed: 2); publishing the seed through RamBlock as a real IOMedia is the path that mounts.
- The Data volume is 32 MiB and holds the original private/var excluding staged_system_apps (39 files, 611715 bytes). Measured 2026-10-27: 20000 directories fit in 5.8 MiB, so capacity and inodes are not the limit for the services that fail.
- cryptexd aborts with mkdirat [28: No space left on device] while that volume reports 31 MiB free, so the ENOSPC names a different mount than /private/var.
Completion criteria
- The configured OS volume mounts and launchd starts; the Data volume mounts read-write as apfs and is accepted by native_owner_data_prepare.
- Persistence within the allocated Data region is not yet demonstrated across a reboot.
Current limits
- The write that fails with ENOSPC is not yet identified: the mkdir probe that prints its path is built but has not run on hardware.
- The Data seed cannot simply be enlarged: boot_a and boot_b are 192 MiB and the payload is a FAT volume, so a seed larger than that does not fit.
Next action
- Run the mkdir probe build and read the path it prints, then decide whether the failing write is on /private/var or elsewhere.
Evidence
device: The kernel reports cryptexd aborting with mkdirat ENOSPC while the Data volume reports 31 MiB free, which places the failing write on a mount other than /private/var. Command:read /dev/tty.usbmodem<N> at 115200 8N1 and collect EXITLOG records. Revision:24d127c47217eb580dbe3f3a94c32ad25cbaae00.
Display
implemented
Components: GopFramebuffer.
Hardware and dependencies
- The panel is 1080x2400 and the loader hands over a framebuffer at 0x9c000000 with 4320-byte rows and 32 bpp, so the display path starts from that memory rather than from a GPU.
- IOMobileFramebufferLegacy is prelinked and exports nothing, so the board archive binds each name to its original absolute address.
Configuration
- CONFIG_XNU_NATIVE_LEGACY_DISPLAY=y; offline-component-load-probes.patch calls both display entry points, so the archive must resolve them or the link fails.
- build-xnu-4k-baseline.sh force-loads libNativeLegacyDisplay.late.a and re-proves every address against this kernel on each run.
Procedure
- Boot the image and read the diagnostic page rows for DISPLAY stage, CLIENT and SWAP; the USB console carries the exit records.
- A photograph of the panel is the frame evidence until a swap is submitted.
Development findings
- 2026-11-13 direct scanout still does not arm: with `dpu-scanout=2` the image carries the argument but `VSYNC dpu=00000000 ds=0`; `NativeLegacyDisplay.cpp:306` returns because `native_ufs_dpu_state>>31` is zero, so the ShengUfs display bank has not installed the window. The widget probe is not conclusive: a narrow `(242,242,247)` counter read 0 on a 250-white surface, and `WidgetRenderer_Defa` reports `problem surface import ref~command_buffer/mod.rs:599`; fix that surface import before claiming widget pixels.
- 2026-11-13 wp3xbundle: the panel shows the J120 wallpaper. The device class is `1024w-1366h@3x~ipad`; the sealed Flat bundle is `@2x`. The owner bundle `7570.iPadOS_17_Flat-1024w-1366h@3x~ipad.wallpaper` declares `@3x`, and `zzz-native-wallpaper-bundle.patch` unions it over the collection and mounts the PNG animation over its `.ca`. `SURFACEL` reads 984/1000 with `mx=253/3/117`, `PANEL` 1000/1000, and `CollectionsPoster:device-ok`. `logicalScreenClass="any"` alone loaded the bundle but used a square view (`SURFACEL 503`, blank lower rows); `@3x` on the sealed `@2x` bundle loaded nothing (`SURFACEL 18`).
- Brightness goes through the panel's own DCS 0x51 register, not an I2C controller: this panel is qcom,mdss_dsi_k11a_38_08_0a_dsc_cmd with bl_ctrl_dcs. The packet leaves through DSI0's TPG command FIFO with no DMA buffer, the path dsi_ctrl_hw_cmn_kickoff_fifo_command takes. Two host tests cover the packet and address arithmetic and caught three errors before any boot: the DCS read wrote 0x72 rather than the command byte, max-return used 0x15, and the GPIO PPID was sheng's 0x18c rather than this board's 0x0c6. Not verified on hardware.
- The brightness interface is the panel's own DCS register over DSI, not an I2C controller, so UniXNU-sheng's AppleARMBacklight.cpp does not port here. This board's panel is qcom,mdss_dsi_k11a_38_08_0a_dsc_cmd (alioth.dts:27435) with qcom,mdss-dsi-bl-pmic-control-type bl_ctrl_dcs, bl-min-level 0x01 and bl-max-level 0x7ff (27487-27489), plus mi,mdss-dsi-bl-dcs-big-endian-type (27472). There is no KTZ8866 node anywhere in the tree -- zero occurrences -- and the only WLED node, qcom,pm8150l-spmi-wled at 5477, is status disabled. sheng drives two KTZ8866 parts over GENI I2C, which this phone does not have. The level goes out through DSI0's test-pattern command FIFO with no DMA buffer (dsi_ctrl_hw_cmn_kickoff_fifo_command, reference/k40-kernel/techpack/display/msm/dsi/dsi_ctrl_hw_cmn.c:703); the controller is qcom,dsi-ctrl-hw-v2.4 (alioth.dts:30915).
- The DCS 0x52 read-back is the judge, not the picture: a level has to come back inside 0x01..0x7ff before a write is trusted. A host test is the right place for the packet words because two errors there are invisible on a panel that already lights: a DCS read whose command byte ORs 0x20 turns 0x52 into 0x72, and SET_MAXIMUM_RETURN_PACKET_SIZE is a 0x37 write, not a 0x15 one.
- u266 is the first image whose plugin pin, bridge patch list and built bundle all name the same source, and the GPU hand-off survives it: GPUFRAME reads offered 7 done 7 fail 0 copied 0 on an untouched boot, which is the idle count this board shows since the touch correlation was measured (79 to 830 with a touch, 7 to 10 without).
- The Metal plugin's pin and its bridge patch list disagreed between u258 and u265: the repository pinned AdrenoMetal 6ee4328's parent (afaa171, sixteen patches) while build-adreno-metal-bridge.py listed the twenty the parity branch carries and every image was built from that branch's bundle. The pin now names parity-selftest, so pin, patch list and built plugin describe one source, and --manifest-only accepts the pair. The translator is fetched by SHA (624bab39), not by branch: it is on neither master nor development, and the build refuses a checkout whose HEAD differs from the pin.
- The GPU raster hand-off was a stub until u260: native_legacy_gpu_offer returned false with five parameters while the display driver calls it with six, so the format was dropped and every frame took the CPU copy path (GPUFRAME offered 0 across boots). u260 implements it and creates the presenter at phase 4, attached to the resource service rather than under the display node. Measured once: gpu offered 830, done 830, fail 0, copied 0. That turn is not repeatable on its own: the same image (boot-u260.img, sha 2e00d7cba235) run again as u263 gave offered 9, nine swaps and luma 29 with AegirPoster aborting 15 times. The difference is whether anyone touches the panel. Across twelve boots the split holds with one boot set apart: with a touch, swaps 76, 144, 215, 413, 830; without one, 8 to 10. The exception is u253, whose GPUFRAME reads legacy surfaces 0 swaps 0 with a touch present -- that boot took the direct scanout path, so the compositor never handed a surface to the legacy layer and the counters describe a different route. Counting only boots that reach the hand-off, the split has no exception. The compositor submits frames when something asks it to, so an idle panel shows whatever was drawn once and a touched one keeps drawing.
- The GPU client allow-list named PosterBoard, but the processes that run the wallpaper are its extensions: AegirPoster and KaleidoscopePoster abort-looped fifteen and twelve times a boot while PosterBoard itself never appeared. The addon is packed with --clients AegirPoster,KaleidoscopePoster,SpringBoard,iconservicesagent since u260 through scripts/make-gpu-addon-alioth.sh. That is not sufficient on its own: u259 drew with the old list and no poster exits at all, and u261, u262 and u263 all carry the new list and still abort AegirPoster fifteen times and KaleidoscopePoster twelve. The client list decides who may ask, but the data cannot separate it from touch: u259 drew with the old list in a touched boot, and u261 to u263 abort with the new list in untouched ones. A clean comparison needs both lists run untouched. The four slots are all taken by that list, so a fifth process still meets kIOReturnNoSpace.
- Measured 2026-10-27 on boot-usb34: the lock screen is stable, SWAP calls=7 ok=7 rej=0, and backboardd creates its resources with kret=0. Earlier builds never submitted a frame at all.
- The panel is driven directly by the kernel's own renderer, which is why the boot-progress page and the colour bands are visible before any userspace renderer runs.
Completion criteria
- A known frame appears with correct geometry and colors, then userland presentation and backlight controls work.
- Brightness, when a driver lands: a DCS 0x52 read comes back inside 0x01..0x7ff, and the panel visibly changes at maximum, at the minimum and at the configured level.
Current limits
- No wallpaper, and the reason is in this repository: sheng-lite=1 disables the two wallpaper extensions by label (com.apple.NanoUniverse.AegirProxyApp.AegirPoster and com.apple.WatchFacesWallpaperSupport.KaleidoscopePoster) because they faulted with SIGBUS on a userspace pointer every boot. That was recorded while every boot was also losing a core about seven seconds in, so the decision is worth one round now that the core loss is fixed: sheng-wallpaper-posters=1 leaves those two labels enabled and changes nothing else in the lite list. The desktop rounds of 2026-11-06 carry no PosterBoard, AegirPoster or KaleidoscopePoster mention at all, which is what a disabled job looks like. Turning them back on did not change that: the w21 round ran to 190 s with the desktop up (sw=116/116/0, PANEL 515) and still mentioned none of the three. The configuration exists: w27 counts one container whose metadata names com.apple.PosterBoard (app=1 group=0), and w28, reading through that container instead of a baked-in UUID, prints ran status=0 bytes=148. So PosterBoard has stored a wallpaper configuration all along and the earlier ENOENT was a stale path, not a missing app. Those 148 bytes are not a wallpaper choice: printed on the console they read bplist00 with stashedBuildVersionString, CAEnableIOSurfaceCompression and a version string, which are CoreAnimation settings. So the file that was being read is the wrong file. The listing found where the choice actually lives: inside the resolved container, Library/Application Support/PRBPosterExtensionDataStore/61 holds PBFPosterExtensionDataStoreSQLiteDatabase.sqlite3 with a live -shm and -wal beside it, plus Extensions and GalleryCache. A live WAL means the database was being written when the process stopped, which is what a killed PosterBoard leaves. Reading it needs a SQLite reader rather than another path guess, and that is the whole remaining step for this item; porting/display does not require a wallpaper, so it stays a stretch goal behind brightness and input. What is still unknown is which collection is selected and why no renderer draws it. Earlier wording follows. The configuration probe reads what it opens: w25 prints [wallpaper cfg] ran status=2 bytes=0 on every sample, and 2 is ENOENT, so the container UUID baked into that path no longer exists. That is either a recreated container or a PosterBoard that never made one, and the next probe has to walk Containers/Data/Application and print the bundle it matches instead of assuming an id. The older wording follows. The configuration probe is not usable yet either -- sheng_wallpaper_read_cfg opens a hardcoded container UUID (21211B1B-49C3-4486-803E-7E7ABCD864ED) and its row never printed, which is what a read that returns nothing looks like; the next version has to print the open status unconditionally so that a stale container id is visible rather than silent.
- dcls was withdrawn on 2026-10-30. It republished the display service as IOClass AppleCLCD2 to test whether the sandbox refusal on our class name gated the wallpaper; the refusal did not gate it, and PosterBoard kept aborting about fifteen times per boot while the service carried a class name that is not upstream's. The argument is gone from board.toml and the code path stays dormant behind it.
- The two wallpaper switches cannot share a boot: with sheng-wallpaper-posters=1 and sheng-wallpaper-probe=1 together the merged command line is 1038 bytes and the builder refuses anything above 1023. They are tested in separate rounds, which is why the probe that reads PosterBoard stored configuration is a round of its own rather than part of the poster test.
- The brightness probe is in this tree (package/BacklightProbe.cpp, with BacklightCore.h and package/tests/backlight_host.c). The DCS 0x52 read-back cannot judge it: this kernel attaches no DSI0 interrupt and the vendor FIFO path only runs in secure_mode. SET_MAXIMUM_RETURN_PACKET_SIZE was sent as a long packet with a payload word and a length of 8; it is a short packet (0x37 with two bytes, one DWORD), and the long form desynchronised the read. The host test now pins 0x00370002 for size 2.
- The Metal plugin is pinned to the ipados27-gpu-parity branch as of u258, which conflicts with the recorded decision to follow the main branch's model. It is kept only because it is the first image that draws: GPUFB nonblack 992/1000 luma 236 and GPUSWAP 215 retired with reason 0, against 86/1000 and zero to nine swaps on the main-based pin. The branch's costs are also measured: 11702 fence timeouts, SpringBoard refusing buffer and texture allocations with OutOfMemory, and four processes left without a device, PosterBoard among them. Reverting means restoring the 16-patch list and translator 720ef1ce9ae2, so the choice needs the owner's decision rather than a silent default.
Next action
- Find out which of the two DSI0 accesses hangs a core. Measured 2026-11-06: alioth-bl=3 wedged four cores (CPUT deaf=1e, mon=11, sw=0, no desktop), and the probe makes two kinds of DSI0 access in one run, panelBlink and writeBrightness. One round with a mode that only blinks, then one that only writes a level, separates them; until that is done the argument stays out of any release image.
- Check the fallback porting/display promises for direct scanout, because this board does not show it. The page says any failure there falls back to the GPU copy and that the [direct scanout] boot log reports flip count, mapped surfaces, latch time and the wait for the GPU before the flip. The 2026-11-06 storm rounds read prep=121717 against sw=4 with the screen frozen and no [direct scanout] row on the console at all, so either the fallback did not fire or that row is persistent-log only like the wallpaper rows were. Reading it is the first step; if the fallback is genuinely absent, that is a driver defect to fix rather than a configuration to avoid.
- Explain the transfer storm that makes the desktop stop updating once it is touched. On the 2026-11-06 w16 rounds the same image behaved two ways: one boot accepted 401 swaps with 401 prepare calls and answered touch, another accepted 4 swaps while native_legacy_prepare_calls reached 121717 in thirty seconds, and the screen stopped following the finger although TOUCHTAP rows kept arriving (46 and 48 in the two rounds) and TOUCHSTAT read the same contacts, irq and hstage. The control settles one half: with native-touch=0 the same image reads prep=11 and sw=11, exactly one prepare per accepted swap, so the storm needs input to start. The next reading is which caller reaches the transfer path without a validateSwap: count prepare calls per GPUOPEN, per SWAPREQ and per latchTick (NativeLegacyDisplay.cpp:785 calls it, and the direct-scanout branch at :806 leaves latchRequest for latchTick to flip), so a storm with SWAPREQ frozen names the latch or a client-side present that never validates.
- Capture the waiting chain of the render server and SpringBoard on a boot that never presents, which is the step porting/display names: boot-ui-trace=1 is now on, but the console came back with six 'STK none' rows, so first find out whether boot_process_probe reaches its 44th call (about 88 s) or whether its vm_map_read_user blocks before it.
- Keep the CPU presentation path as the default and re-measure it over ten boots. It was called unusable because three boots with sheng-dpu-scanout=0 read ds=1, own=0, sw=0, PANEL=911 and no SURFACEL row; those boots were losing a core about seven seconds in, so the render server never started. With the GPU busy-counter poll off, one round reads ds=1, sw=84/84/0, prep=168, PANEL nonblack=515 luma=125, touch answered and the board owner confirmed the screen. The count is what says whether that holds, and the direct-scanout path stays out until its transfer storm under input is explained.
Evidence
device: The direct-scanout image reads dpu=00000000 ds=0 despite dpu-scanout=2; the source gate returns on native_ufs_dpu_state bit 31. The widget image reads SURFACEL white=0 on a PANEL 250/250/250 surface and WidgetRenderer_Defa reports problem surface import ref~command_buffer/mod.rs:599. No direct scanout or widget pixel is claimed. Command:TAG=ds1 ADDON=gpuaddon-wp3xbundle.gpuaddon sh tmp/build-parity.sh --kernel-arg dpu-scanout=2 --kernel-arg sheng-touch-synth=4000 --kernel-arg sheng-touch-synth-swipe=1, then TAG=wpwhite2 ... and run tmp/rounds-count2.sh on both images. Revision:0bbb8da9fc679dcbbdcc02fc513edd4d4a65f4a7.device: The third boot reads TOUCHTAP, sw=230/230/0, own=1, SURFACEL nonblack=995/1000 luma=245 mx=252/2/116, PANEL nonblack=984/1000 luma=206, and GPUCLI clients=4 with WidgetRenderer_Defa:device-ok. The J120 wallpaper remains after the synthetic swipe; the first two boots lost the GPU path. Command:TAG=unlock2 ADDON=gpuaddon-wp3xbundle.gpuaddon sh tmp/build-fast.sh --kernel-arg sheng-touch-synth=4000 --kernel-arg sheng-touch-synth-swipe=1, then sh tmp/rounds-count2.sh tmp/boot-unlock2.img unlock2c 1 200. Revision:0373d0000dea8f496e4cb674cfc653345aba0992.device: On base e0ee2ad the first boot reaches own=1 sw=8/8/0, all three addon mounts 5/0, WALLPAPER 5/0, SURFACEL nonblack=918/1000 luma=111 mx=250/3/113, PANEL nonblack=916/1000, and GPUCLI clients=5. The J120 pink maximum and full twelve-row grid return, so the rebase did not regress the wallpaper. Command:TAG=wp3xbase ADDON=gpuaddon-wp3xbundle.gpuaddon sh tmp/build-parity.sh, then sh tmp/rounds-count2.sh tmp/boot-wp3xbase.img wp3xbase 1 200, and read [addon], WALLPAPER, SURFACEL, PANEL and GPUCLI. Revision:0373d0000dea8f496e4cb674cfc653345aba0992.device: The second boot reads own=1 sw=68/68/0, all three addon mounts 5/0, WALLPAPER 5/0, SURFACEL nonblack=984/1000 luma=181 mx=253/3/117, PANEL nonblack=1000/1000 luma=139, and GPUCLI clients=4 with CollectionsPoster:device-ok. The first boot lost the GPU path (clients=0, own=0) and is the known bad-boot form. Command:sh tmp/rounds-count2.sh tmp/boot-wp3xbundle.img wp3xbundleb 1 200 and read [addon], WALLPAPER, SURFACEL, PANEL and GPUCLI. Revision:0373d0000dea8f496e4cb674cfc653345aba0992.device: The backlight probe hangs the board: four cores stop taking interrupts (CPUT deaf=1e with c1/c2/c3 counting tens of events while c4/c5/c6 count hundreds of thousands), the once-a-second monitor stops after 11 ticks, own=0 sw=0 prep=0 and the desktop never appears, PANEL reads 911/1000 at luma 43. This is the first hardware run of this probe and it ends the earlier note that the path merely could not be read back. Command:sh tmp/rounds-count2.sh tmp/boot-bl1.img bl1 1 200 with kernel argument alioth-bl=3 and read CPUT, SUPER and PANEL from the console capture. Revision:644894d7f5891d71fc43e84d18a8d7b7d29dd29e.device: With the documented default sheng-dpu-scanout=0 the display milestone is met: ds=1, own=1, sw 84/84/0 with prep 168 (exactly 2:1), PANEL nonblack 515/1000 luma 125, tf 13377, deaf=00, and the owner confirmed the desktop was visible and the panel answered touch. At t=190 s the same boot read sw 210/210/0 and prep 420. The contrast is the same image with sheng-dpu-scanout=2: prep reached 121717 against 4 accepted swaps and the panel stopped updating after a touch, over identical TOUCHTAP and TOUCHSTAT rows. Command:sh tmp/rounds-count2.sh tmp/boot-w18.img w18 1 200 and read the SUPER row, PANEL, deaf and TOUCHTAP lines from the console capture. Revision:80cf590692ee0b54740ae64f40ed6f2af2b2eef0.device: DISPLAY stage=10 with CLIENT calls=4 class=IOMobileFramebufferUserClient, and SWAP calls=0: a client connects but no frame is submitted. Command:read the diagnostic page and the USB console after booting the image. Revision:24d127c47217eb580dbe3f3a94c32ad25cbaae00.device: sheng-dpu-scanout=0: three boots, all ds=1 own=0 sw=0 PANEL=911 with no SURFACEL row. sheng-dpu-scanout=2: ds=4 reached, but own=0 and sw=0 on two boots; a third boot read own=1 sw=9/9/0 with SURFACEL nonblack=25. sheng-fb-gpu stays 0 because NativeGOPresenter.cpp:122 returns kIOReturnUnsupported in GPU mode, which removes the CPU copy. Command:boot tmp/boot-s11.img three times with sheng-dpu-scanout=0, then tmp/boot-s12.img twice with 2, and read the VSYNC ds field, the SUPER swap and own fields and the PANEL row. Revision:ab53842422feadf058a0575b6e5a968623c6c052.
Input
implemented
Components: QcomGeniSpi, ShengHidInput, ShengNovatekTouch.
Hardware and dependencies
- FocalTech FT5652 on GENI SE4 (QUPv3 wrapper 0), per alioth-sm8250.dtsi: spi-max-frequency 6000000, interrupts <39 0x2008>, reset GPIO 33, irq GPIO 39, vdd L10C, vcc_i2c L1C, display-coords 0 0 8640 19200, max-touch-number 10.
Configuration
- board.toml: native-touch=1 starts kits/alioth-touch, sheng-touch-hid=1 enables the publication path in ShengHidInput, native-touch-diag=1 is a measurement-only round and must be removed for release images. SPI clock is the device tree's 6 MHz; the source is TCXO 19.2 MHz on DFS level 0.
Procedure
- Build with component ShengHidInput selected and the board display recipe, which invokes build-sheng-hid-input.py and archives NativeHidInput.late.o plus hid-original-bindings.o into the force-loaded libNativeLegacyDisplay.late.a. Then build payload and boot image, verify the payload carries the built kernel, and boot over USB.
Development findings
- The part answers register reads (ID 0x5652) and returns a CRC-correct all-0xFF buffer while it has no report; an earlier version of FocalTouchProtocol.c treated that buffer as a successful empty frame, which is why every image reported frames=valid with contacts=0.
- Frame reads gated on GPIO 39 going low produced real contacts: at t=100 s two contacts, low count 284, raw 0002805f4598; the part's interrupt counter 0x8F rose from 01 to e0 and its work counter 0x91 advances 60 per second, so the sensor, the SPI link, the CRC and the interrupt line are all working.
- The HID publisher was never in the kernel: ShengHidInput compiles NativeHidInput.cpp but nothing archived it, and an object with no inbound reference is dropped from a plain archive. Selected as a component and archived by the display recipe, as UniXNU-sheng does, it links.
- The official input page describes one merged device -- adapt the descriptor to the sensor, transform coordinates into the display direction, keep ids and count from one frame, publish behind sheng-touch-hid=1 -- and neither reference board splits the digitizer: sheng and pipa both report input as implemented with a single device. Splitting was tried here and left the panel unresponsive with reports=781 and max=5, so sheng-touch-split is commented out in board.toml and should not be re-enabled without evidence the references would support.
- Six defects were found and fixed in one pass, each with a source citation: (1) FocalTouchProtocol.c decoded each axis with shifts of 11 and 3 and took the low bits from PRE[7:5], where the vendor driver (reference/k40-kernel focaltech_core.c:712) uses 12 and 4 from PRE[7:4] and scales by 10/16 -- algebraically the vendor value halved, so every touch landed in the top-left 80 % and the FromEdgeTip band at 97.6 % of the height was unreachable; after the fix a swipe from the bottom reports xy=30479,20319. (2) edge::install returned early once any driver was wrapped, so the second device never had FromEdgeTip injected. (3) The per-contact event field was parsed but never read, so a lift was published as a contact still down (reports fell from 781 to 15 once fixed). (4) Contacts with area 0 were published as real touches. (5) native_hid_input_requested answered yes unconditionally, pressing Home every 1.1 s. (6) The digitizer service classification backboardd filters on (Built-In, DisplayIntegrated, PrimaryUsagePage 0x0D, PrimaryUsage 4) was a no-op stub, and the checkpoint was given the device instead of the event driver. A round with the split off and a finger on the panel has not been captured yet: every no-split capture shows low=0, which is the idle state, so the open question is where the reported x/y land (top-left should read near 0,0 and the far corner near the axis maxima) rather than whether reports are accepted.
- Buttons, from the vendor tree: power and volume-down are the PM8150 PON's RT_STS bits 0 and 1 (alioth.dts:4193-4218, QPNP_PON_KPDPWR_N_SET and QPNP_PON_RESIN_N_SET at reference/k40-kernel/drivers/input/misc/qpnp-power-on.c:113-114), and volume-up is PM8150 GPIO 6, declared GPIO_ACTIVE_LOW by gpio_keys (alioth.dts:39116-39128). The arbiter keys on ppid = sid << 8 | (addr >> 8) (spmi-pmic-arb.c:977 for v2, :996 for v5), so the PON is 0x008 and GPIO 6 is 0x0c6; GPIO 6's own SPMI interrupt names peripheral 0xc6 (alioth.dts:4261). Copying sheng's 0x013 and 0x18d would ask this arbiter for peripheral pages this phone does not have.
- This board's SPMI arbiter is not sheng's. alioth.dts:4172-4176 gives reg-names core/chnls/obsrvr/intr/cnfg as 0xc440000 / 0xc600000 / 0xe600000 / 0xe700000 / 0xc40a000, and its 32 MiB chnls window uses the version-5 layout: 0x10000 per apid with ACC_ENABLE, IRQ_STATUS and IRQ_CLEAR at +0x100, +0x104 and +0x108 inside the channel, and the APID map at 0x900 + 4 * n (spmi-pmic-arb.c:1069-1105, 1113). The v2 layout puts the channel at 0x1000 * apid with the interrupt registers in the intr window instead, so the version has to be read at run time rather than assumed.
- The first touch a boot delivered never reached the UI, and the fault was in this component's report: touchSend wrote a contact identifier only for the fingers that were down and left the other nine slots at 0, so all ten transducers carried identifier 0. The event driver keys one contact per identifier, and in the report where it initialises every transducer it dispatched begin(y=0.998) + tip-up(0,0) + begin(y=0.986) for one synthetic touch: the untouched slots lifted the contact that had just begun. hidump=1 shows exactly that on hdp1, whose first swipe produced no swap for 30 s while its second produced 41; hdp2, with every slot writing its own number as the reference implementation does (UmiFtsCore.h:35), dispatches a clean begin and the first swipe of the boot leaves the lock screen with 33 accepted swaps. Every earlier round injected one touch per boot, so every earlier round measured the broken first report and no other.
Completion criteria
- Touches map to the display, simultaneous contacts keep stable IDs, release events arrive, and buttons produce expected HID reports.
Current limits
- HID reports reach the OS: boot-usb74 counted hid 1344 -> 2012 while contacts arrived, and a swipe on the lock screen was confirmed by hand. The six defects fixed for it are listed above. What is still open is the descriptor: ContactCountMaximum, SurfaceWidth/SurfaceHeight and the physical ranges are not set.
- The button probe is in this tree (package/ButtonProbe.cpp). The volume-up key reaches the driver: rep 0 to 6 with irq 0 to 9 in one round, and mask=4 in another. findApid now applies the v5 arbiter rule, that the interrupt belongs to the owner of the highest APID with bit 24 set, and only arms when that owner is EE 0; otherwise the 50 ms poll carries it.
- Only one probe argument fits the kernel command line at a time: board.toml's own argument list is 966 bytes of the 1000 DarwinBoot accepts, and the built line with --kernel-arg sheng-build-tag is 987, so a round carries one of the brightness or button arguments, not both.
Next action
- Answer the interaction question with a finger on the panel, because the synthetic path now does drive the UI: hdp2's first synthetic swipe of the boot dispatches a clean digitizer begin and leaves the lock screen (sw 13 -> 46, SURFACEL nonblack 916 -> 985), and the repeats after it keep drawing. What a finger adds is multi-touch, the edge band at other positions, and gestures SpringBoard recognises only from a real contact sequence. Read TOUCHDUMP beside the SUPER row as before; a gesture that moves nothing is still a stalled loop, not a delivery fault. The lost wakeup it used to hide behind is gone. The frame loop stopped because the touch thread was asleep on a core that had stopped taking timer interrupts, and that core is no longer lost (2026-11-06). So the reading now is functional: tap an icon, swipe between pages, pull the notification shade and open the app switcher, and watch tf= and the TOUCHSTAT rows at the same moment. A gesture that moves tf but changes nothing on screen is an HID or delivery fault; a gesture that moves nothing is still a stalled loop, and then the CPUT per-core timer counts against SUPER's tc= are the reading.
- Merge or discard claude/backlight-buttons, then boot with the button probe at its interrupt mode and read native_buttons_stats: the two APID fields, the report count and the pressed mask.
Evidence
device: hdp1: the first swipe of the boot dispatches begin(y=0.998), a tip-up at (0,0) and a second begin(y=0.986) in one report, and the compositor accepts no swap for 30 s; its second swipe, 30 s later, adds 41 swaps. hdp2 (every finger slot writes its own contact identifier) dispatches one clean begin and no tip-up, the first swipe adds 33 swaps and the surface changes from the lock screen (nonblack 916/1000) to a full one (985/1000); the round ends RESULT own=1 sw=279. Command:fastboot boot tmp/boot-hdp1.img with sheng-touch-synth=400 sheng-touch-synth-swipe=1 sheng-synth-repeat=30 hidump=1, then tmp/boot-hdp2.img with the same arguments, and read TOUCHDUMP, SUPER and SURFACEL from the console captures. Revision:b95383416837e00d2cdd2ec52f5169665a3c7121.device: Tap, swipe and the notification shade answer on the board; the board owner confirmed it twice. TOUCHTAP rows carry down/up pairs with coordinates and held time, TOUCHSTAT reports frames equal to valid with contacts 0 between touches, and tf climbs while SUPER shows sw accepting frames. What made this readable was the core fix: before it, the same image answered no taps because the touch thread was asleep on a core that had stopped taking timer interrupts. Command:fastboot boot tmp/boot-w18.img (sheng-dpu-scanout=0) and use the desktop by hand while reading TOUCHTAP, TOUCHSTAT and SUPER on the USB console. Revision:c9285a9780b36402771943d289216fdc93d3ecbc.source: Frame parsing treats an all-0xFF payload as no data, decodes 15-bit coordinates with the low bits in the pressure byte, and records the CRC it compared so 'passed' is visible rather than inferred.device: A boot that reached the desktop read tf=839 lp=0 tfrc=0 tfs=0 tlow=0: the loop is asleep in IOSleep after a successful frame read, no read ever failed, so the wakeup is what is missing. The same image reaches tf above 27000 on other boots, so the driver initialises and reads correctly. Command:read the SUPER row's tf, lp, tfrc, tfs, tlow and tc fields on the USB console across several boots of one image. Revision:ab53842422feadf058a0575b6e5a968623c6c052.
GPU
device-verified
Components: Adreno650, AdrenoMetal, ArmSmmu4K, AdrenoPM4, AdrenoFirmware.
Hardware and dependencies
- Adreno 650 on SM8250-AC; chip id 0x06050002; blocks GPU 0x3d00000, GMU 0x3d6a000, GPUCC 0x3d90000, SMMU 0x3da0000.
- Firmware already embedded in package/GpuFirmwareA650.c: gmu 41548 B, sqe 31632 B, and the zap image 13964 B (ELF header 148 B at 0, the 6712 B hash at 0x1000, the 1676 B segment at 0x3000). The vendor's a650_zap.mdt is packed as [header 148][hash 6712] and would not satisfy its own program headers; the embedded image is laid out by those headers, which is what zapLoad and qcom_mdt_load read.
- The pipa fork's A650 driver (reference/repo/Adreno650) is the same generation as this board; the upstream Adreno740 is not.
- The GPU line follows upstream main: UniXNU/UniXNU
2366e33(2026-11-12), AdrenoMetal 73d582f, GopFramebuffer b0d812d and the metal2vulkan translator 555b13d5. The A650 driver is the board fork in `Adreno650`; its feeds.toml pin names the public branch base. The device AdrenoMetal branch `fft` is rebased onto 73d582f at 3b84be5 and keeps the board owner trampoline, pkd shim and LaunchServices repair. - `Adreno650` is a device branch of `UniXNU/Adreno740`. The base catalog carries its entry because the tool has no device-local catalog; the code is linked from this repository's `drivers/Adreno650` submodule.
- The on-device known-image check (plugin: NativeAdrenoMetal.selftest beside the bundle, then make-gpu-addon.py --selftest) reports wrong-pixel counts on the [gpu client text] row. Measured 2026-10-29 (u253): SpringBoard and iconservicesagent each reported ok cb=0 rb=0 ib=0, so compute, render-to-texture and import are correct on the GPU side and a black panel is not a rendering-correctness fault.
- Open deviation: packing that marker uses a new --selftest flag on scripts/make-gpu-addon.py in the core repository, which AGENTS.md limits to mount points and build-script macro branches. It is opt-in, changes no default, and implements the known-image step the GPU porting guide asks for; move it into a device-side script, or record it as accepted, before the next core sync.
Configuration
- board.toml passes pipa-gpu=<mode>; CONFIG_XNU_NATIVE_ADRENO=y links the archive, which must be produced at build/adreno740/libAdreno740.a because build-xnu-4k-baseline.sh hard-codes that name and ignores CONFIG_XNU_NATIVE_ADRENO_ARCHIVE.
- CONFIG_XNU_NATIVE_ADRENO_ARCHIVE uses the {tree} token so the path is absolute and satisfies both the checkout-rooted check in scripts/unixnu/kernel.py and the tree-rooted check in the shell script.
- Mode 12 (the Metal accelerator) is compiled out with PIPA_GPU_ACCELERATOR=0: the accelerator is an IOAccelerator subclass and this kernel has no IOAccelerator class (IOAcceleratorFamily2 is absent).
- The 2026-11-13 alignment starts from UniXNU/UniXNU
2366e33and replays only the board-owned catalog entry, build recipes, kernel patches and board hooks. The device package supplies the AppleKeyStore unique-chip-id hook and weak zero fallbacks for the direct-scanout counters that upstream GopFramebuffer no longer exports. RamBlock stays at 4be2d7e because upstream 737f6da needs the macOS 27 ml_static_mfree_prepare API and a NativeUfs write-cached symbol this board does not provide.
Procedure
- Build with the aligned base: tmp/build-parity.sh resolves the A650 checkout through ADRENO650_DRIVER, uses the device feeds and the base tree, and passes the official owner trust bundle and GPU addon. The Metal plugin is built with scripts/build-adreno-metal-plugin.py --target ios after scripts/build-turnip-darwin.py --target ios; make-gpu-addon.py --publish --prime-list build/prime-list.txt writes the addon. The board no longer passes private wallpaper or synthetic-touch probes by default; those are one-round --kernel-arg options.
- Boot with pipa-gpu=<n> and read the GPUROW lines on the console; native_gpu_rows is not rendered by this board's page.
Development findings
- The GPU probe no longer reads the GPU SMMU before checking its power. On 2026-11-08 a failing boot left GPUROWLAST at step 81, the ID2 read at 0x28, which made a gated SMMU the first suspect; the next two boots disproved it. One never started the probe's thread, and the other read GMUCTX pre vote 00000001 cx f8222000 id2 00005511 immediately before the bring-up. The probe now re-reads the two GPUCC prerequisites after the GMU clock stage and skips the bring-up when either is off, calling the shared kit's own mode-3 sequence rather than writing clocks itself: per unixnu.com/zh/porting/drivers the sequence stays in the kit and the device probe only refuses to touch a gated block.
- The GPU hand-off now presents, measured 2026-11-06 on boot-g1: one argument turns gpu offered 0 done 0 into gpu offered 59 done 59 fail 0, backboardd opens the plugin type 0x4147, CollectionsPoster and WidgetRenderer each take a client slot, and the panel shows the desktop and follows it. With sheng-fb-gpu=1 the CPU copy does not exist (NativeGOPresenter.cpp:122 returns kIOReturnUnsupported), so the frame in display memory was written by the GPU. That retires the 2026-11-04 mp1 reading that every GPU write lands in a private copy. The same round is 3.5 times slower than the CPU path, 60 accepted swaps in 190 s against 210, which is what the owner felt as average fluidity, and the wallpaper still does not appear, so the GPU connection is not what blocks it.
- 2026-11-08: the Metal plugin is built by scripts/build-adreno-metal-plugin.py from this repository's drivers/AdrenoMetal submodule (5be6893, the iOS 17 guard); the base repository follows upstream 6d7f734. scripts/turnip/diagnostic-baseline.json now carries a repository-relative patch path. The script now finds a full Xcode by itself because xcode-select stays on the Command Line Tools, adds the homebrew directory for glslc and spirv-val when they are off PATH, and takes VULKAN_INCLUDE when the Mesa include tree is pruned. A parity build from the device submodule and from the base submodule at the same 5be6893 produced identical __TEXT,__text bytes; only LC_UUID and the signature hash differ, so the CDHash changes while the code does not. No GPU behavior change.
- The probe's end was first read as an empty IB, and that reading was an artefact: NativeAdrenoVm.h:30 declares native_adreno_dram_read32 as a board hook and dramWord returns false when it is null, so peekWords returned kIOReturnUnsupported and left the zeros it wrote on entry. Nothing assigned the pointer, so every imported-BO read failed silently and the third submission's IB looked like 736 bytes of zeros. With the hook installed (GpuProbe.cpp, 2026-10-31) the same read returns real data: [ib] fence=5 iova=020004000 bytes=48 with I00 703d8003 20005000 00000000 0badc0de, and [coherence] before==after==703d8003 with distrust=1. The fault itself is unchanged and still open: GPUROW28 cb0 fsr 400 far 5e09e75794f5 with GPUROW25 sub 1/0 busy 999, so the GPU stops on its first user submission. docs/evidence/2026-10-31-ib-read-real.md.
- The GPU driver compiled in this image is reference/repo/Adreno650, which cannot be pushed to an upstream repo. Two local commits sit on top of pipa (bdee54c pool: read pipa-gpu-pool, d7bfe27 publish: keep two client text lines per process) and make the build reproducible from this machine only. The fork exists and the two commits are on its fft branch; feeds.toml now carries a source for Adreno650 pinned at bdee54c. The build script still passes driver:Adreno650 and driver:Adreno740 by --local-module, because neither name is in components.toml and removing the override would resolve Adreno740 to its own submodule (the A760-family one) instead of this driver. Switching the build to the feed needs the catalog to carry Adreno650 first."
- The BO pool is not exhausted, so the upstream change that removes it would not address this board's OutOfMemory. [bo pool] on four boots: an idle one reads 277 BOs from the pool, 0 fell back, 182 MiB in use; the two touched ones read 2836 and 2610 BOs with 3 and 4 fell back and peaks of 701 and 683 MiB of 768. Adreno740's 882f4bf describes the opposite shape -- 404 BOs falling back and 96 allocations of 96 MiB failing -- and that is the case its system-memory rewrite answers. Ours allocates from the pool almost always, so whatever refuses SpringBoard's buffer and texture must be elsewhere, and porting that rewrite now would replace a component that is working.
- Raising the BO pool does not relieve SpringBoard's OutOfMemory; it makes the boot worse. pipa-gpu-pool=1024 (u261) measured worse than the default, and that comparison does not hold: the board package parses pipa-gpu-pool (GpuProbe.cpp:635) while the driver that is actually compiled parses sheng-gpu-pool (reference/repo/Adreno650/NativeAdrenoService.cpp:310) with its own 1536 MiB default. Two names, so the setting probably never reached the allocator and the round measured system memory pressure instead. Before any further pool experiment the two names have to agree.
- Mode 1 (read only) runs: GPU m1 gcc=ok cc=ok smmu=skip gpu=skip io=0.
- Mode 6 powers the GPU: GPU m6 gcc=ok cc=ok smmu=ok io=0 cx1 clocks1 — the CX domain comes out of collapse and the SMMU/GMU clocks run.
- Mode 7 stops at the GMU context's Attach step: status e00002ca, routes 0, programme phase 5 with 13 writes issued and no global fault.
- The Attach failure was the free-slot test, not an ownership wall. ArmSmmu4KStreams.c:47 required an idle slot's S2CR to equal 0x00020000 exactly; this part's idle slots read 0x000203ff, which is FAULT type with CBNDX 0xff left in the low byte, so every slot the kit looked at came back Busy and the attach never wrote a route.
- The board now writes the canonical FAULT word 0x00020000 into the slots it is about to use, before the attach, and only where the type is already FAULT. Mode 7 then completes: routes 2, phase 5 with 13 writes, SCTLR enabled, GMU firmware in 16 blocks, the CM3 running, and HFI acknowledged. Clearing such a slot to zero instead, which an earlier round did, turns FAULT into TRANSLATE and makes it look busy again.
- One write remains unexplained and is not an ownership wall: SMR slot 5, 0x8000007f, reads back 0. The same file takes the kit's context writes and the route writes, so the S2CR/SMR path is usable; slot 5 is outside the slots this board uses.
- Mode 8 powers GX through the GMU on the first attempt: GPUROW17 reads GX on perf 7 vote 0 oob 2 gx 000000c0>00000000 gdscr f8222800 rbbm 00000001. The HFI vote was accepted, the OOB GPU_SET request was acknowledged on the second poll, GDSCR bit 31 came up, and rows 13-15 stayed identical to mode 7.
- Mode 9 builds the GPU's own context and runs its first command: GPUROW18 status 0 with routes 4 (bank 0 / ASID 2, streams 0, 1, 0x400, 0x401), GPUROW19 CP ok with init 0, ring 0 and the marker a6500c0d written by CP_MEM_WRITE into the scratch page and read back by the CPU. GPUROW20 shows rptr and wptr both at 0x1b, hwfault 0 and cpint 0.
- A K40 vendor kernel tree (LineageOS lineage-20, reference/k40-kernel) confirms the board inputs the later modes need: pil_gpu_region@8681a000 with size 0x2000 no-map (the zap shader region) and the GPU interrupt as SPI 300, level high.
- Mode 10 completes after the zap image is laid out by its own program headers: GPUROW21 ZAP ok (init 0/0 in 7 ms, mem 0/0, auth 0/0, resumes 0, secure 0) and GPUROW22 IRQ attach 0, readback a002, count 1>2, nop fence 1, seen 00100000, masked 0. TrustZone accepted the a650 zap, CP_SET_SECURE_MODE(0) fenced, and the SPI 300 line raised an interrupt for a CP_NOP without a storm.
- The vendor a650_zap.mdt is packed as [ELF header 148 B][hash 6712 B] while its program headers address the hash at 0x1000 and the a650_zap.b02 segment at 0x3000. Concatenating the two files, 8536 B, failed zapLoad at -6; the embedded image is now 13964 B in the addressed layout.
- Mode 11 publishes the device and runs the user-client path: GPUROW23 PUBLISH ok submit 0 timer 0 publish 0 | uc 36/36 first 0 at 0 | rounds 4 4, so all 36 steps of two kernel rounds pass.
- Mode 12 registers the staged accelerator: GPUROW24 METAL ok (IOGPUFamily loaded, class size 136, Turnip options nocb). In the same boot GPUROW25 moved from sub 2/2 | uc 2/2 to sub 7/7 | uc 4/4 with pool 128/128/768, so two processes outside the kernel opened the GPU service, took the 128 MiB pool and completed five more submissions: the plugin is found through IOAcceleratorES -> MetalPluginName -> NSBundle and connects to the driver.
- The accelerator builds from the A650 checkout into the same libAdreno740.a that build-xnu links: PIPA_GPU_ACCELERATOR=1, the three IOAcceleratorES imports bound to the audited addresses (0xfffffff004bd3b20 constructor alias, 0xfffffff004bd3b64 destructor, 0xfffffff006aeb688 metaclass), __mod_init_func stripped and the initializer globalised for the probe to run after IOGPUFamily.
- The plan's control is satisfied in the stronger form: the same image with the accelerator but without the plugin bundle (the original Data seed) shows no crash at all, which is the software-rendering fallback the plan predicts.
- The screenshot channel of the USB console does not work on this board: every SCREENSHOT/SHOTNEXT transfer dies with ENXIO a second in, on the image without the plugin as well, so it is independent of the graphics stack. The LIVE and FAULTS rows are the substitute evidence.
- Swapping the driver source from the fork to UniXNU/Adreno740's feat/ipados27-gpu-parity branch is not a straight replacement: parity implements only A7XX, so an A6xx board that takes it drives A7XX ring framing and CP start. The fork's A6xx support is 11 branch points in four files, each with a kernel citation: kEnableA6xx is A6XX_INT_MASK's eleven terms summed from a6xx.xml.h (0x03d0e242, versus parity's A7XX 0x33d283c2 -- writing the A7XX set on an A6xx core masks CP_IB1/CP_IB2 and turns a hang into "the fence never came"); the ring takes NO_UPDATE in CP_RB_CNTL (a6xx_hw_init), a six-word a6xx_submit() prologue (CACHE_INVALIDATE 0x31, PC_CCU_INVALIDATE_DEPTH 0x18, _COLOR 0x19), CACHE_FLUSH_TS (0x04) with the IRQ bit as its fence, and no BV-thread framed fence; and CP start is a6xx_cp_init()'s single eight-dword CP_ME_INIT (0x2f, three hardware contexts, 0x20000000) with no CP_THREAD_CONTROL and no power-up register list. Those are carried on branch a6xx-on-parity as overloads, so the A7XX signatures and sheng's paths are untouched; the host tests pin 0x03d0e242, the CP_RB_CNTL word, the prologue and fence words, and the CP_ME_INIT header. The swap also needs parity's ArmSmmu4K (feat/ipados27-gpu-parity, 1811b6d): main 3ba9245 lacks ArmSmmu4KTablePages, ttbr0_switched, ArmSmmu4KWriteContextTtbr0 and ArmSmmu4KLiveState::detached, so the driver does not compile against it. ArmSmmu4K is not a selected module on this board (Adreno740 is not in board.toml's include list), so --local-module cannot reach it; ADRENO650_KITS is the only lever."
- Three link-time gaps come with the swap, none of them from the A6xx work. (1) NativeAdrenoAccelerator.cpp included ../NativeMetal/OriginalAcceleratorABI.h, a path this repository's build tree has no link for; the fork's own commit 01db67e already fixed exactly this ("A fork has no NativeMetal compatibility link in the build tree") and the swap lost it, so it is re-applied rather than newly invented. (2) parity references native_gpu_dcvs and native_pmap_user_mappings as weak_import; neither exists on this board and both uses are guarded, so BootProgressStubs.c defines them weak, as it already does for the same reason. (3) native_adreno_submit_phase is different in kind: it is the fork's seven-slot submission timer and a real measurement path, so it is implemented rather than stubbed -- a weak definition would silently report zero time. A static kernel link refuses to leave any weak_import undefined, which is why all three have to resolve before the kernel links."
- The self test's first user-client round passes (rounds 4 -1 with the close skipped) and the second returns Busy only because the first client was left open, so submission, IB execution and the fence are correct: [gpu methods] 6:17271/17271/9601, LIVE sub 1/1 busy 0, cp 3d/20004000/0. What blocks the accelerator is clientClose: [gpu close] stops at step 35 and never reaches 36, the markers placed around descriptor_->release() in NativeAdrenoMemory::release, with retireCompleted and the SMMU unmap already returned. The earlier reading that the fence never completes was an artefact of the wait loop in runCore breaking on a null clock.idle after one poll: 2 s requested, 3 us spent. With a 100 us pause between polls the same wait runs 17271 polls over 2.0 s.
- The accelerator registers. With the close unblocked, one round reads rounds 4 4 (both self-test user-client rounds at 4 of 4), GPUROW24 METAL ok with IOGPUFamily loaded and class size 136, LIVE sub 2/2 uc 2/2 busy 0, and backboardd (slot 0, peak 4096) plus mediaserverd opening the device. The block was a board page map: the probe dramRead32 maps the physical page of the buffer it reads and keeps the IOMemoryMap in a global, so the IB BO page stayed mapped in kernel_pmap and the close that freed that BO met the XNU pmap_assert_free. Releasing that map before clientClose fixes it; [gpu close] showed step 35 with dev 0, prep 0, sys 1, spans 1 before the fix. No frame is presented yet (GPUSWAP validate 0); the panel content is the CPU copy path.
- The first Metal client IB (736 bytes at iova 0x1_00027000) is fetched by the CP and never retires: the ring carries CP_INDIRECT_BUFFER to that address with 0xb8 dwords, the CP read pointer reaches the ring end, and the fence the IB ends with (two CP_EVENT_WRITE7 CCU flush timestamps, 0x1d then 0x1c, dst 0x4000) is never written. The IB is real a6xx packets and reads identically through both the board hook and the kernel CPU view, so the reading is not the defect; the self-test 48-byte IB at 0x20004000 completes every round.
Completion criteria
- GPU submissions complete, mapping/fence handling is correct, a known image renders, and the selected Metal client presents it.
Current limits
- Frame pacing, measured on u260 with the desktop in use: [fence wait] outer waits=169, 65142 us total, mean 385 us, longest 7787 us -- 47 percent of a 60 Hz frame budget for one wait. The polls behind it run 50 per submission (GPUROW25 timeouts 97388 over 1897 submissions), each a zero-timeout wait with a pause outside it. The lock half of that reading is out of date: commit dd43abd in the driver submodule made a pending fence poll the ring's own fence word with no lock, and the core's zero-timeout wait now runs under the connection lock only once the fence has passed or the deadline is up. So the count still says the wait is woken about 50 times per submission, which is the GPU's interrupt rate, and the time per poll (about 7.5 us) is a wakeup, not lock contention. What is still missing is the frame interval itself: PLAN.md A3 asks for the interval distribution and the touch interval before any 120 Hz verdict, and neither has been measured. That is where the next work belongs rather than in the resource limits.
- in33, 2026-11-09, is the first healthy desktop round that also reached the diagnostic export point. The GPU half of it reads GPUFRAME ready 1 fail 0 copied 0 gpu offered 239 done 0 fail 239 abandon 0 | legacy surfaces 2 swaps 239: with sheng-fb-gpu=1 set, every offered frame completes with a non-zero status, so the frame the panel shows is the one the legacy completion path takes, not a GPU-composited one. The accelerator itself is fine in the same boot: GPUROW24 METAL ok, GPUROW25 sub 22/22 with no fence wait, and six askers hold a device, WidgetRenderer_Defa and the poster extensions included. The counter is raised in NativeGOPresenter::completeSwap when the client's status is non-zero, and also when an offer finds its sequence already gone, so the next reading has to log that status value rather than count it. The round also carried sheng-swaptest=1, which runs a Metal colour pass of its own, so it is not comparable with in29's off=13 comp=13 fail=0.
- Modes 8 through 12 complete: GX power, the GPU's own context with a CP_MEM_WRITE, the zap shader and secure-mode exit with the GPU interrupt, the published device with 36 of 36 user-client steps, and the registered accelerator with two user-space clients connected.
- Drawing is not confirmed. The wallpaper overlay mounts (WALLPAPER stage=5 status=0) and processes now reach the GPU, but nothing reads the panel back: the USB console's SCREENSHOT/SHOTNEXT path fails with ENXIO on every attempt, on images with and without the plugin.
- The live row carries fence timeouts (t2 at mode 11, t9 once clients come and go) and the GPU context bank keeps reading FSR 0x400 with a changing FAR; submissions complete after the driver's stall recovery, so neither stops the path.
- FSR 0x400 is not a fault under this SoC's own definition: the vendor kernel's arm-smmu-regs.h puts TF at bit 1, and its fault mask is 0xc00001fe (bits 31, 30, 8, 7, 6, 5, 4, 3, 2, 1). 0x400 (bit 10) is outside that mask, which is why the kit's own fault test never fired; bit 10 is either implementation-defined on this part or the readback is not the register it is believed to be. Recorded, not explained.
- backboardd finds the accelerator and the plugin: GPUOPEN records it opening type 1 (the IOAcceleratorES client), 0x4147 and 0x4148 (the plugin's types) with the sandbox gate answering kIOReturnNotPermitted (0xe00002e2) and the grant still admitting it, GPUCCLI shows it in slot 0 with a peak GPU address of 650 MiB, and no open was refused.
- (Superseded 2026-11-08: this describes the fork build, not the driver this image compiles. See the finding below on the device branch.) The user-client table runs out: NativeAdrenoMaxClients is 4 (slots 0..3, 4 is the sentinel) and NativeAdrenoPublish.cpp:237 answers kIOReturnNoSpace when no slot is free. GPUMOUNT fail 1/e00002db slot 4 is exactly that, so it is connection slots, not the VA window (0x20000000..0x80000000) and not the BO pool (128 of 768 MiB used). backboardd takes slot 0, the other three go to the next processes, and a restart whose old connection has not been reaped asks for a fifth.
- The open record's res field is io_filter_resolver's opinion and macf is mac_iokit_check_open's, both taken before the driver decides; only type 0x4147 mounts a core, and refused counts outcomes. res NotPermitted with refused 0 therefore means the filter commented and the open was served anyway.
- The plugin can be carried in the GPU addon instead of the Data seed: make-gpu-addon.py packs the same files and the kernel writes them into the Data volume before its addon mount, so a plugin rebuild no longer needs an APFS remount. With the addon the plugin loads exactly as from the seed (backboardd opens type 1, 0x4147 and 0x4148) and backboardd does not always crash: three minutes without one crash in u208.
- No counter on this board measures the panel yet. The GOP presenter (native_gop_*) only exists on offline-legacy-phase=3 and this board runs phase 4, so its counters are zero by construction; native_legacy_surfaces[1] counts only surfaces the compositor offers to the legacy driver, and this window server draws into the mapped framebuffer instead, so it reads zero while the UI is visible. GPUFRAME reports both and will read zero until the right counter is chosen.
- The live row's fb and sc fields are native_adreno_pool_stats[5] and [2], buffer allocation counters, not scanout; an earlier reading of them as framebuffer and swap counts was wrong.
- The frames stop short of the panel. GPUROW25 keeps swapping at sc12 with fb0, the fence counters show the GPU exactly one fence behind the wait (waited 8, gpu 7; waited 6, gpu 5) and the stall recovery is never entered, and only about eleven submissions arrive in three minutes. sheng-fb-gpu=1 did not move the swap counter.
- The plugin reaches the driver with a full workload before it dies: 50 BoAlloc and 50 BoMap with no failure, 48 BoCpuMap, 7 Submit and 29 WaitFence (two timeouts), slot 0 peaking at 32 live objects and 128 MiB, and GetStatus unsupported on all 8 calls. The fault is then a userspace read through an unmapped level-3 entry (ESR 0x82000007, WnR clear), at a fixed code site that moves with ASLR between boots.
- The control isolates the plugin: with the accelerator registered but the original Data seed (no NativeAdrenoMetal.bundle), backboardd runs 170 s without one crash and opens only the accelerator's type 1; with the plugin present it opens 0x4147 and 0x4148 as well and crash-loops. So the SIGBUS is the plugin's, not the accelerator's, the driver's or the SMMU's.
- backboardd then dies with SIGBUS: EXITCRASH pid 54 sig10 PC 0x106da915c LR 0x106dbbd24 ESR 0x82000007 (data abort, translation fault level 3) and the same backtrace every time; SpringBoard, PosterBoard and WidgetRenderer are terminated with it and the cycle repeats. ReportCrash itself dies the same way, so no crash report is written.
- Metal needs the accelerator published plus the IOAccelerator class; until then the wallpaper overlay and poster rendering do not draw, and an app window opens with no content.
- The wallpaper overlay itself is not an upstream capability: no porting page covers it and no device status table carries a wallpaper row. It arrives through zzy-native-gpu-addon-mount.patch, make-gpu-addon.py and make-wallpaper-overlay.py only, and the mount succeeds here (WALLPAPER stage=5 status=0) while the picture does not appear -- PosterBoard chooses the collection by device idiom, and this image carries only ~ipad collections.
- Two client rows report different quantities and must not be compared directly. GPUCCLI's peak is an ABSOLUTE GPU address: NativeAdrenoPublish.cpp:303 takes core_->windowPeak(), which NativeAdrenoUserClient.cpp:289 sets to the mapping's end iova, and stores peak>>20. GPUSLOT's hi is the WINDOW-RELATIVE value: NativeAdrenoUserClient.cpp:291 stores (window_peak_ - window_start_) >> 20. The two agree on every boot that carries both, which is what confirms the reading: u266 backboardd peak 754 - slot 0 start 512 = 242 = GPUSLOT s 0 hi 242; u258 peak 1048 - 512 = 536 = hi 536; u260 peak 1479 - 512 = 967 = hi 967; SpringBoard u266/u258 peak 1727 - slot 2 start 1706 = 21 = GPUSLOT s 2 hi 21. Read the absolute value only for coverage; read the relative value for capacity.
- SpringBoard's peak 1727 is not a window overflow. It holds slot 2, whose window starts at 0x6AAA9000 (1706 MiB), and its offset is 21 MiB of that slot's 170 MiB. Every GPUSLOT row in that snapshot reports refused 0 and GPUSWAP reports rejected 0 (GPUREASONS accepted 7 rejected 0 | r0 7), so no mapping was refused for leaving a window. The real slot-0 constraint is backboardd's 967 MiB offset in u260 (GPUSLOT s 0 hi 967), a boot that also drew fully (GPUFB nonblack 990/1000 luma 246, GPUFRAME gpu offered 830 done 830 fail 0, no AegirPoster exit), so a table that shrinks slot 0 below that is unsafe. scripts/check-gpu-client-windows.py replays this arithmetic from the captures without a device.
- slot 255 in a GPUCCLI row means no LIVE connection at the moment the row printed, not that the process never got a slot. NativeAdrenoPublish.cpp:311 sets record->slot = 0xff on the successful clientClose path, so a process that mounted and closed shows 255. The counter-example is in docs/evidence/2026-10-29-gpu-gx-and-context.md: SpringBoard opens 2 refused 0 closes 1 slot 1 peak 1674 -- same code, slot 1 while live. Use closes to tell the two apart.
- (Superseded 2026-11-08: the eight-open cap is the fork's; the driver this image compiles has no per-process cap. See the finding below on the device branch.) The GPUCCLI refusal code identifies which limit refused, and the poster extensions hit the per-process cap, not a full slot table. NativeAdrenoPublish.cpp:689 caps every non-backboardd process at 8 opens per boot and :692 refuses with kIOReturnBusy once record->opens reaches it; AegirPoster's last e00002d5 is kIOReturnBusy at opens 8. kIOReturnNoSpace (e00002db) appears only in GPUMOUNT fail 1/e00002db slot 4, which is the kernel client's own second mount and not a fault. A fifth process therefore does not currently meet NoSpace; the four slots are not the binding limit for the posters.
- The client model those two findings describe belongs to the fork, and the image compiles the device branch instead (2026-11-08). build/adreno740/libAdreno740.a carries _native_adreno_next_client, which only src/UniXNU-alioth/drivers/Adreno650 defines (6effc73), so drivers/Adreno650 is the built driver and reference/repo/Adreno650 (bef707a) is not. The device branch has no NativeAdrenoMaxClients constant at all: rows[4] is the console's statistics table (NativeAdrenoPublish.cpp:192, :396-400), every process gets its own address space from NativeAdrenoGpuContext::createVm, and the per-process open cap defaults to zero (sheng-gpu-metal-opens). The eight-open refusals recorded against AegirPoster are that fork's cap and cannot occur in this image. GPUMOUNT fail 1/e00002d5 count 2 is GpuProbe.cpp:1507-1511's own self-test: it opens a kernel client, opens a second one and requires kIOReturnBusy, which writes mount_fail[0]=1 (no address space yet) and [1]=kIOReturnBusy by design, twice a boot; the kernel_task row's closes 2 is the same pair. No user process was refused in that boot, so a refusal of a wallpaper renderer has to be shown some other way than this row.
- The client allow-list is no longer read by the plugin this image carries. drivers/AdrenoMetal/NativeAdrenoMetalPlugin.mm has no listedClient and no reference to NativeAdrenoMetal.clients, and :279 returns clientDevice(port) for every process whose name is not backboardd, so every process gets a device unconditionally. scripts/make-gpu-addon-alioth.sh still packs that file, so the old-list versus new-list rounds recorded above compared two identical behaviours; a client-list experiment needs the guard restored first.
- All three boot-time addon mounts succeed on the current image, and the persistent log says so independently of the serial console. BootLog.c:365 writes the row A files=11 wr=3 same=8 fail=0 err=0 mount=5/0 mount2=5/0 mount3=5/0 for u266: plugin bundle, launchd daemons and wallpaper overlay each reach stage 5 with status 0. Earlier boots (usb177 to usb191) read mount=1/2 mount2=1/2 with files=5, i.e. the plugin bundle was not in the addon at all.
- The os_log export has never produced a file, because the daemon that runs it never starts. NativeOsLogExport.mm is compiled into adrenoprobed and NativeAdrenoProbeDaemon.cpp:27 calls it, and its launchd job is mounted (mount2=5/0), but adrenoprobed appears zero times in every persistent log under build/sheng-logs/ and in tmp/console-u266.log, and no oslog*.gz exists in the workspace. Any diagnosis that needs a userspace process's own os_log lines is blocked on this, not on the export's format.
- The poster extensions open the GPU and map nothing before aborting, so their fault is not GPU allocation. AegirPoster's final u266 row is opens 8 refused 1 closes 8 slot 255 peak 0 last e00002d5: eight successful mounts and eight successful teardowns, and peak_mib advances only on a successful BoMap (NativeAdrenoPublish.cpp:453) or clientClose (:312), so peak 0 means not one byte of GPU address space was mapped. PosterBoard is the same shape (opens 1 closes 1 peak 0). The same crash PC (1e9af2f74) repeats in all fifteen AegirPoster records. A client-visible OutOfMemory(Device) also cannot come from this driver in that boot: every GPUSLOT row reports refused 0, so no BoAlloc was refused.
- All six mapping and submit cost rules the GPU porting guide says to keep unchanged are implemented as written, checked against the source: 16384 objects through a handle index (NativeAdrenoUserClient.h:18, :38); BOs from the board's contiguous write-combined pool with scattered pages when it is full (NativeAdrenoMemory.cpp:72-96, :107); self-owned memory mapped through ArmSmmu4KLiveMapContextBatchExclusive with the alias pass skipped (NativeAdrenoVm.cpp:203-205, :339); imported memory on the same call only when every mapped import shares its class and none of its pages lies in the pool or a mapped scattered buffer, otherwise the full checked batch (NativeAdrenoVm.cpp:241-258, :312-342); unmaps of up to ArmSmmu4KTlbPageLimit = 512 pages invalidated page by page and larger ones by ASID (ArmSmmu4KProgram.h:64, ArmSmmu4KLive.c:491-496); and no TLB invalidation on a map, because it only fills invalid leaves (ArmSmmu4KLive.c:487-490). The 16384-object ceiling is the guide's own number, not a local choice.
- The BO pool is 768 MiB, not the 1536 MiB the driver asks for, and the reason is physical contiguity rather than total memory. NativeAdrenoService.cpp:312 defaults the request to 1536 MiB and NativeAdrenoGpuContext.cpp:36-41 retries at half size until one succeeds; reservePool (NativeAdrenoMemory.cpp:72-96) asks IOBufferMemoryDescriptor for kIOMemoryPhysicallyContiguous under the output address mask, so a request fails when no single contiguous run of that size exists. The boot had 988839 free pages (3862 MiB) at vm_page_bootstrap, far above 1536 MiB, so the 1536 and 1024 MiB attempts failed on contiguity and 768 MiB was the first that fit. u276's [bo pool] row reads '768 MiB (last reserve status 0, wc 80000000): 2387 BOs from it, 6 fell back, in use 688 MiB (peak 701)', i.e. 91 % full at peak with 6 BOs already on scattered pages. The guide's reference value for sheng is 1 GiB, so this board is below it; whether 768 MiB with a 91 % peak causes the single accepted swap is unverified.
- GPUSWAP's 'ok' field is a boolean, not a count, and reading it as a count is what made the presentation look stuck at one. LegacyDisplayProbe.cpp:344 assigns native_legacy_swap_validation_result = accepted, the verdict of the LAST swap only; the counts are native_legacy_swap_accepted_count and native_legacy_swap_rejected_count (:338, :340), printed by GPUREASONS as 'accepted N rejected M'. u276 reads 'GPUSWAP validate 664 ok 1 reason 0' together with 'GPUREASONS accepted 664 rejected 0 | r0 664', i.e. all 664 swaps were accepted and none was rejected. The acceptance criterion for the GPU page's third item is therefore the GPUREASONS counts, not GPUSWAP's ok field.
- On u276 the wallpaper renderers no longer crash and the picture still does not appear, so the two questions have come apart. u276's console carries no EXITLOG for AegirPoster or KaleidoscopePoster at all (u266 carried 15 and 12), and its persistent log names only CollectionsPoster and PosterBoard, never the two aborting extensions. Meanwhile the panel drew: GPUFB reached nonblack 1000/1000 luma 253 and 990/1000 luma 245 in the same boot. GPUMETAL lists AppStore, Preferences and CollectionsPoster, so user applications reach the GPU. The remaining gap is therefore that the wallpaper layer is absent or unpainted while everything else composites, not that a renderer crashes.
- The [vm kinds] row the GPU porting guide asks for beside [vm map], [vm unmap] and [bo pool] was collected but never printed; BootLog.c now prints it. u277 (the image that carries the row) reads 'owned n=3557 mean=40us spans=36323 | import-exclusive n=594 mean=136us spans=83493 | import-checked n=3 mean=590us spans=18', so the three map classes are now separable: driver-owned memory averages 40 us per map, an import on the exclusive call 136 us, and an import that needed the full alias check 590 us. Only 3 of 594 imports took the checked path, which is the rule working as intended rather than a defect.
- u277's serial console stops at t=25s while its persistent log shows the kernel running to 178 s, and the console's own last row is 'QCOM USB LOSS overflow=0 contention=50 transport=0'. The console capture is therefore not a usable basis for the swap and panel acceptance readings on that boot; the persistent log is. The same truncation pattern is what made earlier rounds look like a silent stall. Use the persistent log's rows for any boot whose console ends before the desktop would appear.
- The one client-visible GPU allocation failure, and the best lead for why presentation stalls, is SpringBoard refusing a buffer: u277's persistent log carries 'SpringBoard: problem buffer refused: buffer: OutOfMemory(Device)' and 'SpringBoard: problem texture (fmt 115 ...) texture: OutOfMemory(Device)', while [bo pool] in the same boot reads '768 MiB ... in use 731 MiB (peak 733)'. The pool is 95 % full at peak and 4 BOs have already fallen back to scattered pages. This OutOfMemory is the metal2vulkan bridge's own error (NativeMetalBridge.rs / bridge patch 0013), not a refusal from the kernel driver, which reports refused 0 on every GPUSLOT row. Whether a larger or later-reserved pool removes it is unverified; the pool cannot simply be raised because it is requested as one physically contiguous run (see the pool finding above).
- 2026-11-13: the base is rebased to UniXNU/UniXNU
2366e33and the device AdrenoMetal branch to 73d582f (3b84be5). The display and PMGR arguments now use upstream names: fb-gpu, fb-bgra, vsync, dpu-scanout and pmgr. The rebuilt plugin carries the new SA and PRb rows and the embedded primelist. The aligned image is tmp/boot-align1.img sha256 6a0b77e8af95ffdee56d9da1e0a10c6b28c72057c527062161d06c5d015c27e0; it has not run on the board. docs/evidence/2026-11-13-upstream-align.md. - 2026-11-13: the addon's prime list was the build host's macOS list, not this image's. make-gpu-addon.py --prime-list packed 159 paths, and most of them also exist on iPadOS, so the pass looked healthy while QuartzCore's default.metallib was never reached. configs/prime-list-ios.txt now lists the 168 .metallib files of the 21H461 OS and SystemOS DMGs, of which 159 stat on the board. BootLog printed only the first six telemetry rows, all memory counters; it now prints all 48. The shdr3i round reads PR libs=39/159 made=385, SCb wr 765 23583K and S c32/0 d32 F42, so the pass compiles and persists in the shared cache. The render server still refuses QuartzCore's fixed_frag_lph_cph pipeline with BinaryArchiveMiss, and the panel stays dark (PANEL nonblack 31/1000). docs/evidence/2026-11-13-shader-prime.md.
- 2026-11-13: the archive fallback compiles the pipeline QuartzCore asks for. af1 passes metal-archive-fallback=1; the render server logs 'archive fallback made frag TimgA2S1Xhf_IalpCcl -> ok' and the same for TmuaA2Xhf_Isrc_Isqr, where the call returned BinaryArchiveMiss before. The panel stays dark (PANEL nonblack 33/1000), so that pipeline was not the wallpaper blocker. The remaining lead is CollectionsPoster: u276's sandbox log reads 'Sandbox: CollectionsPoster(216) deny(1) iokit-open-user-client AGXDeviceUserClient', and no current round prints a GPUOPEN for it, so the WallpaperKit provider never opens the accelerator. The fix is a sandbox or entitlement decision, not a shader change. tmp/boot-af1.img sha256 300c3cea3928b6c043e93d4b054a99af0b9c4cd38b6725bf79ab829719e39b37.
Next action
- Measure UnityPoster next. The align1 round (docs/evidence/2026-11-07-align1-round.md) put the aligned baseline on the board: the desktop appeared, GPUROW25 read sub 729/729 with the ring empty, GPUROW24 read METAL ok, ten askers and slots s0..s4 carried real writes, and the 240 s screen export showed the home screen. Official GPU section 3 is complete except the known-image render; section 4 is complete through composition. Wallpaper is still absent: UnityPosterExtension reported no-device device: Vulkan(VkResultCode(-3)) and then crashed in DecodeRow -> Write_BGRA8_vec, so the next round separates device timing from the decode buffer, and the known-image probe runs in the same round.
Evidence
device: The official Flat/J120 wallpaper addon mounts on all three boot-time addon mounts and WALLPAPER reaches stage 5/status 0. Both boots show a desktop via swaps (114 and 1455 at t=230s), but the first A650 user-client self-test round returns 1 and the accelerator is not published: GPUROW23 self test failed, GPUROW24 SELFTEST rounds 1 4, GPUFRAME offered 0, GPUCLI askers=0. This is not a zero-copy or wallpaper completion result. Command:TAG=of1 ADDON=gpu-official-flat.gpuaddon bash tmp/build-parity.sh; sh tmp/rounds-count2.sh tmp/boot-of1.img of1 1 240; sh tmp/rounds-count2.sh tmp/boot-of1.img of1b 1 240; read GPUROW23/24, GPUFRAME, GPUCLI, WALLPAPER, [addon], SUPER and PANEL from both console captures. Revision:8ec009fa56a5a7eb0576b76c397bb71a3d2280fd.device: The hand-off path completes frames for the first time: gpu offered 59 done 59 fail 0 abandon 0, legacy surfaces 3 swaps 59, backboardd opens plugin type 4147, CollectionsPoster and WidgetRenderer_Defa each open twice and close once at slots 4 and 3, and PANEL reads five distinct values ending 579/1000 luma 135 while the owner confirmed the desktop was visible. The same round accepted 60 swaps against 210 on the CPU copy path. Command:sh tmp/rounds-count2.sh tmp/boot-g1.img g1 1 200 with sheng-fb-gpu=1 in board.toml, then read GPUFRAME, GPUSWAP, GPUOPEN, GPUCCLI and every PANEL row from the console capture. Revision:4d19c469cc914299d3035211394bed1a283ee5d6.device: Mode 1 reads and mode 6 powers the CX domain with the SMMU and GMU clocks running: gcc=ok cc=ok smmu=ok cx1 clocks1. Command:sh scripts/run-sheng-unattended.sh <boot.img> 180, then read GPUROW lines from the console capture of that run. Revision:002ccaa75267bcc70ea1ba97dfefea14c6f7211d.device: GPUCCLI peak is absolute and GPUSLOT hi is window-relative, agreeing on all five cross-checked readings; SpringBoard's 1727 MiB is a 21 MiB offset in slot 2, not an overflow; backboardd's u260 offset is 967 MiB, so a 768 MiB slot 0 is unsafe; slot 255 is the successful-close marker and the poster refusals are kIOReturnBusy at the 8-open cap; all three addon mounts reach stage 5; the posters map zero bytes before aborting. Command:read GPUCCLI, GPUSLOT, GPUSWAP, GPUFB, WALLPAPER and the persistent log's A row from a captured boot, then replay the arithmetic with scripts/check-gpu-client-windows.py. Revision:2af006db44f11e10ebdff213e7017a3ea02c3887.device: Writes to SMR slot 5 (0x8000007f) and sCR0 (0x0026040e) both read back the pre-existing value while IDR0 reads 0x4c017e06 through the same window. Command:boot a pipa-gpu=7 image and read the GPUROW14 line from the console capture. Revision:e240b0e810988bf1012b2aa37bd3ae4fd6d84e67.device: routes 2, phase 5 with 13 writes, rb 1, en 1; GMU firmware 16 blocks, version 20010008, cm3 1, HFI acked c6. Command:boot a pipa-gpu=7 image built with the slot normalisation and read GPUROW13/14/15 from the console capture. Revision:7946cba83f32b768075a071a5d47bb0a2fd3eeb2.device: GX on perf 7 vote 0 oob 2 gx 000000c0>00000000 gdscr f8222800 rbbm 00000001 gbif halt 0/3 rbbm halt 0/0. Command:boot a pipa-gpu=8 image (usb191) and read GPUROW17 from the serial console capture. Revision:6642723982701653e2546fb4b83859bb3bf41a17.device: GPUCTX step 7 status 0 routes 4; CP ok init 0 ring 0 fence 0/1 marker a6500c0d read back; rptr and wptr 0x1b, hwfault 0. Command:boot a pipa-gpu=9 image (usb192) and read GPUROW18/19/20 from the serial console capture. Revision:ce0c65a1cbe872e44da38cbe51812cdbc775f32a.device: ZAP ok step 7 init 0/0 mem 0/0 auth 0/0 secure 0; IRQ attach 0 readback a002 count 1>2 nop fence 1 seen 00100000 masked 0. Command:boot a pipa-gpu=10 image with the re-laid zap image (usb194) and read GPUROW21/22 from the serial console capture. Revision:32cdcd97f19d21d8e684ca4670bf1c834d9e681d.device: PUBLISH ok submit 0 timer 0 publish 0 | uc 36/36 first 0 at 0 cpumap 0 | rounds 4 4. Command:boot a pipa-gpu=11 image (usb195) and read GPUROW23 from the serial console capture. Revision:1d954032604c986bd98de483447cb06ab8896cff.device: METAL ok: accelerator registered (IOGPUFamily loaded, class size 136); LIVE moved from sub 2/2 uc 2/2 to sub 7/7 uc 4/4 with pool 128/128/768. Command:boot a pipa-gpu=12 image (usb199) carrying the staged Data seed and read GPUROW24/25 from the serial console capture. Revision:fe2e366add2343efa48f8fe0cb01ff99ffa598d6.device: The plugin takes clients and the ring runs: askers=3..11 naming mediaserverd, backboardd, SpringBoard, WidgetRenderer and poster extensions, GPUHANG h=0 f=0 with no faults, and 12..874 submissions. A boot that presents nothing still reads sw=0 own=0, so the client rendered and never called the display. Command:boot tmp/boot-s12.img and tmp/boot-s13.img and read GPUCLI askers, GPUHANG, GPUROW25 LIVE and the SUPER swap and own fields from the console capture. Revision:ab53842422feadf058a0575b6e5a968623c6c052.device: The desktop appeared and the owner confirmed it; the 240 s screen export showed the home screen. GPUROW19 CP ok with marker a6500c0d, GPUROW25 sub 729/729 bo 316/316 busy 0 roqavail 0/0/0, GPUROW24 METAL ok, [metal askers] named ten processes, [gpu clients] carried slots s0..s4, [gpu objects] showed s0 w485M subs=682 and s4 w21M subs=19, and prime.log compiled the CoreImage pipelines. The known-image render is still outstanding. Wallpaper is absent: UnityPosterExtension reported no-device Vulkan(-3) and crashed in DecodeRow/Write_BGRA8_vec; the other poster extensions reached s4 and submitted. Command:fastboot boot tmp/boot-align1.img (sha256 d6f2d41a496fbcd6255132cbe84d717ee8916a1cfe0683763b486b90ebd6180e), then sh tmp/read-log.sh --diag and read build/sheng-logs/align1-0000002291370ffa. Revision:bdff7cd239a2bd1fcf2478d75e5d9d224ed15639.device: The GMEM colour-order test reports the declared bytes for all four transport kinds on one healthy boot: devs/devg/hosts/hostg each read A3366cc B0a141e C1e1e1e Dcccccc with p12288 e0, while the compositor accepted 241 swaps (own=1) and presented 84 frames. The known image renders with correct geometry and colours through the same Turnip path the desktop uses. Command:sh tmp/rounds-count2.sh tmp/boot-in22.img in22 1 220 with sheng-swaptest=1 and sheng-gpu-trace=1, then read GTPROB2. Revision:f571906aee3d86c6ad8f1ffe207b8c18a04cd989.
Network
planned
Hardware and dependencies
- QCA6390 at 17cb:1101 behind qcom,pcie@1c00000; parf 0x01c00000+0x3000, phy 0x01c06000+0x1000, dm_core 0x60000000+0xf1d, ELBI 0x60000f20+0xa8, IATU 0x60001000+0x1000, conf 0x60100000+0x100000.
- package/alioth_pcie.c is this board's diagnostic bring-up. Step 11 now follows pci-msm.c:4374-4409: after PERST is released it writes the seven DBI training words, sets PARF_LTSSM bit 8, then polls ELBI XMLH_LINK_UP (0x08 bit 10), DLLLA (DBI 0x80 bit 29) and a real vendor/device ID (DBI 0x00) for 20 rounds at 5 ms. Steps 12-15 remain separate read-only or opt-in diagnostics. The PHY reset is only GCC_PCIE_0_PHY_BCR (0x6c01c) before the 99-pair sequence; the later-generation 0x6f000/0x6f010 resets after the sequence were removed. The 100 MHz refgen CFG_RCGR is 0x105 (parent 1, divider 6), not 0x501. PARF_DBI_BASE is written only at the 2.7.0 offset 0x350; 0x168 is read-only here. WLAN_EN and PERST# use the NORTH TLMM tile at 0x0f900000 and set the level before output enable. These constants were verified against reference/k40-kernel f3d39dae and the board-validated MrMoxing/ios-alioth commit 6a5a2d56be33; that repository is iOS 16.5 / xnu-8796, so only its hardware sequence was used, not its Linux compatibility layer or userland.
- The whole resource set the bring-up has to vote, read from the vendor tree on 2026-11-06. Clocks, eleven of them (kona-pcie.dtsi:76-88): pcie_0_pipe_clk, pcie_0_ref_clk_src, pcie_0_aux_clk at 19.2 MHz, pcie_0_cfg_ahb_clk, pcie_0_mstr_axi_clk, pcie_0_slv_axi_clk, pcie_0_ldo, pcie_0_slv_q2a_axi_clk, pcie_tbu_clk, pcie_phy_refgen_clk, pcie_ddrss_sf_tbu_clk at 100 MHz. Resets, two (kona-pcie.dtsi:90-93): GCC_PCIE_0_BCR and GCC_PCIE_0_PHY_BCR. Supplies (kona-pcie.dtsi:46-52): gdsc-vdd from pcie_0_gdsc, vreg-1p8 from pm8150_l9 at 1200000/1200000 uV with 16000 headroom, vreg-0p9 from pm8150_l5 at 880000/880000 uV with 73500 headroom, vreg-cx voted to RPMH_REGULATOR_LEVEL_MAX. SMMU sid base 0x1c00 with two iommu-map entries, and dma-coherent.
- The link-training sequence, from drivers/pci/controller/pci-msm.c:4407-4440. Enable training by writing PCIE20_PARF_LTSSM (parf + 0x1b0) bit 8 to 0. Then poll ELBI + PCIE20_ELBI_SYS_STTS (0x08): bit 10 (0x400, XMLH_LINK_UP) is link up, and bits [17:12] are the LTSSM state. Each check sleeps 5000-5100 us and the default cap is 20 checks, so the whole wait is about 100 ms; a debugfs vote in bits [31:4] of a module parameter can shorten it. A set bit alone is not enough: msm_pcie_confirm_linkup also requires dm_core + 0x80 bit 29 to be set and dm_core + 0x00 (vendor and device id) to differ from the link-down value, and on failure the driver reasserts PERST and returns an error (pci-msm.c:1242-1250).
- The PHY is not a handful of writes: kona-pcie.dtsi carries qcom,phy-sequence as 99 register/value/delay triples (297 numbers) that the driver replays from phy power-down at 0x840, with phy version 1102, link status at 0x814 bit 6, and L1 substate settings of a 10 ms timeout, no L0s, th-scale 2 (1 us) and th-value 70. A port that does not replay all 99 writes is not doing the same bring-up as the vendor kernel.
Configuration
- board.toml passes pcie=<steps>; pcie_skip=<mask> skips a step, and pcie_skip=32 skips the PHY sequence.
- The file was wrapped in #if defined(ARM64_BOARD_CONFIG_SWEET) and compiled to an empty object under this board; the guard now accepts BCM2837 as well.
- The kernel's C record carries -Werror and the driver leaves struct fields implicit, so the recipe passes -Wno-missing-field-initializers; sweet_log_flush is shimmed because that log belongs to the ios-sweet tree.
- printf does not reach this board's console, so the driver's line() tees to qcom_usb_debug_write and the rows appear as PCIE <step>: <text>.
Procedure
- Build with the archive entry and call alioth_pcie_init() from the late display probe; a run is pcie=<n> on the kernel command line.
Development findings
- The PCIe probe's thread is named alioth-pcie so a stopped core's thread is identifiable. 2026-11-08: the hardware sequence was corrected to the vendor clock/DBI/PERST order. This is a source-verified board-probe change, not a claim that Wi-Fi works; no link-up reading exists on the UniXNU 4 KiB line yet.
- Step 9 now reads the clock vote register once more after the PHY reference generator is running, and changes nothing. Step 3 now votes all six branches (CLOCK_VOTES=0x3f), including pipe bit 4. The earlier 0x2f left it out; the external same-board success records that DBI, IATU and link-block reads never return with bit 4 out while PARF reads work, and pc3 measured exactly that. The read remains as the check that bit 4 is set before step 10 touches the IATU window.
- The DBI window was run on the board on 2026-10-30 -- step 10 in the table as it then stood, and steps 13 and 14 in the fifteen-step table the file carries now -- and produced exactly what step_dbi's own comment predicts: with pcie=10 the board never returned, no console device enumerated and no fastboot or adb endpoint appeared, so the first access to the controller's DBI window (the iatu_viewport read) takes the machine down. The step table in alioth_pcie.c already carries all ten steps including step_dbi, so the record's earlier statement that step 10 had never run is out of date; what is now known is that it runs and kills the board rather than that it is missing. Deciding between the mapping and the access rule needs a probe that writes its line before the access and survives it, which this board has no channel for.
- Step 1 reads gcc pcie_0_gdscr = 0x22f001: PWR_ON clear, SW_COLLAPSE set, the controller fully off — the same value the ios-sweet series recorded.
- Step 2 powers it: writing 0x22f000 reads back 0xf822f000 within a millisecond.
- Step 3 finds the halt registers already zero; step 2's power-up cleared them.
- Step 4 reports phy_status 0x68 with bit 6 set before any PHY write, so the bootloader left the PHY initialised and the sequence can be skipped.
- Step 9 with pcie_skip=32 reaches the PARF: parf_mhi_clock_reset_ctrl 0x3 written to 0x13, parf_axi_mstr_wr_addr_halt_v2 unchanged at 0x80000014, both matching the reference.
- The firmware provenance this area required is recorded (2026-11-09): proprietary-files.txt pins ath11k/QCA6390/hw2.0/{amss.bin,m3.bin,board-2.bin} from linux-firmware under an @fetch base with SHA-256 digests, and scripts/extract-files.py fills .cache/firmware for every build tree (--check verifies without writing). The images are the generic QCA6390 hw2.0 set used by mainline Linux on this part; the phone's own BDF in a vendor partition is a later substitution, not a prerequisite for MHI start. The MSI routing is recorded above (SPI 768, doorbell 0x17a10000, endpoint data 768) and the SMMU stream IDs are in inputs (sid base 0x1c00).
- 2026-11-09: the board layer now runs inside the kernel and reaches ath11k's PCI claim. in28 (image 7269fda4...) read, in one healthy boot with the desktop up (own=1 sw=20): link up at 15 ms (endpoint 17cb:10b), outbound window conf bar0 readback 0x60300004 and mem+0x8 0xdeadbeef, inbound window ctrl2 0x80000000 target 0x17a10000, MSI control 0x10b address 0x60400040 data 0x300, TCSR_SOC_HW_VERSION major 2, config id 0x110117cb, SMMU SID 0x1c01 claimed at SMR slot 7 with S2CR bypass, a 32 MiB physically contiguous DMA arena, four WLAN rails voted, 'ath11k: MSI vectors: 32', 'qca6390 hw2.0'. The start then failed at 'firmware .../amss.bin open 2' because that round's addon did not carry the firmware; the addon with firmware/qca6390/{amss.bin,m3.bin,board-2.bin} is built and the next round uses it. Two source defects were found and fixed on the way: cfgRead refused every width but 4 while ath11k claims the device with a 16-bit read, and the firmware lookup used the driver's full 'ath11k/QCA6390/hw2.0/<file>' name against this board's flat directory. Still no MHI start, no firmware download, no QMI/QRTR, no WMI, no scan, no association, no traffic.
- The PCIe bring-up runs only when the command line carries pcie=N; alioth_pcie_init returns at once otherwise. in24 and in25 omitted it, so the board layer read an unprogrammed BAR0 and the CPU hung until a power cycle. alioth_pcie.c now exports how far the steps got and the board layer refuses to map or read the endpoint below step 19 (17 is the outbound window, 19 the inbound window and the MSI capability), naming the argument to add instead of hanging. A round therefore needs 'pcie=19 pp=1 alioth-wifi=1'; pt=1 must not be used with it, because it runs the steps on a thread and lets the boot continue before step 19 finishes.
- The driver cannot come from the catalog component. Ath12kWifi implements ath12k for WCN7850/QCC2072/QCN9274 (components.toml:495-513, tools/sources.txt builds only ath12k), and QCA6390 is ath11k: PCI 17cb:1101, ATH11K_HW_QCA6390_HW20, firmware directory QCA6390/hw2.0 (reference/repo/linux-mainline ath11k/pci.c:30, core.c:220-232, hw.h:74-81). The same stack exists on a sibling device: qiumochen/UniXNU-zizhan drives QCA6490 (17cb:1103) with Linux v7.0.14 ath11k built against the Ath12kWifi shim and reached scan, WPA2, DHCP and HTTPS (docs/devices/zizhan.md g275-g337). Its 149-line ath11k glue and shim headers are imported under drivers/AliothWifi and adapted to 0x1101; the platform, network layer and build recipe are next. No Wi-Fi code is in the image yet.
- 2026-11-09: the endpoint's stream was claimed as TRANSLATE, not BYPASS, and that is what stopped MHI. claimStream wrote S2CR = 0 with a comment calling it bypass; the vendor register header (reference/k40-kernel/drivers/iommu/arm-smmu-regs.h:119-128) encodes the type in bits [17:16] as TRANS 0, BYPASS 1, FAULT 2, and the shared kit repeats it (ArmSmmu4KStreams.c:3). Zero sends every transaction from SID 0x1c01 to context bank 0, which this layer never configured, so all of it faults; a non-posted read from the endpoint then never completes and the host's next register read blocks behind it, which is exactly in32's shape (doorbell rung, then the CPU stops on BHI_STATUS). The same rule is already in this record for the GPU SMMU: clearing a slot to zero turns FAULT into TRANSLATE. The claim now writes BYPASS with EXIDVALID when ID0 reports EXIDS, writes S2CR and reads it back before publishing the SMR, refuses a slot whose S2CR still names an enabled context bank (the UFS takeover writes S2CR before SMR), and logs ID0, sCR0, GFSR before and after and both readbacks. Not yet measured on the board.
- 2026-11-09, in30 and in31: the AMSS file is read into the kernel and MHI's power-up completes, then the CPU stops inside the SBL load. in30 (sha256 580057a4...) and in31 (c96b121d...) both print 'Requested to power ON' and 'Power on setup success' (both from mhi_async_power_up), then the firmware line for amss.bin (3,628,672 bytes, first word 0x464c457f), and nothing more; the console freezes at t=13 s and the watchdog resets the board, so no desktop appears either. in31 also ruled out the BAR0 window: MHICFG reports BHI at 0x100 and BHIe at 0x224 and the window register reads 0x40000000 before the driver touches it, so every MHI register access is below the 0x80000 window start. The MHI register hooks now go through the window anyway (they are correct for any offset), but that was not the cause. What remains is the SBL transfer: mhi_fw_load_handler reads BHI_SERIALNU, requests amss.bin, takes sbl_size bytes, gives the endpoint a DMA buffer and rings BHI_IMGTXDB, then polls BHI_STATUS. A wedged MMIO read and a transfer the endpoint never completes look identical from the console, so the next round logs each step (exec env, buffer address and length, each doorbell, the load result).
Completion criteria
- Scanning, association, address configuration and sustained receive/transmit traffic pass with the selected firmware.
Current limits
- Step 10 stops at its first access, and the window addresses are not the reason. Every one of parf, phy, dm_core, elbi and iatu matches the vendor DTS byte for byte (kona-pcie.dtsi:7-13); only the conf window differs, 0x100000 there against 0x1000 here, and that is not the access that hangs. What differs is the clock vote set: step_clocks votes slv_axi, mstr_axi, cfg_ahb, aux and slv_q2a, while the vendor clock-names also carries pcie_0_ldo, pcie_phy_refgen_clk, pcie_0_ref_clk_src, pcie_tbu_clk and pcie_ddrss_sf_tbu_clk. The LDO and the PHY reference generator decide whether the core and the PHY are powered and clocked at all, so a bus that never returns is what their absence predicts. Next: vote those two only and run to step 9 without touching DBI, then retry step 10.
- No link has trained on the UniXNU 4 KiB line and no endpoint has been enumerated there; MHI, QMI and ath11k do not exist in this tree, and the local reference Ath12kWifi is ath12k, a different driver for a different part. pc2 (boot image sha256 1d3b01eb..., console tmp/console-pc22308321.txt, source revision 1ba611e) ran pcie=11 pp=1 pt=1 once. Step 2 voted ldoa9 1.2 V, ldoa5 0.88 V and cx.lvl 0x30000 level 256 before it powered the controller; the command database resolved cx.lvl, the RSC read 0x800c8104 (8 TCS, 16 commands each), TCS 0 was idle, and the vote completed after one poll with command status 0x10101 and irq 0x1. That 0x10101 is CMD_STATUS_ISSUED (bit 8) plus CMD_STATUS_COMPL (bit 16), the vendor completion criterion (rpmh-rsc.c:283-290); the earlier rail2 line that called it DID NOT COMPLETE used the TCS IRQ status instead and is corrected in docs/evidence/2026-10-31-rail-vote.md. The link still did not train: parf_ltssm stayed 0 after step 10, the PCIE 11 announce reached the console, but no 'about to read dbi' line, THE LINK IS UP or link row followed; the persistent writer stopped at BOOTLOG beat 2 phase 7 and the boot showed CORES deaf=9e. The missing first DBI line is not proof that the DBI read hung: pc2's line_persist waited for the writer before its USB write, and that wait used a timer. pc3 (revision 822f7a4, image b4e5a5b9...) writes USB first and spins on cntpct_el0 so the next run separates the log wait from the first register access. The iOS 16.5 / xnu-8796 commit 6a5a2d56 reports parf_ltssm 0x111 and an open-network join on the same board; it establishes the hardware sequence, not compatibility with this kernel or OS. This early vote is a verified hardware action, not a link or Wi-Fi result. pc3 then printed 'PCIE 11: about to read dbi ... 0x080c' and never returned; the TWRP read shows slots_written=2 and no step 11. The local CLOCK_VOTES was 0x2f and omitted pipe bit 4; the external same-board success uses 0x3f and records that DBI/IATU/link-block reads never return with bit 4 out while PARF reads work. The fix is CLOCK_VOTES=0x3f plus the DT qcom,ep-latency=10 ms before PERST release (source 73a0080); docs/evidence/2026-11-08-pc3-pipe-clock.md records the round. pc4 (image 900494a9..., console tmp/console-pc42331111.txt, source 73a0080/c93f12f) then ran once: the first DBI read returned 0x20190 and the link came up at 5 ms with ELBI 0x11401, DLLLA bit 29 and endpoint 17cb:10b; step 11 and the step table completed. That is link/endpoint evidence, not Wi-Fi: no BAR, DMA, MSI, firmware, MHI, QMI, QRTR, scan or join. The same boot still did not reach the desktop: DATAMOUNT stage=0, [addon] 0/-1, SUPER own=0, and CORES moved from deaf=00 at t=10 s to deaf=1e at t=30 s as c4 froze after link-up. The probe has no PCIe interrupt owner; source e3d5a6f now masks PARF_INT_ALL before link training (pci-msm.c:4537-4552), and pc5 image f6226e27... is built. A normal control image without pcie= (tmp/boot-norm1.img, e4fa67c2...) is also built to separate a probe-induced stall from the known random one. Neither pc5 nor norm1 has a board result yet.
- Of the two clock votes that limit above named as missing, only one was. pcie_phy_refgen_clk is GCC 0x6f02c and every run reads it as 0x1 at step 1, before this file writes anything, so step 9's vote already covered it. pcie_0_ldo is the device tree's name for GCC_PCIE_WIFI_CLKREF_EN (gcc-kona.h:86, clock id 74), whose branch gcc-kona.c:2521 puts at 0x8c004; that one read 0x80000000 (bit 0 clear, branch off) and this file never touched it. Voting it in step 3 turns it to 0x1, and the PARF readings after it (sys_ctrl 0x2000361c, phy_ctrl 0x900, ltssm 0) are identical to the runs without it, so the clock reference reaches the endpoint's side and not the root complex's own registers.
- The DBI base is 0 at both candidate offsets, so the v2/v3 layout question does not explain step 10. The v3 tell is real -- 0x358 reads 0x1000000 while 0x16c reads 0 -- but the vendor driver's 0x350 (pci-msm.c:43) reads 0 as well as the mainline 0x168, before and after step 9's zero write. Step 10's hang therefore has neither of the two explanations this area carried.
- Step 1 never reads the PARF, the PHY or ELBI: gdscr is 0x22f001 (PWR_ON clear) and axi_misc is 0x4100040 (low six bits zero, not 0x3f), so step_look returns at alioth_pcie.c:272 before those reads. The earlier statement that step 1 read elbi_sys_ctrl was wrong -- elbi has a value line in zero console captures -- so the overlapping elbi/dbi mapping has no evidence behind it either way.
- The GPIO write this limit used to say was missing now exists and the limit is not that it is absent. step_endpoint() in package/alioth_pcie.c (from :812) reads both pads first, writes gpio20 as function gpio with pull-up, drive 16 mA and output high, waits the vendor's 1000 us WLAN_ENABLE_DELAY, then writes gpio79 as pull-down, drive 2 mA, output high (which releases the active-low PERST#), waits perst_delay and reads both back, printing HIGH or STILL LOW and RELEASED or STILL ASSERTED. It then reads PARF_LTSSM without writing it, so that a change in link state is attributable to the pads alone. That step has not been run on the board: reference.md:660 still says not to write LTSSM, PERST or WLAN_EN until the read/write path is proven, and the earliest open question is still whether a write inside the controller's windows returns at all. Until step 10 runs, the link has never been asked to train: parf_ltssm reads 0 (LTSSM_DETECT_QUIET) at steps 8, 9 and 10 because nothing ever set the enable bit, not because training was attempted and failed. step_train() at :884 does write that bit, as a read-modify-write that ORs bit 8 in and preserves the state field the way the vendor's msm_pcie_write_mask call does, and it then waits 100 ms and reads PARF back; so the file now carries the write, and what is missing is a run, not the code.
Next action
- Bring up the QCA6390 MHI boot, then QMI/QRTR and the station path. Order and evidence: first the board platform (reuse the trained link, BAR and MSI of package/alioth_pcie.c; own one SMMU context for the endpoint with the recorded sid base 0x1c00, a DMA window and the WLAN rails), then the build recipe that compiles Linux v7.0.14 ath11k against the Ath12kWifi shim the way zizhan's build-pong-ath11k.py does, then the Darwin 23 network layer. Firmware is already pinned; the addon carries it to /private/var/ngpu/firmware/qca6390. Record firmware start, QMI, WMI_INIT, scan, association, address configuration and traffic as separate results; a link or MHI start is not Wi-Fi.
Evidence
device: The read-only stage ran and the controller is still fully collapsed after the bootloader: gcc pcie_0_gdscr 0x22f001, pcie_0_axi_misc 0x4100040, slv_axi_halt 0x80000220, mstr_axi_halt 0x80000220, cfg_ahb_halt 0x80000000, aux_halt 0x80000000, pipe_halt 0x80000000, slv_q2a_halt 0x80000000. The halt registers carry bit 31 with only the acknowledge bits set, which is the held-in-reset shape, and the desktop was unaffected (sw=71/71/0). Command:fastboot boot tmp/boot-p2.img (kernel argument pcie=1) and read the PCIE 1 lines on the USB console. Revision:c9285a9780b36402771943d289216fdc93d3ecbc.device: gcc pcie_0_gdscr reads 0x22f001, the value the ios-sweet series recorded for a fully collapsed controller. Command:boot a pcie=1 image and read the PCIE 1 lines from the console capture. Revision:dc3ab04aa4b05d38a1c372fa2ec257b3ae8547ce.device: Writing 0x22f000 reads back 0xf822f000 within a millisecond: the controller has power. Command:boot a pcie=2 image and read the PCIE 2 lines from the console capture. Revision:28be364f4dc9223a006770635dbc0f352d230401.device: With pcie_skip=32 the PARF setup completes and parf_mhi_clock_reset_ctrl 0x3 becomes 0x13, matching the reference. Command:boot a pcie=9 pcie_skip=32 image and read the PCIE 9 lines from the console capture. Revision:eeda5a8139786ca8029044708679c40e7382eb1e.device: pcie_wifi_clkref reads 0x80000000 at step 1 and 0x1 after step 3's vote, so the device tree's pcie_0_ldo was off and voting it works; pcie0_phy_refgen reads 0x1 at step 1 already, so it was never missing; parf_dbi_base is 0 at both 0x168 and 0x350; parf_ltssm is 0 before and after the init. Command:boot a pcie=9 pcie_skip=32 image tagged wifi1 and read the PCIE 1/3/8/9 lines from the console capture; the persistent log header confirms tag=wifi1. Revision:db6747c7f97f78b8d445e1c524c40b5ca9ce250b.
Audio
planned
Hardware and dependencies
- Collected from the vendor device tree (reference/k40-kernel/arch/arm64/boot/dts/vendor/qcom) on 2026-11-06, which is the inventory porting/power asks for before implementation. Codec: WCD938x, referenced as &wcd938x_codec from alioth-audio-overlay.dtsi. Amplifiers: two Cirrus CS35L41 on I2C, cs35l41@40 (speaker) and cs35l41@41 (speaker and receiver), each with its own interrupt GPIO through pinctrl.
- SoundWire and macros, kona-audio.dtsi:36-60: wsa-macro@3240000 carries swr0 (wsa_swr_master), rx-macro@3200000 carries swr1 (rx_swr_master), tx-macro@3220000 carries swr2 (tx_swr_master), and bolero-clk-rsc-mngr owns the codec clock. The microphone path therefore runs through the TX macro and swr2, not through a separate SoundWire controller.
- DSP transport, kona.dtsi:3725-3748: GLINK to the ADSP uses qcom,remote-pid = <2> over transport = "smem", mailbox IPCC_CLIENT_LPASS / IPCC_MPROC_SIGNAL_GLINK_QMP delivered as an edge interrupt from ipcc_mproc, with intents 0x800x5, 0x2000x3 and 0x4400x2. Two channels are registered under the lpass label: IPCRTR with QRTR net-id 2, and apr_audio_svc with intents 0x200 x 20 -- 20 intents of 512 bytes, which is APR_MAX_BUF. apr_audio_svc is the APR stack's channel; AudioReach does not use it (see the findings). Reserved memory: pil_adsp_region@8bb00000 for the firmware and smem_region@80900000 for SMEM. A separate voice-mhi-audio node takes mailbox_mem.
- Headset detection is described too: alioth-audio-overlay.dtsi sets qcom,msm-mbhc-usbc-audio-supported = 1 and qcom,uart-audio-sw-gpio = <&sbu_uart_en>, so the USB-C audio switch is a GPIO the port has to own before the codec can be told which path is active.
- The protocol is APR, not GPR/AudioReach, and that is a correction: this board's vendor kernel is Linux 4.19.312 and carries the older APR stack in techpack/audio (include/ipc/apr.h, include/ipc/apr_tal.h, dsp/apr_audio-v2.h), with drivers/soc/qcom/apr.c as the transport. GPR and AudioReach are the newer stack the SM8550 reference board uses; copying its arguments here would name a protocol this firmware does not speak. The GLINK channel the device tree registers is apr_audio_svc, which is APR's service port.
- APR packet, from include/ipc/apr.h: a fixed 20-byte header of hdr_field, pkt_size, src_svc, src_domain, src_port, dest_svc, dest_domain, dest_port, token and opcode. hdr_field carries the message type (0 event, 1 command response, 2 sequenced command, 3 non-sequenced) plus the header length and APR_PKT_VER 0x0. Responses are matched by token, and the two universal opcodes are APR_BASIC_RSP_RESULT 0x000110E8 and APR_RSP_ACCEPTED 0x000100BE. The buffer limit is APR_MAX_BUF 512 bytes, which is the same 512 the reference board's SHENG_ADSP_MAX_MESSAGE carries, so the message-size constraint transfers.
- APR addressing, from the same header: domains SIM 1, PC 2, MODEM 3, ADSP 4 and APPS 5; services TEST_CLIENT 0x2, ADSP_CORE 0x3, AFE 0x4, VSM 0x5, VPM 0x6, ASM 0x7, ADM 0x8, MVM 0x9, CVS 0x0A, CVP 0x0B, USM 0x0C, LSM 0x0D and VIDC 0x16. The path that matters for this board is APPS to ADSP (5 to 4) on AFE 0x4 for the port connection and on ASM 0x7 for the stream, with the AFE port ids named in include/dsp (for example AFE_PORT_ID_INT0_MI2S_RX and AFE_PORT_ID_DIGITAL_MIC_TX for the digital microphone).
- Where the port map is written, from asoc/kona.c: the backend tables are msm_common_dai_links (line 5835), msm_bolero_fe_dai_links (6390), msm_common_misc_fe_dai_links (6408), msm_common_be_dai_links (6583), msm_tdm_be_dai_links (6729) and msm_wcn_be_dai_links (6896). Each entry carries .name (LPASS_BE_*), .cpu_dai_name ("msm-dai-q6-dev.N", where N is the AFE port id in decimal), .codec_dai_name and .id (MSM_BACKEND_DAI_*). msm_get_port_id() at kona.c:2807 is the switch that turns .id into the AFE_PORT_ID_* constant, so the two halves of the mapping are in the same file and a path can be read off without guessing. Confirmed numeric ports from include/dsp: PRIMARY_MI2S_RX 0x1000 and TX 0x1001, QUATERNARY_MI2S_RX 0x1006, WSA_CODEC_DMA_RX_0 0xB000 and TX_0 0xB001, VA_CODEC_DMA_TX_0 0xB021. Worked example from the same file: msm_bolero_fe_dai_links at 6390 binds LPASS_BE_WSA_CDC_DMA_TX_0 with .cpu_dai_name = "msm-dai-cdc-dma-dev.45057", and 45057 is 0xB001, so a cdc-dma device number is the AFE codec-DMA port in decimal. That is the rule for reading each remaining path.
- The two amplifiers are not codec DAI links at all: kona.c declares them as snd_soc_aux_dev entries, CS35L41_SPEAKER_NAME "cs35l41.1-0040" and CS35L41_RECEIVER_NAME "cs35l41.1-0041" (asoc/kona.c:100-104, and the aux table uses .dai_name at :128). That is the standard smart-amplifier topology: the amp hangs off the card, and its audio arrives through the codec's path rather than through a backend of its own, so there is no third port to find for the speakers.
- The OS side, read out of the selected kernelcache (out/ipsw/21H461/kernelcache.decompressed) on 2026-11-06. The provider the port has to publish is IOAudio2Device, and the class the OS audio service opens against it is IOAudio2DeviceUserClient; both are present as class-name strings, and the kernelcache is stripped of local symbols so no method list can be read from it directly. The two mechanisms porting/power asks to record are visible by name: clientMemoryForType is the mapped-memory mechanism for the stream buffer (6 occurrences) and registerNotificationPort is the completion mechanism (4).
- The same kernelcache shows that part of this OS's audio path is not IOAudio2 at all: it carries ExclavesAudioDrivers_C.c, ExclavesAudioProxyInterface, ExclavesAudioProxyTightbeam and IISAudioIsolatedStreamECProxy, plus IISAudio,IsolatedStreamHandle. So iOS 17.7.11 has an Exclaves-backed audio proxy layer in addition to IOAudio2Device. The matching question is now answered below, and differently from what this paragraph first suspected: the personalities match on AppleARMIISDevice, and the Exclaves proxies are a separate layer rather than the one the card personalities use.
- Still to collect: the method list and request layout of IOAudio2DeviceUserClient, which needs a disassembly rather than a string read, and which of the two layers this OS's audio service actually drives.
- SHENG_ADSP_MAX_MESSAGE is 512 bytes, and one constraint is not device-specific: CoreAudio assumes a 24 MHz host clock while this SoC's counter is 19.2 MHz, so the audio service must correct that constant rather than inherit it.
- What the OS actually matches on, read from the kernelcache's prelink personalities on 2026-11-06, and it is not IOAudio2 that decides the shape. The com.apple.driver.AppleEmbeddedAudio kext declares a family of personalities whose IOProviderClass is AppleARMIISDevice and whose IONameMatch is a node name of the form audio-data,<role>: aop-mca-loopback, tap, voice, baseband-voice, hawking, virtual-secondary, mikeybus-secondary, haptics-external, audio-loopback, external, maggie-debug, dsp-debug2 and the codec inputs. Their IOClass is AppleSecondaryAudio, with AppleExternalSecondaryAudio and AppleHapticsExternalSecondaryAudio for two of them. AppleSecondaryAudio, AppleARMIISDevice and AppleARMIISAudioDevice are all present in the kernelcache, and AppleARMIICDevice is present the same way for the codec side, so the card and codec classes ship with the OS: the port does not write an audio card class, it supplies an AppleARMIISDevice for the OS to match. That word carries the real work, because AppleARMIISDevice is Apple's driver for Apple's own I2S controller and this SoC's controllers are Qualcomm MI2S blocks, so the provider has to be that class (or a subclass) with the Qualcomm hardware underneath, and the node names have to be audio-data,<role> for the personalities to match at all. Neither dts/alioth.dts nor board.toml has an audio node of any kind today, so that tree is the missing piece.
- I tried that this round and it does not link, which is the most useful thing known about this area. Adding com.apple.driver.AppleEmbeddedAudio to the [kernel.prelink] roots makes the prelink stop at: Kernel target 0xfffffff0078a5c30 has 0 native address candidates: ['_tb_message_complete']. That symbol is Tightbeam, Apple's Exclaves message layer: Apple's own kernelcache exports _tb_message_complete and this kernel exports nothing by that name, so the audio kext cannot bind. Its OSBundleLibraries also name com.apple.driver.AppleEmbeddedAudioLibs and com.apple.iokit.AppleARMIISAudio, and the kernelcache carries com.apple.driver.ExclavesAudioKext beside them. So the Exclaves layer is not an alternative to IOAudio2 that might be bypassed; it is on the dependency path of the audio kext, and the choice for this board is to implement Tightbeam or to write an audio stack that does not use Apple's kexts at all.
- The DSP firmware path already exists in this tree and is not what a reader would guess. package/AdspFirmware.c is a loader, not a blob: it reads adsp.mbn and adsp_dtb.mbn from /private/var/firmware on the mounted Data volume at runtime, and its own header says they are never part of the build, on the caller's thread with plain VFS reads. So an ADSP-side audio provider has a firmware source already wired, and what it does not have is a reader for the image contents, a verification step, or any statement of which adsp.mbn build the board carries. That is the audio area's remaining firmware-service input.
Configuration
- board.toml carries no audio field yet. porting/power names sheng-audio=4 as the boot-time switch; it is not on this board's command line.
Procedure
- Collect the inputs listed above from the vendor device tree, the firmware manifest and the vendor audio driver, record each binary's source and version in the firmware inventory, then select the DSP and audio components and run defconfig, status, kernel, payload and bootimg.
Development findings
- No audio code has been written for this board, but the hardware inventory porting/power asks for first is now collected from the vendor device tree and recorded in inputs: codec, amplifiers, the three SoundWire masters and their macros, the GLINK transport to the ADSP with its intents and channels, the two reserved regions, and the headset switch GPIO. What is still missing is the protocol side, which lives in the vendor driver and the kernelcache rather than in a device tree.
- The vendor tree also settles two questions the reference board's record could not answer for this board: the microphone path is the TX macro's swr2 with the WCD938x rather than a separate capture controller, and the speaker amplifiers are I2C parts (CS35L41) rather than SoundWire ones, so they are configured over a different bus than the codec.
- The sheng reference the official page names is not in this workspace's checkout, and that matters for anyone who opens it next. The page pins commit 552b6749 for package/ShengAdsp.h, ShengGpr.h, ShengAudioReach.h, AudioProbe.cpp, ShengCs35l43.c, ShengAudioService.cpp and hal/ShengAudioPlugIn.c. `UniXNU-sheng` is at 516a780, which does not contain those files: 552b6749 is on another branch, so read them with git show 552b6749:<path>, not from the working tree.
- Which sheng layer transfers is now settled by reading both sides. package/ShengAdsp.h is the GLINK transport: sheng_adsp_channel(name, intent_size, intent_count, initiator, client, context) registers a channel, sheng_adsp_send queues at most 512 bytes, and the receive callback runs on the DSP thread. AudioProbe.cpp calls it as sheng_adsp_channel("adsp_apps", 512, 20, 0, ...), which is the same intent geometry this board's device tree gives apr_audio_svc (0x200 x 20), and initiator 0 means sheng answers the DSP's channel open. That layer is transport-only and transfers as written. package/ShengGpr.h is the packet router above it, and it does not transfer.
- The two wire formats differ in every field, so this is not a rename. sheng's GPR header is 24 bytes in six little-endian words: word 0 is version[3:0], header size in words[7:4] = 6, and total packet size in bytes[31:8]; word 1 is destination domain[7:0] and source domain[15:8]; words 2 to 5 are source port, destination port, token and opcode, each 32-bit. APR's header is 20 bytes in five words: a 16-bit hdr_field holding message type[9:8], header size in words[7:4] = 5 and version[3:0]; a separate 16-bit pkt_size; then four 8-bit bytes src_svc, src_domain, dest_svc, dest_domain; then 16-bit src_port and dest_port, then 32-bit token and opcode (include/ipc/apr.h:24-40). So APR has an 8-bit service id per side that GPR does not, APR's ports are 16-bit where GPR's are 32-bit, APR carries a message type that GPR does not, and the packet size lives in a different place in both.
- The opcodes differ too, and that is the part a port cannot paper over. GPR asks the DSP's audio framework manager whether it is ready with GPR_OP_APM_GET_SPF_STATE 0x01001021 and expects GPR_OP_APM_SPF_STATE 0x02001007 with a one-word payload where 1 means ready; its generic result is GPR_OP_BASIC_RESULT 0x02001005 with a two-word {opcode, status} payload. APR's generic result is APR_BASIC_RSP_RESULT 0x000110E8 with the same two-word payload -- q6core.c:267 rejects an empty one and one shorter than 8 bytes -- so the result shape matches and only the opcode number differs. What has no counterpart is the readiness query: this vendor tree carries no SPF_STATE message, because the APM/SPF framework is the AudioReach generation. APR readiness comes from the subsystem state instead: apr_send_pkt refuses to send while apr_get_q6_state() is not APR_SUBSYS_LOADED (apr.c:376-379), and that state arrives from the PIL/SSR side, not from a query. A port that reuses ShengGpr on this firmware would send a query the DSP does not implement.
- The decisive evidence is in the device tree, and it shows the vendor kernel ships both generations for kona. kona-audio-ar.dtsi declares qcom,gpr on GLINK channel adsp_apps with qcom,intents = <0x200 20>, and hangs spf_core, audio-pkt, audio_prm and spf-core-platform under it; kona-arglass.dtsi includes that file. kona-audio.dtsi, which alioth reaches through alioth-audio-overlay.dtsi -> kona-audio-overlay.dtsi, has none of those nodes: it declares qcom,q6core-audio, qcom,bolero-codec and qcom,kona-asoc-snd, which is the APR generation. alioth-sm8250.dtsi:8 includes the APR overlay. The transport geometry is identical in both (512-byte intents, 20 of them), which is why the transport layer transfers and nothing above it does. The channel name is not the same, though: GPR uses adsp_apps and this board's APR uses apr_audio_svc.
- The APR header now exists as code and is checked without a device. package/AprCore.h holds the 20-byte layout as byte offsets rather than a struct, the hdr_field packing of message type, header words and version, and the receive-side validation in the vendor receiver's own order: version above APR_PKT_VER + 1, header shorter than one header, packet size below a header, below the declared header, or above what arrived, then a domain at or above APR_DOMAIN_MAX and a service at or above APR_SVC_MAX. It also carries the two-word {command, status} basic result and the 512-byte limit. package/tests/apr_host.c builds it with -Wall -Wextra -Werror and checks the packing against apr.h's own macro over all 1024 combinations, the offset of every field, each rejection path, the basic result and the buffer edge.
- The transport is adopted and runs both ends without a device. package/QcomGlink.c/.h comes verbatim from `UniXNU-sheng` at commit 552b67499135bae191f415f444d782a6942c252e: it is the native GLINK protocol -- version handshake, channel open and close, receive intents, data with continuation, done -- on a pair of SMEM FIFOs, event driven and allocation free, with the doorbell left to the owner as a callback. It carries no board constant, so it needed no edit for this board: the FIFOs, the remote pid and the doorbell are the caller's, and those come from kona.dtsi. package/tests/glink_host.c links the two directions through one process so each end's transmit is the other's receive, and checks the handshake, the channel open in both roles, the intent exchange, a byte-exact message each way, twenty sends through a FIFO that wraps, the refusal of a payload one byte over the remote intent, the refusal of anything above half the ring, and a corrupt command stopping the link rather than being skipped. A mutation that breaks either the version handshake or the payload copy fails it.
Completion criteria
- Each declared route carries the selected audio format through playback or capture and handles start/stop correctly.
Current limits
- The APR header codec is written and host-tested; nothing else is. The transport, the DSP session, the codec, the amplifiers, SoundWire and the audio service are all outstanding, and the device tree has no node for any of them.
- The microphone route inputs porting/power lists (codec reset and supply, SoundWire device and TX master, micbias, ADC, decimator, DMA channel, sample rate) are the reference board's; this board's equivalents have to be established from its own vendor tree before they are copied.
Next action
- Adopt the transport next. package/QcomGlink.c/.h in `UniXNU-sheng` at commit 552b67499135bae191f415f444d782a6942c252e is the GLINK layer the findings say transfers: read it against this board's numbers before copying, because the addresses in sheng's AdspProbe.cpp are sheng's SoC and this board's are in kona.dtsi:3691-3758 -- remote pid 2, transport smem, IPCC_CLIENT_LPASS signal IPCC_MPROC_SIGNAL_GLINK_QMP, and the two FIFO items AdspProbe names. Register the channel apr_audio_svc, not adsp_apps, with 512-byte intents and 20 of them. Then the first message is against ADSP_CORE, not a readiness query: this firmware reports readiness through the PIL/SSR subsystem state, so the port waits for that state rather than asking the DSP.
Evidence
host: apr_host: all assertions passed, exit 0. The test checks apr_hdr_field against apr.h's macro over every message type, header size and version, then encodes a real packet and asserts each byte offset, decodes it back field for field, and drives every rejection path in the vendor receiver's order. Command:cc -std=c11 -Wall -Wextra -Werror -o apr_host package/tests/apr_host.c && ./apr_host. Revision:aaadf8b5b4e0ab28863844efeec7751694b9291f.
Power
planned
Hardware and dependencies
- Already in the tree: the EPSS clock domains and their per-domain CPU counts (four, three and one on kona), voted through the qcom-cpufreq-hw-epss register interface that the reference board also uses; the RPMH communication path through AliothRpmhPort; and the platform power service built by build-platform-power.py.
- Battery side, collected from the vendor device tree on 2026-11-06: the charger is pm8150b_charger with qcom,usbpd-phandle = <&pm8150b_pdphy> and qcom,battery-data = <&umi_batterydata> (alioth-sm8250.dtsi:519-536); the profile label umi_batterydata is defined in the sibling board file thyme-sm8250.dtsi:580, and this board also ships three fg-gen4 battery-data files of its own (FMT and GY at 4520 mAh, sun at 5000 mAh), so the gauge is fg-gen4 and the profile in use is the shared one. Two pm8150b GPIOs describe wireless charging: idt,wpc-det and rx,power_good on pm8150b_gpios 7. Charger current readings come from the pm8150b_vadc channels ADC_USB_IN_V_16, ADC_MID_CHG_DIV6 and ADC_USB_IN_I.
- The fuel gauge is not on a firmware protocol at all: it is a pm8150b SPMI peripheral, qcom,fg-gen4, with four 0x100-byte SRAM windows (pm8150b.dtsi:286-350) -- batt-soc at 0x4000, batt-info at 0x4100, rradc at 0x4200, memif at 0x4300. Its notification messages are the block interrupts: soc-update, soc-ready, bsoc-delta, msoc-delta, msoc-low, msoc-empty, msoc-high and msoc-full from batt-soc; vbatt-low, vbatt-pred-delta and esr-delta from batt-info; batt-missing, batt-id, batt-temp-delta, batt-temp-hot and batt-temp-cold from rradc. Every read is paired: the driver reads the value and its shadow copy and retries up to five times until they match (fg-util.c:1014-1050), so a port that reads once will return torn values.
- The units and the sign, from the driver rather than from the header. Current is a 16-bit two's-complement field whose sign bit is bit 15 (fg-util.c:1052, sign_extend32), assembled little-endian and scaled by 488281/1000 to uA on the direct register path, while the SRAM table for IBAT_FINAL uses 488282/1000 -- the two paths differ by one, and a port must pick one and say which. Voltage is scaled 122070/1000 to uV on the direct register path, and the SRAM table's 244141/1000 is exactly twice it, so the SRAM keeps one more bit of the same measurement. State of charge is a raw percentage with no scaling. The SRAM word index for the main fields: IBAT_FINAL 320, VBAT_FINAL 321, ESR 331, OCV 417, VOLTAGE_PRED 432, BATT_SOC 449 (qpnp-fg-gen4.c:143-168).
- Outstanding for thermal and interconnect: the OPP table, regulators, firmware votes and thermal limits, and the peripheral vote ownership and reference counting that must stop dependent DMA and interrupts before a vote is released.
- dts/alioth.dts itself carries only the compatible, memory, the splash region, the eight CPUs and UFS; every battery, charger, gauge and regulator node above is in the vendor tree and has not been carried into this port.
Configuration
- board.toml: sheng-cpufreq=3 votes every EPSS domain that reads enabled, sheng-pmgr=2 selects the PMGR path. The ADT carries sleep-disabled=1, which porting/power names as required for the watchdog not to trap.
Procedure
- Boot the image and read the CPU frequency row (panel row 39, native_cpufreq_row) together with the CLK row, which converts the same counter through the device-tree timebase and through CNTFRQ_EL0 and prints both; they agree only if the timebase is right.
Development findings
- CPU frequency and PMGR are implemented and reporting; battery, charging, thermal and interconnect are not. The area therefore stays planned even though part of it works, because the record's completion condition covers battery readings and sleep/resume restoration, neither of which has been measured.
- porting/power's policy inputs are the reference board's (16 ms scheduler sampling, GMU XO busy voting, touch keeping the P domain and GPU at maximum, the GPU resume boost). They are policy for SM8550 with that board's GPU and touch stack and are not transferable verbatim; this board has no GMU HFI vote path and no battery service.
- The gauge's decoder now exists and is checked without a device, which is the one piece of the battery half that can be finished offline. package/BatteryCore.h holds the four SPMI blocks and their PPIDs (sid 2, peripherals 0x40 to 0x43, so PPIDs 0x240 to 0x243), the batt-info register offsets with the v1.1 byte-order swap fg-reg.h warns about, and both decode paths: the direct registers at 122.070 uV and 488.281 uA per count with the current sign-extended from bit 15, and the SRAM at 244141 and 488282. The header also pins the trap that the same raw count 0x4000 reads as 4 V through the SRAM and 2 V through the registers, which is how a port knows it has picked the wrong path. package/tests/battery_host.c builds it with -Wall -Wextra -Werror and asserts every constant against the vendor sources.
- The paired read is now written and host-tested too, and the vendor implementation it was copied from is wrong in both directions. Every measurement must be read as a value plus its shadow copy six bytes later, retried until the two agree (fg-util.c:1014-1050), because the gauge updates between the two bus accesses. The vendor loop -- `while (tries++ < MAX_READ_TRIES) { ...; if (match) break; }` then `if (tries == MAX_READ_TRIES) return -EINVAL;` -- leaves tries at 6 when the copies never agree, so a torn pair falls out of the loop and is returned as a good value, and leaves tries at 5 when the fifth and last try matches, so a good read is reported as -EINVAL. package/BatteryCore.h implements the intent instead: a counted loop of BG_PAIR_TRIES (the driver's own 5) that fails when no try agrees. package/tests/battery_host.c reproduces the vendor loop and asserts both defects, then drives the port's own loop through a scripted bus: a clean first try, a torn first try, a match only on the last allowed try, copies that never agree, and a bus error that must abort without spending the remaining tries.
- 2026-11-08: scripts/build-platform-power.py replaces the kernelcache symlink instead of creating it twice. A broken link made exists() false and the second build raised FileExistsError. The generated PMGR contract is unchanged.
Completion criteria
- Declared power controls and battery readings match observations; each claimed sleep/resume transition restores its dependent peripherals.
Current limits
- Battery, charging, thermal and interconnect are unimplemented. The gauge's decoder is the exception: it is written and host-tested, but no code reads the gauge on the device yet, so there is no reading of this board's battery, and none of the battery, charger or thermal nodes is in this board's own device tree.
- Sleep and resume are not claimed: the ADT sets sleep-disabled=1 and no round has exercised a sleep transition, so the completion condition's second half has no evidence either way.
Next action
- Read the gauge once on the device and print what came back, which is the smallest step that tests everything in BatteryCore.h at once: find the APID for PPID 0x241, read 0xA0, 0xA1 and their copies 0xA6, 0xA7 until the pair agrees, decode, and print the raw bytes beside the decoded microvolts. A plausible voltage settles the byte order, the scaling and the APID rule together; an implausible one says which of the three is wrong, because the raw bytes are printed next to it. The IOPMPowerSource service comes after that reading, not before.
Evidence
host: battery_host: all assertions passed, exit 0. The test derives the PPIDs from the devicetree's own interrupt specifiers rather than from the header it checks, and pins the two decode paths apart: raw 0x4000 decodes to 4000006 uV through the SRAM and 1999994 uV through the registers. It also reproduces the vendor retry loop and asserts its two defects, and drives the port's own paired read through a scripted bus: a clean read, a torn read that the second try fixes, a match on the last allowed try, copies that never agree, and a bus error that aborts after one read. Command:cc -std=c11 -Wall -Wextra -Werror -o battery_host package/tests/battery_host.c && ./battery_host. Revision:fe3b945239e466ca42d265afdeaa54599577ae13.
Image assembly
device-verified
Components: DarwinBoot, XnuPrelink.
Hardware and dependencies
- The prelinked kernel from build kernel, the firmware volume from build firmware, the device tree the bootloader reads (uefi-alioth/Resources/DTBs/alioth.dtb, 933,795 bytes, not the 3 KB hardware DTB the ADT is built from), and the target IPSW's trust cache.
- Inputs that are not in any repository: the Data seed (--data-ramdisk), the platform seed (--unique-chip-id, board.toml marks it required), and optionally a GPU addon (--gpu-addon).
- The board's own inputs: 3 MiB firmware volume at 0x9FC00000, 180 MiB payload volume, boot_a and boot_b at 192 MiB each, and a kernel command line of 952 bytes on 2026-11-06 against unixnu's 1023-byte limit. The limit is enforced by the payload step, which prints the measured length; the build script appends sheng-build-tag, so the script's own count is 19 bytes short.
Configuration
- [payload]: volume ALIOTHESP, size_mib 180, loader firmware, title Boot, dram_size 0x200000000, skip_setup_tool scripts/seed-data-skip-setup.py. payload.py refuses content above 95 percent of size_mib, which is 171 MiB.
- size_mib history: 192 does not fit with the shim, the FD and the appended device tree; 184 leaves less than the 8 MiB margin; 176 is what the archived port booted; 180 since the Metal staging took the payload files to 168 MiB.
- [payload] trust_cache_sha256 names one accepted bundle, the three-module owner bundle make-owner-trust-bundle.py builds from the two original 21H461 modules plus the Metal plugin's CDHash. payload.py refuses any other --trust-cache. The value changes on every plugin rebuild and must be rewritten from 'shasum -a 256 build/adreno-metal-plugin/owner-trust.bundle' after make-owner-trust-bundle.py; it was 35684e79c41f8e76 on 2026-11-06.
- [payload] panic_screen true patches the panic screen into a copy of the kernel. It shares the zero padding after _start with one stage-4 probe cave, and a third cave pushes the screen past PANIC_CAVE_END, which scripts/patch-xnu-entry-probe.py then refuses.
- boot image geometry comes from uefi-alioth/Resources/Configs/alioth.toml, not board.toml: header_version 1, base 0x10000000, kernel_offset 0x8000, ramdisk_offset 0x16000000, tags_offset 0x100, pagesize 2048. scripts/check-alioth.py refuses any other value.
Procedure
- ./unixnu defconfig alioth_defconfig -D ../UniXNU-alioth, then ./unixnu build kernel -D ../UniXNU-alioth --local-module driver:ShengUfs=../NativeUfs-alioth --local-module driver:ArmCpu=../ArmCpu-alioth.
- ./unixnu build payload -D ../UniXNU-alioth --uefi ../uefi-alioth --unique-chip-id 0xe835c44a614a1914 --trust-cache <owner bundle> --data-ramdisk <seed> --gpu-addon <addon> --kernel-arg sheng-build-tag=uNNN.
- ./unixnu bootimg -D ../UniXNU-alioth --uefi ../uefi-alioth --dtb ../uefi-alioth/Resources/DTBs/alioth.dtb -o tmp/boot-uNNN.img.
- python3 scripts/check-payload-kernel.py --kernel out/DEVICE/OS/CONFIG/kernel/kernel.macho --image tmp/boot-uNNN.img, which must exit 0 before the image is flashed.
- fastboot boot tmp/boot-uNNN.img, which loads the image into RAM and writes no slot; a flash goes to boot_b. Read boot/boot.json and payload/payload.json for the hashes of the parts actually packed.
Development findings
- patches/xnu/series carries one board patch, thread-creation-trail.patch, which records every kernel thread's tid and creation continuation in a 256-entry table that the boot package reads. It is how a stopped core's thread is named when the thread has no name of its own. The patch touches only osfmk/kern/thread.c and adds no behaviour when the table is unread.
- 2026-11-08: the round build moved from tmp/build-parity.sh into scripts/build-round.sh, and scripts/build-alioth-usb.py names the base catalog without a workspace prefix. The kernel, payload and boot image keep the same inputs and steps.
- 2026-11-08: board.toml trust_cache_sha256 changed from f5449ea4... to c2b71ada8e5c476d8895f02625d80c43699cc697b8ca48ed9f6f80473eab481e after the rebuilt Metal plugin and its owner trust bundle (plugin CDHash cddc5705, daemon CDHash 3bdcdfff, Turnip CDHash a9c5a07a). This pins the exact bundle accepted by payload.py; rebuilds must update both the hash and this finding. The trust bundle itself is not tracked as a binary input.
- The XNU kernel does not live in boot.img's kernel section. That section is the boot shim plus the UEFI firmware volume, gzipped, followed by the device tree; the kernel travels inside the payload ramdisk at EFI/UniXNU/Payloads/kernel.macho. Running build kernel and then bootimg without build payload therefore packs the previous kernel, and the device boots and looks healthy on stale code. That is what boot-usb65 did.
- check-payload-kernel.py closes that hole by checking both links: payload.json kernel_sha256 against the built kernel, and the kernel inside the image against payload.json payload_kernel_sha256. The two payload hashes differ from each other because build payload patches a staged copy of the kernel. Measured 2026-10-30: the check refuses boot-u269, whose payload carries a kernel the current payload record does not name, which is exactly the staleness it exists to catch.
- The two reports name different things under the same key. boot.json kernel_sha256 (bootimg.py:134) is the hash of the gzip kernel section, which is the boot shim plus the firmware volume plus the appended device tree; payload.json kernel_sha256 is the prelinked XNU Mach-O. Comparing them across files says nothing. Read payload.json for the kernel, the ADT, the trust cache and the seed, and boot.json only for the header geometry, the FD and the ramdisk size.
- The kernel command line is 987 bytes against a 1000-byte limit, so adding an argument means removing one. payload.py refuses a longer line before it writes the volume, and --kernel-arg NAME=VALUE replaces the board's argument of the same name instead of appending a second copy.
- The device tree that bootimg packs must be uefi-alioth/Resources/DTBs/alioth.dtb (933,795 bytes), not the dtc output of dts/alioth.dts (3,218 bytes). The small tree is the hardware input the ADT is generated from; the bootloader needs the firmware tree, which is the phone's own. Passing the small one produced an image that never reached the kernel.
- bootimg verifies its own output: it unpacks the image and compares the gzip stream, the firmware volume, the appended device tree and the ramdisk bytes with their inputs, and refuses a firmware volume whose size differs from [uefi_fd]. The output is deterministic apart from the ADT's random seed.
Completion criteria
- The kernel and prelink succeed, the payload contains all declared inputs, and the boot image matches the bootloader format and the 192 MiB partition limit.
- Measured on the device: the image booted from fastboot, reached the lock screen at about 104 s, and the same build path has produced every image since, through the one that first published the GPU accelerator.
Current limits
- The build inputs that no repository carries are passed on the command line every time: --unique-chip-id, --trust-cache, --data-ramdisk and --gpu-addon. A checkout alone cannot rebuild a given image byte for byte.
- The payload volume is 180 MiB against a 192 MiB partition and the kernel command line has 13 bytes of head room, so the next added argument or asset needs something removed first.
- The images at the end of the run have not all been booted: four in a row (u268, u269 twice, u271) failed to reach the kernel through fastboot boot while the same u269 image reached the GPU after a manual power cycle, and that load path is not yet attributed.
Next action
- Boot the next image and read the BUILD row to confirm the console now carries the image's own tag; that closes the identity half of the fastboot question, which until 2026-11-06 could not be answered from a console capture at all.
- Attribute the remaining fastboot boot failures: with the tag on the console, a boot that dies before the kernel still has no tag, so the four-in-a-row u268/u269/u271 case needs the firmware side rather than the kernel side.
Evidence
source: Refuses a boot image whose payload was not rebuilt from the kernel just built, by checking the record against the build and the image against the record; it refused boot-u269 on 2026-10-30.device: boot-usb34 reached a stable lock screen: the date and time stayed drawn, SWAP calls=7 ok=7 rej=0, and backboardd created its resources with kret=0 -- the image assembly path produced a bootable image. Command:./unixnu build kernel; ./unixnu build payload; ./unixnu bootimg; fastboot boot the image; photograph the panel and read the console. Revision:c207f91df6000038aac1b91f002a857c07de3b40.device: BUILD tag=s14 on the console within the first second, at t=1 s of the boot supervisor. Until this row existed no console capture could say which image it came from: the tag reached only the persistent-log header and the boot page. Command:fastboot boot tmp/boot-s14.img and read the USB console for the first seconds. Revision:ab53842422feadf058a0575b6e5a968623c6c052.
Diagnostics
device-verified
Components: QcomXnuUsbDebug.
Hardware and dependencies
- The board's DWC3 controller, its apps SMMU stream, and the boot arguments qcom-usb-debug=1 and qcom-usb-ctl=1 in board.toml.
- The diagnostic page is boot-progress=2 with boot-diag-resume=10, so it returns after scanout stops.
Configuration
- board.toml selects the QcomXnuUsbDebug component and passes qcom-usb-debug=1 and qcom-usb-ctl=1.
- configs/alioth_defconfig sets CONFIG_XNU_BOOT_PROGRESS=y and CONFIG_XNU_QCOM_USB_DEBUG=y.
- The apps SMMU is iommu@15000000 with qcom,skip-init; the USB node's iommus = <0x47 0x00 0x00> gives SID 0.
Procedure
- ./unixnu build kernel, then build payload and bootimg, then fastboot flash boot_b.
- Read the console at /dev/tty.usbmodem<N> with a raw 115200 8N1 tty; the dock's SN234567892 node is not the phone.
- Control frames are SXNU1 <16 hex session> <8 hex seq> <VERB> <8 hex crc32>, HELLO first to learn the session.
- One unattended round is scripts/run-sheng-unattended.sh <image> [timeout]: fastboot boot the image, wait for the board's own return, boot the reader from slot a, read and decode into build/sheng-logs/<tag>-<boot id>/, then restore the slot. Fail-closed, and the timeout must exceed sheng-autoreset by 60 s.
Development findings
- A stopped core is now named from the console without a debugger. The GICR row carries the trapped user PC and CPSR of the thread that core holds, the group and priority of every core's SGIs and PPIs, and a GICRKT line with that thread's creation continuation from patches/xnu/thread-creation-trail.patch; armcpu_ipi_probe_core samples a core that takes no interrupts of its own. Two readings settled the question this was built for: the deaf core's thread has pr=31 and no name (the init thread inside its first exec of launchd, not a kernel probe), and its IGROUPR0/IPRIORITYR0 match every healthy core, so a masked section rather than the GIC withholds the interrupt.
- package/tests/adt_properties_host.py covers scripts/check-adt-properties.py: one fixture node carrying a non-writable key must fail with that key named, one carrying only writable keys must pass. The checker runs the real read_fdt and hardware_properties path, so the test exercises the omission rather than a mock of it.
- Four images in a row failed to reach the kernel through fastboot boot (u268, u269 twice, u271) while the same u269 image reached the GPU and the wallpaper after a manual power cycle. The four span different contents -- two carried timer rows, one was rebuilt without them, one differs by a single driver string -- so the content is not what decides it. What all four share is the load path: fastboot boot has the bootloader pull 182.4 MB over USB into memory and jump to it, while a power cycle reads the active slot from flash. Whether the board then runs the slot image rather than the booted one is unverified; the persistent log's tag field would say, and reading it needs a boot that reaches the kernel.
- The timer rows were withdrawn the same day they were added. Two images carried them and both failed to reach a usable kernel, so they came out; but the same image booted to the GPU and the wallpaper after a manual power cycle, so the rows were not shown to be the cause and the withdrawal is a control, not a verdict. The instrument itself is sound: ArmCpu already counts the virtual timer's lead and its short deadlines, and re-adding it needs a boot that survives regardless.
- The persistent log kept the oldest 128 KiB of the kernel message buffer, not the newest: copy_msgbuf started at msg_bufx, the ring's oldest byte, and stopped at the region's limit, so every read-back carried the start of the boot and dropped the seconds before a crash -- the only window an abort diagnosis needs. Every header from u250 to u255 reports msg_bytes 131072, which is the cap, not the buffer. u259 starts at msg_bufx + size - cap instead; its msgbuf covers a later slice of the kernel log than u258's on the same image family (986..1126 s against 516..638 s).
- The CDC-ACM console refused to start with error=10 core=0 domain=5. QcomUsbDomainInstall calls halted() before scan(), so a PRTCAPDIR of 3 would have returned CoreRunning=4; it returned 5, which proves the controller already reported device mode.
- Firmware leaves an SMR entry for SID 0 pointing at context bank 5 with SCTLR=0xe0 (M=0) and TTBR0=0: the stream is programmed but no table exists under it. scan() now reclaims that slot only when translation is off and there is no table, and still refuses a bank that holds a live mapping.
- With that, the console enumerates as 1209:316d named QcomXnuUsbDebug and the kernel log is readable on the host. It is the only channel that keeps a record after the panel has moved on.
- printf and kprintf both fail to reach the console: a DEVELOPMENT kernel leaves disable_kprintf_output true without -enable_kprintf_spam, and printf's console path did not reach the _cnputs tee either. qcom_usb_debug_write() is the entry point that works.
- Exit records measured over 420 s: 180 xpcproxy exits with status=0 (normal fork and exit), 13 cryptexd SIGABRT with ns=18 code=2 (OS_REASON_LIBSYSTEM_CODE_FAULT), 11 liveactivitiesd SIGTRAP, 2 lsd SIGSEGV. Each process crashes at one fixed PC repeated, so the fault is deterministic rather than a race.
- A software REBOOT via the control channel is acknowledged (state=queued) but does not reach fastboot: the worker calls reboot_kernel(0, NULL), an orderly restart that unmounts every filesystem and returns through UEFI. Entering fastboot needs the ABL IMEM handshake, whose address is not measured here.
- The persistent log writer runs: boot-usb101 recorded 273 rounds over 546 s with zero write errors after the console had already stopped, so the medium is the only record past the link's death.
- Returning to fastboot works with sheng-log=1 and sheng-autoreset=<seconds> together: boot-usb102 rebooted at 153 s and boot-usb103 at 120 s, both landing in the board's own bootloader with the PON spare cell written ('pon: subtype 04 shift 1 spare 00 -> 04 want 04 rc=0 ok pon_rc=0') and IMEM reading the reason back (known=1). PSCI alone cannot do it: SYSTEM_RESET, SYSTEM_RESET2(32) and SYSTEM_RESET2(64) all report NOT_SUPPORTED, so PS_HOLD is the path that works.
- The reader must seek relative to the partition: /dev/block/by-name/userdata starts at LBA 0x2a8000, so the window's last 8192 blocks are skip=59086843, not the absolute LBA 61872123 the header records. Passing the absolute value reads nothing at all and looks like a hung read.
- The console's death is a latch, not a transient: dwc3_poll() returns -1 forever once d->failed is set (Dwc3.c:570/581/584), and nothing in the driver clears it, so the worker's retry path cannot revive the link.
- The takeover pixel probe is opt-in through alioth-pixel-check=1 and runs on the published backboardd device with owned private, RGBA/BGRA IOSurface, composition and 1080x2400 BGRA fixtures. CPU and GPU readback are checked independently against exact expected pixels. Reserved Metal rows 46/47 are printed explicitly. The older two-word surface mutation is disabled unless alioth-surface-magic is requested; surviving words never prove an untouched whole frame.
- cpx2 (2026-11-05) fails ordinary owned-buffer fill, creation-upload copy and contents-written copy as well as private clear, compute and render. Destinations retain A5/5A sentinels despite Completed status. Actual TU_DEBUG is sysmem,nocb; A650 APRIV reads 0x6e and CPU table mode is 1. This is a generic effective-write failure, not proof of a CA, host-import, format or cache cause. No desktop status is promoted. The exact artifact hashes and raw console are recorded in the workspace takeover progress.
- The row sender previously skipped the terminator after an odd-length character pair, leaking stale suffix bytes into diagnostics. NativeAdrenoUserTest.h now stops after that pair; tests/test_marker_stream.py compiles the actual sender and verifies 96 text lengths plus an invalid row. The red run failed at length 1 (48 markers instead of 2); the fixed run passes. This is separate from the unresolved GPU pixel failure.
- 2026-11-08: the poster-store listing and first-page SQLite text runs now fire once at the 200-exec cadence without sheng-wallpaper-db=1 or sheng-wp=1, and BootLog prints [wallpaper list] and [wallpaper db] on the 10-tick console channel. This measures whether PosterBoard has a stored selection on a boot that never reaches the desktop. The widget host is already running on the iPadOS 17 line: align1 unified logs contain com.apple.chronod.timeline-host entries for Maps, Stocks, Calendar, Batteries, ScreenTime, News, Notes and Tips widgets. The iOS 16.5 port's missing com.apple.chronod finding is therefore not a current-line diagnosis. Both rows are diagnostic code; no visual wallpaper/widget result is promoted.
Completion criteria
- The console enumerates and answers HELLO and STATUS on the board; STATUS reports usb=3 er=0.
- Every process exit and crash reaches the host console, which is what the exit-loop investigation needs.
Current limits
- cryptexd's fault is not yet attributed: OWNER_CRYPTEX_FILES is 0 by design because UNION_SYSTEMOS requires it off, so cryptexd's expected paths do not exist. Its crash PC is captured but not symbolicated.
- The MAC exec refusal is intermittent. One boot showed backboardd, imagent, lockdownd, cfprefsd, sharingd and nfcd exiting with status=9 ns=9 code=8; the next showed none of them, so the errno the patch now reports has not been observed yet.
- Symbolication of the crash PCs against the extracted dyld shared cache was attempted and produced implausible image names, so it is not reported as a result.
- The iOS USB device stack is not in this kernel: the prelinked component list carries no USB kext (IOUSBDeviceFamily, AppleUSBDeviceMux, AppleEmbeddedUSB, AppleSynopsysOTGDevice all count 0 in out/<device>/kernel/kernel.macho), and the ADT has no usb-complex, usb-device or otgphyctrl node. The board's only USB path is QcomXnuUsbDebug, a self-written CDC-ACM console that owns the DWC3 controller. docs/evidence/2026-10-30-usb-stack-architecture.md records the chain and the two implementation constraints: devicetree.py emits platform nodes only for a fixed name list, so [adt.*] cannot add a usb node (it needs a DTS node with unixnu,adt-name), and IONameMatch is exact string equality against the node name, not a compatible-list match. An offline prelink with four USB roots added resolves and links (components 30 to 42, exit 0, AppleNubSynopsysOTGDevice present); runtime behaviour is unverified, and t7000 versus SM8250 register offsets and PHY topology have not been compared.
- usbmuxd is a host-side daemon, not a device component. macOS runs it at /var/run/usbmuxd from MobileDevice.framework, and the device-side peer is lockdownd, which listens on TCP 62078 (com.apple.mobile.lockdown.plist Sockets). The kernel AppleUSBDeviceMux is a client: sock_connect appears twice in its code and sock_bind, sock_listen and sock_accept appear zero times. An earlier analysis treated the absence of usbmuxd from the root volume as a hard blocker; that conclusion is withdrawn.
- installd is not running on the board, and the usual count of processes is wrong. EXITLOG records only process exits (BootProgress.c boot_progress_exit), so it cannot enumerate running daemons: u266's EXITLOG yields 37 distinct names while its [spawn] census reports names=233. That census lists containermanagerd, misagent, appstored and lockdownd but not installd or afcd. com.apple.mobile.installd.plist carries MachServices and no RunAtLoad, so the job starts on demand; the board has not asked for it. Diagnosing why needs userspace os_log, which has no channel today.
- The Device documentation workflow fails on every push with 'unknown component QcomXnuUsbDebug'. The workflow reuses UniXNU/UniXNU's checker at main, whose catalog lists 25 components, all from the UniXNU organisation; QcomXnuUsbDebug is this port's own CDC-ACM console and exists only in the FFT-infra fork of the base repository. The checker tests 'component in catalog or allow_custom_components' and never passes the second argument. Locally the check passes because the fork's components.toml carries the entry. Resolving it needs a decision: contribute the component upstream, move the repository into the UniXNU organisation, or accept the red check. The record itself is not wrong; only the component's absence from the upstream catalog is.
Next action
- Make the console survive its first error: clear d->failed and re-initialise the controller from the worker, with backoff, and draw the worker's retry and error counters on the diagnostic page so the failure is readable without the link it is about.
- Attribute cryptexd's fault, then decide whether the fix is a stub, a mount change, or accepting the crash.
- Wait for the MAC refusal to reproduce and read the ip_mac_return value it now prints.
Evidence
device: Console enumerated as 1209:316d named QcomXnuUsbDebug; STATUS returned usb=3 er=0 with the worker polling, so the port is live in both directions. Command:read /dev/tty.usbmodem<N> at 115200 8N1 and send SXNU1 ... HELLO / STATUS. Revision:15a15d7cc526262a64531ff56b3a33bdbc46379c.device: 215 exit records captured. 180 xpcproxy status=0 (normal), 13 cryptexd ns=18 code=2, 11 liveactivitiesd sig5, 2 lsd sig11; each process repeats one fixed crash PC, so the faults are deterministic. Command:./unixnu build kernel; ./unixnu bootimg; fastboot flash boot_b; read the CDC-ACM console for 420 s. Revision:15a15d7cc526262a64531ff56b3a33bdbc46379c.
baseband
planned
Hardware and dependencies
- porting/baseband asks for these before implementation and none of them is in the tree: the modem model and its control transport, data engine, firmware, SIM interface and EFS/NV storage, after platform memory and DMA work.
- What the vendor tree does and does not describe, checked across the whole qcom directory on 2026-11-06. Every other SoC in this tree carries a modem: bengal, khaje, lagoon, lito and msm8917 each declare qcom,firmware-name = "modem" and a GLINK edge qcom,glink-label = "mpss". kona declares neither, and its GLINK edges are cdsp, dsps, lpass, npu and spss only, so on this SoC the AP does not load the modem and has no mpss GLINK edge to it. What kona does describe is the packet path: qcom,ipa@1e00000 with IPA core version 17 (IPAv4.5), reg-names ipa-base 0x1e00000 length 0x84000 and gsi-base 0x1e04000 length 0x23000, interrupts 311 and 432, qcom,use-ipa-tethering-bridge, qcom,mhi-event-ring-id-limits = <9 11>, qcom,modem-cfg-emb-pipe-flt, qcom,arm-smmu and qcom,smmu-fast-map, with qcom,ipa_fws and qcom,ipa_uc as pil-tz-generic loaders over their own memory regions and qcom,ipa-mpm holding the modem MHI doorbell bases 0x64300300 and 0x64300700 (kona.dtsi:3557-3600). IPA is therefore the only recorded AP-to-modem interface on this board, and it is a data path rather than a control one. The earlier note that alioth-sm8250.dtsi and alioth-sm8250-overlay.dts carry no modem node was true of those two files and misleading as a conclusion, because they inherit kona.dtsi, which does carry the IPA; dts/alioth.dts declares only the compatible, memory, the splash region, the eight CPUs and UFS, with no /chosen baseband node, no /baseband node, no baseband-chipset property and no cellular ADT product attribute. So there is nothing for launchd to select a cellular CommCenter with, and the vendor tree does not supply the description either.
- Firmware provenance has no entry, and the manifest is emptier than that sentence suggested: proprietary-files.txt is 32 comment lines and not one entry, so it records no firmware of any kind, not merely no modem image. What the board does carry follows two other paths, both worth naming before a modem is planned. GpuFirmwareA650.c compiles 262795 bytes of A650 firmware into the kernel, generated from the archive's redwood_fw_a650.c. AdspFirmware.c is not a blob at all: it reads adsp.mbn and adsp_dtb.mbn from /private/var/firmware on the mounted Data volume at runtime, and its header says they are never part of the build. So this board's firmware story is compile-in plus runtime-read-from-Data, and a modem image would have to pick one of those two, with its source and hash recorded, before the page's provenance requirement is met.
Configuration
- No board.toml field, DTS property or defconfig value is set for baseband.
Procedure
- Establish the modem's power, reset, clock, interconnect request, interrupt, firmware memory and SMMU stream, then bring up the transport, confirm the modem boot and the SMP2P ready signal, and only then add the cellular ADT nodes and product attributes.
Development findings
- Nothing has been started, and the record did not previously carry this area at all: porting/baseband is on the site's navigation and the port is of a phone, so the omission was a coverage gap rather than a decision. Recording it as planned makes the gap visible to the checker and to the catalog.
Completion criteria
- Modem boot, QMI, SIM identity, network registration, data, reset and eSIM are each recorded separately, and the data path passes send, receive, disconnect, aeroplane mode and modem reset in order.
Current limits
- No modem firmware, no ADT node, and no control transport: the AP-side data path is IPA and nothing in the vendor tree gives the AP a GLINK edge or a loader for the modem itself. The board is a phone, so this is pending work rather than something outside the device's scope.
Next action
- Get the modem firmware off the stock firmware and record its source and hash. The tree has now given what it can: the AP-side transport is IPA v4.5 with the modem's MHI doorbells, there is no modem PIL node and no mpss GLINK edge on kona, and the firmware manifest is empty, so the image itself is the one input no source in this workspace holds. Reading it from NON-HLOS.bin on a stock device is a read, not a port, and it is the gate for everything after it.
Evidence
Collect evidence using the next action.
bluetooth
planned
Hardware and dependencies
- The controller is the same QCA6390 as the Wi-Fi: the SoC board device trees declare a bluetooth label over a bt_qca6390 node (kona-mtp.dtsi:154 and the other kona board files), and alioth-sm8250.dtsi:1110 only overrides its supply, qca,bt-vdd-dig-supply = <&pm8150_s6> at 950 mV, which is the same rail the WLAN node uses. So one part provides both radios, and the network area's 17cb:1101 endpoint is the same silicon.
- Not yet recorded: which transport carries the host-controller interface on this board, the firmware and .nvm/.hcd files, and whether the same PCIe link is shared. The board device tree does not add a transport node of its own beyond the supply override.
- The boot argument alioth-bt=1 is not Bluetooth. It is read by ButtonProbe.cpp:358, names the thread 'alioth-bt' for the buttons, and reads the PM8150 PON and PM8150 GPIO 6 keys over SMBus. The name is a shortening of 'buttons' and must not be read as a Bluetooth switch.
- The transport is settled, and the property that settles it is one no other UART carries. qupv3_se6_4uart is compatible qcom,msm-geni-serial-hs at 0x998000 length 0x4000, fed by GCC_QUPV3_WRAP0_S6_CLK with the wrap-0 master and slave AHB clocks, taking GIC SPI 607 plus a tlmm 19 wake line on four pins (gpio16 sleep, gpio17 and gpio19, gpio18 flow control), and it is the only serial engine in the tree with qcom,wakeup-byte = <0xFD> (kona-qupv3.dtsi:85-105). That byte is the Bluetooth HCI wakeup, and the board enables this engine and no other four-wire one (xiaomi-sm8250-common.dtsi:16-18). The other enabled UART, qupv3_se12_2uart, is two-wire and stays the console candidate.
- The qca,qca6390 node is the power driver's, not the host-controller node, and that is why it has no UART phandle: drivers/bluetooth/bluetooth-power.c lists that compatible at :48 and reads bt-reset-gpio, wl-reset-gpio and bt-sw-ctrl-gpio. Its rails and levels are exact (kona-mtp.dtsi:154-174): BT_EN on tlmm 21, WL_EN on tlmm 20 which is the same pad the Wi-Fi bring-up drives, SW_CTRL on tlmm 124, vdd-aon pm8150_s6 at 950 mV, vdd-dig pm8009_s2 at 950-952 mV, vdd-rfa1 pm8150_s5 at 1.9 V, vdd-rfa2 pm8150a_s8 at 1.35 V and vdd-asd pm8150_l16 at 3.024-3.304 V drawing 10 mA. The firmware names come from the driver's own format strings (btqca.c:354-376): qca/crbtfw%02x.tlv and qca/crnv%02x.bin keyed on the ROM version, with qca/rampatch_%08x.bin and qca/nvm_%08x.bin keyed on the SoC version as the fallback. What the ROM version of this particular chip is, and whether either file exists on the stock firmware, is not recorded here.
Configuration
- board.toml: alioth-bt=1 selects the button probe, which belongs to the input area.
Procedure
- Identify the controller and its transport first, then record the firmware and the OS Bluetooth ABI before selecting a component.
Development findings
- The area was missing from the record although the site's navigation carries Bluetooth, and the one argument whose name suggests it is a button probe. Both facts are recorded here so a later reader does not mistake the existing argument for partial Bluetooth support.
- The controller turned out to be the Wi-Fi part rather than an unknown: QCA6390 provides both radios, so this area cannot be brought up before the PCIe link in the network area trains, and the two share the pm8150_s6 rail. That ordering is the useful conclusion of the inventory.
- 2026-11-08: the bt1 and btn6 round scripts moved to scripts/archive/ as history; they are not part of the maintained build. Bluetooth state is unchanged.
Completion criteria
- The controller is enumerated, its firmware loads, and the OS Bluetooth service sees an adapter that can complete a scan.
Current limits
- Nothing implemented. The controller, transport, pads, rails and firmware naming rule are recorded above; what is missing is the ROM and SoC versions that select the two firmware files, and the files themselves, none of which the tree holds.
Next action
- Get the ROM and SoC versions this chip reports, because they are what turn the driver's format strings into the two file names the board actually needs, and then check whether those files exist on the stock firmware. That is a read of the running radio's own version response, so it needs the board or a stock image, not another pass over the tree. Everything the tree can give is now in inputs: the controller, its transport, its pads, its five rails, its firmware naming rule and the driver that owns each node.
Evidence
Collect evidence using the next action.