Skip to content

spi: apple-qspi: admit the GD25UF64E, so the J775D's nvram partition can be written - #3099

Merged
DjDeveloperr merged 1 commit into
aurora-silicon:mainfrom
funkzy:pr/qspi-gd25uf64e
Nov 25, 2026
Merged

DjDeveloperr merged 1 commit into
aurora-silicon:mainfrom
funkzy:pr/qspi-gd25uf64e

Conversation

@funkzy

@funkzy funkzy commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

What: Add the GigaDevice GD25UF64E (c8 83 17, 8 MiB, bp_ok = 0) to apple_qspi_parts[], so the Mac Studio (M5 Ultra, J775D) boot NOR is admitted for NVRAM writes instead of refusing every write with reason=part.
Tested: J775D (Mac Studio, M5 Ultra) at 0cb67690b3f5 on bare main (bf03d7419ea8) under published Aura c0aaf3162ede on 27.2 firmware: probes nvram window [0x700000, 0x7c0000): 12 stores, writes in [0x700000, 0x7c0000), part c88317, aurora-bless --next writes, reads back, and clears cleanly with read_only=N (baseline refuses with reason=part and leaves NVRAM unchanged), 0 new kernel errors, 0 new failed units; KUnit spi_apple_qspi_policy_test 17/17 pass (85 suites, 438/442 pass, 0 fail, 4 skip); tools/asahi/qspi-nvram-tests.py passes all functional tests and all 26 mutation controls.
Risk: Two-way door · affects only machines carrying a c8 83 17 (GD25UF64E) boot NOR with a writable DT nvram partition (J775D; K114c keeps read-only on its nvram partition, so it gains no write path); writes remain gated behind read_only=N, SFDP density verification, NVRAM v3 bank-header qualification, and bp_ok = 0 status checks.
Not yet: J773g row on the same part once its board DTS lands; Linux VM host_tests_vm.sh summary pending final run at 0cb67690b3f5.

Details

Why this shape

  • Where the decision lived. Under spi: apple-qspi: admit NVRAM writes by the DT partition and the part #2817, apple_qspi_parts[] in drivers/spi/spi-apple-qspi-policy.h is the single table that lists which boot NOR parts may be written, along with each part's size and the block-protect status the part is expected to carry at boot.
  • Why not a board or chip exception. A J775D or T6050 check in the QSPI driver would bypass the part-keyed table and risk admitting an unverified NOR revision on the same SoC.
  • The one source used. One new apple_qspi_parts[] row keyed strictly by JEDEC ID { 0xc8, 0x83, 0x17 } (8 MiB, bp_ok = 0), matching the GD25UF64E's SFDP density (0x03ffffff) and status-register state on the J775D (SR1 = 0x00, SR2 = 0x02, SR3 = 0x20). The writable window [0x700000, 0x7c0000) (12 × 64 KiB banks) comes solely from the DT nvram partition Aura populates from ADT anvram, and apple_qspi_window_valid + apple_qspi_gd_status_allows_write enforce the same bounds and status checks used by every other admitted part.
  • What it gives on other boards. Boards with a different flash ID (W25Q64, Macronix, GD25UF16E) or with a read-only nvram partition (such as K114c) are unchanged. Any future board carrying the same c8 83 17 part (such as J773g) gets write support automatically without adding a board rule.

Change

Single commit on main (0cb67690b3f5):

  • drivers/spi/spi-apple-qspi-policy.h: add APPLE_QSPI_JEDEC_GD25UF64E { 0xc8, 0x83, 0x17 } (size = 0x800000, bp_ok = 0) to apple_qspi_parts[] and update the GigaDevice status comment to name both GD25UF16E and GD25UF64E.
  • drivers/spi/spi-apple-qspi-policy-test.c: add { 0xc8, 0x83, 0x17 } to qspi_policy_parts (plus near-neighbour unknown IDs { 0xc8, 0x83, 0x16 } and { 0xc8, 0x83, 0x18 }) and add J775D GD25UF64E status assertions (SR1=0x00, SR2=0x02, SR3=0x20, bp_ok=0 accepted; SR1=0x04 refused) in qspi_policy_gd_status and qspi_policy_part_status.
  • tools/asahi/qspi-nvram-tests.py: add GD25UF64E to the host test part table, add J775D 12-bank read/write, BP0 refusal, and first-write q.qualified = 0 SFDP + bank-header qualification cases, and add the j775d-gd-id mutation control.
Evidence

Testing

Own-base A/B row on J775D (Mac Studio, M5 Ultra): kit qspi-gd64-r3 (window qspi2501m3@20261124-1504) is bare main bf03d7419ea8 plus this commit (0cb67690b3f5, no other PRs carried), compared against baseline kit qspi-gd64-r3b (window qspi2501m3@20261124-1504), bare main bf03d7419ea8 alone. Both arms ran one-shot with a read-only root on the default J775D command line through the 27.2 stub under published Aura c0aaf3162ede.

