Skip to content

arm64: dts: apple: t8140/j700: ANS2, SMC, SPMI and CPU frequency scaling (reworked) - #23

Merged
RyanTheTide merged 8 commits into
aurora-wipfrom
series/neo-j700-ans-cpu-board-20260925
Sep 25, 2026
Merged

RyanTheTide merged 8 commits into
aurora-wipfrom
series/neo-j700-ans-cpu-board-20260925

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

J700 board and T8140 SoC device-tree additions for storage, SMC, SPMI/PMIC and CPU frequency scaling, reworked after the 2026-09-25 maintainer audit and rebased onto aurora-wip (which now carries the reworked #10, #22 and #21).

What changed since the audited head (755111ef)

  • Yureka Lilian's dt-bindings: arm: cpus: Add Apple A18 Pro CPU core compatibles is applied from lore (with Krzysztof Kozlowski's Acked-by and Sven Peter's Reviewed-by) instead of our re-typed copy.
  • The two DTS commits become seven, one subsystem each, in dependency order: PMGR domains first (the SPMI and ANS nodes reference them), then SPMI/PMIC, SMC, ANS2 NVMe, CPU frequency scaling, the Tahiti CPU compatibles and L1 cache sizes, and finally the board enablement. Every intermediate DTB passes dtbs_check except for the five CS42L83 supplies inherited from arm64: apple: T8140/J700 platform prerequisites (reworked) #10.
  • Nodes live where Asahi keeps them: the SPMI controller, SMC (with smc_hwmon and smc_reboot children), ANS mailbox, SART and NVMe move from the board file and from appended &soc {} blocks into t8140.dtsi in unit-address order; ANS and SMC are disabled in the SoC file and enabled by the board; the board includes hwmon-common.dtsi and hwmon-laptop.dtsi like the other laptops.
  • Dropped: the pmp/pmp_mbox nodes (the PMP-v2 driver is parked with cpufreq: apple: J700 T8140 cpufreq and SMC CPU thermal policy (reworked; PMP-v2 parked) #22), 80 of the 86 hwmon channels (unverified placements and raw-key labels; the six CPU die channels the thermal policy needs stay first), the board apple,always-on overrides, the AIC reg reformat, idle=wfi (the default) and pmp_v2.thermal_policy=0 from the boot arguments.
  • /chosen/bootargs is arm64.nowfxt only, inside the existing chosen node and documented as temporary: the secondary cores lose state in WFIT.
  • Comments are reworded to hardware facts or moved into the commit messages; apcie_sys_gp keeps apcie_gp as parent (as on T8132) with the message stating that the generated A18 Pro PMGR description lists no parent and that the ANS link has only been run with the dependency in place.
  • Every commit: author Ryan Murray [email protected], contiguous trailers, wrapped bodies.

Checks: CHECK_DTBS=y apple/t8140-j700.dtb after every commit against the merged bindings (#10, #21, #22), dt_binding_check on cpus.yaml, checkpatch --strict --codespell, dtc W=2.

Not booted on the J700 in this form. The DT is content-identical to the audited one apart from the dropped PMP nodes and hwmon channels, but a boot of the merged aurora-wip is still owed: NVMe adoption, cpufreq reaching the top states under the SMC policy, SMC reboot/power-off.

🤖 Generated with Claude Code

yuyuyureka and others added 8 commits September 26, 2026 01:33
Add "apple,tahiti-e" and "apple,tahiti-p" compatibles for the A18 Pro
efficiency and performance CPU cores respectively. As with the M4 cores,
there is no longer a generational codename, so we assign the core
compatible based on SoC codename ("Tahiti") plus core type (E-Core /
P-Core).

Acked-by: Krzysztof Kozlowski <[email protected]>
Signed-off-by: Yureka Lilian <[email protected]>
Reviewed-by: Sven Peter <[email protected]>
Signed-off-by: Ryan Murray <[email protected]>
Add the power domains used by the ANS2 storage controller and the SPMI
controller, and the always-on domains of the power management
co-processor and of the SMC I2C masters, placed in the existing blocks
by register offset:

 - ans (0x278) and the domains of the PCIe link between the ANS2
   controller and the NAND: apcie_gp (0x258), apcie_sys_gp (0x2a0),
   apcie_st (0x310), apcie_sys_st (0x3a0) and apcie_phy_sw (0x3c0),
 - pmp (0x3d0) and pms_sram (0x3d8), the power management
   co-processor and its SRAM,
 - nub_spmi0 (mini PMGR 0x58), the SPMI controller the PMIC sits on,
 - smc_i2cm1 and smc_i2cm2 (mini PMGR 0x8030, 0x8038), I2C masters
   used by the SMC firmware.

The offsets and always-on flags match the PMGR description generated
from the ADT for Yureka Lilian's A18 Pro series. apcie_sys_gp is given
apcie_gp as its parent, as in the T8132 description; the generated A18
Pro description lists no parent for it. The ANS link has only been run
with this dependency in place, so it is kept.

The ANS co-processor is handed over running and cannot be reset
through PMGR (asserting its reset raises an SError), so its domain is
always-on. nub_spmi0, pmp, pms_sram and the two SMC I2C masters are
always-on too; pmp, pms_sram and the I2C masters have no kernel
consumer. The apcie domains are not always-on: the NVMe controller
holds them once a board enables it.

Also replace the file header with a plain description of the file.

Link: https://lore.kernel.org/r/20260911-apple-a18-pro-initial-devicetrees-v2-7-08d06cf011d4@cyberchaos.dev
Assisted-by: LLM checkpatch sparse
Signed-off-by: Ryan Murray <[email protected]>
Add the nub SPMI controller at 0x308714000 (AIC interrupt 487, power
domain nub_spmi0) and the Baku PMIC on it at USID 0xe. Export the PMIC
scratch registers that the SMC reboot driver uses as NVMEM cells: the
boot stage (0xf701), the boot error and panic counts (low and high
nibble of 0xf702) and the shutdown flag (0xf70f, bit 3). The shutdown
flag is what makes an SMC power-off request power the machine off
instead of rebooting it.

The ADT places the PMIC's legacy scratch area at 0xf700. The cell
offsets and bit fields within it follow the layout used with the other
Apple PMICs, as in the Stowe PMIC description on T8122; they have not
been checked against what iBoot or macOS write on this machine.

Assisted-by: LLM checkpatch sparse
Signed-off-by: Ryan Murray <[email protected]>
Add the SMC and its ASC mailbox. The SMC register window at
0x30c600000 is the ADT's smc reg[0] and the SRAM at 0x30de00000 is the
iop-smc-nub region-base. The mailbox sits at 0x30c608000; its AIC
interrupts 581 to 584 are listed in the binding's send-empty,
send-not-empty, recv-empty, recv-not-empty order. The existing macsmc
driver attaches through the "apple,t8103-smc" fallback.

Children:

 - gpio, the SMC GPIO controller,
 - hwmon, with the six CPU cluster die temperatures: Te05 and Te0S for
   the E cluster, Tp01, Tp05, Tp09 and Tp0D for the P cluster,
 - reboot, SMC reboot and power-off using the PMIC NVMEM cells.

The CPU die channels are the first temperature channels on purpose.
J700 carries an interim CPU thermal policy, until its CPU thermal
limits are described as DT thermal zones, and that policy reads the
first six temperature channels of this node. Other sensors belong to
the board files.

Both nodes are disabled here; the board enables them.

Assisted-by: LLM checkpatch sparse
Signed-off-by: Ryan Murray <[email protected]>
Add the ANS2 storage controller: its ASC mailbox at 0x389608000 (AIC
1007 to 1010), the SART address filter at 0x38dc50000 and the NVMe
controller (AIC 1039).

As on T8132, the NVMMU has its own register window, so the controller
takes three regions: the non-secure controller alias at 0x3cdcc0000,
the ANS co-processor at 0x389600000 and the NVMMU at 0x38dcc0000. The
ADT sizes the controller alias at 0x10000, but the linear submission
queue registers at +0x24908..+0x24910 lie in the same alias, so the
region is 0x30000 long. The NVMMU window size, 0x60000, is the ADT's.

Besides ans and apcie_sys_st the controller holds apcie_phy_sw, the
third power domain the binding requires for T8140: with that domain
off, the ANS PCIe link to the NAND falls to L1 idle and the firmware
reports a link timeout on its first read.

The ANS firmware is started by iBoot and handed over running, and how
it is handed over depends on the boot chain, so the nodes are disabled
here and enabled by the board.

Assisted-by: LLM checkpatch sparse
Signed-off-by: Ryan Murray <[email protected]>
Add the DVFS controllers of the E cluster (0x210e20000) and the P
cluster (0x211e20000) and their OPP tables, and point the CPU nodes at
them.

The tables are the ADT's voltage-states1-sram for the E cluster, six
states from 816 MHz to 2.424 GHz, and voltage-states5-sram for the P
cluster, 17 states from 744 MHz to 4.044 GHz. opp-level is the
hardware P-state written to the controller.

The controllers carry only the "apple,t8140-cluster-cpufreq"
compatible, as the binding documents: the T8140 DVFS status register
layout is not known, so no T8112 fallback is claimed.

The transition latency has not been measured on this SoC, so the OPPs
have no clock-latency-ns and apple-soc-cpufreq reports its DVFS
transaction timeout as the transition latency instead. The CPU nodes
have no capacity-dmips-mhz either; the core capacities have not been
measured.

With the interim J700 CPU thermal policy, the cpufreq driver holds both
clusters at their lowest state until the board enables that policy.

Assisted-by: LLM checkpatch sparse
Signed-off-by: Ryan Murray <[email protected]>
… sizes

Switch the CPU nodes from the Sawtooth and Everest compatibles to
"apple,tahiti-e" and "apple,tahiti-p", the compatibles the CPU binding
defines for the A18 Pro efficiency and performance cores, and add the
L1 cache sizes so that cacheinfo reports them: 128 KiB instruction and
64 KiB data cache on the E cores, 192 KiB and 128 KiB on the P cores.

The compatibles and cache sizes are those of Yureka Lilian's A18 Pro
device tree series. Also drop a stray blank line between cpu@1 and
cpu@2.

Link: https://lore.kernel.org/r/20260911-apple-a18-pro-initial-devicetrees-v2-7-08d06cf011d4@cyberchaos.dev
Assisted-by: LLM checkpatch sparse
Signed-off-by: Ryan Murray <[email protected]>
Enable the ANS2 NVMe controller and the SMC on the MacBook Neo, and add
the SMC sensors shared by the Apple laptops through hwmon-common.dtsi
and hwmon-laptop.dtsi, as the other laptop boards do. macsmc-hwmon
skips keys that this SMC does not have.

Set apple,cpu-thermal-policy on the SMC hwmon node. It enables the
interim J700 CPU thermal policy, which stands in until the CPU thermal
limits are described as DT thermal zones: the policy throttles on the
six CPU die channels that the SoC file lists first, and holds both
clusters at their lowest state whenever fresh readings are missing.
Without it the T8140 cpufreq driver never leaves the lowest state, so
this is what enables CPU frequency scaling here. The driver rejects the
property on other machines, which is why it is set in the board file.

Also set /chosen/bootargs to "arm64.nowfxt". This is a temporary
measure. The secondary cores lose architectural state in WFIT, so SMP
needs the kernel to stay off WFxT in its delay loop, and the kernel
does not yet do that on T8140 by itself. Until it does, boot chains
that pass this DT's /chosen/bootargs through unchanged rely on this
property to boot with SMP. A loader that supplies its own command line
replaces the property and has to pass arm64.nowfxt itself.

Assisted-by: LLM checkpatch sparse
Signed-off-by: Ryan Murray <[email protected]>
@RyanTheTide
RyanTheTide force-pushed the series/neo-j700-ans-cpu-board-20260925 branch from 755111e to 118ffba Compare September 25, 2026 15:33
@RyanTheTide RyanTheTide changed the title arm64: dts: apple: wire J700 ANS and CPU policy resources arm64: dts: apple: t8140/j700: ANS2, SMC, SPMI and CPU frequency scaling (reworked) Sep 25, 2026
@RyanTheTide
RyanTheTide merged commit b6ed675 into aurora-wip Sep 25, 2026
@RyanTheTide
RyanTheTide deleted the series/neo-j700-ans-cpu-board-20260925 branch September 26, 2026 12:45
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.

2 participants