Skip to content

Apple M6 (T8152) Mac mini boot NOR (QSPI): binding and device tree (on top of #191) - #193

Open
joshuaswarren wants to merge 12 commits into
omacom:integration/aurorafrom
joshuaswarren:m6-qspi
Open

joshuaswarren wants to merge 12 commits into
omacom:integration/aurorafrom
joshuaswarren:m6-qspi

Conversation

@joshuaswarren

@joshuaswarren joshuaswarren commented Oct 23, 2026 •

Copy link
Copy Markdown

Summary

Adds the boot NOR (QSPI) controller of the Apple M6 (T8152) Mac mini (J873): the binding accepts the T8152 compatible, and a new device tree fragment describes the controller, its NVRAM partition and its power chain. Two commits.

The first ten commits of this branch are #191 (the M6 base). Only the last two commits are new here: the diff of this PR shows the base too until #191 merges, then I rebase. Review the last two.

It is not needed for the release candidate, and there is no rush to review or merge it.

Commits

# Commit Notes
11 dt-bindings: spi: apple,qspi: Allow the T8152 compatible the compatible list is apple,t8152-qspi, apple,t8140-qspi; the driver needs no change, it keeps its NVRAM window through the apple,t8140-qspi entry
12 arm64: dts: apple: t8152-j873g: Add the boot NOR controller new t8152-j873-qspi.dtsi: spi@331118000, the nvram partition, the ps_sio / ps_spi_p / ps_qspi power chain, ps_sio marked always-on

Measured, on an M6 Mac mini

  • With this device tree, the driver binds and reads the NOR. The nvram partition is mtd0 at 0x24000, size 0xd0000.
  • Boot power state, read from the registers: ps_sio on, ps_spi_p and ps_qspi off. ps_sio is marked always-on in the fragment (it is on at boot); whether other devices sit behind it was not checked.

Not measured

  • A write to the NVRAM from Linux on this board.
  • The kernel's own make dtbs_check / dt_binding_check (a hand-run dt-validate of the board file gave 0 messages).
  • A boot of this exact branch. The boots ran on an older tree.
  • One boot with the fragment but without the QSPI driver, to see that nothing else changes.

Compile receipt

arm64 clang, W=1, integration/aurora at 42672ed plus the 12 commits of this branch: the eight objects of #191 and apple/t8152-j873g.dtb all rc 0 with 0 warnings. A separate cpp + dtc -@ build of the board file gave 0 warnings. check-commits: Signed-off-by on all 12 commits; no checkpatch errors (warnings: long lines, the MAINTAINERS notice).

@joshuaswarren

Copy link
Copy Markdown
Author

Compile receipt (arm64, clang, W=1, integration/aurora at 42672ed plus the 12 commits of this branch, defconfig, no debug info): the eight objects of #191 and apple/t8152-j873g.dtb all rc 0 with 0 warnings.

Not run: a link of the whole kernel, a boot of this branch, dt_binding_check, dtbs_check. The QSPI driver itself is unchanged by this PR.

@greptile-apps

greptile-apps Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge based on the reviewed code.

Summary

Adds T8152 boot NOR support through the existing QSPI driver.

  • T8152 USB ports start in the fixed role set by the board.
  • T8152 USB DARTs map DMA and share a hardware invalidation doorbell.
  • USB service slots and PMGR domains power up in the order their hardware needs.
  • The Apple NVMe driver uses the T8152 controller's register layout.
  • The T8152 board exposes its boot NOR and NVRAM partition.
  • The SART driver reads and writes the T8152 SARTv4 entries.

The earlier findings are addressed in the current code. No new actionable issue was established. This review did not run builds or hardware tests.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  S["ps_sio: always on"] --> P["ps_spi_p"]
  P --> Q["ps_qspi"]
  Q --> C["QSPI controller"]
  C --> N["Boot NOR"]
  N --> V["nvram: 0x24000 + 0xd0000"]
Loading

Reviews (8) · Last reviewed commit: "arm64: dts: apple: t8152-j873g: Add the ..." · Reviewed by Greptile

@joshuaswarren

Copy link
Copy Markdown
Author

Rebased on the fixed #191 head e27454a38c1a7d88a14a3ad242be2142f72b1184 (the two commits of this PR are unchanged; the first ten changed as listed on #191). Head 40ee5ac2224a5e423aaca136e5e366c1c97c5c8a; compile check on the new stack: arm64 clang W=1, the eight objects of #191 and t8152-j873g.dtb, all rc 0, 0 warnings.

Comment thread drivers/iommu/apple-dart.c Resolved
Comment thread drivers/usb/dwc3/dwc3-apple.c Resolved
@greptile-apps

greptile-apps Bot commented Oct 23, 2026

Copy link
Copy Markdown

Want your agent to iterate on Greptile's feedback? Try greploops.

@joshuaswarren

Copy link
Copy Markdown
Author

GREEN at 40ee5ac for the last two commits (QSPI binding, boot NOR dtsi). Read only: nothing built or booted by me, and no dt_binding_check or dtbs_check run.

Checked:

  • Binding: apple,t8152-qspi followed by the apple,t8140-qspi fallback, and the bare T8140 string, is the usual oneOf form; nothing else in the schema changes.
  • t8152-j873-qspi.dtsi is included by t8152-j873g.dts after t8152-j873-pmgr.dtsi, so &pmgr0 exists when the file adds its nodes; AIC_IRQ and IRQ_TYPE_LEVEL_HIGH come from the two headers the .dts already includes. The unit address spi@331118000 matches reg = <0x3 0x31118000 ...> and the comment's arithmetic (0x131118000 + 0x200000000). No domain at @840, @d40 or @1140 exists elsewhere in the series, so there is no duplicate node. The power-domain chain in the nodes (ps_qspi on ps_spi_p on ps_sio, only ps_sio always-on) matches the comment.

Non-blocking notes:

  • interrupt-parent = <&aic> repeats the root node's value.
  • The three PMGR nodes are the only ones added outside t8152-j873-pmgr.dtsi; moving them there would keep the domain list in one place.
  • The clock rate (200 MHz), spi-max-frequency (25 MHz), interrupt 1411 and the nvram partition offset and size come from the firmware tree and a hardware run, so I could not check them; the driver's write restriction to that partition is also unread by me.

@joshuaswarren

Copy link
Copy Markdown
Author

Review at 40ee5ac: findings (two commits: the binding and the boot NOR device tree)

Checked

  • Binding: oneOf of apple,t8140-qspi and the list apple,t8152-qspi, apple,t8140-qspi. The driver matches apple,t8140-qspi in its table and sets its NVRAM window with of_device_is_compatible(), so the fallback reaches the T8140 path without a driver change.
  • Device tree arithmetic: spi@331118000 and reg = <0x3 0x31118000 ...> agree, and 0x200000000 + 0x131118000 = 0x331118000 as the comment says. power-domains has one entry and clocks one, as the binding allows.
  • I built the board file by hand at this head (cpp, dtc -@, no warnings) and ran dt-validate (dtschema 2026.9) against the schemas of this tree. The spi@331118000 node, its flash@0 child and the clock node produce no message. The only messages on this commit's nodes are for the three apple,t8152-pmgr-pwrstate nodes, whose compatible has no binding (same gap as in Apple M6 (T8152) Mac mini base: PMGR, USB2, DART, NVMe, board fragments #191). The binding example validates.

Findings

  1. The comment in t8152-j873-qspi.dtsi and the commit message say spi_p and qspi are switched by the first runtime resume of the controller. spi-apple-qspi.c has no runtime PM call, so attaching the controller to its power domain powers the chain before probe. Change the text (the bot comment says the same).
  2. NOR write window. With the apple,t8140-qspi fallback the driver lets programs and erases through apple_qspi_window_exec_op() for any address inside the nvram partition of the device tree, here [0x24000, 0xf4000). The read_only module parameter is documented for T8122 and T8132 only, so nothing else gates it. The PR text says the partition was measured as mtd0 at 0x24000, size 0xd0000, but that is what this device tree declares; it does not show that the offsets match the NOR layout of this board, and a write is listed as not measured. Either state where the two numbers come from, or drop the partitions node for now: the driver then logs "no usable nvram partition" and keeps the NOR read-only.

Smaller

  • The PR text says check-commits shows a clean checkpatch on all 12 commits. On the two new commits checkpatch reports COMMIT_LOG_LONG_LINE (both), LONG_LINE_COMMENT on five comment lines of the new dtsi, and FILE_PATH_CHANGES (new file, no MAINTAINERS entry). No errors.

Not checked

No compile at this head (I did not reproduce the receipt), no boot, no read or write of the NOR, no dtbs_check run on the whole tree beyond the lines above. The first ten commits are #191 and are not reviewed here.

@joshuaswarren

Copy link
Copy Markdown
Author

Thanks. New head 041cfb1a3cb853affaf3c9872ca382795f786f14: the same two commits, rebased on the fixed #191 head c9d88a5d8fb390d8b61f5d2154f456aa81edfc78. Compile check on the new stack (arm64 clang W=1, the eight objects and t8152-j873g.dtb): rc 0, 0 warnings. I left the non-blocking notes (interrupt-parent, the PMGR nodes in the QSPI fragment) as they are for now. The clock rate, spi-max-frequency and the interrupt are from the firmware tree and a hardware run, as you say.

Comment thread drivers/usb/dwc3/dwc3-apple.c Resolved
@joshuaswarren

Copy link
Copy Markdown
Author

Review at 041cfb1: findings (two commits: the binding and the boot NOR device tree)

The head is a rebase of the two commits onto the fixed #191 head. I compared the PR diff with the one I reviewed at 40ee5ac2224a: the apple,qspi.yaml hunk and t8152-j873-qspi.dtsi are unchanged, and the findings of my earlier comment on this PR still apply.

Checked again

  • The binding hunk is the same oneOf, and the driver reaches its T8140 path through the apple,t8140-qspi fallback.
  • Against the schema of the new stack, the spi@331118000 node, its flash@0 child and the clock node raise no message (hand-run dt-validate, dtschema 2026.9). The three PMGR nodes of this fragment raise the missing-binding message for apple,t8152-pmgr-pwrstate, the same as in Apple M6 (T8152) Mac mini base: PMGR, USB2, DART, NVMe, board fragments #191.

Still open

  1. The comment in t8152-j873-qspi.dtsi and the commit message say spi_p and qspi are switched by the first runtime resume of the controller. spi-apple-qspi.c has no runtime PM call; attaching the controller to its power domain powers the chain before probe.
  2. NOR write window. With the apple,t8140-qspi fallback the driver lets programs and erases through for any address inside the nvram partition of the device tree, here [0x24000, 0xf4000), and the read_only parameter does not gate that path. The partition offset and size are what this node declares; the PR text does not say where they come from, and a write is listed as not measured. Either state the source of the two numbers, or drop the partitions node until a write is checked: the driver then logs "no usable nvram partition" and keeps the NOR read-only.

Not checked

No compile at this head, no boot, no NOR read or write. The first ten commits are #191.

The T8152 GPIO block has the same layout as the T8140 one. Match
"apple,t8152-pinctrl" with the T8140 hardware data.

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
T8152 has a SART with a new register layout: the per-entry config,
physical address and size registers sit at 0x00, 0x60 and 0xc0. Add the
operations for it and match "apple,t8152-sart". The binding lists the
new compatible as a stand-alone entry.

Measured on an M6 Mac mini with an earlier form of this change: the
machine boots and runs its root file system from NVMe, which uses this
SART. This version is compile-checked only.

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
On T8152 the queue setup registers (admin queue, IO queues, the linear
submission queue control) live at different offsets, and a few of them
accept writes but read back zero. Add a register translation for that
layout, skip the read-back checks that cannot work, and describe the
controller with a new hardware data block matched by
"apple,t8152-nvme-ans2".

The ANS is a virtual PMGR device on this SoC and has no reset line, so
the hardware data block carries a no_reset_control flag. Only T8152 skips
the reset lookup. Every other SoC still requires a reset control and
fails the probe without one, as before.

The binding gets the new compatible. On T8152 the resets, power-domains
and power-domain-names properties are not required, and the controller
has two register regions (the NVMMU registers live in the first one).

Measured on an M6 Mac mini with an earlier form of this change: the
machine boots and runs its root file system from NVMe. This version is
compile-checked only.

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
@joshuaswarren

Copy link
Copy Markdown
Author

v2 from the QSPI author, rebased on the fixed #191 head 9af182774f886303e4c85497549f64498551dd03: head 049e0bcab0faaa4a24ef493c22cb41e8d03f31ff, two commits. Per finding of the second review (issuecomment-6370488967):

  • Runtime-PM wording: fixed in the dtsi header and the commit message. The driver has no runtime PM call; attaching the controller to its power domain powers the chain before probe.
  • NOR write window: the partitions node stays, and the text now states what was checked: a read of the NOR through the controller at 0x24000 returns the boot variables from the first byte, and the last non-0xff byte is at offset 0xcff98 of the 0xd0000 window. The source of the two numbers is not claimed beyond that read. A write through this window was done twice on this board with an older tree and its driver (a boot-order change that the next boot used); it was not re-run on this base. If you prefer read-only until it is, the variant without the partitions node is one block in the dtsi, and the driver then logs "no usable nvram partition".

Compile check at this head, arm64 clang W=1: the eight objects of #191 and t8152-j873g.dtb, all rc 0, 0 warnings.

@joshuaswarren

Copy link
Copy Markdown
Author

GREEN at 049e0bc for the last two commits (QSPI v2). Read only: nothing built or booted by me. Against the version I GREENed at 40ee5ac: the binding commit is unchanged (the same diff); in t8152-j873-qspi.dtsi all nodes are unchanged (I compared the file with the comment lines removed) and only the header comment is new. The comment now says that a read of the NOR at offset 0x24000 returns the boot variables from the first byte and that the last used byte lies inside the 0xd0000 size, and that attaching the controller to its power domain powers the chain before the driver probes and the driver makes no runtime PM call of its own. I checked that those statements are consistent with the nodes (the controller has power-domains = <&ps_qspi> and the chain qspi, spi_p, sio is in the file); I did not check them on hardware. The t8152-j873g.dts change is the single #include after the PMGR include.

@joshuaswarren

Copy link
Copy Markdown
Author

GREEN at 049e0bc for the last two commits (QSPI binding and boot NOR device tree).

Compared with the head I reviewed (041cfb1a, and 40ee5ac2 before it): the binding commit is the same oneOf, and the dtsi differs only in text and two comment lines.

Checked

  • Runtime-PM wording: the dtsi header and the commit message now say that attaching the controller to its power domain powers the chain before probe and that the driver has no runtime PM call. That matches spi-apple-qspi.c.
  • NOR write window: the commit text now states what supports the offsets: a read of the NOR through the controller at 0x24000 returns the boot variables from the first byte, the last used byte lies inside the 0xd0000 window, and the fallback compatible lets the driver program and erase inside the window. I accept that as the source of the numbers; the PR text also says plainly that a write on this base was not repeated (two writes with an older tree are reported). The partitions node is what bounds a write, since the T8140 path has no opt-in, so it must stay in the node.
  • Against the schema of this stack (dtcheck.sh, dtschema 2026.9), dt-validate of t8152-j873g.dts at this head: rc 0, 0 lines. The apple,qspi binding example validates.
  • The apple,t8140-qspi fallback must stay in the compatible list: of_device_is_compatible() in the driver probe reads it to set the NVRAM window.

Not checked

No compile at this head (I did not reproduce the receipt), no boot, no NOR read or write. The first ten commits are #191.

@joshuaswarren

Copy link
Copy Markdown
Author

Summary for a maintainer, at head 049e0bcab0faaa4a24ef493c22cb41e8d03f31ff:

@joshuaswarren

Copy link
Copy Markdown
Author

New head 2a359693ac0b5e504fb3233a79a72b214d141a45 (rebased on the same base as the other M6 PRs, plus the fixes for the Greptile and reviewer findings; every Greptile thread of the previous heads has a reply with the commit and is resolved).

Receipts at this head (CT-local, arm64 clang W=1, 16K pages, PCIE_APPLE=m, USB4_APPLE_SOC=m): the eight objects of #191 and t8152-j873g.dtb, rc 0, 0 warnings. dtcheck.sh (dtschema 2026.9) on the board file: dtc -@ 0 warning lines, dt-validate 0 lines, the binding examples print only the baseline message of display/apple,dcp-typec-routes.yaml. Changes since the last GREEN: a failing phy_init() or phy_power_on() in dwc3_apple_core_start() now goes through dwc3_apple_core_stop(); the PSD parents (ps_atcN_usb_aon, ps_atcN_usb); iommus exactly four; the host-only lists skipped for a fixed peripheral; the Gen3 doorbell guarded for non-arm64 builds; a locked Gen3 DART no longer takes the range flush through TLB_CMD; the PSD group power-off restores the stopped slots. Not run: a boot, the kernel's own make dtbs_check.

@joshuaswarren

Copy link
Copy Markdown
Author

GREEN at 2a35969

Read: the twelve commits against the ones I reviewed at 049e0bc, compared per commit as diffs with the hash lines removed. The two commits of this PR (the spi qspi binding and the boot NOR controller dts) are identical (0 differing lines). The ten base commits are the #191 head b8943e8, where I posted the delta review (PSD group power-off restore, Gen3 doorbell guard and locked-DART flush path, fixed-peripheral tunables, core_stop on PHY init failure, four iommus, PSD parents). Not run: build; the author's compile and dt receipts are not reproduced. Merge still needs CI and a second non-author GREEN.

Comment thread drivers/pmdomain/apple/pmgr-psd.c Resolved
On T8152 the ATC USB blocks (and the GPU) are behind a per-slot service
request in the power state director, on top of the normal PMGR power
states. Expose each slot, or a group of slots that must come up together,
as a generic power domain. Power-on writes the slot request and waits for
the acknowledge; power-off requests state 6 in reverse order.

Add the devicetree binding.

When a power-on request times out, the slot that timed out is put back to idle with the slots before it, because its acknowledge was not seen but it may still start.

When a group power-off fails, every slot is put back to its active state, including a slot whose off request timed out and may still finish stopping, because genpd keeps the domain marked on after a failed power-off and would skip power_on at the next resume.

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
The fixed host ports on T8152 need only the USB2 part of the PHY. Add a
driver that applies the bootloader-supplied calibration, handles host and
device mode, and leaves the USB3 and USB4 lanes alone.

Add the devicetree binding.

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
A hub with the Apple ID 05ac:800f sits behind the front ports of the M6
Mac mini. Add that ID to the hub quirk table with
HUB_QUIRK_DISABLE_AUTOSUSPEND so the kernel keeps it powered.

The match is on the vendor and product ID alone. Every hub with this ID
loses autosuspend, not only the one on this machine. The constant is
named after the ID, USB_PRODUCT_APPLE_HUB_800F, because the ID is
Apple's and the part behind it was not identified from the descriptor.

This quirk was not measured on its own: it only keeps the hub awake.

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
Add a peripherals fragment to the M6 Mac mini board file: the always-on
GPIO controller with the reset hog for the front-port USB hub, and the
four PSD service slots for the USB ports.

The NVMe controller, its mailbox and its address filter are not described
here. The NVMe node needs a mailbox driver change that is not in this
tree yet.

The fragment holds only addresses, interrupt numbers and wiring. The boot
loader adds the register tunables that some blocks need. The PMGR power
domains are not described yet, so nodes that need them are left out.

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
Add the DART of the Apple M6 (T8152), a third-generation DART whose
topology is fixed by the hardware. Its streams are described by static
parameters instead of being probed, and it takes no MMIO access until the
first use, because the block can be power gated behind the ATC USB
domains.

The binding requires a second register region (the TLB invalidate
doorbell) for the T8152 compatible only.

The change adds:
- the apple,t8152-dart compatible and its hardware description;
- static topology and "first use" initialisation of every DART;
- the Gen3 TLB invalidate and the fault handler;
- the reset path for DARTs that the boot loader leaves locked.

A DART that the boot loader leaves locked is held powered for its
lifetime. That applies to Gen3 hardware only. The other generations keep
their behaviour. The first-use initialisation re-reads the parameters and fails if the
page size differs from the one assumed at probe. It runs under a spinlock, and
every function it calls is non-sleeping (register accesses and an atomic
poll).

Measured on an M6 Mac mini with the earlier form of this change: the
display controller DART attaches locked on every boot. This version is
rebased on current integration/aurora and was compile-checked only. The
USB DART paths need the T8152 PSD power domains and were not run on
their own.

The doorbell store and the TLBI of the Gen3 invalidate are arm64 instructions: they are built only with CONFIG_ARM64, and other architectures (COMPILE_TEST) get a stub that returns -EOPNOTSUPP. A locked Gen3 DART no longer takes the range flush through TLB_CMD, which Gen3 does not accept; it uses the full-stream Gen3 callback.

Gen3 does not take commands through TLB_CMD, so the unlock after a lock-on-error exception is not sent there: the DART logs once that this is not supported. The stale-exception drain of a reset does not read 0x704 on Gen3, like the fault handler.

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
Add the apple,t8152-dwc3 compatible to the Apple dwc3 glue. The ATC ports
of the M6 (T8152) controller never switch roles through the Type-C
controller. The glue starts the controller as a fixed host, with or
without a hub child, or as a fixed peripheral when the node sets
dr_mode = "peripheral".

The T8152 profile is USB2 only: it needs maximum-speed = "high-speed",
takes no reset line, and its USB3 PHY is optional. The calibration lists
come from the device tree (apple,tunable-* properties that the boot loader
fills in at runtime; the binding does not require them in the board file) and are applied to the register windows in a fixed order after
the core is reset. The pipe handler is set up for the selected role.

The apple,t8103-dwc3 paths keep their behaviour. The controller stays a
syscore device while it runs, as before: no separate suspend or resume
path is added for T8152.

The earlier form of this change ran on an M6 Mac mini USB2 front port.
This version is rebased on current integration/aurora and was
compile-checked only. SuperSpeed does not train yet and is not part of
this change.

A fixed peripheral does not require the host-only calibration lists at probe, since it never applies them. The binding lists exactly four iommus entries, two stream IDs on each of two DARTs.

If the T8152 USB2 PHY fails to initialise or power on during core start, the failure goes through the same shutdown as a failed core init, so the reset and syscore flags set earlier are cleared again.

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
Describe the power management blocks and the USB controllers of the Mac
mini (M6, J873) next to the peripherals fragment:
- the two PMGR blocks and their power domains, in t8152-j873-pmgr.dtsi;
- for each of the four USB ports (usb0, usb1, usb2 and usb3 of the SoC):
  two DART instances, the USB2 PHY and the dwc3 controller.

The register windows, interrupts and DART tunables are the values of the
Apple device tree of the machine. The boot loader adds the apple,tunable-*
lists of the USB2 PHY and the controller at runtime.

The bindings list the apple,t8152-pmgr and apple,t8152-pmgr-pwrstate
compatibles, and the dwc3 and USB2 PHY bindings take the tunable lists as
optional, because the boot loader adds them.

The fragment is a plain description of the hardware. The ports that the
change describes run USB2 only: SuperSpeed and USB4 are not part of it.

This commit compiles to a device tree blob with dtc without warnings. It
was not booted. The bring-up it comes from enumerated the front-port USB2
hub and a USB disk at 480 Mb/s.

The four PSD service slots get their PMGR domains (the aon and the port domain of their port) as parents, so genpd powers them before the slot request.

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
@joshuaswarren

Copy link
Copy Markdown
Author

GREEN at 12e1b4b

The two commits above the #191 head are identical to the ones I cleared at 049e0bca (compared as diffs with the hash lines removed). The base changed, so I re-ran the device tree check with this PR's files on top of the new base: dtcheck.sh (dtschema 2026.9) on a tree that carries these nodes with the other stacked PRs, dtc -@ 0 warning lines, dt-validate of the board file 0 lines, 73 examples with only the baseline message.

Not checked: compile receipts, hardware. Merge still needs CI and the owner's word.

The T8152 boot NOR controller is the same QSPIMC block as the T8140 one. Add
apple,t8152-qspi as a more specific compatible that falls back to
apple,t8140-qspi, so a T8152 device tree describes the controller without
the driver needing a new match entry.

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
Describe the QSPIMC controller that serves the boot NOR of the Mac mini, with
the nvram partition that the driver lets programs and erases through, and the
sio -> spi_p -> qspi chain of power domains that it needs.

The register address is the CPU physical address (the boot firmware lists it
relative to /arm-io, which is mapped at 0x200000000).

Power state at boot, read from the PMGR registers: sio (0x840) is on, spi_p
(0xd40) and qspi (0x1140) are off. sio is marked always-on like the other
domains of this board, so gating it cannot take down other peripherals.
spi_p and qspi are not always-on: attaching the controller to its power
domain powers the chain before the driver probes (the driver has no runtime
PM call of its own).

The nvram partition is [0x24000, 0xf4000). A read of the NOR through the
controller at 0x24000 returns the boot variables from the first byte, and the
last used byte of the store lies inside the 0xd0000 bytes of the window. The
fallback compatible lets the driver program and erase inside this window, so
the node limits what a write can reach.

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
@joshuaswarren

Copy link
Copy Markdown
Author

New head ecad670dc3a3f2279e6c5cc8a6e6b1c0d1e23143: rebased on the new #191 head 9fbb3568 (only the PSD power-on rollback of the base changed); the commits of this PR are unchanged. The stack objects build with rc 0 and 0 warnings (arm64 clang W=1, 16K pages).

@joshuaswarren

Copy link
Copy Markdown
Author

GREEN at ecad670

Read: the commits of this head against my last GREEN head 2a35969, compared per commit as diffs with the hash lines removed. The two commits of this PR (spi qspi binding, boot NOR controller dts) are identical. The ten base commits are the #191 head 9fbb356, where I posted the delta review (PSD power-on rollback includes the failed slot, PSD power-off restores every slot, Gen3 DART drain and unlock changes). Not run: build; the author's compile and dt receipts are not reproduced. Merge still needs CI and a second non-author GREEN.

@joshuaswarren

Copy link
Copy Markdown
Author

GREEN at ecad670

The commits above the #191 head are identical to the ones I cleared at 12e1b4b3 (compared as diffs with the hash lines removed); the head moved because the #191 base changed (one hunk in the PSD power-on rollback, reviewed in #191). The device tree and binding results at 12e1b4b3 stand.

Not checked: compile receipts and hardware. Merge still needs CI and the owner's word.

@joshuaswarren

Copy link
Copy Markdown
Author

Status at head ecad670dc3a3f2279e6c5cc8a6e6b1c0d1e23143: two independent reviews GREEN at this exact head, all Greptile threads replied and resolved, arm64 clang W=1 compile of the touched objects rc 0 with 0 warnings, device-tree schema check 0 messages. Not done: a boot on hardware, CI. Needs a maintainer's CI approval and merge. Not needed for the release candidate.

@joshuaswarren

Copy link
Copy Markdown
Author

[Joshua's agent] This PR is awaiting maintainer review. Is anything else needed from us?

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.

1 participant