Repository navigation
arm64: dts: apple: t8152: describe the USB-C and MagSafe PD controllers on J804 and J833ct (on #2343) - #2411
Draft
RyanTheTide wants to merge 16 commits into
Draft
RyanTheTide wants to merge 16 commits into
RyanTheTide wants to merge 16 commits into
Conversation
The T8152 (M6) PMGR blocks are compatible with the T8103 ones. The J873 device tree already uses this compatible; document it. Signed-off-by: LiamRay11 <228416644+LiamRay11@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The T8152 (M6) PMGR power state controls are compatible with the T8103 ones. The J873 device tree already uses this compatible; document it. Signed-off-by: LiamRay11 <228416644+LiamRay11@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The I2C controllers of T8152 (M6) are compatible with the T8103 ones. Signed-off-by: LiamRay11 <228416644+LiamRay11@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The T8152 (M6) watchdog is compatible with the T8103 one. Signed-off-by: LiamRay11 <228416644+LiamRay11@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The T8152 (M6) FPWM, which drives the keyboard backlight of the J804 MacBook Pro, is compatible with the S5L one. Signed-off-by: LiamRay11 <228416644+LiamRay11@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reading every pin of the T8152 GPIO block to fill a register cache at probe takes an SError on the J804 MacBook Pro: pins 78 and 208 fault on an AP read. The T8140 profile accesses the block uncached and honours gpio-reserved-ranges, so a board that has to keep the CPU off such pins can use "apple,t8152-pinctrl", "apple,t8140-pinctrl", as T6050 does with its T8132 fallback. The existing T8103 fallback stays valid for boards that do not need it. Signed-off-by: LiamRay11 <228416644+LiamRay11@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
As on T8140, the OS cannot request core power-down on T8152 (M6) and WFI is the only idle state. Allow "apple,t8152-cpuidle" with the T8140 compatible as its fallback, which the driver already matches. Signed-off-by: LiamRay11 <228416644+LiamRay11@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Turn the disabled J804 inventory into a board description for a RAM
boot from the loader, on top of the shared T8152 description:
- the twelve CPUs (the loader removes those it has not started),
with the first two performance states of each cluster, which the
cpufreq driver may use without a thermal policy, as on J873
- the AIC and the timer, the boot framebuffer and CPU idle
- the SMC with its mailbox, the pcIO output that resets the
trackpad's touch controller, and the hardware monitor: fan, power,
voltage and current keys, with temperatures discovered. The fan
is monitored only; its speed stays under firmware control
- the watchdog, the GPIO controller with the pins that fault on an
AP read reserved, the I2C controllers of the jack codec and the
speaker amplifiers, and the keyboard backlight PWM
- the boot NOR and the PMGR block from t8152-j873-qspi.dtsi, shared
with J873, plus the SIO and I2C power states
Everything else stays described and disabled; the storage, display,
input, wireless and GPU nodes follow with their drivers. The values
come from the J804 ADT.
Tested on a MacBook Pro (M6, J804) with an equivalent standalone device
tree on an earlier base (integration/aurora f5fa539): all twelve CPUs
come up, the watchdog restarts the machine, the SMC hardware monitor
reports about 170 inputs including the fan, the keyboard backlight
lights, and the NVRAM partition of the boot NOR reads. This tree,
rewritten onto the shared T8152 labels, has not been booted.
Signed-off-by: LiamRay11 <228416644+LiamRay11@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The J804 has no apcie host, port 0 or port-0 DART, so the N1 Wi-Fi and Bluetooth functions that the centauri drivers handle never appear. The J804 ADT's /arm-io/apcie, apcie/pci-bridge0 (PERST# GPIO 3, CLKREQ# GPIO 0, maximum link speed 3), its centauri-control/alpha/beta functions and /arm-io/dart-apcie0 have the same registers, interrupts and pins as the J873g's. Move the host and port 0 from t8152-j873-n1.dtsi (sithglan) into a board-neutral t8152-n1.dtsi and include it from both boards. The J873g keeps its own pinctrl_ap and pcie0_dart in t8152-j873-n1.dtsi; its DTB is unchanged. The J804 uses pcie0_dart and pinctrl_ap from t8152.dtsi and its own board file. On the J804, add the PMGR power states the port and its DART sit in, ADT pmgr devices APCIE_GP (+0x8c0) and APCIE_SYS_GP (+0xec0, child of APCIE_GP), kept on because the loader hands over a trained link, and give them to the host and to pcie0_dart. Describe the Wi-Fi and Bluetooth functions (0,1 and 0,2) with the wifi0 and bluetooth0 aliases, which the loader fills from the ADT's /chosen mac-address-wifi0 and mac-address-bluetooth0. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The J804 has a GL9755 SD host controller on apcie port 2 (ADT /arm-io/apcie/pci-bridge2/pcie-sdreader); the Mac mini has a different device there, so this stays in the board file. The loader switches on the reader's power (the ADT's SMC function-sd_pwr_en) and trains the link. Add port 2 to the host: its port registers (+0x18a028000) and PHY lane (+0x18f018000), from the apcie node's reg; the host interrupts of ports 0 to 2 (ADT apcie interrupts 1571, 1579, 1587), because the driver takes a port's interrupt by its port number; and bus 2 on dart-apcie2, stream 1. The port's PERST# is pci-bridge2's function-perst, GPIO 5, and its link runs at gen 1 (maximum-link-speed 1). The port's MSIs come from the host's shared range. Card detect and write protect are active high (card-detect-polarity and write-protect-polarity 1), as in t6050-j714s.dts and t8142-j704-pcie.dtsi. Enable pcie2_dart with the apcie power state, APCIE_SYS_GP. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Describe the T8152 SEP for the 14-inch MacBook Pro (M6). In t8152-peripherals.dtsi, next to the existing sep_dart: - sep@28a600000 (J804 ADT /arm-io/sep, iop-sep,ascwrap-v8, first reg 0x8a600000 + 0x74000), disabled: iBoot hands over a running SEP and apple_sep enables it and its DART when it loads. - sep_mbox@28a710080, disabled: on T8152 the SEP talks through its window of the post-office block, like the SMC (third sep reg + 0x10080), with the ADT interrupts 542 (send-empty) and 541 (recv-not-empty). - sep_dart gets the DMA window iBoot programmed (ADT dart-sep vm-base-0 0x10000004000, vm-size-0 0xffff0000), as on T8142 and T6050. The J804, J873g and J833ct ADTs describe sep and dart-sep identically. In t8152-j804.dts: the "sep" alias, which makes the loader reserve the SEP firmware and publish the boot manifests on the node; the PMGR SEP (+0xc00, critical) and GPIO (+0xb60) states, both kept on as in t8142-j813-sep.dtsi; those domains on the SEP and on its DART; and the mailbox enabled. The SEP node follows t8140.dtsi and t8142-j813-sep.dtsi; the mailbox follows the J804 SMC mailbox (LiamRay11). Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
…mailboxes On T8152 the NVMe (ANS), display (DCP), keyboard and trackpad (MTP) and SEP coprocessors talk through windows of the same post-office block as the SMC: counted FIFOs sharing one status register, with interrupt masking left to the interrupt controller. The register layout is the one apple,t8152-smc-mailbox already describes. Add a compatible per coprocessor, each with apple,t8152-smc-mailbox as its fallback, so the existing driver match serves them without a code change and a later difference can still be keyed on the specific compatible. All four carry traffic on a MacBook Pro (M6, J804), with the single-compatible form of these nodes: NVMe, the keyboard and trackpad, and Touch ID run through them, and the DCP driver exchanges its messages through the DCP window. Signed-off-by: LiamRay11 <228416644+LiamRay11@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Move the parts of the J804 core board description that are SoC-level
into t8152-common.dtsi, so that the J833ct iMac can use them too:
- the RAM handoff contract, the boot framebuffer and CPU idle
- the twelve CPUs with the first two performance states of each
cluster and the cluster performance controllers
- the AIC and the timer
- the SMC, its mailbox and SRAM carve-out, and the hardware monitor
with temperatures discovered
- the watchdog, the GPIO controller, the I2C controllers of the jack
codec and the speaker amplifiers with the (disabled) jack codec
- the boot NOR and PMGR block, plus the SIO, I2C, internal PCIe
(APCIE_GP, APCIE_SYS_GP), GPIO and SEP power states
Every one of these ADT nodes (/cpus/cpu*, /arm-io/aic, wdt, smc, gpio0,
i2c1, i2c3, i2c1/audio-codec-output, qspi, pmgr) has the same reg,
interrupts and gates in the J804 and J833ct ADTs. t8152-j804.dts keeps
what is J804 only: the GPIO no-restore pins, the trackpad AFE reset
pcIO output, the fan, power and battery hwmon keys, and the keyboard
backlight on fpwm0 (absent from the J833ct ADT).
The J804 DTB decompiles (dtc -s) to the same tree as before; the
common part is the J804 description by LiamRay11, moved unchanged.
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
… board Base the J833ct on the shared loader-booted T8152 description, which brings up the twelve CPUs (the loader removes those it did not start), the AIC, timer, boot framebuffer console, SMC, watchdog, GPIO, the I2C controllers and the boot NOR, as on J804. The board adds only its GPIO no-restore pins (78, 79 and 208, from the J833ct ADT /arm-io/gpio0 no-restore-gpio-pins) and its identity, with the model name from the ADT product description. The keyboard and trackpad are Bluetooth accessories: the J833ct ADT has no MTP and no fpwm0, so there is no trackpad reset and no keyboard backlight. The hardware monitor discovers temperatures only; fan and power keys follow once read on the machine. Not booted: no J833ct is available for testing. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The T8152 (M6) SPMI controller is the fourth generation, with its FIFO registers at 0x200 as on T8142. Describe it as apple,t8152-spmi with an apple,t8142-spmi fallback, the layout the driver already handles. This is the same change as Thomas Glanzmann's in the open J873g series (#1800, #2176, #2178), so the two merge without conflict. Suggested-by: Thomas Glanzmann <thomas@glanzmann.de> Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
…rs on J804 and J833ct No T8152 board in the shared tree describes its USB-C PD controllers (SN201202x on the gen-4 SPMI buses), so there is no typec port and no PD power supply. That includes the J804's MagSafe 3 port. The first two USB-C ports' controllers have the same SIDs on nub-spmi-a0 in the J804 and J833ct ADTs (hpm0 at 0xc, hpm1 at 0xa). The bus and those two controllers go into t8152-common.dtsi. The boards add the rest, from each board's ADT: - J804: hpm5, the MagSafe 3 controller (port-type 0x11), at SID 8 on nub-spmi-a0, with apple,no-liquid-detection and no connector, as on J714s. The right-hand port's hpm3 is alone at SID 0xc on nub-spmi-a1, which only the J804 ADT has. - J833ct: hpm2 and hpm3 at SIDs 8 and 6 on nub-spmi-a0 (four ports). The controllers are polled, as on T8142 and T6050 and in the J873g series. There is no connector graph: the ports' dwc3 and ATC PHY nodes are not described on these boards yet. The J873g is unchanged and byte-identical. Its bus and controllers are in Thomas Glanzmann's open J873g series (t8152-j873-dcp.dtsi) and have the same shape. Not booted: J804 and J833ct are not available for testing here. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
No T8152 board in the shared tree describes its USB-C PD controllers (SN201202x on the gen-4 SPMI buses). Without them there is no
/sys/class/typecport and no PD power supply. On the J804 (MacBook Pro 14-inch, M6) that includes the MagSafe 3 port. The J833ct (iMac 24-inch, M6) has four USB-C ports and none are described.Change
Stacked on #2343, which adds the shared
t8152-common.dtsiused by J804 and J833ct.dt-bindings: spmi: apple,spmi: addsapple,t8152-spmiwith theapple,t8142-spmifallback. The hunk is identical to Thomas Glanzmann's in the open J873g series (J873g: HDMI and USB-C displays (apple_dcpib, T8152 Gen3 display DARTs, M6 Mac mini) #1800, J873g: two USB-C displays and HDMI at once, USB-C at 2560x1440@60 (apple_dcpib, M6 Mac mini) #2176, J873g: USB4 with hotplug on the rear USB-C ports (T8152 routers, PCIe-C, port monitor; M6 Mac mini) #2178), so the two merge cleanly.t8152-common.dtsi: nub-spmi-a0 and the first two ports' controllers, hpm0 at SID 0xc and hpm1 at SID 0xa. Both ADTs have the same values for these.t8152-j804.dts: adds hpm5, the MagSafe 3 controller (port-type 0x11), at SID 8 on nub-spmi-a0. Like J714s, it hasapple,no-liquid-detectionand no connector. Also adds nub-spmi-a1 with the right-hand port's hpm3 at SID 0xc. Only the J804 ADT has that bus.t8152-j833ct.dts: adds hpm2 at SID 8 and hpm3 at SID 6 on nub-spmi-a0.The controllers are polled, as on T8142 and T6050 and in the J873g series. There is no connector graph, because the ports' dwc3 and ATC PHY nodes are not described on these boards yet. The controllers report attach, PD contracts and the power supply, but USB data role switching waits for those nodes.
The J873g is unchanged. Its bus and the same three controllers are in the open J873g series (
t8152-j873-dcp.dtsi), with the same shape. When the J873g moves to the shared files, those nodes can merge with these.Driver checks:
drivers/usb/typec/tipd/spmi.c:515-518matches plainapple,sn201202xand has no board list at probe.tipd/core.c:363-366(sleep SSPS rules),tipd/spmi.c:746and:751(sleep boards), anddrivers/spmi/spmi-apple-controller.c:243-246.tipd/core.c:3810-3811,:758-760and:1419-1420key display handling on T8140/T8142 only, so T8152 takes the default path.Testing
apple,t8152-spmicompatible messages appear.Still to run
CONFIG_TYPEC_SN201202X, four ports appear under/sys/class/typecand dmesg has no sn201202x probe errors. A USB-C charger on each USB-C port, then the MagSafe 3 cable, brings the matching/sys/class/power_supply/*toonline=1. Unplugging givesonline=0. Depends on arm64: dts: apple: t8152-j833ct: the iMac (24-inch, M6) core board (on #2340) #2343./sys/class/typec, and a USB-C device or charger on each shows a partner. Depends on arm64: dts: apple: t8152-j833ct: the iMac (24-inch, M6) core board (on #2340) #2343 and on the loader booting a non-J873g T8152 board (aura main.c currently panics on that).Per-board values and DTB diffs
Values are from each board's ADT. The bus address is the ADT reg plus the arm-io offset, as for the SMC.
J804 DTB: adds
spmi@308908000(usb-pd@8, @A, @c) andspmi@308a08000(usb-pd@c). J833ct DTB: addsspmi@308908000(usb-pd@6, @8, @A, @c). J873g: IDENTICAL-DTB.Assisted-by: LLM (Claude:Opus 5.5)