Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@

## Unreleased

- Breaking: the overlays and the opt-in file move with omarchy-mac-boot's
overlay contract (omacom/omarchy-mac-pkgs#3, the port of
omacom/omarchy-mac#677). Overlays install to
`/usr/lib/omarchy-mac-boot/dtb-overlays`, the directory omarchy-mac-boot
ships for package-owned overlays, and its pacman hook now watches
`usr/lib/omarchy-mac-boot/dtb-overlays/*/*.dtbo`. They were
`/usr/share/omarchy-platform/dtb-overlays`. A package upgrade moves the
files. A hand install in either old directory (`packaging/build-dtbo /`;
`usr/lib/omarchy-platform/dtb-overlays` and
`usr/share/omarchy-platform/dtb-overlays` both refuse) must
move: while `.dtbo` files are in an old directory, `omarchy-ane-dt apply`
refuses, keeps the current copies, and names the steps. The opt-in file
moves with them: `/etc/omarchy-platform/dtb-overlays.opt-in` is now
`/etc/omarchy-mac-boot/dtb-overlays.opt-in`. Re-add your opt-in lines to
the new file; nothing reads the old one. On Arch Linux ARM
installs without omarchy-mac-boot the package creates the overlay
directory, and apply, `update-m1n1-dtbs` and the two
`90-omarchy-ane-dt` hooks stay.
- H15 (M3) opt-in experimental bring-up module: `ane/h15/` (4 soc
rows, four-stage module, host ADT self test), three experimental
overlays, three data-only overlays (`packaging/dt/`), and
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Linux driver for the Apple Neural Engine (ANE) in M1 and M2 Macs. It ships DRM k
- unsupported: no driver binds this ANE.
- data-only: no driver binds this ANE, but the repo keeps cited data for it in `data/ane-soc/` ([docs/ane-soc-data.md](docs/ane-soc-data.md)). No opt-in key applies its overlay. `omarchy-ane-check` prints `DATA-ONLY SoC` for it.

To opt in, append the key as one line to `/etc/omarchy-platform/dtb-overlays.opt-in`, then:
To opt in, append the key as one line to `/etc/omarchy-mac-boot/dtb-overlays.opt-in`, then:

```sh
sudo omarchy-ane-dt apply
Expand Down Expand Up @@ -59,7 +59,7 @@ In-tree rows. Each row records `driver_source`. It is `intree` when the kernel's

Two jobs of `.github/workflows/promotion.yml` make the `aurora-dt` change. The `aurora-plan` job builds the chip's board device trees from aurora-silicon/linux `aurora-wip` with `tools/aurora_dt.py`, which finds each disabled node that the ANE node uses. It removes the chip's `APPLE_ANE_UNTESTED` define when the tree has one (T6000, T6020 and T8103 at #155). Otherwise it adds `status = "okay"` for each of those nodes. This job runs code from the aurora tree, so it holds no credential. The `aurora-pr` job runs on a new runner and builds nothing. It checks that `aurora-wip` is still at the commit the plan used. It reads the file at that commit from GitHub, makes the change again, and stops before any write if the result differs from the plan. Then it commits the change to the joshuaswarren/aurorasilicon-linux fork, opens or updates a PR to aurora-silicon/linux, and comments on #155 for the in-tree tester once per PR. Only that last step gets the repository secret `AURORA_PR_TOKEN`. The token needs three permissions and no others: push to the fork, open a PR on aurora-silicon/linux, and comment there. A classic token with the `public_repo` scope can do this. Without the secret, and on a `dry_run` or `synthetic` dispatch, the step runs with `DRY_RUN=1` and only prints the diff, the PR text and the comment. When no board of the chip has an ANE node in `aurora-wip`, which is true until #155 merges, the plan prints a `SKIPPED` line and the run stays green: the aurora PR can be made only after the in-tree driver lands in that branch, and the overlay PR is not affected.

To submit a judged row for an untested chip, install `omarchy-ane-dkms` and add that chip's opt-in key from the table above to `/etc/omarchy-platform/dtb-overlays.opt-in`. For T6022 and T8112, run `sudo omarchy-ane-firmware-fetch` first. Then run `sudo omarchy-ane-dt apply` and reboot. From an omarchy-mlx checkout, run `python3 scripts/collect_deep.py --ane-smoke --submit`. The collector runs the smoke when the chip is idle (load < 0.5, PSI 0); no fixed uptime is required. Rows without an installed driver or smoke attempt are not judged. On a kernel that ships the ANE driver, `omarchy-ane-check` says: userspace + smoke + firmware fetch only; do not install omarchy-ane-dkms. Build the userspace from source (below) instead.
To submit a judged row for an untested chip, install `omarchy-ane-dkms` and add that chip's opt-in key from the table above to `/etc/omarchy-mac-boot/dtb-overlays.opt-in`. For T6022 and T8112, run `sudo omarchy-ane-firmware-fetch` first. Then run `sudo omarchy-ane-dt apply` and reboot. From an omarchy-mlx checkout, run `python3 scripts/collect_deep.py --ane-smoke --submit`. The collector runs the smoke when the chip is idle (load < 0.5, PSI 0); no fixed uptime is required. Rows without an installed driver or smoke attempt are not judged. On a kernel that ships the ANE driver, `omarchy-ane-check` says: userspace + smoke + firmware fetch only; do not install omarchy-ane-dkms. Build the userspace from source (below) instead.

## Install

Expand All @@ -68,11 +68,11 @@ To submit a judged row for an untested chip, install `omarchy-ane-dkms` and add
Install `omarchy-ane-dkms` (`sudo pacman -S omarchy-ane-dkms`), or pick the Install menu's "MLX + Core ML (Apple Silicon)" row. The row installs it with the rest of the MLX stack. The package:

- builds `ane.ko` (M1 family) and `ane_t6021.ko` (M2 family) with DKMS for every kernel that has headers. It rebuilds them after each kernel update. Install the headers for the kernel you run (`linux-aurora-headers`, `linux-asahi-headers`). A kernel that ships the ANE driver itself (`CONFIG_DRM_ACCEL_ANE`, aurora-silicon/linux #155) keeps its own modules: DKMS skips that kernel.
- installs the device-tree overlays to `/usr/share/omarchy-platform/dtb-overlays` and re-applies them after every kernel update (pacman hook `90-omarchy-ane-dt.hook`).
- installs the device-tree overlays to `/usr/lib/omarchy-mac-boot/dtb-overlays` and re-applies them after every kernel update (pacman hook `90-omarchy-ane-dt.hook`).
- fetches the ANE firmware at install and upgrade on the M2 Max (pacman hook `90-omarchy-ane-firmware.hook`).
- ships the tools: `omarchy-ane-check`, `omarchy-ane-dt`, `omarchy-ane-firmware-fetch`, `omarchy-ane-probe` (a read-only JSON report of the ANE state, [docs/ane-probe.md](docs/ane-probe.md)), `omarchy-ane-smoke`, and `omarchy-ane-run` (the `tools/ane-run` program runner).

On M1, M1 Max and M2 Max the package does the rest, once omarchy-mac-boot can apply device tree overlays. That support is [omacom/omarchy-mac#677](https://github.com/omacom/omarchy-mac/pull/677), which is not merged yet. With an older omarchy-mac-boot, `omarchy-ane-dt` refuses, and the ANE node is absent unless the kernel's own device tree has it. With the support in place, the overlay applies at install and the driver binds at boot. The package adds no udev rule: systemd's default rule makes `/dev/accel/*` mode `0666`, so every user can open the ANE node.
On M1, M1 Max and M2 Max the package does the rest, once omarchy-mac-boot can apply device tree overlays. That support is [omacom/omarchy-mac-pkgs#3](https://github.com/omacom/omarchy-mac-pkgs/pull/3), the port of [omacom/omarchy-mac#677](https://github.com/omacom/omarchy-mac/pull/677), which is not merged yet. omarchy-mac-boot ships the overlay directory empty, and this package drops its overlays into it. With an older omarchy-mac-boot, `omarchy-ane-dt` refuses, and the ANE node is absent unless the kernel's own device tree has it. With the support in place, the overlay applies at install and the driver binds at boot. The package adds no udev rule: systemd's default rule makes `/dev/accel/*` mode `0666`, so every user can open the ANE node.

### Arch Linux ARM (asahi-alarm)

Expand Down
2 changes: 1 addition & 1 deletion ane/h15/README-bringup.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ installed by the package; the first M3 owner:
2. Copy the `dtbo` into the overlay directory with owner-only
permissions.
3. Add the line `ane-h15-experimental` to
`/etc/omarchy-platform/dtb-overlays.opt-in`.
`/etc/omarchy-mac-boot/dtb-overlays.opt-in`.
4. Reboot.

T6034 boards (j514m, j516m) use the t6031 ADT nodes — a t6034
Expand Down
2 changes: 1 addition & 1 deletion ane/h15/t8122-ane-experimental.dts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* it is not a row of packaging/dt/overlays and omarchy-ane-dt never
* applies it. The first owner of an M3 Linux box compiles it and
* copies it into the overlay directory by hand, with the opt-in key
* ane-h15-experimental in /etc/omarchy-platform/dtb-overlays.opt-in.
* ane-h15-experimental in /etc/omarchy-mac-boot/dtb-overlays.opt-in.
*
* Source: receipts/2026-10-03-ane-h15/README.md (b0 table). ADT 27.0
* 26A428:
Expand Down
2 changes: 1 addition & 1 deletion ane/h16/README-bringup.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ The first M4 owner:
(or take the compiled dtbo from the receipt),
2. copy it into the overlay directory with owner-only permissions,
3. add the line `ane-h16-experimental` to
`/etc/omarchy-platform/dtb-overlays.opt-in`,
`/etc/omarchy-mac-boot/dtb-overlays.opt-in`,
4. reboot.

T6040/T6041 have no board device tree in aurora yet; this overlay is
Expand Down
2 changes: 1 addition & 1 deletion ane/h16/t8132-ane-experimental.dts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* a row of packaging/dt/overlays and omarchy-ane-dt never applies it.
* The first owner of an M4 Linux box compiles it and copies it into the
* overlay directory by hand, with the opt-in key ane-h16-experimental
* in /etc/omarchy-platform/dtb-overlays.opt-in. See ane/h16/README-bringup.
* in /etc/omarchy-mac-boot/dtb-overlays.opt-in. See ane/h16/README-bringup.
*
* Sources (receipts/2026-10-03-ane-h16): ADT j604ap (27.0 26A428):
* ane reg engine 0x500000000+0x2000000, pmgr 0x380700000+0x18000 with
Expand Down
2 changes: 1 addition & 1 deletion docs/ane-soc-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ A data-only SoC is a chip that no omarchy-ane driver binds, but whose ANE data t
## What the package does

- `packaging/build-dtbo` installs each data file as `/usr/share/omarchy-ane/soc/SOC.json`. It compiles each `SOC-ane-dataonly.dts` as a check and installs none: omarchy-mac-boot applies every overlay in the overlay directory. It refuses an overlay without the root marker, a manifest row whose overlay has the marker, and a data file for a SoC that has an installed overlay.
- `omarchy-ane-dt apply` never applies an overlay with `omarchy,data-only`, even when its opt-in key is in `/etc/omarchy-platform/dtb-overlays.opt-in`. `omarchy-ane-dt status` adds the line `data-only (no driver): SOC` when the installed data file for this SoC says data-only.
- `omarchy-ane-dt apply` never applies an overlay with `omarchy,data-only`, even when its opt-in key is in `/etc/omarchy-mac-boot/dtb-overlays.opt-in`. `omarchy-ane-dt status` adds the line `data-only (no driver): SOC` when the installed data file for this SoC says data-only.
- `omarchy-ane-check` prints `DATA-ONLY SoC: SOC (no driver yet)` in place of `UNTESTED SoC: SOC` for such a SoC, and fails: no driver binds it.

## Checks
Expand Down
4 changes: 2 additions & 2 deletions docs/h15-volunteer.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ git clone https://github.com/joshuaswarren/omarchy-ane
cd omarchy-ane/ane/h15
dtc -@ -I dts -O dtb -o ane-h15-t8122.dtbo t8122-ane-experimental.dts
sudo install -D -m 600 ane-h15-t8122.dtbo \
/usr/share/omarchy-platform/dtb-overlays/t8122/ane-h15-t8122.dtbo
echo ane-h15-experimental | sudo tee -a /etc/omarchy-platform/dtb-overlays.opt-in
/usr/lib/omarchy-mac-boot/dtb-overlays/t8122/ane-h15-t8122.dtbo
echo ane-h15-experimental | sudo tee -a /etc/omarchy-mac-boot/dtb-overlays.opt-in
sudo omarchy-ane-dt apply && sudo omarchy-ane-dt status
```

Expand Down
5 changes: 3 additions & 2 deletions packaging/90-omarchy-ane-dt.hook
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# Before 95-m1n1-install.hook (asahi-scripts), so the update-m1n1 it runs after
# a kernel update reads the overlaid board device tree. The second Target is
# OVERLAY_DIR of omarchy-ane-dt.
# OVERLAY_DIR of omarchy-ane-dt, with the glob of omarchy-mac-boot's
# 95-omarchy-mac-dtb-overlays.hook.
[Trigger]
Type = Path
Operation = Install
Operation = Upgrade
Operation = Remove
Target = usr/lib/modules/*/dtbs/*
Target = usr/share/omarchy-platform/dtb-overlays/*
Target = usr/lib/omarchy-mac-boot/dtb-overlays/*/*.dtbo

[Action]
Description = Adding the ANE node to the board device tree...
Expand Down
2 changes: 1 addition & 1 deletion packaging/dt/overlays
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# the constant in packaging/omarchy-ane-dt). PREFIX selects the board device
# trees by file name. STATE: enabled applies by default; opt-in applies only
# after the owner opts in (the overlay's "omarchy,opt-in" string, listed in
# /etc/omarchy-platform/dtb-overlays.opt-in); disabled is not installed.
# /etc/omarchy-mac-boot/dtb-overlays.opt-in); disabled is not installed.
# Tested SoCs are enabled (T8103, T6001, T6021, T6000, T6020). Untested SoCs are opt-in.
# SoCs that no driver binds are disabled. The SoC table is in README.md,
# "Chip coverage".
Expand Down
2 changes: 1 addition & 1 deletion packaging/dt/t6002-ane.dts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0+ OR MIT
/*
* Overlay state: opt-in ("ane-t6002" in /etc/omarchy-platform/dtb-overlays.opt-in).
* Overlay state: opt-in ("ane-t6002" in /etc/omarchy-mac-boot/dtb-overlays.opt-in).
* ANE for T6002 (M1 Ultra) board device trees: the die-0 ANE only.
*
* Die 0 is the T6001 die (t600x-ane.dtsi): the macOS 13.5 ADT of j375d has
Expand Down
2 changes: 1 addition & 1 deletion packaging/dt/t6021-uboot-serial-stdin.dts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*
* U-Boot console input for T6021 (M2 Max) disk boots: serial only. OPT-IN:
* installed, but it applies only when "uboot-serial-stdin-t6021" is a line of
* /etc/omarchy-platform/dtb-overlays.opt-in. It is a workaround, not an ANE
* /etc/omarchy-mac-boot/dtb-overlays.opt-in. It is a workaround, not an ANE
* part.
*
* Problem, seen on one M2 Max laptop (receipts/2026-10-01-t6021-disk-boot):
Expand Down
2 changes: 1 addition & 1 deletion packaging/dt/t6022-ane.dts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0+ OR MIT
/*
* Overlay state: opt-in ("ane-t6022" in /etc/omarchy-platform/dtb-overlays.opt-in).
* Overlay state: opt-in ("ane-t6022" in /etc/omarchy-mac-boot/dtb-overlays.opt-in).
* ANE for T6022 (M2 Ultra) board device trees: the die-0 ANE only. Die 0 has
* the T6021 values
* (t602x-ane.dtsi, same in the macOS 13.5 ADTs of j180d and j475d), and the
Expand Down
2 changes: 1 addition & 1 deletion packaging/dt/t8112-ane.dts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0+ OR MIT
/*
* Overlay state: opt-in ("ane-t8112" in /etc/omarchy-platform/dtb-overlays.opt-in).
* Overlay state: opt-in ("ane-t8112" in /etc/omarchy-mac-boot/dtb-overlays.opt-in).
* ANE for T8112 (M2) board device trees, for ane_t6021 (apple,t8112-ane).
*
* Values and sources (receipts/2026-10-01-t8112-ane, the table, and
Expand Down
4 changes: 2 additions & 2 deletions packaging/omarchy-ane-check
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ case $soc in
[[ $mod == ane_t6021 ]] && steps+=("sudo omarchy-ane-firmware-fetch")
steps+=("boot a kernel whose own device tree enables the $soc ANE node")
else
echo "UNTESTED SoC: $soc. $mod has not run on it. Its overlay applies only when ane-$soc is a line of /etc/omarchy-platform/dtb-overlays.opt-in."
steps+=("echo ane-$soc | sudo tee -a /etc/omarchy-platform/dtb-overlays.opt-in")
echo "UNTESTED SoC: $soc. $mod has not run on it. Its overlay applies only when ane-$soc is a line of /etc/omarchy-mac-boot/dtb-overlays.opt-in."
steps+=("echo ane-$soc | sudo tee -a /etc/omarchy-mac-boot/dtb-overlays.opt-in")
[[ $mod == ane_t6021 ]] && steps+=("sudo omarchy-ane-firmware-fetch")
steps+=("sudo omarchy-ane-dt apply" "sudo update-m1n1" "sudo reboot")
fi
Expand Down
37 changes: 21 additions & 16 deletions packaging/omarchy-ane-dt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ or "ok") with one of them: the kernel's node wins. A disabled node does not
count: the overlay applies, and its nodes of the same name replace the kernel
node's properties and enable it. When no overlay is left, apply retires the copy.
An overlay whose root has the string "omarchy,opt-in" applies only when that
string is a line of /etc/omarchy-platform/dtb-overlays.opt-in, which the owner
string is a line of /etc/omarchy-mac-boot/dtb-overlays.opt-in, which the owner
writes (the untested T6002, T6022 and T8112 nodes: "ane-t6002", "ane-t6022" and "ane-t8112"; the T6021 U-Boot input: "uboot-serial-stdin-t6021").
An overlay whose root has "omarchy,data-only" carries SoC data for a chip that
no driver binds: apply never applies it, whatever the opt-in file says. status
Expand Down Expand Up @@ -54,21 +54,25 @@ import sys
import tempfile
from pathlib import Path

# Where the package installs its overlays: the directory that
# omacom/omarchy-mac#677 (dtb-overlays.sh) applies on Omarchy Macs.
# packaging/build-dtbo reads this line, and 90-omarchy-ane-dt.hook's second
# Target names the same directory (tools/test_ane_dt.py checks both). Arch
# Where the package installs its overlays: the directory omarchy-mac-boot
# ships for package-owned overlays and its dtb-overlays.sh applies (omacom/
# omarchy-mac-pkgs#3, the port of omacom/omarchy-mac#677). packaging/build-dtbo
# reads this line, and 90-omarchy-ane-dt.hook's second Target names the same
# directory (tools/test_ane_dt.py checks both). Arch
# Linux ARM installs have no omarchy-mac-boot, so there apply,
# update-m1n1-dtbs and the hooks stay.
OVERLAY_DIR = "usr/share/omarchy-platform/dtb-overlays"
# The directory before 2026-10-01. apply refuses while it has overlays, so a
# hand install there (the lab M2) keeps its copies until it moves them.
# Remove with its check in apply when no install uses it.
OLD_OVERLAY_DIR = "usr/lib/omarchy-platform/dtb-overlays"
OVERLAY_DIR = "usr/lib/omarchy-mac-boot/dtb-overlays"
# The directories before 2026-10-04: usr/lib/omarchy-platform (until
# 2026-10-01) and usr/share/omarchy-platform (the omacom/omarchy-mac#677
# location). apply refuses while either has overlays, so a hand install there
# (the lab M2) keeps its copies until it moves them. Remove with its check in
# apply when no install uses them.
OLD_OVERLAY_DIRS = ("usr/lib/omarchy-platform/dtb-overlays",
"usr/share/omarchy-platform/dtb-overlays")
FRAGMENT = "/usr/lib/omarchy-ane/update-m1n1-dtbs"
LINE = f"[ -r {FRAGMENT} ] && . {FRAGMENT} # omarchy-ane"
ANE = re.compile(r"apple,t[0-9a-z]+-ane")
OPT_IN = "etc/omarchy-platform/dtb-overlays.opt-in"
OPT_IN = "etc/omarchy-mac-boot/dtb-overlays.opt-in"
CONFIG = "etc/default/update-m1n1"
DTBS = re.compile(r"\s*(?:export\s+)?DTBS=(.*)")
# The community collector's field (omarchy-mlx scripts/collect_deep.py), also
Expand Down Expand Up @@ -322,11 +326,12 @@ def apply(root, hook_targets):
raise Refuse("this omarchy-mac-boot refuses a changed device tree (omarchy update's boot check) and has "
"no overlay support (omacom/omarchy-mac#677); the ANE node must come from the kernel or an "
"omarchy-mac-boot with that support")
old = glob.glob(str(root / OLD_OVERLAY_DIR / "*/*.dtbo"))
if old:
raise Refuse(f"overlays are in the old directory /{OLD_OVERLAY_DIR} ({len(old)} files). Install them in "
f"/{OVERLAY_DIR} (the omarchy-ane package, or packaging/build-dtbo /), remove "
f"/{OLD_OVERLAY_DIR}, then run apply again. The current copies stay until then")
for old_dir in OLD_OVERLAY_DIRS:
old = glob.glob(str(root / old_dir / "*/*.dtbo"))
if old:
raise Refuse(f"overlays are in the old directory /{old_dir} ({len(old)} files). Install them in "
f"/{OVERLAY_DIR} (the omarchy-ane package, or packaging/build-dtbo /), remove "
f"/{old_dir}, then run apply again. The current copies stay until then")
name = board(root)
overlays = overlays_for(root, name)
state_root = root / "var/lib/omarchy-ane/dtbs"
Expand Down
Loading
Loading