Apple PMIC NVMEM cell driver (Formerly: Generic SPMI NVMEM cell driver)
Subsystems (3)
v3 cover Apple PMIC NVMEM cell driver (Formerly: Generic SPMI NVMEM cell driver)
Hi.
This patch series adds a driver for exposing a set of registers as NVMEM cells on a SPMI-attached PMIC on Apple ARM platforms. Those are used to store the RTC offset and to communicate platform power state between the OS and boot firmware.
The NVMEM cell consumer drivers will be sent in a further series.
---
Changes in v3:
- No longer try to make it generic, use for the 3 relevant PMICs only
- Link to v2: https://lore.kernel.org/r/[email protected]
Changes in v2:
- s/pmu/pmic/
- Sort dts in unit-order, instead of t600x-unit-order
- Link to v1: https://lore.kernel.org/r/[email protected]
---
Hector Martin (2):
nvmem: Add apple-spmi-nvmem driver
arm64: dts: apple: Add PMIC NVMEM
Sasha Finkelstein (1):
dt-bindings: spmi: Add Apple SPMI NVMEM
.../bindings/nvmem/apple,spmi-nvmem.yaml | 54 +++++++++++++++++++ MAINTAINERS | 2 + arch/arm64/boot/dts/apple/t6001.dtsi | 1 + arch/arm64/boot/dts/apple/t6002.dtsi | 1 + arch/arm64/boot/dts/apple/t600x-die0.dtsi | 50 +++++++++++++++++ arch/arm64/boot/dts/apple/t8103.dtsi | 50 +++++++++++++++++ arch/arm64/boot/dts/apple/t8112.dtsi | 50 +++++++++++++++++ drivers/nvmem/Kconfig | 13 +++++ drivers/nvmem/Makefile | 2 + drivers/nvmem/apple-spmi-nvmem.c | 62 ++++++++++++++++++++++ 10 files changed, 285 insertions(+)
---
base-commit: 2e0e70c95077172b29a5b13716c4b159d578e82c
change-id: 20250415-spmi-nvmem-e08635316175
Best regards,
Signature · 1 line
Sasha Finkelstein <[email protected]>
PATCH v3 1/3 dt-bindings: spmi: Add Apple SPMI NVMEM
Add bindings for exposing SPMI registers of Apple PMICs as NVMEM cells
--- .../bindings/nvmem/apple,spmi-nvmem.yaml | 54 ++++++++++++++++++++++ MAINTAINERS | 1 + 2 files changed, 55 insertions(+)
Documentation/devicetree/bindings/nvmem/apple,spmi-nvmem.yaml new file +54 -0
@@ -0,0 +1,54 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/nvmem/apple,spmi-nvmem.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple SPMI NVMEM + +description: Exports a series of SPMI registers as NVMEM cells + +maintainers: + - Sasha Finkelstein <[email protected]> + +allOf: + - $ref: nvmem.yaml# + +properties: + compatible: + items: + - enum: + - apple,maverick-pmic + - apple,sera-pmic + - apple,stowe-pmic + - const: apple,spmi-nvmem + + reg: + maxItems: 1 + +required: + - compatible + - reg + +unevaluatedProperties: false + +examples: + - | + #include <dt-bindings/spmi/spmi.h> + + pmic@f { + compatible = "apple,maverick-pmic", "apple,spmi-nvmem"; + reg = <0xf SPMI_USID>; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + boot_stage: boot-stage@6001 { + reg = <0x6001 0x1>; + }; + }; + }; + +...
MAINTAINERS +1 -0
@@ -2277,6 +2277,7 @@ F: Documentation/devicetree/bindings/mailbox/apple,mailbox.yaml F: Documentation/devicetree/bindings/net/bluetooth/brcm,bcm4377-bluetooth.yaml F: Documentation/devicetree/bindings/nvme/apple,nvme-ans.yaml F: Documentation/devicetree/bindings/nvmem/apple,efuses.yaml +F: Documentation/devicetree/bindings/nvmem/apple,spmi-nvmem.yaml F: Documentation/devicetree/bindings/pci/apple,pcie.yaml F: Documentation/devicetree/bindings/pinctrl/apple,pinctrl.yaml F: Documentation/devicetree/bindings/power/apple*
Signature · 1 line
2.49.0
Re: [PATCH v3 1/3] dt-bindings: spmi: Add Apple SPMI NVMEM
Quoted 9 lines · Sasha Finkelstein
Add bindings for exposing SPMI registers of Apple PMICs as NVMEM cells
Reviewed-by Alyssa Rosenzweig <[email protected]>Signed-off-by Sasha Finkelstein <[email protected]>--- .../bindings/nvmem/apple,spmi-nvmem.yaml | 54 ++++++++++++++++++++++ MAINTAINERS | 1 + 2 files changed, 55 insertions(+)
PATCH v3 2/3 nvmem: Add apple-spmi-nvmem driver
In reply to Sasha FinkelsteinFrom: Hector Martin <[email protected]>
Add a driver for a series of SPMI-attached PMICs present on Apple devices
--- MAINTAINERS | 1 + drivers/nvmem/Kconfig | 13 +++++++++ drivers/nvmem/Makefile | 2 ++ drivers/nvmem/apple-spmi-nvmem.c | 62 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 78 insertions(+)
MAINTAINERS +1 -0
@@ -2298,6 +2298,7 @@ F: drivers/iommu/io-pgtable-dart.c F: drivers/irqchip/irq-apple-aic.c F: drivers/nvme/host/apple.c F: drivers/nvmem/apple-efuses.c +F: drivers/nvmem/apple-spmi-nvmem.c F: drivers/pinctrl/pinctrl-apple-gpio.c F: drivers/pwm/pwm-apple.c F: drivers/soc/apple/*
drivers/nvmem/Kconfig +13 -0
@@ -40,6 +40,19 @@ config NVMEM_APPLE_EFUSES This driver can also be built as a module. If so, the module will be called nvmem-apple-efuses. +config NVMEM_APPLE_SPMI + tristate "Apple SPMI NVMEM" + depends on ARCH_APPLE || COMPILE_TEST + depends on SPMI + select REGMAP_SPMI + help + Say y here to build a driver to expose NVMEM cells for a set of power + and RTC-related settings on a SPMI-attached PMIC present on Apple + devices, such as Apple Silicon Macs. + + This driver can also be built as a module. If so, the module + will be called apple-nvmem-spmi. + config NVMEM_BCM_OCOTP tristate "Broadcom On-Chip OTP Controller support" depends on ARCH_BCM_IPROC || COMPILE_TEST
drivers/nvmem/Makefile +2 -0
@@ -12,6 +12,8 @@ obj-y += layouts/ # Devices obj-$(CONFIG_NVMEM_APPLE_EFUSES) += nvmem-apple-efuses.o nvmem-apple-efuses-y := apple-efuses.o +obj-$(CONFIG_NVMEM_APPLE_SPMI) += apple_nvmem_spmi.o +apple_nvmem_spmi-y := apple-spmi-nvmem.o obj-$(CONFIG_NVMEM_BCM_OCOTP) += nvmem-bcm-ocotp.o nvmem-bcm-ocotp-y := bcm-ocotp.o obj-$(CONFIG_NVMEM_BRCM_NVRAM) += nvmem_brcm_nvram.o
drivers/nvmem/apple-spmi-nvmem.c new file +62 -0
62 lines not on this page · raw message
Signature · 1 line
2.49.0
PATCH v3 3/3 arm64: dts: apple: Add PMIC NVMEM
In reply to Sasha FinkelsteinFrom: Hector Martin <[email protected]>
Add device tree entries for NVMEM cells present on the PMIC
--- arch/arm64/boot/dts/apple/t6001.dtsi | 1 + arch/arm64/boot/dts/apple/t6002.dtsi | 1 + arch/arm64/boot/dts/apple/t600x-die0.dtsi | 50 +++++++++++++++++++++++++++++++ arch/arm64/boot/dts/apple/t8103.dtsi | 50 +++++++++++++++++++++++++++++++ arch/arm64/boot/dts/apple/t8112.dtsi | 50 +++++++++++++++++++++++++++++++ 5 files changed, 152 insertions(+)
arch/arm64/boot/dts/apple/t6001.dtsi +1 -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> #include "multi-die-cpp.h"
arch/arm64/boot/dts/apple/t6002.dtsi +1 -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> #include "multi-die-cpp.h"
arch/arm64/boot/dts/apple/t600x-die0.dtsi +50 -0
56 lines not on this page · raw message
arch/arm64/boot/dts/apple/t8103.dtsi +50 -0
56 lines not on this page · raw message
arch/arm64/boot/dts/apple/t8112.dtsi +50 -0
56 lines not on this page · raw message
Signature · 1 line
2.49.0
Quoted 40 lines · On Wed, Apr 23, 2025 at 1:55 PM Sasha Finkelstein via B4 Relay…
Hi.
This patch series adds a driver for exposing a set of registers as NVMEM cells on a SPMI-attached PMIC on Apple ARM platforms. Those are used to store the RTC offset and to communicate platform power state between the OS and boot firmware.
The NVMEM cell consumer drivers will be sent in a further series.
Signed-off-by Sasha Finkelstein <[email protected]>---
Changes in v3:
- No longer try to make it generic, use for the 3 relevant PMICs only
- Link to v2: https://lore.kernel.org/r/[email protected]Changes in v2:
- s/pmu/pmic/
- Sort dts in unit-order, instead of t600x-unit-order
- Link to v1: https://lore.kernel.org/r/[email protected]---
Hector Martin (2):
nvmem: Add apple-spmi-nvmem driver
arm64: dts: apple: Add PMIC NVMEMSasha Finkelstein (1):
dt-bindings: spmi: Add Apple SPMI NVMEM.../bindings/nvmem/apple,spmi-nvmem.yaml | 54 +++++++++++++++++++ MAINTAINERS | 2 + arch/arm64/boot/dts/apple/t6001.dtsi | 1 + arch/arm64/boot/dts/apple/t6002.dtsi | 1 + arch/arm64/boot/dts/apple/t600x-die0.dtsi | 50 +++++++++++++++++ arch/arm64/boot/dts/apple/t8103.dtsi | 50 +++++++++++++++++ arch/arm64/boot/dts/apple/t8112.dtsi | 50 +++++++++++++++++ drivers/nvmem/Kconfig | 13 +++++ drivers/nvmem/Makefile | 2 + drivers/nvmem/apple-spmi-nvmem.c | 62 ++++++++++++++++++++++ 10 files changed, 285 insertions(+)
Quoted 4 lines
---
base-commit:2e0e70c95077172b29a5b13716c4b159d578e82c
change-id: 20250415-spmi-nvmem-e08635316175
Series LGTM.
Signature · 1 line
真実はいつも一つ!/ Always, there's only one truth!
Re: (subset) [PATCH v3 0/3] Apple PMIC NVMEM cell driver (Formerly: Generic SPMI NVMEM cell driver)
In reply to Sasha FinkelsteinQuoted 8 lines · Sasha Finkelstein
This patch series adds a driver for exposing a set of registers as NVMEM cells on a SPMI-attached PMIC on Apple ARM platforms. Those are used to store the RTC offset and to communicate platform power state between the OS and boot firmware.
The NVMEM cell consumer drivers will be sent in a further series.
[...]
Applied, thanks!
[1/3] dt-bindings: spmi: Add Apple SPMI NVMEM
commit: 342ad99689be22776c50ab5d82064b700e516a98
[2/3] nvmem: Add apple-spmi-nvmem driver
commit: 8d2900cc141122ad3a754d6d86cd15a9a4bf0b74Best regards,
Signature · 1 line
Srinivas Kandagatla <[email protected]>
Sven Peter
AppliedRe: (subset) [PATCH v3 0/3] Apple PMIC NVMEM cell driver (Formerly: Generic SPMI NVMEM cell driver)
In reply to Sasha FinkelsteinQuoted 8 lines · Sasha Finkelstein
This patch series adds a driver for exposing a set of registers as NVMEM cells on a SPMI-attached PMIC on Apple ARM platforms. Those are used to store the RTC offset and to communicate platform power state between the OS and boot firmware.
The NVMEM cell consumer drivers will be sent in a further series.
[...]
Applied to [email protected]:AsahiLinux/linux.git (asahi-soc/dt), thanks!
[3/3] arm64: dts: apple: Add PMIC NVMEM
https://github.com/AsahiLinux/linux/commit/d8bf82081c9e
Best regards,
Signature · 1 line
Sven Peter <[email protected]>