Driver for the Apple SPMI controller
Subsystems (3)
v4 cover Driver for the Apple SPMI controller
Hi.
This patch series adds support for the SPMI controller persent in most Apple SoCs. The drivers for the attached PMU and subdevices will be in further patch series.
---
Changes in v4:
- Rebase on 6.14
- Link to v3: https://lore.kernel.org/r/[email protected]
Changes in v3:
- Inlined helpers, dropped unneccesary error prefixes
- Link to v2: https://lore.kernel.org/r/[email protected]
Changes in v2:
- Removed redundant error prints
- Various style fixes
- Better explanation of why the driver is needed
- Link to v1: https://lore.kernel.org/r/[email protected]
---
Jean-Francois Bortolotti (1):
spmi: add a spmi driver for Apple SoC
Sasha Finkelstein (2):
dt-bindings: spmi: Add Apple SPMI controller
arm64: dts: apple: Add SPMI controller nodes
.../devicetree/bindings/spmi/apple,spmi.yaml | 49 ++++++ MAINTAINERS | 2 + arch/arm64/boot/dts/apple/t600x-die0.dtsi | 7 + arch/arm64/boot/dts/apple/t8103.dtsi | 8 + arch/arm64/boot/dts/apple/t8112.dtsi | 7 + drivers/spmi/Kconfig | 8 + drivers/spmi/Makefile | 1 + drivers/spmi/spmi-apple-controller.c | 168 +++++++++++++++++++++ 8 files changed, 250 insertions(+)
---
base-commit: a24588245776dafc227243a01bfbeb8a59bafba9
change-id: 20250304-spmi-6d3c24b9027a
Best regards,
Signature · 1 line
Sasha Finkelstein <[email protected]>
PATCH v4 1/3 dt-bindings: spmi: Add Apple SPMI controller
Add bindings for the SPMI controller present on most Apple SoCs
--- .../devicetree/bindings/spmi/apple,spmi.yaml | 49 ++++++++++++++++++++++ MAINTAINERS | 1 + 2 files changed, 50 insertions(+)
Documentation/devicetree/bindings/spmi/apple,spmi.yaml new file +49 -0
@@ -0,0 +1,49 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/spmi/apple,spmi.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple SPMI controller + +maintainers: + - Sasha Finkelstein <[email protected]> + +description: A SPMI controller present on most Apple SoCs + +allOf: + - $ref: spmi.yaml# + +properties: + compatible: + items: + - enum: + - apple,t8103-spmi + - apple,t6000-spmi + - apple,t8112-spmi + - const: apple,spmi + + reg: + maxItems: 1 + +required: + - compatible + - reg + +unevaluatedProperties: false + +examples: + - | + #include <dt-bindings/spmi/spmi.h> + + spmi@920a1300 { + compatible = "apple,t6000-spmi", "apple,spmi"; + reg = <0x920a1300 0x100>; + #address-cells = <2>; + #size-cells = <0>; + + pmic@f { + reg = <0xf SPMI_USID>; + /* PMIC-specific properties */ + }; + };
MAINTAINERS +1 -0
@@ -2282,6 +2282,7 @@ F: Documentation/devicetree/bindings/pinctrl/apple,pinctrl.yaml F: Documentation/devicetree/bindings/power/apple* F: Documentation/devicetree/bindings/pwm/apple,s5l-fpwm.yaml F: Documentation/devicetree/bindings/spi/apple,spi.yaml +F: Documentation/devicetree/bindings/spmi/apple,spmi.yaml F: Documentation/devicetree/bindings/watchdog/apple,wdt.yaml F: arch/arm64/boot/dts/apple/ F: drivers/bluetooth/hci_bcm4377.c
Signature · 1 line
2.49.0
Re: [PATCH v4 1/3] dt-bindings: spmi: Add Apple SPMI controller
Quoting Sasha Finkelstein via B4 Relay (2025-04-09 14:52:12)
Quoted 8 lines
From: Sasha Finkelstein <[email protected]>
Add bindings for the SPMI controller present on most Apple SoCs
Reviewed-by Rob Herring (Arm) <[email protected]>Reviewed-by Sven Peter <[email protected]>Signed-off-by Sasha Finkelstein <[email protected]>---
Applied to spmi-next
PATCH v4 2/3 spmi: add a spmi driver for Apple SoC
In reply to Sasha FinkelsteinFrom: Jean-Francois Bortolotti <[email protected]>
The connected PMU contains several useful nvmem cells such as RTC offset, boot failure counters, reboot/shutdown selector, and a few others. In addition M3+ machines have their USB-PD controller connected via SPMI.
--- MAINTAINERS | 1 + drivers/spmi/Kconfig | 8 ++ drivers/spmi/Makefile | 1 + drivers/spmi/spmi-apple-controller.c | 168 +++++++++++++++++++++++++++++++++++ 4 files changed, 178 insertions(+)
MAINTAINERS +1 -0
@@ -2302,6 +2302,7 @@ F: drivers/pinctrl/pinctrl-apple-gpio.c F: drivers/pwm/pwm-apple.c F: drivers/soc/apple/* F: drivers/spi/spi-apple.c +F: drivers/spmi/spmi-apple-controller.c F: drivers/video/backlight/apple_dwi_bl.c F: drivers/watchdog/apple_wdt.c F: include/dt-bindings/interrupt-controller/apple-aic.h
drivers/spmi/Kconfig +8 -0
@@ -11,6 +11,14 @@ menuconfig SPMI if SPMI +config SPMI_APPLE + tristate "Apple SoC SPMI Controller platform driver" + depends on ARCH_APPLE || COMPILE_TEST + help + If you say yes to this option, support will be included for the + SPMI controller present on many Apple SoCs, including the + t8103 (M1) and t600x (M1 Pro/Max). + config SPMI_HISI3670 tristate "Hisilicon 3670 SPMI Controller" select IRQ_DOMAIN_HIERARCHY
drivers/spmi/Makefile +1 -0
@@ -4,6 +4,7 @@ # obj-$(CONFIG_SPMI) += spmi.o spmi-devres.o +obj-$(CONFIG_SPMI_APPLE) += spmi-apple-controller.o obj-$(CONFIG_SPMI_HISI3670) += hisi-spmi-controller.o obj-$(CONFIG_SPMI_MSM_PMIC_ARB) += spmi-pmic-arb.o obj-$(CONFIG_SPMI_MTK_PMIF) += spmi-mtk-pmif.o
drivers/spmi/spmi-apple-controller.c new file +168 -0
168 lines not on this page · raw message
Signature · 1 line
2.49.0
Re: [PATCH v4 2/3] spmi: add a spmi driver for Apple SoC
Quoting Sasha Finkelstein via B4 Relay (2025-04-09 14:52:13)
Quoted 6 lines
From: Jean-Francois Bortolotti <[email protected]>
The connected PMU contains several useful nvmem cells such as RTC offset, boot failure counters, reboot/shutdown selector, and a few others. In addition M3+ machines have their USB-PD controller connected via SPMI.
Quoted 6 lines
Signed-off-by Jean-Francois Bortolotti <[email protected]>Reviewed-by Sven Peter <[email protected]>Reviewed-by Alyssa Rosenzweig <[email protected]>Co-developed-by Sasha Finkelstein <[email protected]>Signed-off-by Sasha Finkelstein <[email protected]>---
Applied to spmi-next
PATCH v4 3/3 arm64: dts: apple: Add SPMI controller nodes
In reply to Sasha FinkelsteinAdd device tree entries for the SPMI controller
--- arch/arm64/boot/dts/apple/t600x-die0.dtsi | 7 +++++++ arch/arm64/boot/dts/apple/t8103.dtsi | 8 ++++++++ arch/arm64/boot/dts/apple/t8112.dtsi | 7 +++++++ 3 files changed, 22 insertions(+)
arch/arm64/boot/dts/apple/t600x-die0.dtsi +7 -0
@@ -45,6 +45,13 @@ pinctrl_smc: pinctrl@290820000 { <AIC_IRQ 0 749 IRQ_TYPE_LEVEL_HIGH>; }; + nub_spmi0: spmi@2920a1300 { + compatible = "apple,t6000-spmi", "apple,spmi"; + reg = <0x2 0x920a1300 0x0 0x100>; + #address-cells = <2>; + #size-cells = <0>; + }; + wdt: watchdog@2922b0000 { compatible = "apple,t6000-wdt", "apple,wdt"; reg = <0x2 0x922b0000 0x0 0x4000>;
arch/arm64/boot/dts/apple/t8103.dtsi +8 -0
@@ -11,6 +11,7 @@ #include <dt-bindings/interrupt-controller/apple-aic.h> #include <dt-bindings/interrupt-controller/irq.h> #include <dt-bindings/pinctrl/apple.h> +#include <dt-bindings/spmi/spmi.h> / { compatible = "apple,t8103", "apple,arm-platform";
@@ -741,6 +742,13 @@ pcie_pins: pcie-pins { }; }; + nub_spmi: spmi@23d0d9300 { + compatible = "apple,t8103-spmi", "apple,spmi"; + reg = <0x2 0x3d0d9300 0x0 0x100>; + #address-cells = <2>; + #size-cells = <0>; + }; + pinctrl_nub: pinctrl@23d1f0000 { compatible = "apple,t8103-pinctrl", "apple,pinctrl"; reg = <0x2 0x3d1f0000 0x0 0x4000>;
arch/arm64/boot/dts/apple/t8112.dtsi +7 -0
@@ -782,6 +782,13 @@ wdt: watchdog@23d2b0000 { interrupts = <AIC_IRQ 379 IRQ_TYPE_LEVEL_HIGH>; }; + nub_spmi: spmi@23d714000 { + compatible = "apple,t8112-spmi", "apple,spmi"; + reg = <0x2 0x3d714000 0x0 0x100>; + #address-cells = <2>; + #size-cells = <0>; + }; + pinctrl_smc: pinctrl@23e820000 { compatible = "apple,t8112-pinctrl", "apple,pinctrl"; reg = <0x2 0x3e820000 0x0 0x4000>;
Signature · 1 line
2.49.0
Quoted 40 lines · On Wed, Apr 9, 2025 at 5:52 PM Sasha Finkelstein via B4 Relay…
Hi.
This patch series adds support for the SPMI controller persent in most Apple SoCs. The drivers for the attached PMU and subdevices will be in further patch series.
Signed-off-by Sasha Finkelstein <[email protected]>---
Changes in v4:
- Rebase on 6.14
- Link to v3: https://lore.kernel.org/r/[email protected]Changes in v3:
- Inlined helpers, dropped unneccesary error prefixes
- Link to v2: https://lore.kernel.org/r/[email protected]Changes in v2:
- Removed redundant error prints
- Various style fixes
- Better explanation of why the driver is needed
- Link to v1: https://lore.kernel.org/r/[email protected]---
Jean-Francois Bortolotti (1):
spmi: add a spmi driver for Apple SoCSasha Finkelstein (2):
dt-bindings: spmi: Add Apple SPMI controller
arm64: dts: apple: Add SPMI controller nodes.../devicetree/bindings/spmi/apple,spmi.yaml | 49 ++++++ MAINTAINERS | 2 + arch/arm64/boot/dts/apple/t600x-die0.dtsi | 7 + arch/arm64/boot/dts/apple/t8103.dtsi | 8 + arch/arm64/boot/dts/apple/t8112.dtsi | 7 + drivers/spmi/Kconfig | 8 + drivers/spmi/Makefile | 1 + drivers/spmi/spmi-apple-controller.c | 168 +++++++++++++++++++++ 8 files changed, 250 insertions(+)
Quoted 4 lines
---
base-commit:a24588245776dafc227243a01bfbeb8a59bafba9
change-id: 20250304-spmi-6d3c24b9027a
Series LGTM.
Signature · 1 line
真実はいつも一つ!/ Always, there's only one truth!
Sven Peter
AppliedRe: (subset) [PATCH v4 0/3] Driver for the Apple SPMI controller
In reply to Sasha FinkelsteinQuoted 5 lines · Sasha Finkelstein
This patch series adds support for the SPMI controller persent in most Apple SoCs. The drivers for the attached PMU and subdevices will be in further patch series.
Applied to [email protected]:AsahiLinux/linux.git (asahi-soc/dt), thanks!
[3/3] arm64: dts: apple: Add SPMI controller nodes
https://github.com/AsahiLinux/linux/commit/2e0e70c95077
Best regards,
Signature · 1 line
Sven Peter <[email protected]>