Metric Baseline kit qspi-gd64-r3b PR kit qspi-gd64-r3
NVRAM probe / write gate NVRAM denied: reason=part on write nvram window [0x700000, 0x7c0000): 12 stores, writes in [0x700000, 0x7c0000), part c88317
read_only=N, aurora-bless --next --set-boot "Aura 27.0" refused (rc=1, ENODEV); next boot stayed Aura, partition sha256 unchanged (e38e6655878c0dc4) succeeded (rc=0), read back Aura 27.0, --clear-next restored Aura, default boot volume stayed Aura, read_only restored to Y
Failed systemd units 2 (iwd, systemd-networkd-persistent-storage) 2 (exact same 2)
New err-level kernel lines baseline (7) 0 new (7)
WARNING / BUG / Oops / panic 0 / 0 / 0 / 0 0 / 0 / 0 / 0
  • Extra evidence in an earlier window: kit qspi-gd64-r3 (window qspi2866r3@20261124-1455) on the 27.0 stub under the same published Aura c0aaf3162ede passed the same probe and aurora-bless --next write/readback/clear sequence with 0 new kernel errors.
  • KUnit (qspi-gd64-r3-kunit, CONFIG_KUNIT=y, CONFIG_SPI_APPLE_QSPI_KUNIT_TEST=y, CONFIG_DRM_ASAHI=y, kunit-vz with upstream aop_motion.rs disabled): 85 suites; 438/442 pass, 0 fail, 4 skip; spi_apple_qspi_policy_test 17/17 pass.
  • Host test (tools/asahi/qspi-nvram-tests.py, ASan + UBSan): all functional cases pass (including GD25UF64E J775D part qualify + BP0 refusal) and all 26 mutation controls pass (including j775d-gd-id).
  • ALARM has no SELinux, so there is no AVC count.

…can be written

The J775D (Mac Studio, M5 Ultra) boot NOR reads JEDEC ID c8 83 17, a
GigaDevice GD25UF64E (64 Mbit, 8 MiB), with no block protection left set
(SR1 0x00, SR2 0x02: QE only, SR3 0x20). Its nvram partition is the
ADT's anvram, 0xc0000 at 0x700000 (12 banks of 64 KiB), which ends
within the part. Add the part with its size and no tolerated BP bits.

The part-table checks in KUnit and in tools/asahi/qspi-nvram-tests.py
list it, and a host-test case runs the GigaDevice status checks with
the J775D's SR1/SR2/SR3 in its partition and refuses BP0.

Signed-off-by: Jeff Queisser <[email protected]>
@funkzy
funkzy requested review from a team and DjDeveloperr as code owners November 24, 2026 23:26
@github-actions github-actions Bot added area:gpu Area from CODEOWNERS (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Nov 24, 2026
@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Merge readiness at 0cb67690: not ready yet

Check Detail
CI at head ok 2 checks passed
Review no approved by satchlj, but GitHub does not count it yet (code owner from Core or Omarchy Mac needed, or approval went stale)
Requested changes ok none
Hardware row at head ok in the PR body at 0cb67690
Conflicts ok none
PR text ok Risk: two-way · affects only machines carrying a c8 83 17 (GD25UF64E) boot NOR with a writable DT nvram partition (J775D; K114c keeps read-only on its nvram partition, so it gains no write path); writes remain gated behind readonly=N, SFDP density verification, NVRAM v3 bank-header qualification, and bpok = 0 status checks.

Areas: area:gpu

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

@satchlj satchlj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Gemini 4 Neon on @satchlj's behalf

Verdict at 0cb67690b3f5

Approve. Admitting the GigaDevice GD25UF64E ({ 0xc8, 0x83, 0x17 }, 8 MiB, bp_ok = 0) into the apple-qspi policy table with matching KUnit and host mutation-test coverage is clean and conservative.

Blockers

None.

Checked

  • Diff audit (3 files, +47/-16):
    • drivers/spi/spi-apple-qspi-policy.h: verified APPLE_QSPI_JEDEC_GD25UF64E ({ 0xc8, 0x83, 0x17 }, size = 0x800000 within 3-byte addressing, bp_ok = 0) routes via APPLE_QSPI_MFR_GIGADEVICE (0xc8) to apple_qspi_gd_status_allows_write(sr1, sr2, bp_ok), which rejects WIP/WEL (sr1 & 0x03), all BP[4:0] (sr1 & 0x7c & ~0), and CMP/SUS1/SUS2 (sr2 & 0xc4) while tolerating J775D's observed SR1=0x00 SR2=0x02 SR3=0x20.
    • drivers/spi/spi-apple-qspi-policy-test.c & tools/asahi/qspi-nvram-tests.py: verified KUnit coverage and the new j775d-gd-id mutation control.
  • CI at 0cb67690b3f5: host-tests=SUCCESS, readiness=SUCCESS, pr-text=SUCCESS.
  • Posted hardware evidence: J775D (M5 Ultra) exact-head 0cb67690b3f5 PASS (aurora-bless --next write/readback/clear with read_only=N, baseline refusal control reason=part, KUnit 17/17, host suite + 26 mutation controls).
  • Untested scope: Static source + CI + posted-evidence review only (no kernel install/boot or NOR flash write run by this reviewer).
Evidence
  • Verified files: drivers/spi/spi-apple-qspi-policy.h, drivers/spi/spi-apple-qspi-policy-test.c, tools/asahi/qspi-nvram-tests.py.
  • CI: host-tests SUCCESS, readiness / readiness SUCCESS, pr-text / pr-text SUCCESS at 0cb67690b3f5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:gpu Area from CODEOWNERS (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants