Device configurationDraft
OpenBoot has to know which Mac it is running on, because a few facts are not in the device tree that iBoot hands over, and a few workarounds belong to one board only. Those facts live in device descriptors: small TOML files that are turned into a table at build time. This page explains the model. The pages that follow give the schema, the quirk registry, a guide for adding a board, and the analysis tooling.
Which devices have a descriptor#
The Device List is generated from the descriptor files and lists every board that has one, with its tier. Each descriptor has a generated page, and Supported hardware says what works on each. A Mac without a descriptor is unsupported: OpenBoot may still start on it, but nothing about it has been checked.
One generation has descriptors today, the M5 series: one
board is supported and one descriptor is experimental, never seen on real
hardware and kept only so that the code paths for its chip id stay stable.
The other generations are listed on Supported hardware
as "no descriptor yet".
How a board is identified#
At start-up the firmware reads two numbers from the /chosen node of the
device tree: chip-id and board-id. It looks the pair up in the compiled
descriptor table. The match is exact on both numbers, and no two
descriptors may claim the same pair.
- A hit gives the descriptor, its tier and its quirk mask.
- A miss means the device is unknown. There is no descriptor, so the tier is "unknown" and the quirk mask is zero.
Hardware blocks do not depend on the descriptor. Drivers still bind to the
device tree by compatible; a descriptor never lists blocks that the
device tree already describes. It carries only what the tree does not say.
Support tiers#
| Tier | Meaning |
|---|---|
| supported | The project verified the descriptor on a real machine. |
| experimental | The generator accepts the descriptor. Nothing is promised about the board. |
| unknown | There is no descriptor. This is what a lookup miss means; it cannot be written in a file. |
What a descriptor holds#
A descriptor has up to four tables. The full list of keys is in the schema reference.
[device]: name, SoC, tier, and the chip and board ids that identify it.[layout]: a known-good early memory layout, used only if deriving the layout from the live device tree fails. The firmware says so on the console when it falls back.[cpu]: the CPU start-mask stride and the PSC register addresses.[quirks]: the names of board workarounds, from the quirk registry.
From file to firmware#
tools/devgen/devgen.py reads every descriptor and devices/quirks.toml,
validates them, and writes two files into the build directory:
devtable_data.c, the table, and quirk_ids.h, one bit macro per quirk.
Nothing is parsed from TOML at run time. A malformed descriptor fails the
build rather than the boot.
Where to go next#
- Descriptor schema: every key.
- Named quirks: the workaround registry and its rules.
- Adding a device: writing a descriptor, and sharing a sanitised device tree.
- Analysis mode: checking an unknown Mac's device tree against the drivers that exist, host side only for now.