Tools for extracting hardware information from ACPI-booted systems and converting it to Device Tree Source (DTS) files for mainline Linux kernel development.
These tools solve a common problem in ARM64 Linux development: creating Device Tree files for new boards when ACPI tables are available but DTS is not.
Workflow:
- Boot the board in ACPI mode (UEFI default)
- Extract hardware information using
extract-hw-info.sh - Convert ACPI data to DTS using
acpi-to-dts.sh - Review and refine the generated DTS
| Script | Purpose |
|---|---|
extract-hw-info.sh |
Extracts hardware info from running system (ACPI or DT mode) |
acpi-to-dts.sh |
Converts ACPI extraction to Device Tree Source |
# 1. Install dependencies
sudo apt install -y pciutils usbutils i2c-tools ethtool gpiod \
nvme-cli dmidecode device-tree-compiler acpica-tools
# 2. Boot in ACPI mode and extract hardware info
sudo ./extract-hw-info.sh /tmp/hw-extract
# 3. Generate DTS from extraction
./acpi-to-dts.sh /tmp/hw-extract /tmp/board.dts
# 4. Review the generated DTS
less /tmp/board.dtssudo apt install -y \
pciutils \
usbutils \
i2c-tools \
ethtool \
gpiod \
nvme-cli \
dmidecode \
device-tree-compiler \
acpica-tools| Package | Tools | Purpose |
|---|---|---|
| pciutils | lspci | PCI device enumeration |
| usbutils | lsusb | USB device enumeration |
| i2c-tools | i2cdetect | I2C bus scanning |
| ethtool | ethtool | Network PHY details |
| gpiod | gpioinfo | GPIO pin information |
| nvme-cli | nvme | NVMe device details |
| dmidecode | dmidecode | SMBIOS/DMI tables |
| device-tree-compiler | dtc | Device tree tools |
| acpica-tools | iasl | ACPI table decompilation |
Extracts comprehensive hardware information from a running system.
sudo ./extract-hw-info.sh [output_directory]| File | Contents |
|---|---|
| 00-summary.txt | Quick overview |
| 01-system-info.txt | CPU, kernel, DMI/SMBIOS |
| 02-pci-devices.txt | PCI topology |
| 03-usb-devices.txt | USB controllers and devices |
| 04-network.txt | Network interfaces, PHYs |
| 05-gpio.txt | GPIO controllers and pins |
| 06-i2c.txt | I2C buses and detected devices |
| 07-spi.txt | SPI controllers |
| 08-storage.txt | NVMe, block devices |
| 09-display.txt | DRM cards, connectors |
| 10-interrupts.txt | IRQ mappings |
| 11-clocks.txt | Clock tree |
| 12-regulators.txt | Power regulators |
| 13-thermal.txt | Thermal zones |
| 14-firmware.txt | Boot mode, EFI vars |
| 15-platform-devices.txt | Platform device bindings |
| 16-modules.txt | Loaded kernel modules |
| dmesg.txt | Kernel ring buffer |
| acpi/ | ACPI tables (ACPI mode) |
| devicetree/ | Extracted DTS (DT mode) |
Parses ACPI DSDT and generates a Device Tree Source file.
./acpi-to-dts.sh <extraction_dir> [output.dts]- Parses ACPI DSDT for device definitions
- Extracts register addresses, sizes, and interrupts
- Maps 60+ CIX ACPI HIDs to DT compatible strings
- Generates proper GIC SPI interrupt numbers
- Includes detected I2C devices from extraction
| ACPI HID | DT Compatible | Device Type |
|---|---|---|
| CIXH200B | cdns,i2c-r1p14 | I2C Controller |
| ARMH0011 | arm,pl011 | UART |
| CIXH1003 | cix,sky1-gpio | GPIO |
| CIXH2020 | cix,sky1-pcie | PCIe |
| CIXH5010 | cix,sky1-dwc3 | USB |
| CIXH502F | cix,linlon-dp | DisplayPort |
| CIXH4000 | arm,mali-valhall-csf | GPU |
| ... | ... | ... |
| Aspect | ACPI Mode | Device Tree Mode |
|---|---|---|
| ACPI tables | Extracted & decompiled | Skipped |
| Device tree | Skipped | Extracted via dtc |
| Other info | Full extraction | Full extraction |
For DTS development, ACPI mode is preferred - it shows what UEFI firmware detects without depending on a potentially broken device tree.
If your O6N fails to boot with existing DTS:
- Boot in ACPI mode (remove
acpi=offfrom kernel cmdline) - Run extraction:
sudo ./extract-hw-info.sh /tmp/hw-extract-o6n
- Generate DTS:
./acpi-to-dts.sh /tmp/hw-extract-o6n /tmp/o6n.dts
- Compare with O6:
diff -r /tmp/hw-extract-o6/ /tmp/hw-extract-o6n/
| Feature | O6 (CD8180) | O6N (CD8160) |
|---|---|---|
| Form factor | Mini-ITX (170x170mm) | Nano-ITX (120x120mm) |
| Ethernet | Dual 5GbE | Dual 2.5GbE |
| USB-C | 2x with USB-PD | 1x with DP |
| PCIe x16 | Yes (Gen4 x8) | No |
| M.2 4G modem | No | Yes (B Key) |
| UFS | No | Yes |
| eDP | Yes | No |
| Power | ATX 24-pin / USB-C PD | 12V DC barrel |
See examples/ directory for sample outputs:
generated-o6-from-acpi.dts- DTS generated from O6 ACPI extraction
| Issue | Solution |
|---|---|
| Script hangs on I2C | Built-in 3s timeout handles this |
| Clock info empty | Run with sudo for debugfs access |
| DT extraction fails | Install device-tree-compiler |
| DSDT.dsl missing | Install acpica-tools, rerun in ACPI mode |
| Interrupt numbers wrong | Check GIC SPI offset (subtract 32 from ACPI IRQ) |
MIT License - See individual script headers for details.
- Run extraction on your board
- Test acpi-to-dts.sh output
- Add missing ACPI HID mappings
- Submit pull requests with board-specific fixes