Mainline arm64 review culture will not look at your board until it has a device tree, and the vendor firmware on a new SoC ships ACPI tables instead, which means the very first problem of any bring-up is not a driver or a clock tree but a translation: somewhere between the machine that boots and the tree mainline wants sits a gap that people historically crossed by hand, reading register maps out of leaked PDFs and guessing at interrupt numbers until something probed. That guesswork is where bring-up projects go to die, because a hand-written DTS with one wrong IRQ or one missing power domain produces a board that hangs silently at probe time, and you cannot tell a wrong guess from a missing driver when the symptom is nothing at all.

The CIX Sky1 work we wrote up in the bring-up diary hung every one of its 41 patches off device tree nodes, and none of those nodes were guessed, because before any kernel patching started we spent half a day writing two scripts, extract-hw-info.sh and acpi-to-dts.sh, that boot the board exactly as the vendor shipped it, pull the hardware description out of the running system, and convert it into a starting DTS you refine by hand from there. The tooling lives in the sky1-linux repo under acpi-to-dts-tools, MIT licensed, and it is deliberately boring: two bash scripts, no build step, no daemon, nothing to version beyond the scripts themselves.

The extraction half: interrogate the running system

The insight that makes the whole thing tractable is that the vendor’s ACPI-booted system already knows where everything lives, because the UEFI firmware enumerated the hardware, the DSDT describes the devices, and the stock BSP kernel booted successfully against all of it, so the hardware truth is sitting in /sys and /proc waiting to be asked politely. The extraction script is built around that, and its first design rule is that no single probe is allowed to ruin the run: each of its sixteen sections writes its own numbered file, 01-system-info.txt through 16-modules.txt, every potentially slow command runs under timeout with a ten-second default, and I2C bus scans get three seconds because a wedged bus will otherwise hang the script on a board you only have serial console access to.

sudo apt install -y pciutils usbutils i2c-tools ethtool gpiod \
    nvme-cli dmidecode device-tree-compiler acpica-tools

# Boot the board in its stock ACPI mode, then:
sudo ./extract-hw-info.sh /tmp/hw-extract

The output is a directory you can diff, which turns out to matter as much as the extraction itself. The ACPI branch copies the raw tables out of /sys/firmware/acpi/tables and decompiles the DSDT with iasl, the script grabs the PCI topology, USB devices, network PHY details, GPIO controllers, clock tree, regulators, thermal zones, IRQ mappings, and the kernel ring buffer into separate files, and when we brought up the O6N alongside the O6 the workflow was not “figure out the O6N,” it was diff -r hw-extract-o6/ hw-extract-o6n/ and read the differences, which is how the dual 2.5GbE versus dual 5GbE distinction and the missing PCIe x16 slot stopped being mysteries and started being lines in a diff. If the machine happens to boot in device tree mode the script handles that too, pulling the live tree out with dtc, but the README is blunt about preferring ACPI mode for DTS work: it shows what the firmware detected without depending on a device tree that might already be broken.

The translation half: sixty-one HIDs and an interrupt offset

The converter is the larger script, about 62 kilobytes of bash, and its core is a lookup problem wrapped in a parser: it reads the decompiled DSDT, walks the device definitions, and maps each ACPI hardware ID to a device tree compatible string through an associative array carrying sixty-one CIX-specific entries, so CIXH200B becomes cdns,i2c-r1p14, ARMH0011 becomes arm,pl011, CIXH4000 becomes arm,mali-valhall-csf for the GPU, and so on down the list of GPIO, PCIe, USB, and display blocks. Around that table it keeps per-device associative arrays for clocks, resets, pinctrl groups, GPIO lines from GpioIo descriptors, and parent-child nesting, because a device tree node is never just a compatible string, it is the whole web of phandles pointing at the clock controller and the reset line and the pin group that make the node probe successfully.

./acpi-to-dts.sh /tmp/hw-extract /tmp/board.dts
less /tmp/board.dts

The detail that earns the script its keep is interrupt translation, because ACPI and the GIC do not number interrupts the same way: an ACPI IRQ resource counts from zero while a GIC SPI starts at 32, so the converter subtracts 32 on the way through, and getting that wrong in a hand-written tree is exactly the class of mistake that produces a device whose driver loads, whose probe runs, and whose interrupt never fires, a failure mode with no log line in the world. The converter also merges in the I2C devices the extraction actually detected on each bus, so the generated tree describes the board as it booted rather than the board as the DSDT imagines it, and it emits CPU topology out of the ACPI PPTT table, four Cortex-A720 performance cores beside eight Cortex-A520 efficiency cores, with the compatible line, the serial aliases, and the chosen stdout path already filled in.

What comes out, and what still takes weeks

Both generated trees are checked into the repo as examples, generated-o6-from-acpi.dts at 743 lines and generated-o6n-from-acpi.dts at 830, and they are checked in for the same reason the extraction directories are diffable: when you run the tools on your own board you should be able to compare your output against a known-good one and see immediately whether the difference is your hardware or your procedure. The generated file is honest about what it is, too, with a header comment that says manual review and adjustment is required, plus the preprocessing incantation for compiling it against the kernel’s dt-bindings headers, because a raw .dts is not a .dtb until cpp and dtc have had their say.

/ {
	model = "Radxa Orion O6";
	compatible = "radxa,orion-o6", "cix,sky1";
	interrupt-parent = <&gic>;

That honesty is the correct frame for the whole exercise, because the generated DTS is scaffolding, not a building; the weeks after generation are still spent refining nodes by hand, fixing the power domains the firmware describes badly, and discovering the register quirks that no table capture can tell you about, which in the Sky1’s case meant the SCMI performance-domain plumbing and the Panthor frequency policing that filled the middle chapters of the bring-up diary. What the tooling removes is the silent-hang phase, the stretch where the board gives you nothing because your tree is wrong in a way you cannot observe, and replacing “stare at a dead board” with “edit a text file that mostly boots” is the difference between a bring-up that stalls and one that accretes patches.

The honest tradeoff is that this workflow is a starting-gun, not a finish line, and a generated tree that boots is still months from a tree mainline would accept, but the alternative is the one we lived through in the 2000s with x86 bring-ups, where you hand-wrote everything from a datasheet and hoped, and the modern equivalent of that hope is a bash script that asks the firmware what it already knows. Half a day of tooling, sixty-one HID mappings, and one interrupt offset, and the rest of the project becomes ordinary kernel work, which is exactly what good scaffolding is for.