Xiaomi Mi MIX 4 (odin, Snapdragon 888+ / SM8350) (3364789753)
Xiaomi Mi MIX 4 (Snapdragon 888+). Inputs and shared-support gaps live in FACTS.md; no hardware value below is measured until the device rows there close.
Source record: porting.toml, 78ef1d70cea4d58a342c680fd9674683e0165870.
This page is generated from the device record.
| Area | Status |
|---|---|
| Configuration | host-verified |
| Firmware and boot | host-verified |
| CPU and interrupts | planned |
| Memory and DMA | planned |
| Storage and root | host-verified |
| Display | planned |
| Input | host-verified |
| GPU | host-verified |
| Network | planned |
| Audio | planned |
| Power | host-verified |
| Image assembly | host-verified |
| Diagnostics | planned |
Configuration
host-verified
Components: ArmDTPlatform, ArmCpu, SoftwareAES, XnuPrelink, DarwinBoot.
Hardware and dependencies
- Identify the configuration hardware, resources and existing component interfaces for this board.
Configuration
- Record the board.toml fields, DTS properties and defconfig values used for configuration.
Procedure
- Follow the configuration stage in the porting guide and record the actual commands.
Development findings
- board.toml, feeds.toml and odin_defconfig resolve; the ADT generator accepts the board and publishes /chosen/boot-manifest-hash; the release preflight enumerates 60 patches before the example gate. The inputs that remain are the ones only the unit can supply, and scripts/collect-device-inputs.sh gathers them read-only after refusing any product other than odin.
- Measured on unit 11b5d7c3 on 2026-11-05: the production shell cannot read the GPT, so the one-shot recovery boot path was used. userdata is sda33, first_lba 2967552 and last_lba 61844474 in 4096-byte LBAs (sysfs 512-byte start 23740416 and size 471015384; fastboot partition-size 0x38263FB000 and GPT entry 61 agree). The same run fixed the SKU as 8 GB and captured the applied device tree, including the k8 panel node.
- The root volume UUID comes from the IPSW, not the device: the single System volume of 044-76040-038.dmg is 04769D26-2CA0-4825-B443-E2E5F88300F2, and make-adt.py writes it into /chosen/root-matching as an IOMedia UUID match.
- [firmware] is the board key that turned from a placeholder into a contract, and the first real EDK II build is what finished it: six preflight entries in the documented order, the four submodules of the Mu-Silicium checkout (Binaries deliberately absent, because odin's vendor modules are generated from xbl_a rather than taken from Device-Binaries), twelve PACKAGES_PATH entries and, as of 2026-11-06, patches = [] - measured in the checkout, Resources/MuPatches holds Auth-Service, Boot-Manager, Timer and Usb-Bus only, so the inherited Gic-Spurious.patch would have stopped the build at git apply --check. [board] example is false now: every input the flag was holding is measured on unit 11b5d7c3 (memory map, userdata geometry, root volume UUID, DSDT), and the platform seed was never a board fact - it is a --unique-chip-id argument per run.
- The first real kernel build on this board stopped inside the patch series, and the cause is not ours: the ipados-17.7.11-21H461 OS series opens with patches/xnu/zzz-boot-progress.patch, whose bsd_init.c:773 hunk instruments the block that patches/xnu/sheng-platform-power.patch creates, and no series in that profile applies the latter. Measured on the pinned xnu-10063.141.1 tree: all 56 arm64 entries apply cleanly and the failure is that one hunk alone. The fix is in the SM8350 feed (its series now carries the 15-line guarded block before the OS series, which is where it has to land because board patches run last), and the macro is defined by nothing in these profiles, so the code stays dead on this generation. feeds.toml and unixnu.lock moved to that feed commit 15fab28de068fae8aa41c54e8519740a6bf6dc43.
- The cores the feed describes were wrong, and this unit's own tree says so: it labels all eight qcom,kryo and splits them by capacity-dmips-mhz and qcom,freq-domain into 0x400/domain 0 on affinity 0x0-0x300, 0x79a/domain 1 on 0x400-0x600 and 0x800/domain 2 on 0x700 - 4x Cortex-A55, 3x Cortex-A78, 1x Cortex-X1. The feed had seven A78s plus an X1 and no capacity at all, so dts/sm8350.dtsi now carries the three cluster identities with the capacities and domains quoted, and feeds.toml and unixnu.lock moved to 7fffe977373f39ed0d06e9fd4fbf56688704c7e1 (tag v0.3.1).
- [payload] moved from 192 MiB to 80 MiB and gained panic_screen = true, both decided by the unit rather than by convention: a 192 MiB payload volume plus the firmware on top of it (202461184 bytes) dies mid-Booting on this unit while 85020672 bytes of the same content is accepted, and max-download-size reads 805306368 - so the rule that binds is the partition the image would be flashed into, not the download buffer, and the debug UART the board's own tree names - qcom,qup_uart@98c000 - is on internal pins rather than USB, so a stop without the panel showing something is a stop with no evidence at all. The platform seed lives in UniXNU/unixnu.local.toml, which .gitignore keeps out of every repository.
Completion criteria
- All source pins resolve; every selected component has a record; status shows the intended overrides and patch order.
Current limits
- binaries and the ACPI table are no longer configuration gaps - Binaries/odin generates from facts/xbl_a.img and the retail SKU reads 2106118C - and board.example is false, so the gates that remain are the per-run ones: --unique-chip-id for the ADT seed, and CONFIG_XNU_NATIVE_UFS / CONFIG_XNU_NATIVE_ADRENO, which need SM8350 components that do not exist yet.
Next action
- Take the first fastboot boot of the packed boot.img on unit 11b5d7c3; the image is host-verified but boot.json still records hardware_tested = false until the board says otherwise.
Evidence
host: identity guard refuses a non-odin unit (exercised against a connected clover device) and the geometry path converts 512-byte start/size to the 4096-byte LBA pair, warning instead of emitting unaligned values; exercised with a scripted adb, since the odin unit was not attached Command:scripts/collect-device-inputs.sh. Revision:a8182d2e0fe29a8fbd78fae66a6b1818a5df205f.device: unit 11b5d7c3 (2106118C, sku odin, hwversion 7.9.0): sda33 start 23740416 and size 471015384 in 512-byte sectors, logical_block_size 4096, so first_lba 2967552 and last_lba 61844474; fastboot reports 0x38263FB000 and primary GPT entry 61 the same extent; the SKU is 8 GB (DT memory 7.897 GiB, MemTotal 7378824 kB); the production shell denies the same files, which is why a one-shot recovery boot was used and nothing was written Command:fastboot boot twrp-3.7.0_11-0-odinx.img; adb shell 'cat /sys/class/block/sda33/start /sys/class/block/sda33/size'; fastboot getvar partition-size:userdata; dd if=/dev/block/sda bs=4096 skip=1 count=33. Revision:b10d580b7b224f609b25256a879b1ae9b8569278.host: the sidecar builds at 14084 bytes and /chosen/root-matching carries IOProviderClass IOMedia with UUID 04769D26-2CA0-4825-B443-E2E5F88300F2, so root selection matches the volume the payload will write; the test seed is local only and never enters the board Command:dtc -I dts -O dtb -i ../UniXNU-sm8350-common/dts -o /tmp/odin.dtb dts/odin.dts && python3.13 ../UniXNU/scripts/make-adt.py --dtb /tmp/odin.dtb --os-profile ../UniXNU/profiles/os/ipados-17.7.11-21H461/profile.toml --board board.toml --unique-chip-id 0102030405060708 --output /tmp/odin-adt.bin. Revision:a9473a93f4bee34c61b393b60ae2e7ed751301d3.host: the board resolves through UniXNU's own TOML loader with the firmware block complete: five preflight entries, four submodules, one patch and twelve package paths Command:python3 - <<'EOF' import sys; sys.path.insert(0, '../UniXNU/scripts') from unixnu.config import load_toml from pathlib import Path fw = load_toml(Path('board.toml'))['firmware'] print(len(fw['preflight']), len(fw['submodules']), len(fw['patches']), len(fw['packages'])) EOF. Revision:8cd72da0ad99f6b21217a4e8536233e1eb17027d.host: the replay localized the failure to a single hunk: 56 arch patches apply on the pinned tree, zzz-boot-progress then fails only at bsd_init.c:773; with the SM8350 feed series carrying sheng-platform-power.patch the same replay reports 60 of 61 applied and grep finds the boot_progress_stage line inside the PMGR block, so the hunk matches. The only entry the replay could not resolve is the driver-internal component:XnuPrelink prefix, which the real build handles Command:cd out/odin/ipados-17.7.11-21H461/odin/tree/refer/xnu && git checkout -- . && git clean -fdq && python3 replay.py # every series entry in order, git apply -p1, then git apply --check for the next one. Revision:15fab28de068fae8aa41c54e8519740a6bf6dc43.host: the same seventeen suites the local run passes, run on every push with UniXNU and its QcomGeniSpi submodule checked out beside the device repository; the first two runs proved the checkout layout is itself a dependency, failing on a missing GeniSpi.c until the device was placed under 'device' and submodules were fetched. The count has grown with the port - it read thirteen when this row was written and reads seventeen now - so the row is re-checked against sh package/run-tests.sh rather than trusted from memory Command:sh package/run-tests.sh. Revision:a8182d2e0fe29a8fbd78fae66a6b1818a5df205f.host: the board builds with example = false instead of being refused: 165 modules, SILICIUM_UEFI.fd at 2097152 bytes (sha256 4562fe592a4a841cba3d30d4bb73f7896241a41bad1248a6e3631d93a289bb46, the exact [uefi_fd] size bootimg asserts) and boot.img at 1134592 bytes with boot.json recording header v1, kernel_address 0x8000, tags_address 0x1e00000, shim 192 bytes and the verify() round trip passing Command:PATH=$TMPDIR/pybin:$PATH ./unixnu firmware -D ../UniXNU-odin --uefi ../Mu-Silicium -j 8 && ./unixnu bootimg -D ../UniXNU-odin --uefi ../Mu-Silicium --dtb out/odin/ipados-17.7.11-21H461/odin/tree/build/odin/odin.dtb. Revision:98744370b3ccf66fb367fe6ce4f817e9f54e5df9.host: the boot-image tree carries the corrected clusters: four arm,cortex-a55 at reg 0x0/0x100/0x200/0x300 with capacity 0x400, three arm,cortex-a78 at 0x400/0x500/0x600 with 0x79a and one arm,cortex-x1 at 0x700 with 0x800, 0 dtc errors and 0 warnings; check-odin-dsdt.py still reports 8 CPUs against the tree Command:dtc -I dts -O dtb -i ../UniXNU-sm8350-common/dts -o build/odin/odin.dtb dts/odin.dts && dtc -I dtb -O dts build/odin/odin.dtb | sed -n '/cpus {/,/};/p'. Revision:98744370b3ccf66fb367fe6ce4f817e9f54e5df9.host: the payload step builds the 80 MiB volume from the board's own keys: patch-xnu-entry-probe.py --panic-screen --no-reset on the staged kernel copy, dtc for device-tree/hardware.dtb against the pinned sm8350 feed, and payload.json recording kernel_sha256 14d587cdfe65d49a..., adt_sha256 e9659a94a9b4b384..., panic_screen true and payload_bytes 83886080; bootimg then produces an 85020672-byte image, inside the one-shot limit this unit measures Command:./unixnu payload && ./unixnu bootimg --dtb out/odin/ipados-17.7.11-21H461/odin/tree/build/odin/odin.dtb. Revision:93e111a5ce242b34ebbf93624c04979c59232468.
Firmware and boot
host-verified
Hardware and dependencies
- Identify the firmware and boot hardware, resources and existing component interfaces for this board.
Configuration
- board.toml [firmware] now lists eight preflight entries in the order the porting guide gives it - install this board's overlay into the checkout, then download, extract, import, check - beside the config, dsc and fd keys, so the firmware step checks the vendor inputs before EDK II runs.
- The same table declares the Mu-Silicium checkout the build needs: submodules (Common/Mu, Common/Mu_OEM_Sample, Silicium-ACPI, the pinned openssl tree - not Binaries, because odin is not in Project-Silicium/Device-Binaries and its modules come from the importer), the one patch the edk2 checkout takes (Gic-Spurious, measured against mu_basecore 8f10084c), and the twelve PACKAGES_PATH entries a Lahaina package resolves against. The Mu-Silicium checkout's own edits cannot ride in patches - firmware.py applies those with git -C edk2 - so the SEC handoff travels as Resources/Patches/Sec-EntryArg.patch and a preflight entry.
- board.toml [firmware.image] stays a documented hole rather than a guess: no official MIX 4 fastboot URL has been confirmed from the CDN, so the download and extract scripts read the key, skip with the reason when it is unset and the local dump satisfies proprietary-files.txt, and refuse when neither holds.
- The vendor modules are generated, not stored: scripts/import-odin-uefi.py writes Binaries/odin into the firmware checkout named by UNIXNU_UEFI, and every FILE_FREEFORM and INF path in uefi-odin points into that tree.
Procedure
- Dump the partition that carries the UEFI volume read-only (facts/xbl_a.img), hash it, and keep it out of Git.
- Slice the EDK II volume out of the image and unpack it with the pinned UEFIExtract A76, then generate one .inf per module with the GUID the stock volume gives it.
- Point the package's DXE.inc, APRIORI.inc and RAW.inc at the generated tree and re-resolve the board on the host.
Development findings
- The whole UEFI lives in xbl, not abl: abl_a is 2 MiB whose single volume carries one LZMA-compressed LinuxLoader and no DXE driver at all, while xbl_a holds a 2564096-byte FFS2 volume at 0x93000 with the SEC core, the DXE core, two nested volumes (gzip GUID-defined sections, GUID e91f301d-79be-5343-91c2-d23bc959ae0c) and 91 DXE drivers.
- 94 AArch64 modules and 51 freeform files now generate from this unit's own volume, and every Binaries/odin path the odin package names resolves - 99 references across DXE.inc and APRIORI.inc, none missing. UFSDxe, DisplayDxe, EnvDxe, I2CDxe, SPIDxe, GpiDxe, PILDxe, TzDxeLA and QcomChargerDxeLA are all present.
- The raw config files carry the same GUIDs as the venus package's RAW.inc byte for byte (uefipil.cfg 21E9BDD9, QcomChargerCfg.cfg 45FE4B7C, BATTERY.PROVISION F780C779, SecParti.cfg A1E235DE), so the SM8350 firmware volume layout is shared across these boards and odin's FDF needed no invented GUIDs.
- uefiplat.cfg, BDS_Menu.cfg and logo1.bmp exist in the volume but stay out of the FDF: the platform description here comes from Library/ConfigurationMapLib, which is what venus does too.
- proprietary-files.txt now names the inputs by digest instead of listing categories: xbl_a (14ef0bd6...) as the source of every vendor module, boot_a for the header version and rollback, st_fts_k8.ftb (dedfe0fd...) and stm_fts_production_limits.csv from the mounted vendor image, and the remaining OS-side blobs - aop, GPU zap, adsp, Wi-Fi firmware - still marked REQUIRED_FROM_IMAGE because the official archive is not pinned yet.
- The Mi MIX 4 has no sheng-style global archive: its builds are China-only (the CNXM suffix), the newest stable measured for this line is OS1.0.8.0.UKMCNXM on Android 14, and Xiaomi publishes one MD5 per fastboot package on bigota/hugeota.d.miui.com with no SHA-256 and no browsable listing. The mirror-digested packages found by search could not be tied to that revision, so the scripts take the MD5 as the mandatory check and the SHA-256 as optional - and when only the MD5 is pinned they print the measured SHA-256 to record before the extraction deletes the archive.
- The whole preflight chain exits 0 on this machine without an archive: download and extract report the unset pin plus the matching local dump, import re-slices the volume from facts/xbl_a.img, and check-odin-firmware.py re-hashes Binaries/odin against manifest.json, resolves DXE.inc and APRIORI.inc, compares Resources/Configs/odin.toml with the board's own MemoryMapLib rows and refuses the raw configs that belong elsewhere. Pin an archive and the same four commands do the documented thing instead.
- The board's DSDT could not be acquired, so it was written and then made checkable: iasl compiles DSDT.asl with 0 errors and 0 warnings into 1189 bytes, and scripts/check-odin-dsdt.py recompiles it, refuses a committed DSDT.aml that differs, round-trips through the decompiler, and rejects any of its 18 memory windows or 5 interrupts that facts/odin-fdt.dts does not state. That last rule is what caught two wrong SPI-to-ACPI conversions in the first draft (0x164 written as 0x194 and 0xd0 as 0x100; the rule is SPI plus the 32 offset, which UFS confirms independently as 0x109 to 0x129, the value the published MTP table carries).
- The shim this board boots with is not the upstream one, and the difference is load-bearing: Project-Silicium/Mu-Silicium's BootShim/BootShim.S (sha256 0f412999b77f8daa...) jumps to the firmware volume without cleaning the D-cache, and states the ARM64 header's Image Size as FD_SIZE alone. The copy this port carries from UniXNU/uefi-sheng@66421cb7 (e3c053fe31bda287...) walks the FD range with dc cvac, issues ic iallu with dsb sy and isb before br x5, and reports FD_SIZE + (_Payload - _Head). mkbootimg.py by contrast is byte-identical to upstream (55037fd1a6d6cd86...), so the packer odin.toml's keys describe is the packer the checkout ships. Practical consequence for the build: the --uefi checkout has to be overlaid with this board's BootShim, not used as cloned. And odin.toml's values match the sibling venus.toml (0x9FD00000/0x200000, header_version 1) even though they were taken from odin's own MemoryMapLib rows first, which is a cross-check rather than a copy.
- Two claims the published SM8350 tables make do not hold on this unit: the first GENI wrapper is not at 0x0a600000 (that is the DWC3 controller the same bootargs names), it is qcom,qupv3_0_geni_se@9c0000 with its engines at 0x980000..0x99c000; and the GPU clock controller is its own node clock_gpucc: qcom,gpucc@3d90000 rather than part of qcom,kgsl-3d0, so it is declared nowhere in the table because this board has no ACPI driver for a clock controller and package/OdinGpuPower.c votes on it directly. The pin controller keeps the convention both published SM8350 tables use: node pinctrl@f000000, pin registers at REG_BASE 0x100000 inside it, so GIO0 is declared at 0x0F100000 for 0x300000.
- The firmware volume now exists, and it contains this board's own ACPI table: ./unixnu firmware against a completed Mu-Silicium checkout builds 165 modules into Build/odinPkg/DEBUG_CLANGPDB/FV/SILICIUM_UEFI.fd, 2097152 bytes - the exact [uefi_fd] size bootimg asserts - and the 1189-byte DSDT.aml occurs verbatim inside FVMAIN.Fv at offset 6918624, which is the proof that RuleOverride = ACPITABLE odin/AcpiTables.inf consumed odin's table rather than a sibling's. It is absent from the FD itself because the FD carries FVMAIN_COMPACT, an LZMA-compressed volume. bootimg then packs gzip(BootShim + FD) + DTB into a 1134592-byte header-v1 image whose own verify() decompresses and compares every section.
- Two defects that only a real build could surface, both now fixed where they belong. First, the preflight scripts derived the board root from __file__, which is the device repository only when the script runs in place; the build driver copies scripts/ into the build tree and runs them there, so the first run died on proprietary-files.txt not found under out/odin/.../tree. Every script now takes its root from $UNIXNU_DEVICE, with __file__ as the fallback for a human run. Second, Silicon/Silicium/SiliciumPkg/SiliciumPkg.dsc.inc:13 puts -D ENABLE_SECUREBOOT=$(ENABLE_SECUREBOOT) into every CLANGPDB compile, and an undefined value makes the expansion the bare word ENABLE_SECUREBOOT= - which GNU make reads as an assignment prefix and hoists off the recipe line, leaving -D -D in the module's cc_resp.txt and clang's 'no such file or directory' on the first module. [firmware.defines] ENABLE_SECUREBOOT = 0 fixes it and is also upstream's own default in build_active_devices.sh, matching the shared include's !if (ENABLE_SECUREBOOT) == 0 branch that an unmodified vendor XBL needs.
- The boot image's device tree gained a producer, which is what docs/porting/packaging.md assigns to a firmware preflight script and what board.toml had only ever described in a comment: scripts/build-odin-dtb.py resolves the SoC feed by matching feeds.toml's pin against git rev-parse HEAD in UniXNU/out/feeds/UniXNU-sm8350-common-* or the sibling clone, compiles device:dts/odin.dts with the [device_tree] include_dirs, refuses any dtc warning, checks the FDT magic and writes the [bootimg] dtb path relative to the build tree - 6955 bytes. Note that a bare ./unixnu bootimg does not read [bootimg] dtb (only release resolves it), so the flag has to be passed there.
- The first temp boots on the unit measured the packing limit rather than the boot itself: 202461184 bytes (a 192 MiB payload volume plus the 1108 KiB of shim and firmware on top of it) is refused mid-Booting with fastboot's usb_read failed, while 85020672 bytes of the same content sends in 1.9 s and answers Booting OKAY. The claim that this is the staging buffer being boot_a's size was withdrawn the same day: fastboot getvar max-download-size reads 805306368, so what binds is the partition the image would be flashed into. [payload] size_mib therefore drops to 80, which the payload step itself proves fits (kernel.macho is 51937280 bytes, and payload.build() refuses a volume smaller than its files). panic_screen = true joins it because this board has no host-reachable console: the debug UART qcom,qup_uart@98c000 that the tree names is on internal pins, not USB, so a kernel stop has to be visible on the panel, which is what patch-xnu-entry-probe.py --panic-screen --no-reset does to the payload's copy of the kernel.
- Three of our images left fastboot and came back inside about twenty seconds, and that is recorded as a stop, not as a cause. The one host-side artifact that would separate 'UEFI ran and found no OS' from 'the jump never reached SEC' is uefivarstore (sde60): DarwinBoot's boot entry for the ODIN volume only exists if Mu's BDS reached it. Reading that partition needs root, and the root route this file was built from - one-shot TWRP - now fails authentication on this ROM (FAILED remote: 'Failed to load/authenticate boot image: Load Error', twice, with the same image that produced the GPT, the applied DT and xbl_a). boot.json and payload.json keep hardware_tested = false, and no reason for the stop is claimed anywhere until one of those two observations is available. The owner-authorized partition write narrowed it anyway: flashing the same 85020672-byte image to boot_a and rebooting lands the same way with nothing on the panel at all - no BDS menu, no boot logo and no panic screen, which the payload's copy of the kernel is built to leave there (--panic-screen --no-reset). So the stop is before the first framebuffer write, in the shim or SEC/PEI, and it is not the benign case of a UEFI that came up and found no operating system.
Completion criteria
- Firmware image builds, enters UniXNU, publishes the framebuffer and preserves the documented memory reservations.
Current limits
- The FD and the boot image are host-verified only: nothing has run on the unit, so boot.json's hardware_tested = false is still the honest state, and the vendor modules odin.dsc links come from this unit's own xbl_a dump rather than an archive anyone else can fetch. uefi-odin carries the files that checkout's layout puts outside the package - BootShim/BootShim.S, Resources/Configs/odin.toml, Resources/Scripts/mkbootimg.py, Resources/Patches and Resources/MuPatches, Platforms/Xiaomi/odinPkg and ACPI/Platforms/Xiaomi/odin - the first and the packer byte-identical to UniXNU/uefi-sheng at 66421cb7bb5694843aec8de1ca3d1de4c20cca38. That placement is automated now: scripts/sync-odin-uefi.py is preflight entry one, takes the manifest from the overlay's own Git index filtered to the prefixes that belong in a firmware tree (22 of the 25 tracked files; README.md, ACPI/README.md and .gitignore are deliberately not installed onto a third-party checkout), maps ACPI/Platforms to Silicium-ACPI/Platforms, installs by byte comparison, re-reads every destination after copying and refuses a target that is not a Mu-Silicium checkout. Before it, the mapping was three documented manual copies and a machine that had not done them failed with missing-file messages that did not name the cause.
- An FD sha256 identifies a build instance, it does not describe firmware content: measured 2026-11-06, a build whose inputs were byte-for-byte the previous build's (the sync reported 22 of 22 already current) produced an FD differing in 1,058,661 of 2,097,152 bytes, because all 160 module .efi files relink. So the checks that close this area are the volume's own census (FV/Ffs directory names, FVMAIN.inf's EFI_FILE_NAME lines, FILE_GUID and signature-string hit counts, the entry-arg HOB GUID's FD offset against Sec.map) and not a digest comparison.
- board.toml [firmware.image] has no official archive URL, so an unattended run on a machine without this unit's read-only xbl_a dump cannot fetch the inputs; scripts/collect-device-inputs.sh is the only route today.
- The preflight needs python3 3.11 or newer for tomllib - the same requirement UniXNU's own loader has - while this host resolves python3 to the 3.9 Apple build, so a build run needs a python3 that points at 3.13 first in PATH. EDK II additionally needs Mu's pip-requirements.txt installed: this Homebrew interpreter fails inside python3 -m venv at ensurepip, so the route is pip3.13 install --user --break-system-packages.
- odin/DSDT.aml is authored, not dumped, and authored is not the same as observed: the table is consistent with this unit's applied device tree and with the conventions both published SM8350 tables use, and it now demonstrably ships inside FVMAIN, but no firmware has booted on the board to confirm a driver reads those windows the way the tree intends.
Next action
- First action on the next sighting of unit 11b5d7c3: scripts/read-boot-trace.py pull - stock recovery is rooted and mounts logfs read-only, so this reads the v10 run that already happened at 08:25 without booting anything, and sha256sum /dev/block/by-name/boot_a against e0c67f73... to confirm the owner's partition is still itself. Then: which ABL message ended the run, whether UNIXNU.TXT reached ReadyToBoot, and what fdt handoff reports for the device tree and the initrd range. If it dies mid-Booting rather than mid-firmware, the payload image is 516096 bytes above the largest size this unit has answered Booting OKAY to, so the first move is [payload] size_mib = 78 and the second is the FD-only image.
- Confirm an official MIX 4 fastboot archive for this firmware revision from Xiaomi's CDN, record its url, md5 and bytes in board.toml [firmware.image], and let the preflight verify the MD5 and print the SHA-256 to pin before the extraction deletes the archive.
- Build the payload and userdata root, which is the step that needs the platform seed and the absolute [userdata] LBAs, and only after boot_a and the partition table are backed up.
Evidence
device: unit 11b5d7c3: xbl_a is 8388608 bytes with sha256 14ef0bd648b68f476a6cc4aed49453e5476c1375017da9e8d2940e03ef225264; one FFS2 volume at 0x93000 of 2564096 bytes; the importer reports 94 AArch64 modules and 51 raw files written to Binaries/odin, with nothing written to the device Command:fastboot boot twrp-3.7.0_11-0-odinx.img; adb exec-out 'dd if=/dev/block/by-name/xbl_a bs=1048576' > facts/xbl_a.img; sha256sum facts/xbl_a.img; UNIXNU_UEFI=../uefi-odin python3 scripts/import-odin-uefi.py --image facts/xbl_a.img. Revision:97c410c65a47737e01541f5f7f58a3fc16b4f05c.host: 99 references across the two includes all resolve against the generated tree, and the pinned UEFIExtract download matches the same A76 hash the sheng importer uses Command:python3 - <<'EOF' # every Binaries/odin INF named by the package must exist after the import import re,os for inc in ('DXE.inc','APRIORI.inc'): for line in open('uefi-odin/Platforms/Xiaomi/odinPkg/Include/'+inc): if line.strip().startswith('INF ') and 'Binaries/odin' in line: assert os.path.exists('uefi-odin/'+line.strip()[4:].strip()), line EOF. Revision:97c410c65a47737e01541f5f7f58a3fc16b4f05c.source: the documented firmware step is a board preflight that downloads the pinned archive, keeps only the named inputs, deletes the archive and generates the binary modules the volume builds from; import-odin-uefi.py is odin's half of that, and the archive pin is what is still missingdevice: no ACPI tables anywhere on this unit: /sys/firmware/acpi/tables does not exist even under root adb, /sys/firmware carries only devicetree and fdt, the real bootargs say androidboot.dtbo_idx=26 with dtb_idx=0, and all eight ACPI signatures count zero in xbl_a; the GPT has no sdt, acpi or toolsfv partition either Command:adb shell 'ls /sys/firmware/acpi/tables'; python3 -c "import re;d=open('facts/xbl_a.img','rb').read();print([d.count(s) for s in (b'DSDT',b'APIC',b'FACP',b'GTDT',b'IORT',b'MCFG',b'PPTT',b'DBG2')])". Revision:7ba1ec98bec7d94bc341bd49aec89562ea9fde69.source: odinPkg generated by mechanical renaming of the proven venus package: odin.dsc, odin.fdf, APRIORI and DXE driver order, DeviceBuild.py and the configuration map, with the venus panel descriptions replaced by the verified odin valuessource: the firmware's ACPI manifest is a submodule file, not a device-package one: [Binaries] with the device DSDT.aml, Common/SSDT.aml and Lahaina/APIC+FACP+GTDT, with a FILE_GUID shared by every device in the repository - so odin needs only its own DSDT, and the SM8350 SoC tables are already publishedsource: APIC, DBG2, FACP, GTDT, IORT, MCFG, PPTT with decompiled .dsl sources plus DSDT_Minimal.asl (eight ACPI0007 CPU devices) and venus/Decompiled/DSDT.dsl, a 926 KB table dumped from a real SM8350 unit; used as an independent cross-check of this port's register map - UFS host, apps SMMU, kgsl SMMU, debug UART, mdss, the four gfx/GPU_CC windows and the GENI wrapper blocks all agree, ACPI merging per block what the device tree lists per functionhost: the four board.toml preflight entries each exit 0 in order: download and extract report that [firmware.image] is unset while facts/ matches the two full digests in proprietary-files.txt, import re-slices 94 modules and 51 raw files from facts/xbl_a.img, and check reports 94 modules, 51 raw files, source 14ef0bd648b68f47 followed by all checks passed Command:PATH=$TMPDIR/pybin:$PATH UNIXNU_UEFI=../uefi-odin UNIXNU_DEVICE=$PWD python3 scripts/download-odin-firmware.py && python3 scripts/extract-odin-firmware.py --delete-archive && python3 scripts/import-odin-uefi.py && python3 scripts/check-odin-firmware.py. Revision:66421cb7bb5694843aec8de1ca3d1de4c20cca38.host: the skip is claimed only when every required full-length digest is present and matches: a missing file, a mismatching dump and a pins-only-optional board all report False, so neither script pretends an unverified archive was handled Command:python3 - <<'EOF' # synthetic roots: missing file, wrong digest, optional-only pin import tempfile, pathlib, sys sys.path.insert(0, 'scripts'); import odin_firmware_inputs as o root = pathlib.Path(tempfile.mkdtemp()); (root/'facts').mkdir() (root/'proprietary-files.txt').write_text('xbl_a.img|' + 'a'*64 + '\n-opt.img|' + 'b'*64 + '\n') print(o.local_dump_complete(root)); (root/'facts/xbl_a.img').write_bytes(b'x'); print(o.local_dump_complete(root)) (root/'proprietary-files.txt').write_text('-opt.img|' + 'b'*64 + '\n'); print(o.local_dump_complete(root)) EOF. Revision:66421cb7bb5694843aec8de1ca3d1de4c20cca38.host: the board resolves through UniXNU's own TOML loader: four preflight scripts, four submodules, one inherited Mu patch and twelve package paths, and uefi-odin passes cli.need_uefi - the Resources/Scripts/mkbootimg.py, Resources/Configs/odin.toml and odin.dsc the docs layout requires are all present Command:python3 - <<'EOF' import sys; sys.path.insert(0, '../UniXNU/scripts') from unixnu.config import load_toml from pathlib import Path fw = load_toml(Path('board.toml'))['firmware'] uefi = Path('../uefi-odin') print(len(fw['preflight']), len(fw['submodules']), fw['patches'], len(fw['packages'])) print((uefi/'Resources/Scripts/mkbootimg.py').is_file(), (uefi/'Resources/Configs/odin.toml').is_file(), (uefi/fw['dsc']).is_file()) EOF. Revision:66421cb7bb5694843aec8de1ca3d1de4c20cca38.source: the Mu-Silicium layout the firmware step reads is BootShim/BootShim.S, Resources/Configs/<device>.toml, Resources/Scripts/mkbootimg.py and Platforms/<Vendor>/<device>Pkg, and the same page lists [firmware] submodules and patches as the way a board declares its checkout - uefi-odin now ships the first three for odin and board.toml declares the restsource: BootShim.S and mkbootimg.py were vendored from the proven sheng tree byte for byte (sha256 e3c053fe31bda28780c048b7144cdd407576234bd344bcc2f405f6a985aeb552 and 55037fd1a6d6cd861add76c2083d5d4321373bf714acae3f6a40deb004c27d47), so the shim that copies the FD to FD_BASE and the packer that checks its length are the same code the sheng board boots withhost: iasl compiles the authored table with 0 Errors and 0 Warnings at 1189 bytes; the checker verifies 16 devices (8 CPUs against the tree's 8 cpu nodes, and UFS0, MMU0, MMU1, UARD, URS0, URS1, GPU0, GIO0), 18 register windows and 5 interrupts against facts/odin-fdt.dts, confirms the committed DSDT.aml equals a fresh compile, and proves the decompile and recompile round trip returns identical bytes Command:iasl -sa DSDT.asl && python3 scripts/check-odin-dsdt.py --require. Revision:388d27768e571cc61b3d4bf939098fc4752be3b1.device: unit 11b5d7c3's own tree contradicts two inherited SM8350 ACPI claims and the table follows the tree: qupv3_0 is the node qcom,qupv3_0_geni_se@9c0000 (0x9c0000/0x2000) with engines at 0x980000..0x99c000 while 0xa600000 is the DWC3 controller the bootargs name, and the GPU clock controller is its own node clock_gpucc: qcom,gpucc@3d90000 (0x3d90000/0x9000), not part of qcom,kgsl-3d0's seven reg windows Command:grep -n 'reg = <0x3d90000|qcom,gpucc@|qupv3_0_geni_se@9c0000|a600000.dwc3' facts/odin-fdt.dts. Revision:7932be0bd0d783e72973afdd2cb94e536f4d43ed.host: the checkout resolves and builds for real: BaseTools compiled, the four submodules fetched over SSH (mu_plus, mu_oem_sample, Silicium-ACPI at f50bc115, openssl at the pinned 67b5686b) with Mu_Basecore at 64f4789 as the separate edk2 tree, 165 modules, and the FD is 0x200000 bytes - the size bootimg asserts. The authored DSDT is inside: the 1189 bytes match at FVMAIN.Fv offset 6918624 with 8 DSDT signature occurrences and an APIC, while the FD itself shows none because it carries the LZMA FVMAIN_COMPACT volume Command:GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0='[email protected]:.insteadOf' GIT_CONFIG_VALUE_0='https://github.com/' PATH=$TMPDIR/pybin:$PATH ./unixnu firmware -D ../UniXNU-odin --uefi ../Mu-Silicium -j 8; python3 - <<'EOF' # is odin's table actually in the volume? import pathlib fd = pathlib.Path('../Mu-Silicium/Build/odinPkg/DEBUG_CLANGPDB/FV/SILICIUM_UEFI.fd').read_bytes() aml = pathlib.Path('../uefi-odin/ACPI/Platforms/Xiaomi/odin/DSDT.aml').read_bytes() fv = pathlib.Path('../Mu-Silicium/Build/odinPkg/DEBUG_CLANGPDB/FV/FVMAIN.Fv').read_bytes() print(hex(len(fd)), fd.count(b'DSDT'), fv.find(aml), fv.count(b'DSDT')) EOF. Revision:98744370b3ccf66fb367fe6ce4f817e9f54e5df9.host: the two build defects localized themselves. The preflight traceback is FileNotFoundError on tree/proprietary-files.txt, which is the scripts'-root-from-__file__ assumption breaking the moment the driver copies them into the build tree; and the failing module's cc_resp.txt reads '-D CLANG -D -D __DEPRECATED_AARCH64_4K_RUNTIME_GRANULARITY' where every module that compiles reads '-D CLANG -D ENABLE_SECUREBOOT=0', which is make hoisting the bare ENABLE_SECUREBOOT= assignment off the recipe line and leaving the -D dangling Command:cd UniXNU/out/odin/ipados-17.7.11-21H461/odin/tree && UNIXNU_DEVICE=../../../.. ./unixnu firmware ... # first run, then: grep -n 'CLANG -D' Build/odinPkg/DEBUG_CLANGPDB/AARCH64/SiliciumPkg/Library/MemoryInitPeiLib/MemoryInitPeiLib/OUTPUT/cc_resp.txt. Revision:98744370b3ccf66fb367fe6ce4f817e9f54e5df9.source: the same table that documents the archive preflight defines [bootimg] dtb as 'Device tree of the boot image, relative to the build tree. A firmware preflight script builds it' - which is why the DTB now has a producer in the preflight rather than a hand-run dtc line, and why its path is resolved against the tree, not the device repositorydevice: unit 11b5d7c3: slot-retry-count a=6 and b=5 with both slots slot-successful no, and current-slot moving from b to a on its own - the A/B bookkeeping, not the image format, is what had been refusing fastboot continue and the TWRP temp boot. Our image wrote in 2.1 s (Sending and Writing OKAY) and the reboot came straight back to fastboot with nothing on the panel, so the stop precedes any framebuffer write. Restoring the stock dump byte-for-byte plus set_active a brings the phone back to sys.boot_completed = 1 on release 17, which is what makes the next partition test safe Command:fastboot -s 11b5d7c3 getvar slot-retry-count:a; fastboot -s 11b5d7c3 flash boot_a /tmp/odin-payload-boot.img; fastboot -s 11b5d7c3 reboot; fastboot -s 11b5d7c3 flash boot_a facts/boot_a.img; fastboot -s 11b5d7c3 set_active a; fastboot -s 11b5d7c3 reboot; adb -s 11b5d7c3 shell getprop sys.boot_completed. Revision:cef9b88020dd3b7d64956e9f7793c81007b1fe79.device: unit 11b5d7c3, product odin, unlocked yes, nothing written to any partition: 1134592 bytes answers Sending OKAY and Booting OKAY, 202461184 bytes answers Sending OKAY then Booting ERROR usb_read failed / FAILED (Status read failed), 85020672 bytes sends in 1.9 s and answers Booting OKAY, and each of the three has the phone back in fastboot within about twenty seconds. The control is the TWRP image this file's measurements came from: it now fails with FAILED (remote: 'Failed to load/authenticate boot image: Load Error') on both attempts, which is what closes the root route to uefivarstore (sde60). Same unit, same session: max-download-size 805306368, current-slot b, slot-count 2, and after the three runs fastboot continue answers Resuming boot FAILED (remote: 'Failed to load image from partition: Load Error') while set_active b is accepted and the following reboot lands back in fastboot - the A/B logic refusing to load boot_b, with no partition written by any command here and the recovery options recorded in FACTS.md Command:adb -s 11b5d7c3 reboot bootloader; fastboot -s 11b5d7c3 getvar product; fastboot -s 11b5d7c3 boot /tmp/odin-fd-only.img; fastboot -s 11b5d7c3 boot /tmp/odin-payload-boot.img; fastboot -s 11b5d7c3 boot ~/Downloads/twrp-3.7.0_11-0-odinx.img. Revision:93e111a5ce242b34ebbf93624c04979c59232468.device: unit 11b5d7c3 keeps a host-readable firmware log: logfs (sda13) is a FAT volume with one 64 KiB vendor UEFI console file per boot (UefiLog0..4.txt, rotated), and it survives into whatever OS boots next. That is what localized the stop that looked like 'the firmware does not boot': our first image's file ends at 'No match found for Soc Dtb type' / 'Error: Appended Soc Device Tree blob not found', so ABL decompressed gzip(BootShim + FD) and then refused the handoff on the boot image's device tree; adding qcom,msm-id advances it to 'ApplyOverlay: ufdt apply overlay failed' (no /__symbols__ to overlay onto); the vendor base SoC tree (476052 bytes, 3043 nodes) reaches 'Apply Overlay total time: 2494 ms' and 'Start EBS [10449]' - the firmware volume is handed control. pureason reads 40001 for that boot against 40011 for a working kernel handoff. All of it from one-shot boots: A/B retry count NOT decremented, nothing written Command:adb -s 11b5d7c3 shell 'mkdir -p /dev/logfs; mount -t vfat /dev/block/sda13 /dev/logfs'; adb -s 11b5d7c3 pull /dev/logfs/UefiLog1.txt; fastboot -s 11b5d7c3 boot /tmp/odin-fd-only.img; fastboot -s 11b5d7c3 boot /tmp/odin-fd-vendor-dtb.img. Revision:0ec682bc685fb997f787484c1c1d76d898ea0567.host: the producer now slices the base SoC tree out of vendor_boot by chip id rather than compiling this port's dts, requires the /__symbols__ node, refuses an ambiguous match, and reproduces byte-for-byte the blob that demonstrably boots on the unit; dts/odin.dts keeps feeding the payload hardware tree instead. Alongside it OdinBringupLog dispatches in APRIORI DXE immediately behind DiskIo/Partition/UFSDxe/Fat and writes UNIXNU.TXT to the volume that owns UefiLog0.txt - a fresh 512 KiB dd of uefivarstore after a run still holds only the 14 stock variables, and the vendor BDS banner reads 'UEFI NV tables are enabled as VOLATILE!', so the variable sink cannot persist here and the file is the only persistent instrument Command:cd UniXNU/out/odin/ipados-17.7.11-21H461/odin/tree && UNIXNU_DEVICE=../../../../UniXNU-odin python3.13 ../../../../UniXNU-odin/scripts/build-odin-dtb.py && cmp build/odin/odin.dtb /tmp/odin-soc-dtb-v21.dtb. Revision:0ec682bc685fb997f787484c1c1d76d898ea0567.source: the page's Required integration table names six modules a board firmware volume must carry - UniXNU (menu and configuration reader), UniXNUDxe (boot-option registration), DarwinBootPkg/Driver/DarwinBoot.inf (XNU loader), UniXNURamDiskDxe (publish the Mu-Silicium FDT initrd as a read-only block device), DiskIoDxe and Fat - plus the HobLib and FdtLib mappings, and it says sheng's Include/DXE.inc is where those dependencies already sit. odin had only DiskIo and Fat: a search for darwinboot, macho and kernel.macho across the whole Mu-Silicium checkout returns nothing, so loader = "firmware" was an unbacked claim rather than a working pathhost: the four modules were added at the same places the proven board puts them: UniXNU and UniXNUDxe next to the SMBIOS tables in the FDF, UniXNURamDiskDxe and DarwinBoot listed ahead of DiskIo/Partition/Fat - sheng's own comment explains that ordering, because this build's image verification refuses a driver loaded off a volume - and only UniXNULib needed a new library mapping since SiliciumPkg.dsc.inc:184,322 already supplies HobLib and FdtLib. All four compiled and the FD stayed 0x200000 bytes; the claim that they were therefore in the volume was wrong and is corrected by the two entries below, as is the placement: sheng's DXE.inc:47-50 is the file-content list, not APRIORI Command:git clone --depth 1 [email protected]:UniXNU/uefi-sheng.git /tmp/uefi-sheng && sed -n '100,130p' /tmp/uefi-sheng/Platforms/Xiaomi/shengPkg/sheng.dsc && sed -n '40,56p' /tmp/uefi-sheng/Platforms/Xiaomi/shengPkg/Include/DXE.inc; PATH=/tmp/py313bin:$PATH ./unixnu firmware -D ../UniXNU-odin --uefi ../Mu-Silicium -j 8. Revision:6d9146e7d7bca7cb15549e33abaa9bcc70e5d777.host: compiling a module is not shipping it: the two drivers built into AARCH64/.../OUTPUT/*.efi yet their FILE_GUID counted 0 in FVMAIN.Fv, no Ffs directory existed for them and FVMAIN.inf did not name them, because an INF that appears only inside APRIORI DXE { } is a dispatch-order reference and this build's GenFds drops it without a word. FV content is the [FV.*] INF list - here DXE.inc and RAW.inc - so all three of UniXNURamDiskDxe, DarwinBoot and OdinBringupLog are now listed in DXE.inc in front of DiskIo/Partition/Fat (sheng's placement) and keep their APRIORI entries for ordering; after the rebuild the GUIDs count 2, 2 and 3, FVMAIN carries UNIXNURAMDISK 7 times and DarwinBoot 4, taken size moves 0x8ce380 to 0x908c70 and the FD is still exactly 0x200000 Command:python3 - <<'EOF' # does the FD actually carry the modules the DSC built? import pathlib, struct def gb(t): p = t.split('-'); return struct.pack('<IHH', int(p[0],16), int(p[1],16), int(p[2],16)) + bytes.fromhex(p[3]+p[4]) fv = pathlib.Path('../Mu-Silicium/Build/odinPkg/DEBUG_CLANGPDB/FV/FVMAIN.Fv').read_bytes() for n, g in (('UniXNURamDiskDxe','75CA63AD-FBAE-4A06-92A0-F937C671251D'), ('DarwinBoot','1B64AF87-8415-4B57-9B16-680D70913B9F')): print(n, fv.count(gb(g))) EOF; ls Mu-Silicium/Build/odinPkg/DEBUG_CLANGPDB/FV/Ffs | grep -ci unixnu. Revision:9e3f7aa0e99c8074cbff86001158a4cee1308460.source: the second half of the handoff was missing in the shared tree, not in odinPkg: UniXNURamDiskDxe takes the FDT address from a GUID HOB 0xDAEE82E6-8090-4E72-BFB9-78C13CD4E359 that upstream Mu-Silicium's SEC never builds (grep -rni EntryArg over Silicon/Silicium, Common/Mu and Common/Mu_OEM_Sample returns nothing, and SiliciumPkg.dec declares only the token space), so the driver can only print no entry argument HOB. sheng's SEC supplies it - ModuleEntryPoint.S stores x0 in a .quad slot in the entry section, Sec.c publishes it with BuildGuidDataHob after PlatformPeim(), the FD/stack maintenance becomes WriteBackInvalidateDataCacheRange because a plain invalidate can discard that very store, and SecCleanInvalidateDataCacheAll plus msr SPSel, #1 handle the caches and stack select ABL leaves. Its Exception.S, Sec.h and ArchSec.c are byte-identical to this checkout's, so the delta is reviewable rather than a fork; the per-constructor DEBUG calls, CheckHobList and the split constructor list were left out because they print to a serial port this board cannot readhost: the patch is carried in uefi-odin/Resources/Patches/Sec-EntryArg.patch and applied by a seventh preflight entry, because [firmware] patches is aimed at the edk2 checkout (git -C edk2 apply) while these files live in the Mu-Silicium one. Both paths were exercised - fresh apply after git checkout -- of the five files, and the already-applied branch, each ending with the tree diff compared byte-for-byte against the patch and the four anchors (str x0,[x1], BuildGuidDataHob, Sec.inf [Guids], the .dec declaration) re-read from the source. The firmware build then runs it as preflight entry six of seven and rebuilds; the HOB GUID's 16 bytes sit in the FD at 0xcb78, which is gSiliciumEntryArgHobGuid's address in Sec.map, and Sec.map also carries SecCleanInvalidateDataCacheAll at 0x75000 and gSecEntryArg0 at 0x790b8 Command:UNIXNU_UEFI=../Mu-Silicium python3.13 scripts/apply-odin-sec-patch.py --check-only; git -C ../Mu-Silicium checkout -- <the five SEC files>; UNIXNU_UEFI=../Mu-Silicium python3.13 scripts/apply-odin-sec-patch.py; ./unixnu firmware -D ../UniXNU-odin --uefi ../Mu-Silicium -j 8; python3 - <<'EOF' # read the FD, not the sources import pathlib fd = pathlib.Path('../Mu-Silicium/Build/odinPkg/DEBUG_CLANGPDB/FV/SILICIUM_UEFI.fd').read_bytes() print(hex(fd.find(bytes.fromhex('e682eeda9080724ebfb978c13cd4e359')))) EOF. Revision:9e3f7aa0e99c8074cbff86001158a4cee1308460.host: the bring-up trace now reports the handoff instead of leaving it inferred: the FD is still 0x200000 with the HOB GUID at 0xcb78, the GUID appears twice in FVMAIN (UniXNURamDiskDxe's static copy plus this reader), fdt handoff:/memory map:/FREE-MEMORY all occur in the volume and sysmem occurs zero times - the entry line no longer prints PcdSystemMemorySize, which this board never sets. Two API corrections came out of the build itself: GetMemoryMap is the five-argument form (MapKey, DescriptorSize, DescriptorVersion) and NEXT_MEMORY_DESCRIPTOR lives in UefiLib, so the walk uses the returned descriptor stride rather than sizeof (EFI_MEMORY_DESCRIPTOR). Repacked after this rebuild: /tmp/odin-payload-v8.img 85536768 bytes (sha256 272cfd59…), /tmp/odin-fd-v8.img 1650688 (235b5178…), FD e8ba59ce… Command:./unixnu firmware -D ../UniXNU-odin --uefi ../Mu-Silicium -j 8; python3 - <<'EOF' # the instrument shipped, and the unset PCD stopped being printed import pathlib fv = pathlib.Path('../Mu-Silicium/Build/odinPkg/DEBUG_CLANGPDB/FV/FVMAIN.Fv').read_bytes() fd = pathlib.Path('../Mu-Silicium/Build/odinPkg/DEBUG_CLANGPDB/FV/SILICIUM_UEFI.fd').read_bytes() g = bytes.fromhex('e682eeda9080724ebfb978c13cd4e359') print(hex(len(fd)), hex(fd.find(g)), fv.count(g), [fv.count(s) for s in (b'fdt handoff:', b'memory map:', b'FREE-MEMORY', b'sysmem')]) EOF. Revision:eb6b80045f27d4838236295ccfcdcfecfedf8ebe.host: the round trip the next device session has to do is one command: it checks fastboot getvar product is odin, boots the image once without writing any partition, waits for the board to end its own run, mounts logfs, pulls UNIXNU.TXT and UefiLog0..4.txt and prints what the boot proved. Its classifier is asserted rather than trusted: the catalogued ABL messages resolve in run order, the three fdt-handoff failures each get their own cause (a missing HOB is blamed on preflight entry seven, a non-DTB x0 on the shim or ABL, and FREE-MEMORY refuses the run as uninformative for the payload), a trace without ReadyToBoot is stated as never having reached a boot option, and all three dead ends - no rooted Android, a board that answers neither USB state, and a payload sitting in free memory - stop without writing. Suite 14 of package/run-tests.sh Command:python3.13 scripts/read-boot-trace.py --self-test && python3.13 scripts/read-boot-trace.py parse <dir with the two samples> && sh package/run-tests.sh | tail -1. Revision:eb6b80045f27d4838236295ccfcdcfecfedf8ebe.source: the file this board's records said was not public is in the sibling SM8350 board's own repository, and its PORTING.md:36 names the case it exists for: an unregistered level interrupt, IPCC INTID 0x105 among them. It patches the no-handler branch of GicV3IrqInterruptHandler to GicV3DisableInterruptSource before the end-of-interrupt and to report a source that will not mask - without it an acknowledged level interrupt with nobody registered re-fires on the same CPU foreverhost: [firmware] patches is used for the first time and it is the right mechanism for this file: the target ArmPkg/Drivers/ArmGicDxe/GicV3/ArmGicV3Dxe.c lives in mu_basecore, applies cleanly at the pinned 8f10084c, and both GicV3DisableInterruptSource (line 366) and GicV3GetInterruptSourceState (line 395) are already there. The build log shows the apply, mu_basecore is clean again afterwards, FVMAIN carries both new strings once, and the FD is unchanged at 0x200000. sha256 of the patch 62d09395b43bd998b8f84da293ae0d7aba4aa1f27ec9c539ab89efdc1d24464e; repacked /tmp/odin-payload-v9.img 85536768 bytes (5ab3167b…) and /tmp/odin-fd-v9.img 1650688 (040c8bb8…), FD 8f774244bdc32012… Command:cp /tmp/uefi-sheng/Resources/MuPatches/Gic-Spurious.patch uefi-odin/Resources/MuPatches/; shasum -a 256 …; git -C Mu-Silicium/Mu_Basecore apply --check …/Gic-Spurious.patch; ./unixnu firmware -D ../UniXNU-odin --uefi ../Mu-Silicium -j 8; git -C Mu-Silicium/Mu_Basecore status --short; python3 - <<'EOF' # the strings the patch adds, in the volume that ships import pathlib fv = pathlib.Path('../Mu-Silicium/Build/odinPkg/DEBUG_CLANGPDB/FV/FVMAIN.Fv').read_bytes() print([fv.count(s) for s in (b'cannot be masked', b'Spurious GIC interrupt')], hex(len(pathlib.Path('../Mu-Silicium/Build/odinPkg/DEBUG_CLANGPDB/FV/SILICIUM_UEFI.fd').read_bytes()))) EOF. Revision:9e3f7aa0e99c8074cbff86001158a4cee1308460.host: the nine links from ABL to XNU read in the sources rather than inferred from a boot: x0 survives BootShim, the HOB carries it, UniXNURamDiskDxe has Depex TRUE, Fat and DiskIo are in the volume, PcdUniXNUConfigPath defaults to exactly the path payload.py writes (so the reader and the volume agree without a board override), loader = "firmware" means no [[driver]] line and Boot.c:58 therefore LocateProtocols the in-FD DarwinBoot, and both sides include the same UniXNULoader.h where UNIXNU_LOADER_REVISION is 0x00020000, so the revision check cannot fail from a forked header. Shapes only - no row of this table is an observation, which is why the trace driver and read-boot-trace.py exist Command:grep -n 'linux,initrd-start' ../UniXNU/package/UniXNUPkg/Driver/UniXNURamDiskDxe/UniXNURamDiskDxe.c; grep -n 'PcdUniXNUConfigPath' ../UniXNU/package/UniXNUPkg/UniXNUPkg.dec; grep -n 'unixnu.toml|initrd =' ../UniXNU/scripts/unixnu/payload.py; grep -n 'gUniXNULoaderProtocolGuid' ../UniXNU/drivers/DarwinBoot/DarwinBootPkg/Driver/DarwinBoot.inf ../UniXNU/package/UniXNUPkg/Library/UniXNULib/Boot.c; grep -n 'UNIXNU_LOADER_REVISION' ../UniXNU/package/UniXNUPkg/Include/Protocol/UniXNULoader.h ../UniXNU/drivers/DarwinBoot/DarwinBootPkg/Driver/DarwinBoot.c. Revision:eb6b80045f27d4838236295ccfcdcfecfedf8ebe.host: the manual overlay copies become a checked step. Against the real trees: --check reports all 22 files current and exits 0; after deleting Sec-EntryArg.patch and appending '# drift' to RAW.inc it names exactly those two paths and exits 1; the install run reports '22 overlay files in ../Mu-Silicium, 2 installed, 20 already current', the re-check is clean and the injected drift is gone (grep count 0). The manifest is git -C uefi-odin ls-files filtered to BootShim/, Resources/Configs|Scripts|Patches|MuPatches/, Platforms/Xiaomi/ and ACPI/Platforms/ - 22 of the 25 tracked files; README.md, ACPI/README.md and .gitignore are excluded on purpose, because the checkout has its own and a sync step overwriting a third-party repository's notes is not a sync. ACPI/Platforms maps to Silicium-ACPI/Platforms (that is where odin.dsc:95 resolves odin/AcpiTables.inf); Binaries/odin stays with import-odin-uefi.py and Silicon/Silicium with apply-odin-sec-patch.py, which runs later in the same list, so entry one cannot undo the SEC handoff. Inserting it moves every later ordinal by one: apply-odin-sec-patch.py, described as the sixth of seven in the entry above, is the seventh of eight, and read-boot-trace.py's no-entry-HOB cause now names preflight entry 7 - its own self-test asserts that string, so the renumbering is checked rather than hoped. Every destination is re-read after copying, and a $UNIXNU_UEFI without Silicon/Silicium/SiliciumPkg/Sec is refused with the reason named. Command:UNIXNU_UEFI=../Mu-Silicium python3.13 scripts/sync-odin-uefi.py --check; rm ../Mu-Silicium/Resources/Patches/Sec-EntryArg.patch; printf '# drift ' >> ../Mu-Silicium/Platforms/Xiaomi/odinPkg/Include/RAW.inc; UNIXNU_UEFI=../Mu-Silicium python3.13 scripts/sync-odin-uefi.py --check; echo exit=$?; UNIXNU_UEFI=../Mu-Silicium python3.13 scripts/sync-odin-uefi.py; grep -c drift ../Mu-Silicium/Platforms/Xiaomi/odinPkg/Include/RAW.inc. Revision:42e726c3d8493e13ec6c2666b0d84bf17a99c60c.host: the step is asserted on the host the way the trace reader is, in a temporary throwaway overlay/checkout pair: 13 assertions - refusal of a target that is not a firmware checkout, the manifest being the overlay Git index filtered by prefix, --check listing all six uninstalled files and writing nothing and exiting 1, install copying six, the ACPI prefix mapping landing the DSDT under Silicium-ACPI/Platforms/Xiaomi/odin, README.md and .gitignore not installed, a second install being a no-op, --check clean afterwards, a locally edited file caught byte for byte and repaired, and a file newly added to the overlay picked up without editing this script. It is suite 15 (uefi-sync) of run-tests.sh, which now prints 15 green lines. Command:python3.13 scripts/sync-odin-uefi.py --self-test; sh package/run-tests.sh | tail -3. Revision:42e726c3d8493e13ec6c2666b0d84bf17a99c60c.host: a full rebuild of unchanged sources is not byte-reproducible, so the FD digest cannot be the content check this area has been using it as. Inputs verified identical first (the sync reported 22 of 22 already current before and after the build), then the FDs compared: 1,058,661 of 2,097,152 bytes differ, the first difference is at 0x7a010, and 256-byte windows taken from the old FD at 0x0/0x40000/0x80000 sit at the same offsets while the ones at 0xc0000 and beyond are found nowhere in the new FD - so content and layout both moved, not a uniform shift. The cause is on disk: 160 module .efi files newer than the build and 0 older, i.e. the whole tree relinked, and FVMAIN.Fv grew 0x908c70 to 0x90b000. Only one module kept its old stamp (the 'Nov 5 2026' string at 0xab68 is in both). The DTB digest 48cc079c is unchanged across the same builds, which is the counter-example: dtc over these sources is deterministic, the EDK II link is not. Command:python3 - <<'EOF' # FD from the v9 image versus the FD the eight-entry build just made import pathlib, zlib, hashlib b = pathlib.Path('/tmp/odin-fd-v9.img').read_bytes() i = b.find(b'\x1f\x8b\x08'); old = zlib.decompressobj(47).decompress(b[i:])[192:192+0x200000] new = pathlib.Path('../Mu-Silicium/Build/odinPkg/DEBUG_CLANGPDB/FV/SILICIUM_UEFI.fd').read_bytes() print(sum(1 for k in range(len(old)) if old[k] != new[k]), next(k for k in range(len(old)) if old[k] != new[k]), [new.find(old[k:k+256]) for k in (0, 0x40000, 0x80000, 0xc0000, 0x100000)]) EOF find ../Mu-Silicium/Build/odinPkg/DEBUG_CLANGPDB -name '*.efi' -newermt '2026-11-06 07:00' | wc -l. Revision:42e726c3d8493e13ec6c2666b0d84bf17a99c60c.host: the eight-entry build runs sync, download, extract, import, check-odin-firmware, check-odin-dsdt --require, apply-odin-sec-patch and build-odin-dtb and ends at Build/odinPkg/DEBUG_CLANGPDB/FV/SILICIUM_UEFI.fd (2097152 bytes, sha256 59d21101…). Content re-verified in that build rather than assumed: FV/Ffs has UniXNURamDiskDxe 75CA63AD…, DarwinBoot 1B64AF87…, OdinBringupLog 6E2F6B4E…, UniXNU 9B665204… and UniXNUDxe 29B950CF… each with one EFI_FILE_NAME line in FVMAIN.inf; FVMAIN.Fv counts the entry-arg HOB GUID 2, UNIXNURAMDISK 7, DarwinBoot 4, 'fdt handoff:' 3, 'memory map:' 1, 'FREE-MEMORY' 1, 'Spurious GIC interrupt' 1, 'cannot be masked' 1 and 'unixnu.toml %a' 1; the HOB GUID is once in the FD at 0xcb78 = gSiliciumEntryArgHobGuid in Sec.map, with SecCleanInvalidateDataCacheAll at 0x75000 and gSecEntryArg0 at 0x790b8; apply-odin-sec-patch.py --check-only says already applied. Repacked: /tmp/odin-payload-v10.img 85536768 bytes (sha256 860d63a4f044415d…, kernel 6cfe4697…, ramdisk 83886080, shim 192, header_version 1) and /tmp/odin-fd-v10.img 1650688 (673a93a16104faa7…); v9 retired. Note for the next run: the payload image is 516096 bytes ABOVE 85020672, the only size this unit ever answered Booting OKAY to, and that earlier 'both images are under the accepted size' sentence in FACTS was arithmetically wrong - if a one-shot boot dies mid-Booting the first move is [payload] size_mib = 78. Command:python3.13 ./unixnu firmware -D ../UniXNU-odin --uefi ../Mu-Silicium -j 8 (eight preflight lines in the log); python3.13 ./unixnu bootimg -D ../UniXNU-odin --uefi ../Mu-Silicium --dtb out/odin/ipados-17.7.11-21H461/odin/tree/build/odin/odin.dtb; cp …/boot/boot.img /tmp/odin-payload-v10.img; ./unixnu bootimg … --ramdisk none; cp … /tmp/odin-fd-v10.img. Revision:42e726c3d8493e13ec6c2666b0d84bf17a99c60c.device: the FD that went into this run is sha256 59d21101...; the unit returned at 08:16:39 without a power-key hold, and the session measured three things the plan did not know. (1) Stock recovery runs adbd as uid=0 (context u:r:su:s0) and mounts logfs read-only, so reading the instruments needs no partition write at all - the older instruction to flash a recovery into boot_a is retired, and read-boot-trace.py grew a pull step and a read-only mount to match. (2) The five UefiLog files present at 08:20 came to Start EBS with one boot showing Apply Overlay total time: 399 ms, and neither has a ReadyToBoot line, so those runs stopped inside DXE - those logs are from the pre-instrument images, which had neither OdinBringupLog nor DarwinBoot shipping. (3) fastboot boot of /tmp/odin-payload-v10.img at 08:25 (Sending OKAY 1.939s, Booting OKAY 0.169s, nothing written) brought the unit back on its own into recovery at 08:26:30, where the 04:20 round had needed a physical recovery - the entry_probe_reset_delay = 6 build does end by itself. The catch that keeps this from being the run the port is waiting for: adb dropped after about ninety seconds, before the mount landed, so the UNIXNU.TXT that this FD writes has still not been read, and the unit has been off both channels since. Slot state read alongside it: current-slot a, slot-successful:a no, retry-count 3 (was 6), boot_a itself untouched by any of this. The first action on the next sighting is read-boot-trace.py pull. Command:adb shell id; adb shell 'mount -o ro /dev/block/by-name/logfs /dev/logfs_ro; ls -l /dev/logfs_ro'; adb pull each UefiLog*.txt; python3.13 scripts/read-boot-trace.py parse <dir>; fastboot getvar product/current-slot/slot-successful:a/slot-retry-count:a; fastboot boot /tmp/odin-payload-v10.img; poll fastboot devices and adb devices. Revision:42e726c3d8493e13ec6c2666b0d84bf17a99c60c.
CPU and interrupts
planned
Hardware and dependencies
- Identify the cpu and interrupts hardware, resources and existing component interfaces for this board.
Configuration
- Record the board.toml fields, DTS properties and defconfig values used for cpu and interrupts.
Procedure
- Follow the cpu and interrupts stage in the porting guide and record the actual commands.
Development findings
- Collect the first cpu and interrupts observation, its cause when established, and the resulting implementation decision.
Completion criteria
- Every enabled CPU reaches its entry checkpoint and timer/IPI handling works on each enabled CPU.
Current limits
- No network driver exists for this board yet: ath12k is the SM8550 component and this is a WCNSS/ath10k-class part, so the component choice itself is open.
- The firmware files under the vendor image (the wlan/ directory and the bt_firmware blob) are named by the device tree but not yet identified per file, and none of them is committed.
Next action
- Inventory the required cpu and interrupts inputs before implementation.
Evidence
host: GCC clock layer implemented and tested against a mock register file: SE11 branch 0x1839c with vote bit 25 and RCG 0x183a0, CFG/M/N/D matching the vendor values for the same table entries, the 2h-1 pre divider, CEIL rate rounding from 7 MHz to 7372800, timeout reporting and refusal of hardware-owned domains Command:cc -std=c11 -Wall -Wextra -Werror -o /tmp/odin-clock-tests package/OdinClocks.c package/OdinClocksTests.c && /tmp/odin-clock-tests. Revision:a8182d2e0fe29a8fbd78fae66a6b1818a5df205f.source: [email protected]@7 carry reg 0x0, 0x100 through 0x700: the core number lives in MPIDR Affinity1, which is what the SoC feed patch for start.s assumeshost: the SoC series is resolved into the build order: 60 patches, with native-smp-secondary.patch at position 57 taken from the pinned sm8350 feed, and odin_defconfig accepted Command:cp -R ../UniXNU-odin ../UniXNU-odin-probe; in the copy set board.example = false; cd ../UniXNU-odin-probe; bash scripts/package.sh --os ipados-17.7.11-21H461 --check. Revision:e66022542ef0bab3283bfa8e4f66d282412f9d23.
Memory and DMA
planned
Hardware and dependencies
- Identify the memory and dma hardware, resources and existing component interfaces for this board.
Configuration
- Record the board.toml fields, DTS properties and defconfig values used for memory and dma.
Procedure
- Follow the memory and dma stage in the porting guide and record the actual commands.
Development findings
- Collect the first memory and dma observation, its cause when established, and the resulting implementation decision.
Completion criteria
- All handoff regions are accounted for and each enabled DMA engine accesses its allocated range with the documented cache policy.
Current limits
- Hardware inputs and implementation are pending for this example board.
Next action
- Inventory the required memory and dma inputs before implementation.
Evidence
host: the modem PIL versus DXE heap question is a lifetime question rather than an overlap: no-map regions bind the OS while the firmware heap is reclaimed at ExitBootServices; 21 regions enumerated, proven non-overlapping, totalling 640-768 MiB and all ending below 0xECA00000 Command:cc -std=c11 -Wall -Wextra -Werror -include stdio.h -include string.h -o /tmp/odr-tests package/OdinReservations.c package/OdinReservationsTests.c && /tmp/odr-tests. Revision:a8182d2e0fe29a8fbd78fae66a6b1818a5df205f.device: unit 11b5d7c3's own XBL and UEFI report the memory the port had been declaring unmeasured: 'Rank 0 size = 8192 MB, Rank 1 size = 0 MB', 'Total Installed RAM : 8192 MB (0x0200000000)', 'Total Available RAM : 8087 MB (0x01F9700000)' in two entries 0x80000000+0x39700000 and 0xC0000000+0x1C0000000, so DRAM ends at 0x280000000 and the 105 MB missing below 0xC0000000 is XBL's reservation rather than absent memory. LPDDR5, 1555 MHz at boot, 1709 MHz current, 3196 MHz max enabled. The same file names the framebuffer the memory map claims: DisplayDxe pFrameBufferBase 0xEA600000, uFrameBufferSize 10368000 = 1080 x 2400 x 4 Command:adb -s 11b5d7c3 pull /dev/logfs/UefiLog0.txt && grep -E 'Rank 0 size|Total Installed|Total Available|RAM Entry|Add Base|pFrameBufferBase|uFrameBufferSize' UefiLog0.txt. Revision:0ec682bc685fb997f787484c1c1d76d898ea0567.host: what the boot payload's memory actually is: MemoryInitPei.c:97 turns a map entry into an allocation HOB only for EFI_RESOURCE_SYSTEM_MEMORY or EfiRuntimeServicesData, and odin's only EfiConventionalMemory rows are DXE Heap 0x9B800000+0x03C00000 and DBI Dump 0xE1A00000+0x00F00000 - 75 MiB in total, which is the whole reach of the DXE allocator, so the 80 MiB ramdisk ABL staged elsewhere cannot be allocated over. That is also why venus carries no {"Kernel", 0xA8000000, 0x10000000, Reserv} row and odin copied that, while the newer boards (sheng, garnet, ingres, marble, nuwa, onyx) need it. PcdSystemMemorySize is set by nobody - ArmPkg.dec:256 defaults it to 0 and odin.dsc:45 sets only the base - so the question is answered at run time by GetMemoryMap in the bring-up trace rather than by those PCDs Command:grep -n 'AddMem, SYS_MEM.*Conv' ../uefi-odin/Platforms/Xiaomi/odinPkg/Library/MemoryMapLib/MemoryMapLib.c; sed -n '88,100p' ../Mu-Silicium/Silicon/Silicium/SiliciumPkg/Library/MemoryInitPeiLib/MemoryInitPei.c; grep -rn 'PcdSystemMemorySize' ../uefi-odin/Platforms/Xiaomi/odinPkg/odin.dsc ../Mu-Silicium/Mu_Basecore/ArmPkg/ArmPkg.dec. Revision:eb6b80045f27d4838236295ccfcdcfecfedf8ebe.
Storage and root
host-verified
Components: ShengUfs, RamBlock, VerifiedRoot, VirtioMmioBlock.
Hardware and dependencies
- Controller, PHY, clocks, reset and power, SMMU, DMA, handoff, storage layout and OS interface, each with a source and an owner (docs/porting/ufs.md hardware inventory).
Configuration
- board.toml [userdata] now carries the measured geometry: first_lba 2967552, last_lba 61844474, lba_bytes 4096, with the OS and Cryptex1,SystemOS windows.
- dts/odin.dts inherits the exported ufshc and ufsphy nodes from sm8350.dtsi; both windows align inside a non-zero 16 MiB arm-io base, so unlike the touch engine the storage driver can live in the kernel.
- configs/odin_defconfig leaves CONFIG_XNU_NATIVE_UFS unset - not because the component is missing, it is selected and built, but because the flags open a link chain this port has not closed (limits); native-ufs-root=1 is added with it and never before. The plan is now consistent, so the archive build no longer refuses; what the flags do at link time is recorded in the experiment below, and the kernel does not force-load the driver until a known block has been read back on the unit.
- Selection is now the documented shape rather than a board-only recipe: ShengUfs is in the complete [components] include array, feeds.toml pins its source to package/ufs (so the tree's drivers/ShengUfs is a link into this repository and unixnu status reports origin local (feeds)), and [kernel] archives now names the storage family after the arch profile's own entries. Writing that list out was forced rather than chosen: archive_plan() takes the merged board table, profiles/arch/arm64/profile.toml supplies an explicit eight-entry archives array, and arrays replace inherited arrays - so with three more selected kernel-stage components and no position for them, the kernel step stopped with "[kernel] archives needs component entries for: RamBlock, ShengUfs, VirtioMmioBlock". The claim recorded here earlier - that an absent archives key means implicit, therefore everything selected gets built, which is why libArmCpu.a, libArmDTPlatform.a and libSoftwareAES.a exist - is withdrawn: those three were built because the inherited arch entries name them. The cost of the restatement is drift: if the arm64 profile gains a recipe, odin's copy silently omits it.
- The catalog's revision pin (99d8bcd3) no longer describes the bytes for this board: a locally pinned module reports its revision as the device repository's own commit, so the fork's provenance lives in package/ufs/README.md and in git history. RamBlock is selected as well, because it is the caller that sizes and opens the Data store, and the contract between the two archives was checked rather than assumed: nm -u on build/ram-block/libRamBlock.a (301472 bytes, built by the catalog recipe with the same object audit) asks for six native_ufs_store_* names and nm --defined-only on odin's libShengUfs.a defines exactly those six - which matters because the imports are weak, so a missing export would not fail the link, it would fail the address test at NativeRamBlock.cpp:89 and leave the store silently never opened. XNU_NATIVE_RAM_BLOCK=1 additionally requires XNU_NATIVE_AES=1 (build-xnu-4k-baseline.sh:214-219) and odin already resolves CONFIG_XNU_NATIVE_AES=y, so that gate is met today. What this tree does not have is the CONFIG_XNU_NATIVE_UFS_ARCHIVE a sibling device record passes for its own fork: line 639 hardcodes UFS_ARCHIVE to build/sheng-ufs/libShengUfs.a and grep finds no such variable here, so pointing the pipeline at that path is the contract, not a workaround. Archive digests are no more build identifiers than the FD's were: rebuilding the same source through the same recipe moved build/odin-ufs/libOdinUfs.a from 130b09aa to 007aa5f0, because ar records timestamps - so a digest says which instance ran, not which bytes are in the kernel.
Procedure
- Inventory from the vendor tree, then transcribe the reviewed ShengUfs contract (adopt sequence, UTRD and UPIU packing, completion policy, SMMU takeover, write windows) into package/OdinUfs*.{h,c}.
- Assert every byte of the descriptors and every write order against a scripted controller and a scripted SMMU on the host: sh package/run-tests.sh.
- On the device, run the read-only milestones in order: registers, DMA, one command, capacity and known blocks, root mount, persistence.
Development findings
- UFS host window 0x1d84000/0x3000 with inline crypto at 0x1d88000/0x8000 and its HWKM at 0x1d90000/0x9000, GIC_SPI 265, two lanes per direction, QMP phy 0x1d87000/0xe10, apps SMMU stream id 0xE0.
- The unit's LUN 0 uses 4096-byte logical blocks while the GPT is addressed in 512-byte LBAs: /sys/class/block/sda33 reports start 23740416 and size 471015384 in 512-byte sectors, fastboot's partition-size is 0x38263FB000, and both divide by eight exactly. The eUFS part is a Samsung KLUEG8UHDC-B0E1 (rev 0200).
- Resolved: the board's eUFS is clocked by the GCC_UFS_PHY_* family (CFG 0x77010 AXI, 0x77018 AHB, 0x7705c UNIPRO, 0x77064 ICE, 0x770cc aggregate; RCGs 0x77024 with mnd_width 8, 0x7706c and 0x77084 with mnd_width 0; BCR 0x77000, GDSC 0x77004). The 0x75xxx card family belongs to an external slot. og_ufs_phy_enable() programs it and refuses to write M/N/D into an mnd_width=0 RCG.
- The host window, the GDSC address and the apps SMMU physical base are identical on SM8550 and SM8350, so the UFS controller IP carries over; the divergence is the PHY window (0x1d80000/0x2000 vs 0x1d87000/0xe10), the stream id (0x60 vs 0xE0), the SMMU compatible (arm,mmu-500 vs qcom,qsmmu-v500) and every GCC branch offset. 0x77018 means AXI on SM8550 and AHB on SM8350: an offset imported by analogy would clock the wrong branch.
- Two refusals in the upstream SMMU planner are dead ends on this generation, and the sibling SM7475 port proved it on hardware: the candidate-bank scan stops after the top eight, and an exclusive firmware mapping of our own stream onto another bank is refused as a conflict. OdinUfsSmmu.c keeps both refusal strings, scans every bank, and adds a takeover mode that resets the firmware's bank to a clean bypass context after proving no other stream points at it.
- Completion policy is deliberately unforgiving: a timeout or a fatal interrupt bit quarantines the host and the buffer stays allocated, because the controller may still own that memory with the doorbell back at zero. No cancel, no reset, no retry.
- The gate to a component, not to the porting layer: scripts/build-arm-driver.py compiles a driver archive against XNU source-build compile records (build/xnu/ios-obj/DEVELOPMENT_ARM64_BCM2837/iokit/DEVELOPMENT/IOPlatformExpert.cpo.json). The claim recorded here on the strength of one FileNotFoundError - that odin has no such records, that its kernel step is only a patched prelinked cache, and so that a storage driver cannot be built on this machine - was wrong and is withdrawn the same day: those records do exist, 528 MB of ios-obj with 123 cpo.json files under the assembled device tree, three driver archives were already built for odin from them (libArmCpu.a, libArmDTPlatform.a, libSoftwareAES.a, each logged -Werror build and arm64-apple-ios17.0 object audit passed), and an unmodified SM8550 storage driver builds in the same tree (libShengUfs.a 514112 bytes). The repro that produced the error ran UniXNU/scripts/build-arm-driver.py, whose ROOT is the shared repository and which therefore looks in UniXNU/build, a directory that does not exist; the kernel step runs the copy inside the device tree, where ROOT resolves to the tree that holds the records. What actually blocks odin is a port, not a build system: the component's SoC constants (host/PHY bases, GCC branch ids, apps-SMMU stream, userdata geometry) are SM8550 values and must become odin's, which are already pinned and host-tested in package/OdinUfs*.{c,h}. CONFIG_XNU_NATIVE_UFS and the [kernel] archives key stay unset until that substitution exists and has been read back on the unit, because a driver that has only ever compiled sits below the docs' block-reads/root/persistence milestones.
- The boot-argument surface of the fork is eleven names, read from its own source: native-ufs-probe, native-ufs-root, native-ufs-diagnostics, native-ufs-stats-delay and seven sheng-prefixed policy arguments (sheng-log, sheng-log-reserve, sheng-data-persist, sheng-dpu, sheng-dpu-scanout, sheng-wifi, sheng-wifi-attr). native-ufs-stream and native-ufs-smmu-takeover, which other device records pass for their UFS bring-up, are not parsed here at all - this implementation takes the stream id as the compiled constant 0xE0 - so copying those records verbatim would have bought arguments that do nothing.
- The Data store has no board address: native_ufs_store_open (NativeUfs.cpp:1283-1310) computes first = userdata_last + 1 - reserve - blocks from the GPT it parsed, where reserve is sheng-log-reserve MiB times 256 four-KiB blocks, default 1024, anything over 16384 falling back to the default, and it refuses with the words size or overlaps the root image. The log is fixed at the last 32 MiB of the partition (kLogReserveBlocks 8192) with a 256 MiB export region below it (kExportBlocks 65536), opened as one 73728-block write window, and the reserve must hold both or the log refuses with reserve too small for the log. The reserve is a lifetime value: the source says changing it moves the store and the old one reads as blank.
- For this unit that rule resolves to concrete LBAs, asserted on the host: a 4 GiB store lands at 60533755, the 1024 MiB reserve occupies 61582331..61844474, the log region is 61836283 for 8192 blocks, the log write window starts at 61770747 for 73728 blocks, and 188416 blocks (736 MiB) of reserve go unused between the store and that window.
- The Data size is not a board field either: native_ufs_store_open has no caller in the driver. It is one of the five exports drivers/RamBlock/NativeRamBlock.cpp:89-96 weak-imports and calls, and RamBlock sizes the store from its own RAM disk, so owner Data needs RamBlock selected and linked (XNU_NATIVE_RAM_BLOCK=1, build-xnu-4k-baseline.sh:207,719) plus the --data-ramdisk seed payload.check_data_input demands with CONFIG_XNU_OWNER_DATA_MOUNT.
Completion criteria
- Host: descriptor bytes, register write order, completion and quarantine policy and the SMMU plan are pinned by tests against the reviewed contract.
- Device: registers readable and clock/link state matching the chosen path; buffers reachable and one command completing; capacity and known blocks correct; the configured root mounts and launchd starts; writes survive the documented reboot inside the allocated Data region.
Current limits
- No device run of the transport: nothing here has yet touched the UFS controller; the geometry and the part identity came from a read-only recovery boot, not from this code.
- What was recorded as 'ShengUfs cannot be selected here' is closed: the SM8550 fork in package/ufs is now selected under the catalog identity, with its source pinned by feeds.toml, and the catalog recipe builds it into the archive the link names. What remains is not a build question: CONFIG_XNU_NATIVE_UFS, native-ufs-root=1 and the payload Data seed stay unset, because a driver that panics on a stalled request list does not go into the image the owner's phone boots. And what "stays unset" was measured rather than deferred: with the plan fixed, turning those flags on in a reverted experiment made the kernel link refuse six strong vr_*/verified_root_* names (whose provider libVerifiedRootProbe.a needs the selected root's verified-root policy bundle, a payload product this tree does not build yet) plus the weak _boot_progress_poll, for which no provider exists in this workspace at all. Enabling the driver is that chain, not two flags.
Next action
- On the next sighting of unit 11b5d7c3, before anything else: scripts/read-boot-trace.py pull, which still owes the v10 firmware's UNIXNU.TXT.
- Enablement is a link chain now, and its two open ends are named: get the verified-root policy bundle for the selected root (build/verified-root-systemos/verification.json, host-derivable from the local IPSW) so scripts/build-verified-root-probe.py can produce libVerifiedRootProbe.a and the six strong vr_* imports resolve, and decide boot-progress explicitly instead of stubbing it - either this port carries package/BootProgress.c plus scripts/build-boot-progress.py as the sheng and ishtar records do, or XNU_BOOT_PROGRESS stays off and the chain stops asking for _boot_progress_poll. The flags and arguments themselves are already read out of the code and are the easy half: CONFIG_XNU_NATIVE_UFS=y plus native-ufs-root=1, CONFIG_XNU_NATIVE_RAM_BLOCK=y with sheng-data-persist=1 or =2 and the --data-ramdisk seed payload.check_data_input demands, and sheng-log-reserve fixed once before the first write, because the store address depends on it and a changed reserve makes the old store read as blank.
- Then, once that chain resolves and a kernel actually links the driver, the read-only milestones from docs/porting/ufs.md in order: registers readable, buffers reachable, one command completing, capacity and known blocks, root mount, persistence - each recorded at its own level, observed with scripts/read-boot-trace.py capture because the panel shows nothing before the display stack exists. Milestones cannot be reached by flashing an image that does not contain the driver, so this step is after the two open ends, not parallel to them.
Evidence
source: ufshc@1d84000 with ufs_ice 0x1d88000/0x8000 and ufs_ice_hwkm 0x1d90000/0x9000, GIC_SPI 265, two lanes per direction, iommus = <&apps_smmu 0xE0 0x0>source: QMP phy 0x1d87000/0xe10 with compatible qcom,ufs-phy-qmp-v4-lahainasource: the board eUFS requests GCC_UFS_PHY_* with freq-table-hz 75/300 MHz, so the card family at 0x75xxx does not applysource: the reviewed SM8550 clock transcription, used here as the divergence table: GDSC 0x77004 and host 0x1d84000/0x3000 match odin, AXI/AHB/UNIPRO branch offsets do notsource: adoption sequence and register map transcribed: mask 0x24, stop 0x60, publish 0x50/0x54, clear 0x20, run 0x60, wait HCS bit1; the host is only read when the GDSC is powered and AXI is not haltedsource: hostSubmit's UTRD word packing, PRDT entry layout, big-endian UPIU fields, response header checks 1 to 7, the fatal-status quarantine rule and the store/log window bounds are the contract OdinUfsTransport.c implementssource: SMMUv2 planning refusals (stage 1 capability, all four encoded address widths, geometry, conflicting mapping, bank not bypass) copied field by field, including the refusal stringssource: a device-verified SM7475 port with the same stream 0xE0: its probe found smr=800000e0 s2cr=2 on a firmware-chosen bank, which upstream refused, and the fix was the full-bank scan plus the takeover resetsource: first_lba and last_lba come from the GPT entry named userdata on the device, lba_bytes is its logical block size, and root_match_volume_uuid comes from the selected OS image's APFS root volumehost: descriptor bytes and every register write asserted against a scripted controller: handoff refusals, stop timeout, the six-write adopt order, the SMMU hook running between stop and publish, quarantine after timeout and fatal status, response reasons 1-7, sense decode, LUN-0-only writes and both window edges Command:cc -std=c11 -Wall -Wextra -Werror -I package -o /tmp/ufs-tests package/OdinUfsTransport.c package/OdinUfsTransportTests.c && /tmp/ufs-tests. Revision:e2b32cc429e8cf1501161c1d8c517f8994ceb9b2.host: the SM7475 unit's residue reproduced in a mock register file: refused without takeover, planned and configured with it, six writes in the required order; shared or masked mappings still refuse, nine taken banks fall through to a tenth, and the unsupported stage-1, width and geometry cases are final Command:cc -std=c11 -Wall -Wextra -Werror -I package -o /tmp/ufs-smmu-tests package/OdinUfsSmmu.c package/OdinUfsSmmuTests.c && /tmp/ufs-smmu-tests. Revision:e2b32cc429e8cf1501161c1d8c517f8994ceb9b2.device: unit 11b5d7c3: LUN sda reports a 4096-byte logical block, sda33 start 23740416 and size 471015384 (512-byte units) giving 58876923 blocks = 241159876608 B, and the eUFS is a Samsung KLUEG8UHDC-B0E1 rev 0200; read-only, so the controller itself has still not been driven by this port Command:fastboot boot twrp-3.7.0_11-0-odinx.img; adb shell 'cat /sys/block/sda/queue/logical_block_size /sys/class/block/sda33/start /sys/class/block/sda33/size'; adb shell 'cat /sys/class/scsi_device/*/device/model'. Revision:b10d580b7b224f609b25256a879b1ae9b8569278.host: the wall this area reported at 06:21 does not exist. The compile records are there (528 MB ios-obj, 123 cpo.json, the IOPlatformExpert record 10011 bytes), three driver archives were already built for odin from them, and the SM8550 storage driver - unmodified, with only its two pinned dependencies added - builds too: 'ShengUfs: -Werror build and arm64-apple-ios17.0 object audit passed', libShengUfs.a 514112 bytes, NativeUfs.o a 510296-byte arm64 Mach-O object. The FileNotFoundError that produced the earlier claim is real but is about a path convention: UniXNU/scripts/build-arm-driver.py has ROOT = the shared repository, whose build/ does not exist, while the kernel step runs the tree's copy, where ROOT is the tree holding the records. kernel.log's own header line says the intended flow is source build then prelink, and prelink.log's 'executable bytes unchanged' is therefore about no component being selected, not about one being unbuildable. Nothing shipped changed: board.toml still selects five components with no [kernel] archives key, /tmp/odin-payload-v10.img is still 860d63a4f044415d…, and the copied SM8550 sources and build/sheng-ufs were deleted from the generated tree so a later build cannot read them as odin's. Remaining work is the constant substitution (SM8550 host/PHY bases, GCC branch ids, apps-SMMU stream, userdata geometry -> odin values already host-tested in package/OdinUfs*.{c,h}), and qualification still needs the unit. Command:ls -l UniXNU/out/odin/ipados-17.7.11-21H461/odin/tree/build/xnu/ios-obj/DEVELOPMENT_ARM64_BCM2837/iokit/DEVELOPMENT/IOPlatformExpert.cpo.json; find UniXNU/out/odin//odin/tree/build/xnu/ios-obj -name '.cpo.json' | wc -l; cat UniXNU/out/odin/*/odin/logs/component-ArmCpu.log; cd UniXNU/out/odin/ipados-17.7.11-21H461/odin/tree && git clone [email protected]:UniXNU/ShengUfs.git (checkout 99d8bcd3e43dd24fc3c8437c67b5d4cc71ab94d0) plus VerifiedRoot@974f043d0c71ba2e60331483a41c6c6d35274ee3 and VirtioMmioBlock@4e1013eb8c45077b57f8d38d61b389fe899ea1c3 at the paths components.toml gives, then UNIXNU_XNU_ARCH=arm64 UNIXNU_IOS_VERSION=17.0 python3.13 scripts/build-arm-driver.py ShengUfs; ls -l build/sheng-ufs; file build/sheng-ufs/NativeUfs.o; shasum -a 256 /tmp/odin-payload-v10.img. Revision:99d8bcd3e43dd24fc3c8437c67b5d4cc71ab94d0.host: the port's open substance is now a table rather than a search: nine of the reference driver's clock constants are paired SM8550/SM8350 with a citation on both sides - the eight branch enables plus the phy GDSC, which is 0x77004 identical (axi 0x77018->0x77010, ahb 0x77024->0x77018, tx_symbol0 0x77028->0x7701c, rx_symbol0 0x7702c->0x77020, unipro 0x77068->0x7705c, ice 0x77074->0x77064, rx_symbol1 0x770cc->0x770b8, aggre 0x770e4->0x770cc), and two are recorded as not obtained: phy_aux 0x770b0 has no SM8350 value and SM8550's ufs_mem_phy GDSC 0x9e000 has no SM8350 domain at all, so the fork refuses both instead of writing them. Two branch-enable offsets collide across generations (0x77018, 0x770cc) and SM8550's ahb enable offset 0x77024 is SM8350's gcc_ufs_phy_axi_rcg_clk register, so a base-shifting port would program a different kind of block and still read back as enabled - the suite asserts the collision count, each pair and that overlap separately so a wrong citation fails by name. The architecture-bound half needs no port at all: UFSHCI offsets, the 4096/512/1024/8192+131072 transfer geometry and 32 blocks per command, the SMMUv2 SMR/S2CR/CB layout and the 0x01d84000/0x3000 host window are identical on both. Nothing is selected into an image: the driver still has to be rebuilt with these values and then read back on the unit, which is where this area has been since 04:20. Command:cc -std=c11 -Wall -Wextra -Werror -include stdio.h -include string.h -I package -o /tmp/ufs-gcc-tests package/OdinUfsGccTests.c && /tmp/ufs-gcc-tests; sh package/run-tests.sh | tail -4. Revision:99d8bcd3e43dd24fc3c8437c67b5d4cc71ab94d0.host: odin has a storage driver that compiles against its own kernel ABI, and it is not in any image. The fork is ShengUfs@99d8bcd3 with two files touched - package/ufs/GccUfs.h replaced with odin's values, and 22 lines in NativeUfs.cpp covering exactly the SoC-bound sites the substitution table predicted (the 0x60 stream literal in the adopt path and in the probe=7 match, the apps-SMMU base twice, the ufs_mem_phy window and the phy_aux read, and sheng's hardware comments marked as that unit's) - everything else byte-identical, verified with cmp against a fresh clone. build-odin-ufs.py prints -Werror build and arm64-apple-ios17.0 object audit passed with a 513400-byte libOdinUfs.a, then reads the artifact back: nm must define __ZN9NativeUfs10gMetaClassE and __ZN9NativeUfs12adoptAndReadEj (54 NativeUfs symbols total) and a -dM -E pass must report NATIVE_UFS_STREAM 0xE0u, AXI 0x77010u, AHB 0x77018u, host 0x01d84000ULL, PHY 0x01d87000ULL and the two unobtained registers as 0u. That check is what makes the compile mean something - a driver still carrying SM8550 constants compiles and audits identically - and it caught its own first bug, asserting an Info.plist string that was never in the object. Not selected: [kernel] archives unset, five components, /tmp/odin-payload-v10.img still 860d63a4f044415d..., because a driver that panics on a stalled request list does not go into the owner's phone before it has read a known block. Outstanding before selection: dependencies through [components] rather than copied directories, and the inherited org.blu-sharky.NativeUfs bundle identity, whose matching rules this port should not discover by booting. Command:cmp -s /tmp/ShengUfs/RootCommands.h package/ufs/RootCommands.h && echo identical; diff -u /tmp/ShengUfs/NativeUfs.cpp package/ufs/NativeUfs.cpp | grep -c '^[+-][^+-]'; UNIXNU_TREE=UniXNU/out/odin/ipados-17.7.11-21H461/odin/tree python3.13 scripts/build-odin-ufs.py --clean; xcrun nm --defined-only UniXNU/out/odin/*/odin/tree/build/odin-ufs/libOdinUfs.a | grep -c 9NativeUfs; shasum -a 256 /tmp/odin-payload-v10.img. Revision:99d8bcd3e43dd24fc3c8437c67b5d4cc71ab94d0.host: ut_place transcribed from NativeUfs.cpp:1256-1265,1294-1299 and 1468-1487 and asserted on this unit's geometry: the MiB-to-4KiB-block conversion (1024 MiB = 262144 blocks), the store landing at 60533755 for a 4 GiB request with its end exactly one reserve below the partition end, the log at 61836283 for 8192 blocks with the export region making one 73728-block window at 61770747, the 736 MiB of reserve left unused, all three refusal words (size, overlaps the root image, reserve too small for the log) reached by name, the >16384 MiB reserve falling back to the default, a zero reserve refused while the log is on and accepted with it off, and the resulting windows satisfying the transport's own write-time ut_in_window checks at both edges and in the gap between them Command:cc -std=c11 -Wall -Wextra -Werror -o /tmp/ufs-transport-tests package/OdinUfsTransport.c package/OdinUfsTransportTests.c && /tmp/ufs-transport-tests. Revision:99d8bcd3e43dd24fc3c8437c67b5d4cc71ab94d0.source: the Data side of the story: six weak imports (native_ufs_store_mode/open/read/write/sync/gpt_check, lines 35-40) and attachStore() at 89-96 refusing unless all five of the working ones are present, sizing the store from the RAM disk itself ((isBig ? big.bytes : sparse.bytes) / 4096 with persist::windowBlocks on top), recording the returned first LBA and printing the driver's own refusal word - which is why enabling odin's root needs RamBlock selected, not a board field for the Data addresshost: the documented selection path works for a board fork: with ShengUfs in [components] include and feeds.toml pinning its source to package/ufs, the assembled tree links drivers/ShengUfs -> UniXNU-odin/package/ufs and status reports origin "local (feeds)" with the device repository's own commit as the revision. Selecting it changes the tree and the archive, not the image - CONFIG_XNU_NATIVE_UFS is untouched. Command:PATH=/tmp/py313bin:$PATH ./unixnu tree -D ../UniXNU-odin --os ipados-17.7.11-21H461; ls -l out/odin/ipados-17.7.11-21H461/odin/tree/drivers/ShengUfs; PATH=/tmp/py313bin:$PATH ./unixnu status --json -D ../UniXNU-odin. Revision:99d8bcd3e43dd24fc3c8437c67b5d4cc71ab94d0.host: the catalog recipe builds odin's driver: "ShengUfs: -Werror build and arm64-apple-ios17.0 object audit passed", 513480 bytes with NativeUfs.o inside and 54 NativeUfs symbols including __ZN9NativeUfs10gMetaClassE and __ZN9NativeUfs12adoptAndReadEj. Two consequences recorded honestly: the slot no longer needs this board's recipe to install into it (build-odin-ufs.py stopped writing build/sheng-ufs/, so the pipeline owns the path the link reads), and a rebuilt archive of unchanged source changed digest from 130b09aa to 007aa5f0 because ar stores timestamps - the digest identifies a run, not a content check. Command:UNIXNU_DEVICE=$PWD python3.13 scripts/build-odin-ufs.py --clean; python3.13 out/odin/ipados-17.7.11-21H461/odin/tree/scripts/build-arm-driver.py ShengUfs; xcrun nm --defined-only out/odin/.../tree/build/sheng-ufs/libShengUfs.a | grep -c 9NativeUfs; shasum -a 256 out/odin/.../tree/build/{sheng-ufs/libShengUfs.a,odin-ufs/libOdinUfs.a}. Revision:99d8bcd3e43dd24fc3c8437c67b5d4cc71ab94d0.host: RamBlock selected, built and matched against the storage archive: the tree gains drivers/RamBlock at 4be2d7eb plus the legacy_name alias directory drivers/NativeRamBlock, the catalog recipe prints "RamBlock: -Werror build and arm64-apple-ios17.0 object audit passed" into a 301472-byte archive, and the difference between the six native_ufs_store_* names RamBlock imports and the six odin's libShengUfs.a defines is empty - the comm output printed nothing, which is the check that the weak imports will actually resolve rather than quietly leaving the store closed Command:PATH=/tmp/py313bin:$PATH ./unixnu tree -D ../UniXNU-odin --os ipados-17.7.11-21H461; python3.13 out/odin/ipados-17.7.11-21H461/odin/tree/scripts/build-arm-driver.py RamBlock; xcrun nm -u out/odin/ipados-17.7.11-21H461/odin/tree/build/ram-block/libRamBlock.a | grep -o native_ufs_store[a-z_]* | sort -u > /tmp/imports.txt; xcrun nm --defined-only out/odin/ipados-17.7.11-21H461/odin/tree/build/sheng-ufs/libShengUfs.a | grep -o native_ufs_store[a-z_]* | sort -u > /tmp/defines.txt; comm -13 /tmp/defines.txt /tmp/imports.txt. Revision:4be2d7eb05ef5a98126c91e0302c149140c0e3e1.host: the experiment this area had been avoiding: with the flags on, the kernel step first refused at the plan - "[kernel] archives needs component entries for: RamBlock, ShengUfs, VirtioMmioBlock" as written by kernel.py, which disproved the record's own explanation that an absent archives key means every selected component gets built (the arch profile supplies an explicit eight-entry list, and arrays replace inherited arrays), and after the list was stated out verbatim with the storage family appended, ld refused: _verified_root_key, _verified_root_policies, _verified_root_policy_count, _vr_open, _vr_verify_block and _vr_xnu_crypto as strong undefined externals from libShengUfs.a[2](NativeUfs.o) and _boot_progress_poll, an undefined weak external, refused as well. So selection is closed and enablement is a chain, and the two open ends have names: libVerifiedRootProbe.a (build-verified-root-probe.py, which reads build/verified-root-systemos/verification.json - the selected root's verified-root policy bundle) and a boot-progress writer, which in the sibling records is a device-repository file (package/BootProgress.c plus scripts/build-boot-progress.py) odin does not have. Nothing of the experiment ships: the defconfig was restored from the copy, the plan fix and the component selection did, and the tree's kernel.macho and kernel.json were restored from the pre-experiment snapshot and re-verified as 14d587cdfe65d49a and a12496ad, the bytes inside /tmp/odin-payload-v10.img (860d63a4f044415d) and the boot image flashed at 04:20 Command:cp configs/odin_defconfig /tmp/odin_defconfig.shipped && printf 'CONFIG_XNU_NATIVE_UFS=y CONFIG_XNU_NATIVE_RAM_BLOCK=y ' >> configs/odin_defconfig && PATH=/tmp/py313bin:$PATH ./unixnu defconfig odin_defconfig -D ../UniXNU-odin && PATH=/tmp/py313bin:$PATH ./unixnu build kernel -D ../UniXNU-odin --os ipados-17.7.11-21H461. Revision:a6684e23138e0acd933e4a0182e91ffd8a0fe1c5.
Display
planned
Hardware and dependencies
- Controller and panel identity, the DSI windows and splash region, the brightness transport and its encoding, the tear-check wiring and the enable GPIOs, each with a source.
Configuration
- dts/odin.dts keeps the panel block as documentation until the scanout path exists; the geometry already verified there is 1080x2400 DSC 1.1 command mode at 60 Hz with porches 40/20/10 and 2000/2704/2.
- package/OdinDisplayBoard.h holds the panel and brightness facts with per-value citations; package/OdinDisplayBacklight.h/.c holds the transport rules, and neither bakes in an 8-bit assumption.
- uefi-odin's Include/RAW.inc now names this board's own panel description, extracted from its XBL volume as Panel_K8_42_02_0a_amoled_dsc_cmd.xml with the stock GUID 6FF4EF1B-166B-4D80-B27D-4A31E6D3B298; USE_CUSTOM_DISPLAY_DRIVER stays 0, matching venus.dsc, so the shared SimpleFbDxe path is what a first build uses.
Procedure
- Read the panel description first-hand and quote it line by line.
- Read the brightness path in the vendor display driver (techpack/display/msm/dsi/dsi_panel.c) and the DRM helper it calls, and implement the encoding and the holds as a transport-agnostic layer.
- Assert packets, bounds and hold behaviour on the host with a recorded bus.
- Then establish firmware scanout, then the kernel backend, then brightness against the real panel.
Development findings
- Panel is 1080x2400 DSC 1.1 command mode (slice 1080x12, one slice per packet, bpc 10, bpp 8) at 60 Hz, backlight over DCS with no dedicated IC, TE on gpio82 (mdp_vsync mux 1), reset on gpio24, vddio and vddd enables on gpio42 and gpio83, ESD error interrupt on gpio75, and an avdd L13C supply.
- Corrected against the vendor driver: brightness is written as the raw level, 16 bits, bounded only at 0xffff (dsi_panel.c:562-588) - it is NOT scaled into 8 bits, and an earlier revision of OdinDisplayBoard.h claimed it was, which would have made levels above 255 unreachable.
- This panel declares qcom,mdss-dsi-bl-inverted-dbv (panel dtsi:39), and the driver exchanges the two bytes of the level when that flag is set (dsi_panel.c:583-584). With the DRM helper's low-parameter-first payload (drm_mipi_dsi.c:1057-1061) the two rules cancel, so the level appears big-endian on the link - a port that implements either rule alone produces a plausible-looking but wrong packet.
- Two holds happen before any transport is touched: an unchanged level is recorded and dropped (dsi_panel.c:659-661), and this panel sets qcom,bl-update-flag = delay_until_first_frame (dtsi:40, parsed at dsi_panel.c:2567), so the first change waits for a queued frame. In command mode both are about real packets on a real link, not cosmetics.
- odin's panel sets no qcom,bl-dsc-cmd-state, so the driver's default leaves the brightness write in high-speed mode; a panel that declared dsi_lp_mode would be sent in escape mode instead, and the layer models that as state rather than a constant.
- Board range confirmed with real line numbers: bl_ctrl_dcs, min 2, max 4095, brightness-init-level 100 (xiaomi-sm8350-common.dtsi:282-286). The mi,HBM and clone bands (1..2047, threshold 2047, clone 8191, dtsi:684-701) are recorded but unmodelled because their consumers are in the Xiaomi extras, not in dsi_panel.c.
- Also confirmed on the way through: qcom,mdss-dsi-te-dcs-command = 1 with te-check-enable and te-using-te-pin, tx-eot-append, lp11-init and panel-mode-switch (panel dtsi:30-38), which is the tear-effect configuration the display stage needs.
- Closed on the device: the 90 Hz and 120 Hz porch sets are 1000/1336 and 500/652 with the horizontal blanking unchanged, read from the applied device tree's timing@1 and timing@2, and the 60 Hz description in this unit's XBL volume reproduces timing@0 exactly (2000/2704/2 at 1100000000 bit-clock, 4 lanes). Still open: the demura/dc-vi follow-up writes the driver performs after a successful brightness update (dsi_panel.c:588-592).
- A transcription this port corrected from its own record: the Lineage panel dtsi asks for two slices per packet at lines 249, 459 and 669 and that value had been marked [V] in package/OdinDisplayBoard.h, but this unit's applied device tree says one in all three timings and so does the panel description inside its own firmware volume. One slice per packet is a different wire format from two, so the device wins; the header now says one and names the two sources that agree.
- xbl_a carries two k8 descriptions and only one of them is the driver's: the freeform file in the volume (slice 1080x12, profile 8, porches 2000/2704) matches the device tree, while a single-line copy in the ELF data section carries slice height 40, profile 4 and porches 20/8 that no odin timing uses. The FDF points at the volume copy with its stock GUID.
Completion criteria
- A known frame appears with correct geometry and colors, then userland presentation and backlight controls work.
Current limits
- Only the brightness encoding layer is implemented and host-verified; firmware scanout and the XNU display backend are not, so this area stays planned.
- The DSI controller windows are [R] from the extraction pass and no packet has yet been seen on a link, though DisplayDxe itself is now extracted from this unit's volume rather than assumed.
- The AOD 0x51 hold (aod_bl_51ctl) is not modelled because this unit's setting for it is unknown.
- avdd stays unresolved: the reported gpio 12 at a fixed 5500000 uV contradicts this unit's own supply list, which carries avdd as a 3000000 uV PMIC entry, so nothing drives that rail from the header value yet.
Next action
- Build the firmware against the generated Binaries/odin, confirm the menu on the panel, then wire odb_set/odb_first_frame to the real DSI transport and measure brightness.
Evidence
source: 1901 lines re-read first-hand: 60 Hz timing block at 47-58 (1080x2400, 40/20/10, 2000/2704/2), DSC block, TE and ESD wiring, and the brightness-relevant lines 30-40 (te-dcs-command 1, bl-inverted-dbv, bl-update-flag delay_until_first_frame) plus 684-701 for the mi,HBM bandssource: 331 lines read: the odin panel overlay at 281-290 gives bl_ctrl_dcs, min 2, max 4095, brightness-init-level 100, TE gpio 82 and reset gpio 24, promoting those from [R] to [V]; a second panel node above it declares a 0..255 range with TE gpio 83source: 5236 lines read for the brightness path: update_backlight bounds at 0xffff, forces LPM only under lp_mode, byte-swaps under bl_inverted_dbv; set_backlight skips an unchanged level and holds under LP1; the bl-update-flag strings are parsed at 2560-2568source: mipi_dsi_dcs_set_display_brightness at 1054-1066: DCS 0x51 with a two-byte payload ordered low byte then high bytesource: cont_splash region 0xea600000 size 0x2300000 at lines 484-487host: packets asserted byte for byte (100 -> 51 00 64, 0x0F2C -> big-endian pair, 1000 and 3000 distinct), the two bounds failing as different errors, skip-if-equal writing nothing, the first-frame hold releasing only the newest level, the LP-mode and bus-failure cases leaving the recorded level untouched Command:cc -std=c11 -Wall -Wextra -Werror -I package -o /tmp/bl-tests package/OdinDisplayBacklight.c package/OdinDisplayBacklightTests.c && /tmp/bl-tests. Revision:a8182d2e0fe29a8fbd78fae66a6b1818a5df205f.host: the 8-bit scaling checks replaced by range, init-level, inverted-dbv, wire-order and unmodelled-band checks Command:cc -std=c11 -Wall -Wextra -Werror -o /tmp/odin-board-tests package/OdinBoardTests.c && /tmp/odin-board-tests. Revision:a8182d2e0fe29a8fbd78fae66a6b1818a5df205f.device: the board's own panel description, Panel_K8_42_02_0a_amoled_dsc_cmd.xml with GUID 6FF4EF1B-166B-4D80-B27D-4A31E6D3B298, extracted from the volume in this unit's xbl_a; read back it carries 1080x2400, vertical porch 2000/2704/2, DSC 1.1 slice 1080x12, one slice per packet, profile 8, 60 Hz, 1100000000 bit-clock and 4 lanes - the same numbers the applied device tree reports Command:fastboot boot twrp-3.7.0_11-0-odinx.img; adb exec-out 'dd if=/dev/block/by-name/xbl_a bs=1048576' > facts/xbl_a.img; UNIXNU_UEFI=../uefi-odin python3 scripts/import-odin-uefi.py --image facts/xbl_a.img. Revision:97c410c65a47737e01541f5f7f58a3fc16b4f05c.host: thirteen suites pass with the porch sets, the one-slice-per-packet value, the 10 bpc to 8 bpp pair, the 1.1 GHz bit clock and the TE and reset pins now asserted against the device's own readings Command:sh package/run-tests.sh. Revision:97c410c65a47737e01541f5f7f58a3fc16b4f05c.
Input
host-verified
Hardware and dependencies
- Controller identity, bus pins and clocks, the command set and event framing, the bring-up order, the firmware image path and the contact report contract, each with a source.
Configuration
- board.toml selects no input component: the protocol runs in the firmware because the arm-io 16 MiB base rule cannot export SE11, so QcomGeniSpi is a firmware-side dependency of uefi-odin rather than a kernel component here.
- package/OdinTouchBoard.h holds the bus, pin, clock and axis facts with [V]/[R] marks; package/OdinDisplayBoard.h holds the panel geometry the axis space is divided against; the orientation is passed to the report layer as an argument because the vendor sets no rotation property on this board.
- configs/odin_defconfig stays as the minimal set: the HID consumer arrives with the firmware producer, not before.
Procedure
- Extract the command set, framing and timings from the vendor driver with per-line citations (FtsProtocol).
- Establish the bring-up order from the same tree and encode it as one pipeline function per vendor step (OdinTouchPipeline).
- Assert the whole path on the host with a scripted bus that replays FIFO records by length: raw bytes in, contacts out (sh package/run-tests.sh).
- On the device, confirm the first working frame, then measure orientation, then verify the report against the panel.
Development findings
- SE11 sits on wrapper qupv3_1 (stream id 0x43) with the bus on gpio48/49/50 and the chip select split out to gpio51 by the odin pinctrl override; touch reset and irq are gpio22 and gpio23 at 8 mA active drive. The per-pin roles of the three bus lines are not stated by the vendor, so they must be read from the first working frame.
- Consequence of the 16 MiB arm-io base rule: the touch protocol has to run in firmware, which makes QcomGeniSpi reusable and leaves FtsProtocol as the only new code.
- Bring-up order, read from the vendor tree rather than inferred: interrupts down, reset line low 10 ms, poll the FIFO for the whole-byte ready event 0x03, then read the 208-byte system information block. The chip id is read only on the failed-reset path, where it decides between no panel and panel-without-firmware. Sensing is switched with {0xA0,0x00,0x01} and off with {0xA0,0x00,0x00}.
- A defect this port found and fixed in its own earlier code: the ready event had been matched as (byte >> 4) == 0x03, which accepts 0x30 (a leave-point event) and rejects the only byte that means ready, so a successful reset looked like a timeout. The high nibble is the dispatch index (fts.c:4849), the id is the whole byte (ftsCore.c:237).
- Two defects of the same class came out of wiring the pipeline: a bus failure inside the ready poll was reported as a timeout, hiding a broken serial engine behind a slow-looking reset; and sensing could be started on a controller that never announced itself.
- Axis space is ten times the panel (10800 x 24000) with super resolution enabled, so the report layer divides by ten and clamps; ten contacts is the ceiling and surface ids are monotonic and never reused, which the pipeline test asserts through a full frame and an eleventh contact.
- The board's own firmware image was recovered read-only from the mounted vendor partition: st_fts_k8.ftb, 124072 bytes, SHA-256 dedfe0fd65d0801d2d7a557f6d87d01fa1fe6d341494a565f28fa623d5144c79, with stm_fts_production_limits.csv (25982 bytes). The recovery kernel names it during probe, so the file is the one this controller is flashed from.
- Parsed with this port's own reader, the real header agrees with every constant transcribed from the vendor tree: signature 0xAA55AA55, format version 1, target bytes 0x36 0x40 - exactly FTS_DCHIP_ID_0 and FTS_DCHIP_ID_1 - and section sizes 120404 + 3600 + 0 + 0 = 124004, which is the file minus its 64-byte header and 4-byte trailing CRC.
- A second defect of the ready-event class, found by running the reader over the real image: the four page counts at FLASH_ORG_INFO_INDEX 280 are single bytes (ftsFlash.c:512-516 indexes them with index++), and this port read them as 32-bit fields. On this board the bytes are 44, 1, 2, 1 while the word at 280 is 0x0102012C, so the CX base would have landed hundreds of thousands of pages past the real one - an erase-and-burn into the wrong flash area. The fallback rule was also wrong: the vendor selects the fixed bases when ANY of the four counts is zero, not when their sum is.
- Observed on the running board rather than transcribed: the vendor FTS driver 5.2.4.1 probes over SPI and registers an input device at /devices/platform/soc/a8c000.spi/spi_master/spi2/spi2.0, which is the SE11 window this port drives from firmware; the probe also reports tp vendor 56, tp color 50 and the fingerprint-on-display regions 4180 x 16810.
Completion criteria
- Touches map to the display, simultaneous contacts keep stable IDs, release events arrive, and buttons produce expected HID reports.
Current limits
- No device run of this port's own code: the frames, the order and the report are asserted against a scripted controller, and the recovery log shows the vendor driver working, not ours.
- The burn path has now got its image - st_fts_k8.ftb is in facts/, never committed - but no erase or DMA write has been attempted, so the flash arithmetic stays host-only.
- Orientation is unmeasured, so it is an argument rather than a constant; the sensor matrix behind the fts,* filter arrays is undecoded, which only affects the axis limits.
Next action
- Read the first working frame on the device to settle the three bus lines' per-pin roles and the orientation, then produce the HID producer in uefi-odin on top of otp_poll.
Evidence
source: fts_init at 5417-5465 gives the bring-up order and puts the chip-id probe on the failed-reset branch only; the event batch at 4836-4855 walks remaining+1 records, stops at EVT_ID_NOEVENT and dispatches on the high nibblesource: fts_system_reset at 85-146 (interrupts down, reset low 10 ms, poll for ready, three attempts); pollForEvent at 193-265 compares readData[0] as a whole byte and flags an unsolicited ready event as an IC reset; setScanMode at 338-355 is the three-byte frame, two for low powersource: event ids at 273-281 (0x00 none, 0x03 ready, 0x13 enter, 0x23 motion, 0x33 leave, 0x43 status, 0x53 user, 0xE3 debug, 0xF3 error) with NUM_EVT_ID derived from the high nibble, and the scan mode selectors at 86-89source: FocalTech fts@0 compatible st,spi, reset gpio22, irq gpio23, 7 MHz, panel phandle dsi_k8_42_02_0a_dsc_cmdhost: the whole path on a scripted bus: ready then sys-info with no chip id read, the A0 00 01 and A0 00 00 frames, a three-record batch ending as two contacts at panel units, ids never reused, an unsolicited ready returning the state to re-init, error and status records counted but not decoded, ten contacts then an eleventh refused, palm dropped by the type mask Command:cc -std=c11 -Wall -Wextra -Werror -I package -o /tmp/otp-tests package/OdinTouchPipeline.c package/FtsProtocol.c package/OdinTouchReport.c package/OdinTouchPipelineTests.c && /tmp/otp-tests. Revision:a8182d2e0fe29a8fbd78fae66a6b1818a5df205f.host: byte frames asserted literally, plus the two directions of the ready-event fix: 0x03 is accepted and 0x30 is not Command:cc -std=c11 -Wall -Wextra -Werror -o /tmp/fts-protocol-tests package/FtsProtocol.c package/FtsProtocolTests.c && /tmp/fts-protocol-tests. Revision:a8182d2e0fe29a8fbd78fae66a6b1818a5df205f.device: the board's own touch firmware recovered read-only (124072 bytes, sha256 dedfe0fd...): its header parses clean through fts_ftb_check, its target bytes are the 0x36/0x40 this port carries, its page counts are the bytes 44,1,2,1, and the recovery kernel that used it registered input3 on a8c000.spi/spi2.0 Command:fastboot boot twrp-3.7.0_11-0-odinx.img; adb shell 'dmesg > /tmp/dmesg.txt'; adb shell 'mount -o ro /dev/block/mapper/vendor_a /mnt/vro'; adb exec-out 'cat /mnt/vro/firmware/st_fts_k8.ftb' > facts/st_fts_k8.ftb; shasum -a 256 facts/st_fts_k8.ftb. Revision:7ba1ec98bec7d94bc341bd49aec89562ea9fde69.host: the page-count fix pinned against the real image: bytes 44,1,2,1 give CX base 46080 words and config base 48128, the same bytes read as one 32-bit field give 0x0102012C and a different base, and a zero in any single count - not only a zero sum - selects the fixed bases Command:cc -std=c11 -Wall -Wextra -Werror -I package -o /tmp/fts-protocol-tests package/FtsProtocol.c package/FtsProtocolTests.c && /tmp/fts-protocol-tests. Revision:7ba1ec98bec7d94bc341bd49aec89562ea9fde69.source: a second SPI device on this board that the port had not listed: &qupv3_se2_spi is status ok with ir-spi@0, compatible ir-spi-led, reg 0, spi-max-frequency 19200000 (lines 716-725), so SE2 and its pins are in use by a consumer-IR receiver and must not be handed to anything else
GPU
host-verified
Hardware and dependencies
- The graphics IP identity and its windows, the power domain and clock owner, the CP packet encoding this generation emits, and the GMU boot sequence, each with a source.
Configuration
- dts/sm8350.dtsi exports gfx 0x3d00000/0x40000 plus 0x3d61000 and 0x3de0000, gmu 0x3d6a000 and kgsl-smmu 0x3da0000; the firmware's own ACPI table for the same silicon declares one MON0 device covering 0x3d00000, 0x3d60000, 0x3d90000 and 0x3de0000, so the merged coverage and the ADT tuples agree.
- The GPU clock controller is at 0x3d90000 (OGP_GPUCC_BASE) with CX/GX domains at 0x3d9106c and 0x3d9100c: they are inside the graphics window, not the GCC's, so they cannot be programmed through a GCC mapping. Nothing maps it yet - GPUCC is one of the power board's own five windows (OGP_W_GPUCC) and no driver has been written to supply the mapping, which is why the DSDT does not declare it under another device's id.
- AdrenoFirmware is the only reusable catalog component here (it is SoC-neutral); Adreno740 and Sm8550Platform are SM8550-scoped and are not applicable to a 660.
Procedure
- Inventory first-hand from the vendor tree (already done: chipid, windows, GMU, PDC, ZAP, power domains).
- Build the packet layer against the encoding the vendor driver actually emits, asserted on the host, before touching a submission path.
- Then the GMU boot sequence, then a render, then presentation.
Development findings
- Adreno 660 (A650 family), chipid 0x06060000, with GMU 0x3d6a000, PDC 0x0b290000 and the ZAP blob a660_zap loaded at pil_gpu 0x8e71a000.
- Correction that saves a whole module: this generation does not emit PM4 type-3 packets. The vendor driver builds every CP command with cp_type7_packet (adreno_pm4types.h:188-203, used at adreno_a6xx.c:1008 CP_ME_INIT, 1120 CP_SET_PSEUDO_REGISTER, 1133 CP_CONTEXT_SWITCH_YIELD, 1255 CP_SET_MARKER), so the existing type-4/type-7 coverage is the right base and a type-3 path would be dead code.
- Type-7 header encoding is count in bits[14:0] with an odd-parity bit at 15, opcode in bits[22:16] with an odd-parity bit at 23; type-4 adds an 18-bit register index with its own parity. The builder therefore has to compute parity, not copy a literal, and the tests must pin it.
- Two structural requirements visible in the same code and easy to miss: every 64-bit GPU address is written through cp_gpuaddr as a two-word low/high split, and the CP can be in protected mode - the driver brackets address-writing packets with cp_protected_mode(0) and cp_protected_mode(1). A builder that ignores either produces a packet stream the CP rejects.
- CP_ME_INIT is emitted as a single packet whose payload size is A6XX_CP_INIT_DWORDS - 1 with an ordinal mask and conditionally present fields, so the field count is derived from the mask rather than fixed.
- Inventory of the catalog driver, measured rather than assumed: Adreno740 takes every window from the device tree (NativeAdrenoService.cpp parses the provider's reg, requires at least two, and builds the GMU adapter's bases from node->windowAddress(index)/windowBytes(index)), so addresses are not this port's blocker.
- What does block it: both probe filters are substring tests over the compatible block - advertisesAdreno() wants the bytes qcom,adreno, advertisesGmu() wants qcom,adreno-gmu - and this unit's a6xx nodes say qcom,kgsl-3d0 and qcom,gpu-gmu, so the driver would bind neither. The sheng coupling is narrow and decisive: 6 of 61 files mention Sheng, 3 include ShengGmu.h, and that header lives only in Sm8550Platform (UniXNU-sm8550-common), which is the driver's first catalog dependency and is not applicable to a 660.
- The substring rule is also the hazard: qcom,adreno occurs inside qcom,adreno-smmu, which this port publishes on iommu@3da0000 with exactly the two windows the driver's count check accepts, and RBBM_STATUS at 0x840 lies well inside that 128 KiB block - so a byte-substring matcher on this board binds the GPU SMMU and reads its global registers as if they were the graphics core. An odin driver must match compatible elements, not bytes.
- The two generations' GMU nodes genuinely differ, so the a7xx window list cannot be reused: the a7xx node publishes three windows (gmu 0x3d6a000/0x35000, rscc 0x3d50000/0x10000, gmu_pdc 0xb280000/0x10000) and the driver binds only at three or more, while this unit's publishes two (kgsl_gmu_reg 0x3d6a000/0x34000, kgsl_gmu_pdc_cfg 0xb290000/0x10000) because RSCC belongs to the GPU node at a6xx (window index 2, 0x3de0000/0x10000).
Completion criteria
- GPU submissions complete, mapping/fence handling is correct, a known image renders, and the selected Metal client presents it.
Current limits
- No implementation yet: the packet builder and the GMU boot path are the next pieces of work, and the GX power domain has never been brought up on this port.
- The ZAP firmware blob and the GMU/OOBP images are vendor binaries and are not in these repositories, so the GMU path cannot be exercised before they are obtained from the unit.
- The catalog Adreno740 driver is not a route to GPU on this board and is not selected: it matches a7xx compatible names this unit does not use, its GMU cold start needs Sm8550Platform's ShengGmu layer, and its five-window adapter expects three GMU windows where this board publishes two. Editing a catalog component's needles, class and bundle names is refused by its own AGENTS.md, so the work is an odin-scoped a6xx component.
- Nothing binds graphics today even if a driver existed: gpu@3d00000, gmu@3d6a000 and iommu@3da0000 are all status = "disabled" in dts/sm8350.dtsi, [kernel] archives names no GPU archive, and CONFIG_XNU_NATIVE_ADRENO is not set for odin.
Next action
- Write the a6xx GPU component for this board: element-wise compatible matching against qcom,kgsl-3d0 and qcom,gpu-gmu, windows taken from reg in the order the tree publishes them, and the bundle identity the catalog rules require of a new component rather than an edited one.
- Then run the power board's staged sequence read-only on the first hardware boot - ogp_run photographs GCC AHB, CX, GX, RBBM_STATUS and the gfx SMMU stream without writing anything - because every gate downstream assumes a rail and a clock this port has never proved up.
- Then the GMU bring-up from a6xx_gmu.c on top of the type-7 builder already tested here: ZAP through PAS 13 into pil_gpu_region, logos and OOBP, CM3 start, HFI handshake - which needs the vendor firmware images, so it cannot start on the host.
- Then the ringbuffer start, then a known render, then presentation.
Evidence
source: cp_type3/4/7_packet builders at 176-203 with the odd-parity helper at 165-173, the reserved-bit check in pkt_is_type3, and the CP opcode table (CP_WAIT_MEM_WRITES 0x12, CP_WAIT_FOR_ME 0x13, CP_WAIT_REG_MEM 0x3c, CP_EVENT_WRITE 0x46, CP_WAIT_REG_EQ 0x52, CP_LOAD_STATE 0x30)source: 2811 lines read: the CP command stream is type-7 throughout (1008, 1120, 1133, 1255), 64-bit addresses go through cp_gpuaddr as a low/high pair, address-writing packets are bracketed by cp_protected_mode, and CP_ME_INIT's payload is A6XX_CP_INIT_DWORDS-1 words with fields present only when the ordinal mask enables themsource: the sibling SM8350 firmware's MON0 device declares 0x3d00000/+0x3f010, 0x3d60000/+0x3f000, 0x3d90000/+0x9000 and 0x3de0000/+0x10000, and MMU1 declares the kgsl SMMU at 0x3da0000/+0x20000 - an independent confirmation of the gfx, GPU_CC and GPU SMMU windows this port took from the device treesource: chipid 0x06060000, GMU 0x3d6a000, PDC 0xb290000 and the a660_zap PIL entry at 0x8e71a000host: parity checked against a popcount oracle; type-7 roundtrip for every opcode and a sweep of counts, with both parity bits and bits 27:24 each refused independently; ME_INIT asserted word by word including the padding dword and the declared-count refusal; protected-window balance in both directions; the CP_REG bit-18 collision demonstrated by a packet the reader accepts and the writer refuses Command:cc -std=c11 -Wall -Wextra -Werror -I package -o /tmp/pm4-tests package/OdinGpuPm4.c package/OdinGpuPm4Tests.c && /tmp/pm4-tests. Revision:a8182d2e0fe29a8fbd78fae66a6b1818a5df205f.source: 4426 lines read for the GPU entries: gcc_gpu_cfg_ahb_clk 0x71004, gcc_gpu_gpll0_clk_src enable_reg 0x52000 mask BIT(15) and gcc_gpu_gpll0_div_clk_src BIT(16) (2248-2270) - the same word and bits SM8550 uses - while gcc_gpu_memnoc_gfx_clk is 0x7100c against SM8550 0x71010 and gcc_gpu_snoc_dvm_gfx_clk matches at 0x71018source: 682 lines read: gpu_cc_ahb 0x1078, cx_gmu 0x1098, gx_gmu 0x1064, hlos1_vote_gpu_smmu 0x5000 - and no struct gdsc anywhere in the file, which is why SM8350 takes its power domains from qcom,gdsc device tree nodes rather than from the clock driversource: RBBM_STATUS dword 0x210 and RBBM_STATUS3 0x213 at lines 139-140, scaled by four for the byte offsets the observation layer useshost: the gated sequence asserted by read counts rather than values: with the GCC AHB branch off, including the hardware-gated case where the enable is set and CLK_OFF is set, no read is issued to GPUCC, the Adreno SMMU or the graphics window; with CX up and GX down the status registers stay unread; the gfx stream is found past an earlier group belonging to another stream; a window that fails to read is recorded as unavailable rather than idle Command:cc -std=c11 -Wall -Wextra -Werror -I package -o /tmp/gpub-tests package/OdinGpuPowerBoard.c package/OdinGpuPowerBoardTests.c && /tmp/gpub-tests. Revision:a8182d2e0fe29a8fbd78fae66a6b1818a5df205f.source: the driver's inputs are the device tree, not constants: advertisesAdreno() accepts a compatible block containing qcom,adreno (105), start() parses provider reg through NativeAdrenoBoard::parseReg and refuses fewer than two windows (227), maps windows 0 and 1 as the GPU register and CX windows, and binds the GMU adapter from node->windowAddress(index)/windowBytes(index) only when the GMU node publishes three or more windows (261-272)source: advertisesGmu() (25) wants the bytes qcom,adreno-gmu, so the node it publishes windows for is found by the same substring rule; the service itself maps each reg tuple and performs no access - the comment says powering CX/GX, starting the CM3 and loading firmware belong to the GPU bring-up, not to this nodesource: the a7xx GMU node this port is compared against: compatible = "qcom,adreno-gmu-740.1", "qcom,adreno-gmu" with three reg windows named gmu, rscc and gmu_pdc (2540-2543) - 0x3d6a000/0x35000, 0x3d50000/0x10000, 0xb280000/0x10000 - which is the shape the driver's three-window minimum and its five-window adapter were written againstdevice: unit 11b5d7c3's own applied tree: the GPU node is qcom,kgsl-3d0@3d00000 with compatible = "qcom,kgsl-3d0" and seven windows (kgsl_3d0_reg_memory 0x3d00000/0x40000, cx_dbgc 0x3d61000/0x800, rscc 0x3de0000/0x10000, isense_cntl 0x3d8b000/0x2000, qdss_gfx 0x6900000/0x80000, rdpm_cx 0x634000/0x1000, rdpm_mx 0x636000/0x1000) and GIC_SPI 300; the GMU node is qcom,gmu@3d69000 with compatible = "qcom,gpu-gmu" and two windows (kgsl_gmu_reg 0x3d6a000/0x34000, kgsl_gmu_pdc_cfg 0xb290000/0x10000) with GIC_SPI 304 and 305 - neither compatible contains qcom,adreno, and RSCC is on the GPU node, as the a6xx layout requires Command:adb shell "dtc -I fs -O dts /proc/device-tree" > facts/live-dtb.dts; grep -n -A6 'qcom,gmu@3d69000 {' facts/live-dtb.dts. Revision:a8182d2e0fe29a8fbd78fae66a6b1818a5df205f.host: the binding inventory asserted: the seven a6xx GPU windows and two GMU windows with names and sizes, the four the authored tree exports, both a7xx needles refused for this board's GPU and GMU compatibles, the substring rule accepting the GPU SMMU's compatible block where an element-wise matcher refuses it, the GMU block one page smaller than a7xx, and the two generations' PDC bases 0xb280000 and 0xb290000 demonstrably not the same window Command:cc -std=c11 -Wall -Wextra -Werror -I package -o /tmp/gpu-binding-tests package/OdinGpuBinding.c package/OdinGpuBindingTests.c && /tmp/gpu-binding-tests. Revision:a9a2cbb43b89d672e2921e19721a6438b738b17f.
Network
planned
Hardware and dependencies
- Identify the network hardware, resources and existing component interfaces for this board.
Configuration
- Record the board.toml fields, DTS properties and defconfig values used for network.
Procedure
- Follow the network stage in the porting guide and record the actual commands.
Development findings
- The SKU question is settled from this unit's own applied device tree, not from a sibling board: the node is wlan: qcom,cnss-qca6490@b0000000 with compatible "qcom,cnss-qca6490" and bluetooth: bt_qca6490, so the combo chip is QCA6490 and wil6210 does not apply to this board.
- The same node gives the wiring the driver needs: reg smmu_iova_ipa 0xb0000000/0x10000 plus tcs_cmd 0xb2e5510/0x690, wlan-en-gpio 64, bt-en-gpio 65, sw-ctrl-gpio 153, qcom,wlan-rc-num 0 so the device sits behind PCIe RC0 (pcie0 at 0x1c00000), a dynamic ramdump region of 0x420000 and a vdd-wlan-aon supply.
- The recovery kernel log proves the reserved region is real on this board - cnss_wlan_region initialized as a shared-dma-pool - but the recovery build carries no cnss driver, so no PCIe binding and no firmware load were observed; that is still a running-OS measurement.
Completion criteria
- Scanning, association, address configuration and sustained receive/transmit traffic pass with the selected firmware.
Current limits
- Hardware inputs and implementation are pending for this example board.
Next action
- Pick the driver family for QCA6490 on this SoC, then list the firmware files the vendor image actually carries for it.
Evidence
Collect evidence using the next action.
Audio
planned
Hardware and dependencies
- Identify the audio hardware, resources and existing component interfaces for this board.
Configuration
- Record the board.toml fields, DTS properties and defconfig values used for audio.
Procedure
- Follow the audio stage in the porting guide and record the actual commands.
Development findings
- Collect the first audio observation, its cause when established, and the resulting implementation decision.
Completion criteria
- Each declared route carries the selected audio format through playback or capture and handles start/stop correctly.
Current limits
- Hardware inputs and implementation are pending for this example board.
Next action
- Inventory the required audio inputs before implementation.
Evidence
Collect evidence using the next action.
Power
host-verified
Hardware and dependencies
- Every rail each subsystem is fed from, with its voltage, load, enable GPIO, boot-on state and any parent supply, each quoted from the board device tree.
Configuration
- The rails stay described in the device tree as the vendor writes them; package/OdinPowerBoard.h is where the port keeps the ordering and the gates, because XNU has no regulator framework to read the DT phandles.
- dts/sm8350.dtsi's ufs node now carries the vcc/vccq/vccq-parent note next to the controller it feeds, so the dependency is visible where the controller is described.
- No regulator node is added to the board DTS: these are consumer properties of the Linux drivers, and exporting them into the ADT would describe a device the port does not have.
Procedure
- Read the supply properties out of the board and overlay dtsi files with line numbers.
- Transcribe them as a table, leaving a value at zero where the tree declares none instead of filling it in.
- Encode the parent-before-child rule and the three subsystem gates, and assert every row against the file it came from.
Development findings
- Storage: vcc = pm8350_l7 at 2504000..2950000 uV, 800000 uA; vccq = pm8350_l9, 900000 uA with no level declared on this board; and vccq's qcom,vccq-parent-supply = pm8350_s12 at 210000 uA (xiaomi-sm8350-common.dtsi:124-138). The parent is the part a port cannot see from the controller node, and enabling l9 without it powers an rail from a source that is not on.
- Display: dsi_panel_pwr_supply_k8 is an ordered list - vddio then vddd then avdd - with 1800000/1800000/3000000 uV, enable loads 60700/60700/10000 uA, disable loads 80/80/0 and a two-millisecond pre-off and post-on sleep on every entry (display/lahaina-sde-display-common.dtsi); the rails themselves are display_prim_vddi on tlmm 42, display_prim_vddd on tlmm 83, both regulator-boot-on, and L13C (odin-sm8350.dtsi:37-49, 412-414).
- Input: touch vdd = L2C with no level or load stated on this board, avdd = touch_avddsource_vreg, a fixed regulator on tlmm 132 at 3008000 uV, regulator-boot-on and regulator-always-on (odin-sm8350.dtsi:92-93, 81-85, 55-58).
- Because two of the fixed rails are boot-on, a warm handoff from vendor firmware has them already enabled; the state model starts from that instead of demanding GPIO writes that have happened, and the gates still refuse anything whose LDO is down.
- Two rails are deliberately recorded with zeros: vccq's level and L2C's level and load are not declared by this board, so the module carries them as undeclared and no consumer treats zero as a default.
Completion criteria
- Host: the rail table, the parent ordering and the three gates are asserted against the device tree rows they came from.
- Device: declared power controls and battery readings match observations; each claimed sleep/resume transition restores its dependent peripherals.
Current limits
- No PMIC access path yet: this layer describes which rails, in which order and with what loads, but the writes go through a driver that does not exist for SM8350 here.
- Battery, charger and gauge are not inventoried at all, and suspend/resume sequencing is untested, so the second half of this area stays open.
- The loads are the values the board declares, not measurements; a rail shared with a subsystem this port has not examined may carry more than these rows say.
Next action
- Wire opb_enable and the three gates into the firmware's PMIC sequencing before the first storage or display attempt, then inventory the battery and charger nodes.
Evidence
source: 331 lines read first-hand: 124-138 give the eUFS supplies including the vccq parent, 209-275 show the panel candidate nodes, 281-290 the odin overlay that selects k8 with bl_ctrl_dcs and the TE/reset GPIOssource: 733 lines read first-hand: 37-49 the two fixed panel regulators with their TLMM GPIOs and regulator-boot-on, 55-58 the 3008000 uV always-on touch avddsource, 81-93 the touch supply properties, 405-414 the panel supply-entry phandle and vddio/vddd/avddsource: 1022 lines, the dsi_panel_pwr_supply_k8 node transcribed entry by entry: order, voltages, enable and disable loads and the two-millisecond sleepshost: every row asserted against its citation, name lookups shown to be exact rather than prefix-matching, vccq refused before its parent with the parent named as the reason, an undeclared rail refused with the bit mask untouched, boot-on rails honoured on a warm start, a force-marked child still refused by the gate that re-checks the parent, and the panel sequence checked entry by entry including both sleeps Command:cc -std=c11 -Wall -Wextra -Werror -I package -o /tmp/power-tests package/OdinPowerBoard.c package/OdinPowerBoardTests.c && /tmp/power-tests. Revision:a8182d2e0fe29a8fbd78fae66a6b1818a5df205f.source: the recorded contradiction is closed: the family file enables wil6210 (xiaomi-sm8350-common.dtsi:204-206, with qcom,wireless-fw-name idt9412.bin just above it, a WiGig image), while the odin overlay disables its root port - &pcie1 and &pcie1_msi at lines 708-714 - so the WiGig node is dead on this unit and the working WLAN is the QCA6490 on pcie0
Image assembly
host-verified
Hardware and dependencies
- Identify the image assembly hardware, resources and existing component interfaces for this board.
Configuration
- Record the board.toml fields, DTS properties and defconfig values used for image assembly.
Procedure
- Follow the image assembly stage in the porting guide and record the actual commands.
Development findings
- Collect the first image assembly observation, its cause when established, and the resulting implementation decision.
Completion criteria
- Kernel and prelink succeed, payload contains all declared inputs, and the boot image matches the bootloader format and size limit.
Current limits
- Verified up to the build boundary only: no kernel, payload, firmware or boot image has been produced, because the device inputs above are still unmeasured and the firmware binaries are not extracted.
- The probe copy is where the check ran; the committed board still refuses release, deliberately.
Next action
- Inventory the required image assembly inputs before implementation.
Evidence
host: exit 0 through deps, preflight and patches; the same command on the committed board exits with the example-device refusal, which is the tooling saying REQUIRED_ inputs are still unmeasured Command:cp -R ../UniXNU-odin ../UniXNU-odin-probe; in the copy set board.example = false; cd ../UniXNU-odin-probe; bash scripts/package.sh --os ipados-17.7.11-21H461 --check. Revision:e66022542ef0bab3283bfa8e4f66d282412f9d23.
Diagnostics
planned
Hardware and dependencies
- Identify the diagnostics hardware, resources and existing component interfaces for this board.
Configuration
- Record the board.toml fields, DTS properties and defconfig values used for diagnostics.
Procedure
- Follow the diagnostics stage in the porting guide and record the actual commands.
Development findings
- The board's checks are commands, not narratives: sh package/run-tests.sh builds and runs the host programs (board-facts, touch-bus, fts-protocol, clocks, reservations, touch-report, ufs-transport, ufs-smmu and the rest) and every line ends all checks passed, and scripts/check-odin-firmware.py is the preflight gate that re-hashes every Binaries/odin module against manifest.json, resolves each INF named by DXE.inc and APRIORI.inc, compares Resources/Configs/odin.toml against the rows MemoryMapLib.c actually carries, and refuses the raw configs that belong to ConfigurationMapLib instead of the firmware volume.
- check-odin-firmware.py separates the two ways a firmware build can fail: exit 1 means a board file is wrong here, and exit 2 means a vendor input is missing on this machine. A green run therefore never implies the vendor bytes were verified, and the archive scripts say the same thing in words - download and extract print why they skipped rather than exiting silently on a path they did not take.
- A checker earns its place by finding something: scripts/check-odin-dsdt.py is a preflight entry and its rule that every ACPI window and interrupt must appear in this unit's own device tree caught two wrong SPI-to-ACPI conversions in the table's first draft (0x194 for 0x164 and 0x100 for 0xd0, where the rule is plus 32). It also refuses to be a gate on machines that cannot run it, since a review input that is absent is not a defect: without acpica or without facts/ it prints skipped and exits 0, and only --require, the form the preflight uses, turns an absent input into a failure. Which copy it reads is now a checked property rather than an assumption: with --uefi naming a real Mu-Silicium checkout the table lives at Silicium-ACPI/Platforms/Xiaomi/odin (that is what odin.dsc:95's odin/AcpiTables.inf resolves against), so the checker prefers the installed overlay over the authored uefi-odin/ACPI copy and a stale install fails the run.
- A check script must not depend on where it was invoked from. Every board script here used to take the device repository from Path(__file__).parents[1], which is right for a human running it in place and wrong for the build driver, which copies scripts/ into the build tree and runs them there - the first real firmware build proved it with FileNotFoundError on tree/proprietary-files.txt. All of them now read $UNIXNU_DEVICE, which firmware.py already exports, and fall back to __file__ only so that the documented standalone commands keep working.
- A kernel build that stops at a patch tells you where it stopped, not why, because the driver reverts the tree on failure and the next command sees a pristine checkout. The reproducible localizer is to replay the selected series one patch at a time in the scratch tree (git checkout -- . and git clean -fdq first, then git apply -p1 per entry, then git apply --check for the one that failed): it turned 'the iOS 17 series does not apply' into 'one hunk needs the XNU_SHENG_PMGR block, which no series in that profile creates' in a single pass. The firmware build has the same shape: the compiler error was 'no such file or directory: ENABLE_SECUREBOOT=', and the answer was in the failing module's cc_resp.txt, which showed '-D -D' where the modules that compile show '-D ENABLE_SECUREBOOT=0'.
Completion criteria
- Each claimed milestone has a reproducible command, a matching source/image revision and an accessible result.
Current limits
- Every check here runs on the host against this board's own artifacts. Nothing observes the device: the firmware and the boot image now exist as bytes, but no firmware has booted, so the runtime diagnostics - the framebuffer handover, the ADT the loader reads, the modem PIL regions still live at ExitBootServices - have no observations yet, and boot.json records hardware_tested = false.
Next action
- Run the built FD on unit 11b5d7c3 through fastboot boot, which writes nothing, and record the stage it reaches: SEC, the BDS menu, the framebuffer, and whether the loader publishes odin's DSDT; the host gate stays as it is until then.
Evidence
host: compiles with no errors over 11 exported hardware nodes Command:dtc -I dts -O dtb -i ../UniXNU-sm8350-common/dts -o /tmp/odin.dtb dts/odin.dts. Revision:a8182d2e0fe29a8fbd78fae66a6b1818a5df205f.host: ADT generated at 16708 bytes with arm-io base 0x1000000 size 0x17000000 Command:python3 scripts/make-adt.py --dtb /tmp/odin-all2.dtb --os-profile profiles/os/ipados-17.7.11-21H461/profile.toml --board ../UniXNU-odin/board.toml --output /tmp/odin-all2.adt. Revision:a8182d2e0fe29a8fbd78fae66a6b1818a5df205f.host: 13 structured areas checked Command:python3 scripts/porting-record.py check --device ../UniXNU-odin. Revision:a8182d2e0fe29a8fbd78fae66a6b1818a5df205f.host: the board-facts suite grew panel timing and DSC assertions taken from the device rather than from a sibling board's source tree, and still passes as thirteen suites Command:sh package/run-tests.sh. Revision:97c410c65a47737e01541f5f7f58a3fc16b4f05c.host: the suite is what caught the transcription on its own terms: given the byte counts 44,1,2,1 it expects CX at 46080 words and config at 48128, and it keeps a separate case for the same fixture read as one 32-bit field, which gives 0x0102012C and a different base Command:cc -std=c11 -Wall -Wextra -Werror -I package -o /tmp/fts-protocol-tests package/FtsProtocol.c package/FtsProtocolTests.c && /tmp/fts-protocol-tests. Revision:c6a5a54c5e9920d0ffb9d3207b680ad880420799.host: all checks passed with exit 0 against the generated tree: 94 modules and 51 raw files re-hashed from manifest.json, 99 INF references resolved, odin.toml matched against the MemoryMapLib rows it claims to come from Command:UNIXNU_UEFI=../uefi-odin python3 scripts/check-odin-firmware.py; echo $?. Revision:8cd72da0ad99f6b21217a4e8536233e1eb17027d.host: the same command in both forms, as the board needs them: with the tree and acpica present it reports 16 devices, 18 windows and 5 interrupts verified and exits 0, and it is the run that failed the first draft on two interrupt conversions before the table was committed Command:python3 scripts/check-odin-dsdt.py --require; python3 scripts/check-odin-dsdt.py. Revision:388d27768e571cc61b3d4bf939098fc4752be3b1.host: run from the build tree rather than the device repository, this is the form that used to fail: the traceback pointed at tree/proprietary-files.txt, which is why the root moved to $UNIXNU_DEVICE. With that in place all six preflight entries exit 0 from inside the tree, and build-odin-dtb.py writes build/odin/odin.dtb (6955 bytes) where [bootimg] dtb points, naming the feed directory it resolved by pin Command:cd UniXNU/out/odin/ipados-17.7.11-21H461/odin/tree && UNIXNU_DEVICE=/Users/zhouzhou/Documents/Qoder/2026-10-13/f2fb76e0/UniXNU-odin UNIXNU_UEFI=/Users/zhouzhou/Documents/Qoder/2026-10-13/f2fb76e0/Mu-Silicium PATH=$TMPDIR/pybin:$PATH python3 scripts/build-odin-dtb.py 2>&1 || true # then the same six entries through ./unixnu firmware. Revision:98744370b3ccf66fb367fe6ce4f817e9f54e5df9.host: the lock is rewritten by the fetch, not by hand: sm8350 resolves to 7fffe977373f39ed0d06e9fd4fbf56688704c7e1, the commit carrying the three-cluster CPU block, and the nine other pins are unchanged - which is also the run that shows HTTPS is unavailable on this network and the SSH rewrite is what resolves it Command:GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0='[email protected]:.insteadOf' GIT_CONFIG_VALUE_0='https://github.com/' ./unixnu fetch -D ../UniXNU-odin. Revision:98744370b3ccf66fb367fe6ce4f817e9f54e5df9.