Skip to content

arm64: dts: apple: t6041-j575c: describe the boot NOR and its NVRAM - #2851

Merged
RyanTheTide merged 1 commit into
aurora-silicon:integration/aurorafrom
7robertodantas:j575c-nvram
Nov 23, 2026
Merged

RyanTheTide merged 1 commit into
aurora-silicon:integration/aurorafrom
7robertodantas:j575c-nvram

Conversation

@7robertodantas

@7robertodantas 7robertodantas commented Nov 22, 2026 •

Copy link
Copy Markdown

Summary

The J575c leaves the QSPI controller disabled and describes no flash, so there is no MTD partition labelled nvram
and asahi-nvram / asahi-bless have nothing to open.

This copies the J614c/J616c boot NOR description (#1458) to the J575c: the always-on supply, the jedec,spi-nor
flash at 10 MHz single-lane, the nvram partition and its alias, and ps_qspi.

DT only. On the current integration tree the J575c NVRAM stays read-only: spi-apple-qspi refuses every program or
erase (NVRAM denied: reason=layout) because the J575c has no apple_qspi_boards[] row. Writes come with #2817,
which admits them by the DT partition and the probed part instead of a board table.

The values come from the J575c ADT (macOS 27.0.1 and 27.2.1, same in both), as posted on #1498
(issuecomment-7064323735):

ADT node Value DT
/arm-io/qspi qspi,qspimc, 0x229118000, IRQ 1573 t604x.dtsi qspi (spi@429118000), unchanged
/arm-io/qspi/spinor/anvram 0x700000, 0x100000 nvram: partition@700000
/arm-io/qspi/spinor/firmware, syscfg 0x20000/0x350000, 0x680000/0x684000 not described, as on the J614c/J616c

Testing (Mac Studio, M4 Max, J575c)

Kernel from integration/aurora f5fae3c; one-shot trial Stage 2 with the DTB built from f5fae3c plus this commit
(same tree as d75593a; CHECK_DTBS clean).

  • Read: spi0.0 JEDEC ef6517 (spi-nor-generic); 1 fixed-partitions partitions found on MTD device spi0.0,
    0x000000700000-0x000000800000 : "nvram"; /proc/mtd mtd3: 00100000 00001000 "nvram";
    asahi-nvram -d /dev/mtd3ro read lists the store (39 variables); asahi-bless --get-boot / -l report the Aurora
    volume and list macOS and Aurora.

  • Regressions: 0 failed units, 0 AppArmor denials (Arch, no SELinux), no new kernel warnings compared with the same
    kernel on the installed device tree.

  • Writes on this DT: with read_only=N, asahi-bless --set-boot-macos is refused,
    NVRAM denied: reason=layout opcode=06; nvram unchanged.

  • Write round trip, not part of this PR: the same kernel with only spi-apple-qspi.ko rebuilt with a J575c
    apple_qspi_boards[] row (W25Q64 ef6517, bp_ok 0; it was the second commit here, dropped in review in favour of
    spi: apple-qspi: admit NVRAM writes by the DT partition and the part #2817). read_only=N, back to Y after each write; nvram backed up first:

    step result
    asahi-bless --set-boot-macos rc 0; only system:boot-volume changed
    reboot macOS boots
    boot picker -> Linux, asahi-bless --set-boot "Aurora Alarm" rc 0; only system:boot-volume changed
    reboot Aurora boots
  • make ARCH=arm64 CHECK_DTBS=y apple/t6041-j575c.dtb (dtschema from pip): no warnings (J614c/J616c too);
    checkpatch clean.

Not done: the optional read-only firmware partition (kept the same as the J614c/J616c), moving the block into
t604x-j575-j773.dtsi (needs a J773s boot), and writes through #2817 on the J575c (I can run that row once #2817
is ready for it).

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown

Review at c6b729c.

Thanks, this looks right to me. It is the same description as the J614c/J616c (#1458) and the J773s, and the offsets match the ADT you posted on #1498.

  1. Safety: only nvram (0x700000+0x100000) is described. With CONFIG_MTD_PARTITIONED_MASTER off, the iBoot/syscfg range below it never becomes an MTD device, so nothing under 0x700000 can be written. Good. If you want parity with the J614s/J616s (t604x-j614-j616.dtsi:331-339), you could add a firmware partition <0x0 0x700000> with read-only; after nvram so the nvram index stays put. That one is optional.
  2. t6041-j575c.dts:2020-2066: the J575c and J773s already share t604x-j575-j773.dtsi, and t6040-j773s.dts:216-242 carries the same &qspi/&ps_qspi block (without vcc-supply). As a follow-up, the block could move into the shared dtsi once, which would also give the J773s the supply. It doesn't need to block this PR, but a J773s boot plus an nvram read would be needed when it moves.
  3. Rows: please add (a) a J575c boot on a DTB built from this head, not the patched 7.3.0-1-40 DTB, with the same /proc/mtd and asahi-nvram read checks, and (b) one write round trip, since the partition is writable and that is the path asahi-bless uses: asahi-bless --set-boot to macOS, then reboot and confirm macOS comes up, then set it back to Aurora and reboot again. Do it with a recovery path at hand (a second Mac for DFU). If you'd rather leave writes for later, please say so in the PR.
  4. Nit: the extra top-level / { } at t6041-j575c.dts:2020 only holds the regulator. It could go in the existing root node near line 36, next to the new alias.

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adversarial pre-PR checklist review (§1–§6) at c6b729cecddcb70e1eaad181112a04a07f8c21ee (REQUEST_CHANGES).

Checklist Summary

  • §1 (No model gating): Pass — pure board devicetree addition in arch/arm64/boot/dts/apple/t6041-j575c.dts.
  • §2 (Production-ready / default cmdline): Pass — works on default kernel command line.
  • §3 (Safety — Boot NOR / NVRAM): Pass — verified against the J575c ADT (macOS 27.0.1 / 27.2.1, #1498 comment):
    • /arm-io/qspi (0x229118000 + arm-io 0x200000000 = 0x429118000, IRQ 1573) matches t604x.dtsi:2008 (qspi: spi@429118000).
    • /arm-io/qspi/spinor/anvram (0x700000, 0x100000) matches nvram: partition@700000.
    • Only the nvram partition is exposed; iBoot firmware (0x20000..) and syscfg (0x680000..) are not described, and CONFIG_MTD_PARTITIONED_MASTER is unset in arch/arm64/configs/defconfig, so regions below 0x700000 are not exposed as writable MTD devices.
    • 10 MHz single-lane (spi-rx-bus-width = <1>, spi-tx-bus-width = <1>) and always-on nor_flash_vcc regulator match t6041-j614c-j616c.dtsi:2696-2744 (#1458).
  • §4 (Clean-room & attribution): Pass — single commit (c6b729cecddc) carries human author/committer and human Signed-off-by: only; PR body includes Assisted-by:.
  • §5 (Evidence): Blocked — see Blockers below. Both CI checks (dt-checks, host-tests) are green.
  • §6 (Naming): Pass — references existing userspace CLI tool names (asahi-nvram, asahi-bless) and in-tree DTS conventions.

Blockers

  1. §5 (Evidence) — Boot test was not run on a DTB built from this PR head (c6b729ce):
    • The J575c test booted a patched 7.3.0-1-40 DTB rather than a DTB built from c6b729ce on integration/aurora, and does not report the regression checks (0 SELinux denials, 0 new kernel errors in addition to 0 failed units).
    • Please boot J575c with the DTB built from c6b729ce (or the updated head) and report /proc/mtd, asahi-nvram read, asahi-bless --get-boot/-l, and the regression counts.
  2. §5 (Evidence) — Writable nvram partition has no write verification:
    • The partition is exposed read-write (no read-only; property), which is the path asahi-bless --set-boot / asahi-nvram write use, yet writes were explicitly not tested.
    • Aligning with Ryan's review point #3: please run one safe write round-trip (asahi-bless --set-boot to macOS -> reboot to macOS -> set back to Aurora -> reboot) with a DFU recovery Mac on hand, or explicitly mark the partition read-only; / state in the PR if writes are intentionally deferred.

Non-blocking Nits

  • t6041-j575c.dts:2020: nor_flash_vcc adds a second top-level / { ... }; block instead of sitting inside the existing root node near line 23.
  • Follow-up: consider consolidating the &qspi / &ps_qspi / nor_flash_vcc block into t604x-j575-j773.dtsi (as noted by Ryan) once validated on J773s as well.

Assisted-by: LLM (Gemini 4 Neon)

The J575c leaves the QSPI controller disabled and describes no flash,
so no MTD partition is labelled "nvram" and asahi-nvram and asahi-bless
have nothing to open.

Describe the boot NOR as the J614c/J616c do: the always-on supply, the
jedec,spi-nor flash at 10 MHz single-lane, the nvram partition and its
alias, and the QSPI power state. The J575c's ADT (macOS 27.0.1 and
27.2.1) has the same controller and layout: /arm-io/qspi is
"qspi,qspimc" at 0x229118000 with IRQ 1573 (the t604x.dtsi qspi node),
and /arm-io/qspi/spinor/anvram is 0x700000, 0x100000.

Tested on a J575c with a device tree built from this commit: the
flash probes (JEDEC ef6517, spi-nor-generic), the "nvram" partition
appears as a 1 MiB MTD device, asahi-nvram reads it through the
read-only node and asahi-bless reports the boot target.

Signed-off-by: Roberto Dantas <7robertodantas@gmail.com>
@7robertodantas

Copy link
Copy Markdown
Author

Thanks both. Updated (head e40efd7, rebased on f5fae3c):

  1. Regulator moved into the existing root node next to the alias; the extra / { } is gone.
  2. Boot on a DTB built from this head, kernel from the same f5fae3c: /proc/mtd has nvram, asahi-nvram read
    lists the store, asahi-bless --get-boot / -l work; 0 failed units, 0 AppArmor denials (Arch, no SELinux), no new
    kernel warnings compared with the same kernel on the installed device tree.
  3. Writes: the first try was refused by the driver, not the flash: NVRAM denied: reason=layout opcode=06. The
    J575c had no row in apple_qspi_boards (on T6041 only the J616s). The second commit adds it, beside the J616s
    (W25Q64 ef6517, bp_ok 0). With read_only=N: asahi-bless --set-boot-macos, then macOS booted; then the boot
    picker back to Linux, asahi-bless --set-boot back to the Aurora volume, then Aurora booted. Each write changed only
    system:boot-volume. Details in the PR body.
  4. Not done: the optional read-only firmware partition (kept the same as the J614c/J616c), and moving the block into
    t604x-j575-j773.dtsi, which needs a J773s boot I can't do.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown

Re-review at e40efd7 (first pass was at c6b729c).

Earlier points: the regulator is now in the root node (t6041-j575c.dts:46-54), and the rest of the DT block is unchanged from c6b729c. The rows I asked for are in: a boot on a DTB from this head, and the full write round trip, including the refusal without the table row. The firmware partition and the move into t604x-j575-j773.dtsi are fine to leave, as you said.

I checked the window against your live ADT dump on #1498. The boot ranges (firmware up to 0x680000, syscfg up to 0x6a4000) all end below the partition, and nvram [0x700000, 0x800000) is exactly anvram. It ends at the end of the 8 MiB W25Q64. The IPSW DeviceTree agrees on the controller (0x229118000, IRQ 1573). In the driver, the DT partition has to equal the row (spi-apple-qspi.c:1034-1041), each program or erase has to fall inside it (:878-884), the JEDEC ID is checked before every write enable (:737-744), and any block-protect bit refuses the write with bp_ok 0. Nothing here can reach a boot range.

Two small things:

Looks good to me.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown

e40efd7 merges without conflicts on integration/aurora daa9e2d. The DT commit is needed either way. The second commit adds a J575c row to apple_qspi_boards[], which #2817 removes in favour of the DT partition and the probed flash part; if #2817 lands first, that commit can be dropped and the J575c is admitted through the part table. @7robertodantas could you confirm in the Testing section that the write rows ran on f5fae3c plus both commits of this branch?

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adversarial pre-PR checklist (§1–§6) re-review at e40efd7325135a4b82b9c59fdc04e162ecca7281 (dt-checks: success, host-tests: success).

Verdict: APPROVE — all prior blockers from c6b729ce are resolved, both CI checks are green, and the J575c exact-head read, negative-control write refusal, full macOS/Aurora write round-trip, and regression counts are verified.

Checklist Verification (§1–§6)

  • §1 (No model gating): Pass. Commit 1 (d75593af3d3b) is a pure board devicetree description (arch/arm64/boot/dts/apple/t6041-j575c.dts). Commit 2 (e40efd732513) adds the J575c row to the existing apple_qspi_boards[] allowlist in drivers/spi/spi-apple-qspi.c; this is unavoidable on current integration/aurora while draft PR #2817 (DT-partition + probed-part admission) has not yet landed, and the commit message clearly explains why the row is required.
  • §2 (Production-ready / default cmdline): Pass — boot NOR discovery and NVRAM reads work on the default command line; writes retain the existing deliberate root runtime read_only=N opt-in. nor_flash_vcc is cleanly placed inside the existing root node (t6041-j575c.dts:20-24).
  • §3 (Safety — Boot NOR / NVRAM): Pass — verified against the live J575c ADT (macOS 27.0.1 and 27.2.1):
    • /arm-io/qspi (0x229118000 + 0x200000000 = 0x429118000, IRQ 1573) matches t604x.dtsi and the apple_qspi_boards[] aperture.
    • /arm-io/qspi/spinor/anvram (0x700000, 0x100000) matches nvram: partition@700000; boot firmware (0x20000..0x680000) and syscfg (0x680000..0x6a4000) remain unexposed with CONFIG_MTD_PARTITIONED_MASTER disabled.
    • apple_qspi_probe() (spi-apple-qspi.c:1035-1042) requires exact DT partition equality, and apple_qspi_nvram_modify() (spi-apple-qspi.c:726-745) verifies live JEDEC ID ef6517 (W25Q64) and SR1/SR2/SR3 against bp_ok == 0 before any real WREN goes on the wire.
  • §4 (Clean-room & attribution): Pass — both commits (d75593af3d3b, e40efd732513) carry human author/committer (Roberto Dantas <7robertodantas@gmail.com>) and human Signed-off-by: only, with zero AI trailers in commits.
  • §5 (Evidence): Pass — dt-checks and host-tests are green on e40efd73, CHECK_DTBS=y and checkpatch are clean, and J575c (M4 Max) hardware testing verified:
    • DTB + kernel built from f5fae3cbb (exact parent of d75593af) + this branch: spi0.0 JEDEC ef6517, mtd3 0x700000..0x800000 "nvram", asahi-nvram read (39 variables), asahi-bless --get-boot/-l.
    • Negative control without commit 2 refused cleanly (NVRAM denied: reason=layout opcode=06, NVRAM unchanged).
    • Full write round-trip with read_only=N: asahi-bless --set-boot-macos -> macOS boot -> boot picker -> Linux -> asahi-bless --set-boot "Aurora Alarm" -> Aurora boot, changing only system:boot-volume.
    • Regression counts: 0 failed units, 0 AppArmor denials (Arch), 0 new kernel warnings.
  • §6 (Naming): Pass.

Non-blocking Notes

  • Please clarify in the PR Testing section (as @RyanTheTide noted) that the write round-trip kernel was built from f5fae3cbb plus both commits of this branch (e40efd73).
  • Merge coordination: if #2817 lands before this PR, commit 2 (e40efd73) can be dropped cleanly and J575c will be admitted via #2817's DT+part path.

Assisted-by: LLM (Gemini 4 Neon)

@RyanTheTide

Copy link
Copy Markdown

Review at e40efd7: one blocker (commit 2), the DT commit is fine.

  • d75593a (DT): no blockers. The boot NOR, nvram partition and supply match the ADT, and dt-checks are green. Without a driver row, the J575c NVRAM stays read-only, which is the safe default.
  • e40efd7 (apple_qspi_boards[] row): this adds a board-keyed entry ("apple,j575c" plus a hardcoded write window and part ID) to a per-board table. Our standing rules don't allow new board gates or per-model protection tables when DT can carry the data, and here it can: the DT partition and the probed JEDEC ID already describe the window. spi: apple-qspi: admit NVRAM writes by the DT partition and the part #2817 removes the table for exactly this reason, but it is still a draft.

Could you split it, so this PR keeps the DT commit only (no rebase needed, a revert commit or a fresh branch both work)? The J575c then gets writes through #2817's partition and part checks once that lands, with no row to delete afterwards. As soon as the head is DT-only, the train merges it on Dj's approval.

Assisted-by: LLM (Claude:Opus 5.5)

@7robertodantas

Copy link
Copy Markdown
Author

Thanks. Split as asked: the head is now d75593a, the DT commit alone (the same commit you both reviewed; the branch
was reset to it, nothing rebased). The apple_qspi_boards[] row is gone from this PR and I won't send it separately,
so there is nothing to drop whichever of this and #2817 lands first. On this head the J575c NVRAM is read-only
(reason=layout) until #2817.

On the kernel question: the write rows ran on f5fae3c with only spi-apple-qspi.ko rebuilt with the row; the
Testing section now says so and marks them as outside this PR.

I can run the J575c through #2817 (window [0x700000, 0x800000), W25Q64 ef6517) when it is ready for test rows.

Assisted-by: LLM (Claude:Opus 5.5)

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formal §1–§6 pre-PR checklist re-review at d75593af3d3b3ad200b1c4389b4d2fe890471d83 (dt-checks: success, host-tests: success).

Verdict: APPROVE — cleanly split to the DT-only commit (d75593af3d3b), removing the apple_qspi_boards[] per-board table entry in favor of #2817, with green CI and exact-head J575c hardware verification.

Checklist Verification (§1–§6)

  • §1 (No model gating): Pass — pure board devicetree addition in arch/arm64/boot/dts/apple/t6041-j575c.dts (+46/-0). Dropping the apple_qspi_boards[] row eliminates board gating; NVRAM writes will come generically via #2817's DT-partition + probed-part admission.
  • §2 (Production-ready / default cmdline): Pass — works on the default kernel command line with no extra parameters or hacks; nor_flash_vcc sits cleanly inside the existing root node (t6041-j575c.dts:20-24).
  • §3 (Safety — Boot NOR / NVRAM): Pass — verified against the live J575c ADT (macOS 27.0.1 and 27.2.1):
    • /arm-io/qspi (0x229118000 + 0x200000000 = 0x429118000, IRQ 1573) matches t604x.dtsi qspi; /arm-io/qspi/spinor/anvram (0x700000, 0x100000) matches nvram: partition@700000.
    • Boot firmware (0x20000..0x680000) and syscfg (0x680000..0x6a4000) remain unexposed (CONFIG_MTD_PARTITIONED_MASTER is unset).
    • On current integration/aurora, spi-apple-qspi fails closed on writes (NVRAM denied: reason=layout opcode=06), leaving J575c NVRAM safely read-only until #2817 lands.
  • §4 (Clean-room & attribution): Pass — single commit d75593af3d3b carries human author/committer (Roberto Dantas <7robertodantas@gmail.com>) and human Signed-off-by: only (zero AI trailers in commits); PR body includes Assisted-by:.
  • §5 (Evidence): Pass — dt-checks and host-tests are green on d75593af3d3b, CHECK_DTBS=y and checkpatch are clean, and J575c (M4 Max) hardware testing on f5fae3cbb + this exact commit confirmed:
    • spi0.0 JEDEC ef6517, mtd3 0x000000700000-0x000000800000 "nvram", asahi-nvram -d /dev/mtd3ro read (39 variables), asahi-bless --get-boot / -l.
    • Negative control (read_only=N) refused cleanly (NVRAM denied: reason=layout opcode=06, NVRAM unchanged).
    • Regression counts: 0 failed units, 0 AppArmor denials (Arch, no SELinux), 0 new kernel warnings vs baseline.
    • Separate out-of-PR write round-trip test also confirmed the partition offset/size works end-to-end.
  • §6 (Naming): Pass.

Ready for MERGETRAIN-LINUX4.

Assisted-by: LLM (Gemini 4 Neon)

@RyanTheTide
RyanTheTide merged commit 3cd5e0b into aurora-silicon:integration/aurora Nov 23, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants