linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 00/11] Apple SoC PMGR device power states driver
@ 2021-11-24  7:34 Hector Martin
  2021-11-24  7:34 ` [PATCH v3 01/11] MAINTAINERS: Add PMGR power state files to ARM/APPLE MACHINE Hector Martin
                   ` (11 more replies)
  0 siblings, 12 replies; 23+ messages in thread
From: Hector Martin @ 2021-11-24  7:34 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Hector Martin, Marc Zyngier, Rob Herring, Arnd Bergmann,
	Linus Walleij, Alyssa Rosenzweig, Krzysztof Kozlowski,
	Greg Kroah-Hartman, Mark Kettenis, Philipp Zabel,
	Rafael J. Wysocki, Johan Hovold, devicetree, linux-pm,
	linux-kernel, linux-samsung-soc, linux-serial

This series adds the driver for the Apple PMGR device power state
registers. These registers can clockgate and (in some cases) powergate
specific SoC blocks. They also control the reset line, and can have
additional features such as automatic power management.

The current driver supports only the lowest/highest power states,
provided via the genpd framework, plus reset support provided via
the reset subsystem.

Apple's PMGRs (there are two in the T8103) have a uniform register
bit layout (sometimes with varying features). To be able to support
multiple SoC generations as well as express pd relationships
dynamically, this binding describes each PMGR power state control
as a single devicetree node. Future SoC generations are expected to
retain backwards compatibility, allowing this driver to work on them
with only DT changes.

#1: MAINTAINERS updates, to go via the SoC tree to avert merge hell
#2-#5: Adds power-domains properties to existing device bindings
#6-#7: Adds the new pmgr device tree bindings
#8: The driver itself.
#9: Instantiates the driver in t8103.dtsi. This adds the entire PMGR
    node tree and references the relevant nodes from existing devices.
#7: Adds runtime-pm support to the Samsung UART driver, as a first
    working consumer.
#8: Instantiates a second UART, to more easily test this.

There are currently no consumers for the reset functionality, so
it is untested, but we will be testing it soon with the NVMe driver
(as it is required to allow driver re-binding to work properly).

== Changes since v2 ==
- DT schema review comments & patch order fix
- Added the power-domains properties to devices that already mainlined
- Now adds the entire PMGR tree. This turns off all devices we do not
  currently instantiate, and adds power-domains to those we do. The
  nodes were initially generated with [1] and manually tweaked. all
  the labels match the ADT labels (lowercased), which might be used
  by the bootloader in the future to conditionally disable nodes
  based on hardware configuration.
- Dropped apple,t8103-minipmgr, since I don't expect we will ever need
  to tell apart multiple PMGR instances within a SoC, and added
  apple,t6000-pmgr{-pwrstate} for the new SoCs.
- Driver now unconditionally enables auto-PM for all devices. This
  seems to be safe and should save power (it is not implemented for
  all devices; if not implemented, the bit just doesn't exist and is
  ignored).
- If an always-on device is not powered on at boot, turn it on and
  print a warning. This avoids the PM core complaining. We still
  want to know if/when this happens, but let's not outright fail.
- Other minor fixes (use PS names instead of offsets for messages,
  do not spuriously clear flag bits).

On the way the parent node is handled: I've decided that these syscon
nodes will only ever contain pwrstates and nothing else. We now size
them based on the register range that contains pwrstate controls
(rounded up to page size). t6000 has 3 PMGRs and t6001 has 4, and
we shouldn't have to care about telling apart the multiple instances.
Anything else PMGR does that needs a driver will be handled by
entirely separate nodes in the future.

Re t6001 and t6000 (and the rumored t6002), t6000 is basically a
cut-down version of t6001 (and t6002 is rumored to be two t6001
dies), down to the die floorplan, so I'm quite certain we won't need
t6001/2-specific compatibles for anything shared. The t6000 devicetree
will just #include the t6001 one and remove the missing devices.
Hence, everything for this SoC series is going to have compatibles
named apple,t6000-* (except the extra instances of some blocks in
t6001 which look like they may have differences; PMGR isn't one of
them, but some multimedia stuff might).

[1] https://github.com/AsahiLinux/m1n1/blob/main/proxyclient/tools/pmgr_adt2dt.py

Hector Martin (11):
  MAINTAINERS: Add PMGR power state files to ARM/APPLE MACHINE
  dt-bindings: i2c: apple,i2c: Add power-domains property
  dt-bindings: iommu: apple,dart: Add power-domains property
  dt-bindings: pinctrl: apple,pinctrl: Add power-domains property
  dt-bindings: interrupt-controller: apple,aic: Add power-domains
    property
  dt-bindings: power: Add apple,pmgr-pwrstate binding
  dt-bindings: arm: apple: Add apple,pmgr binding
  soc: apple: Add driver for Apple PMGR power state controls
  arm64: dts: apple: t8103: Add PMGR nodes
  tty: serial: samsung_tty: Support runtime PM
  arm64: dts: apple: t8103: Add UART2

 .../bindings/arm/apple/apple,pmgr.yaml        |  134 ++
 .../devicetree/bindings/i2c/apple,i2c.yaml    |    3 +
 .../interrupt-controller/apple,aic.yaml       |    3 +
 .../devicetree/bindings/iommu/apple,dart.yaml |    3 +
 .../bindings/pinctrl/apple,pinctrl.yaml       |    3 +
 .../bindings/power/apple,pmgr-pwrstate.yaml   |   71 ++
 MAINTAINERS                                   |    3 +
 arch/arm64/boot/dts/apple/t8103-j274.dts      |    5 +
 arch/arm64/boot/dts/apple/t8103-pmgr.dtsi     | 1136 +++++++++++++++++
 arch/arm64/boot/dts/apple/t8103.dtsi          |   36 +
 drivers/soc/Kconfig                           |    1 +
 drivers/soc/Makefile                          |    1 +
 drivers/soc/apple/Kconfig                     |   21 +
 drivers/soc/apple/Makefile                    |    2 +
 drivers/soc/apple/apple-pmgr-pwrstate.c       |  317 +++++
 drivers/tty/serial/samsung_tty.c              |   93 +-
 16 files changed, 1798 insertions(+), 34 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/arm/apple/apple,pmgr.yaml
 create mode 100644 Documentation/devicetree/bindings/power/apple,pmgr-pwrstate.yaml
 create mode 100644 arch/arm64/boot/dts/apple/t8103-pmgr.dtsi
 create mode 100644 drivers/soc/apple/Kconfig
 create mode 100644 drivers/soc/apple/Makefile
 create mode 100644 drivers/soc/apple/apple-pmgr-pwrstate.c

-- 
2.33.0


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH v3 01/11] MAINTAINERS: Add PMGR power state files to ARM/APPLE MACHINE
  2021-11-24  7:34 [PATCH v3 00/11] Apple SoC PMGR device power states driver Hector Martin
@ 2021-11-24  7:34 ` Hector Martin
  2021-11-24  7:34 ` [PATCH v3 02/11] dt-bindings: i2c: apple,i2c: Add power-domains property Hector Martin
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 23+ messages in thread
From: Hector Martin @ 2021-11-24  7:34 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Hector Martin, Marc Zyngier, Rob Herring, Arnd Bergmann,
	Linus Walleij, Alyssa Rosenzweig, Krzysztof Kozlowski,
	Greg Kroah-Hartman, Mark Kettenis, Philipp Zabel,
	Rafael J. Wysocki, Johan Hovold, devicetree, linux-pm,
	linux-kernel, linux-samsung-soc, linux-serial

This covers the PMGR power state driver and its DT bindings,
as well as any other future stuff in drivers/soc/apple.

Signed-off-by: Hector Martin <marcan@marcan.st>
---
 MAINTAINERS | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 7a2345ce8521..5af8f33da7df 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1745,17 +1745,20 @@ B:	https://github.com/AsahiLinux/linux/issues
 C:	irc://irc.oftc.net/asahi-dev
 T:	git https://github.com/AsahiLinux/linux.git
 F:	Documentation/devicetree/bindings/arm/apple.yaml
+F:	Documentation/devicetree/bindings/arm/apple/*
 F:	Documentation/devicetree/bindings/i2c/apple,i2c.yaml
 F:	Documentation/devicetree/bindings/interrupt-controller/apple,aic.yaml
 F:	Documentation/devicetree/bindings/mailbox/apple,mailbox.yaml
 F:	Documentation/devicetree/bindings/pci/apple,pcie.yaml
 F:	Documentation/devicetree/bindings/pinctrl/apple,pinctrl.yaml
+F:	Documentation/devicetree/bindings/power/apple*
 F:	arch/arm64/boot/dts/apple/
 F:	drivers/i2c/busses/i2c-pasemi-core.c
 F:	drivers/i2c/busses/i2c-pasemi-platform.c
 F:	drivers/irqchip/irq-apple-aic.c
 F:	drivers/mailbox/apple-mailbox.c
 F:	drivers/pinctrl/pinctrl-apple-gpio.c
+F:	drivers/soc/apple/*
 F:	include/dt-bindings/interrupt-controller/apple-aic.h
 F:	include/dt-bindings/pinctrl/apple.h
 F:	include/linux/apple-mailbox.h
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH v3 02/11] dt-bindings: i2c: apple,i2c: Add power-domains property
  2021-11-24  7:34 [PATCH v3 00/11] Apple SoC PMGR device power states driver Hector Martin
  2021-11-24  7:34 ` [PATCH v3 01/11] MAINTAINERS: Add PMGR power state files to ARM/APPLE MACHINE Hector Martin
@ 2021-11-24  7:34 ` Hector Martin
  2021-11-29  0:54   ` Rob Herring
  2021-11-24  7:34 ` [PATCH v3 03/11] dt-bindings: iommu: apple,dart: " Hector Martin
                   ` (9 subsequent siblings)
  11 siblings, 1 reply; 23+ messages in thread
From: Hector Martin @ 2021-11-24  7:34 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Hector Martin, Marc Zyngier, Rob Herring, Arnd Bergmann,
	Linus Walleij, Alyssa Rosenzweig, Krzysztof Kozlowski,
	Greg Kroah-Hartman, Mark Kettenis, Philipp Zabel,
	Rafael J. Wysocki, Johan Hovold, devicetree, linux-pm,
	linux-kernel, linux-samsung-soc, linux-serial

This will bind to the PMGR pwrstate nodes that control power/clock
gating to SoC blocks. The i2c driver doesn't do runtime-pm yet, so
initially this will just keep the domain on permanently.

Signed-off-by: Hector Martin <marcan@marcan.st>
---
 Documentation/devicetree/bindings/i2c/apple,i2c.yaml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/i2c/apple,i2c.yaml b/Documentation/devicetree/bindings/i2c/apple,i2c.yaml
index 22fc8483256f..be2bfbddfa36 100644
--- a/Documentation/devicetree/bindings/i2c/apple,i2c.yaml
+++ b/Documentation/devicetree/bindings/i2c/apple,i2c.yaml
@@ -40,6 +40,9 @@ properties:
       used. This frequency is generated by dividing the reference clock.
       Allowed values are between ref_clk/(16*4) and ref_clk/(16*255).
 
+  power-domains:
+    maxItems: 1
+
 required:
   - compatible
   - reg
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH v3 03/11] dt-bindings: iommu: apple,dart: Add power-domains property
  2021-11-24  7:34 [PATCH v3 00/11] Apple SoC PMGR device power states driver Hector Martin
  2021-11-24  7:34 ` [PATCH v3 01/11] MAINTAINERS: Add PMGR power state files to ARM/APPLE MACHINE Hector Martin
  2021-11-24  7:34 ` [PATCH v3 02/11] dt-bindings: i2c: apple,i2c: Add power-domains property Hector Martin
@ 2021-11-24  7:34 ` Hector Martin
  2021-11-29  0:54   ` Rob Herring
  2021-11-24  7:34 ` [PATCH v3 04/11] dt-bindings: pinctrl: apple,pinctrl: " Hector Martin
                   ` (8 subsequent siblings)
  11 siblings, 1 reply; 23+ messages in thread
From: Hector Martin @ 2021-11-24  7:34 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Hector Martin, Marc Zyngier, Rob Herring, Arnd Bergmann,
	Linus Walleij, Alyssa Rosenzweig, Krzysztof Kozlowski,
	Greg Kroah-Hartman, Mark Kettenis, Philipp Zabel,
	Rafael J. Wysocki, Johan Hovold, devicetree, linux-pm,
	linux-kernel, linux-samsung-soc, linux-serial

This will bind to the PMGR pwrstate nodes that control power/clock
gating to SoC blocks. The DART driver doesn't do runtime-pm yet, so
initially this will just keep the domain on permanently.

Signed-off-by: Hector Martin <marcan@marcan.st>
---
 Documentation/devicetree/bindings/iommu/apple,dart.yaml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/iommu/apple,dart.yaml b/Documentation/devicetree/bindings/iommu/apple,dart.yaml
index 94aa9e9afa59..82ad669feef7 100644
--- a/Documentation/devicetree/bindings/iommu/apple,dart.yaml
+++ b/Documentation/devicetree/bindings/iommu/apple,dart.yaml
@@ -41,6 +41,9 @@ properties:
       Has to be one. The single cell describes the stream id emitted by
       a master to the IOMMU.
 
+  power-domains:
+    maxItems: 1
+
 required:
   - compatible
   - reg
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH v3 04/11] dt-bindings: pinctrl: apple,pinctrl: Add power-domains property
  2021-11-24  7:34 [PATCH v3 00/11] Apple SoC PMGR device power states driver Hector Martin
                   ` (2 preceding siblings ...)
  2021-11-24  7:34 ` [PATCH v3 03/11] dt-bindings: iommu: apple,dart: " Hector Martin
@ 2021-11-24  7:34 ` Hector Martin
  2021-11-29  0:58   ` Rob Herring
  2021-11-24  7:34 ` [PATCH v3 05/11] dt-bindings: interrupt-controller: apple,aic: " Hector Martin
                   ` (7 subsequent siblings)
  11 siblings, 1 reply; 23+ messages in thread
From: Hector Martin @ 2021-11-24  7:34 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Hector Martin, Marc Zyngier, Rob Herring, Arnd Bergmann,
	Linus Walleij, Alyssa Rosenzweig, Krzysztof Kozlowski,
	Greg Kroah-Hartman, Mark Kettenis, Philipp Zabel,
	Rafael J. Wysocki, Johan Hovold, devicetree, linux-pm,
	linux-kernel, linux-samsung-soc, linux-serial

This will bind to the PMGR pwrstate nodes that control power/clock
gating to SoC blocks. The pinctrl driver doesn't do runtime-pm yet, so
initially this will just keep the domain on permanently.

Signed-off-by: Hector Martin <marcan@marcan.st>
---
 Documentation/devicetree/bindings/pinctrl/apple,pinctrl.yaml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/pinctrl/apple,pinctrl.yaml b/Documentation/devicetree/bindings/pinctrl/apple,pinctrl.yaml
index 07b00de79755..200d411621e7 100644
--- a/Documentation/devicetree/bindings/pinctrl/apple,pinctrl.yaml
+++ b/Documentation/devicetree/bindings/pinctrl/apple,pinctrl.yaml
@@ -50,6 +50,9 @@ properties:
   '#interrupt-cells':
     const: 2
 
+  power-domains:
+    maxItems: 1
+
 patternProperties:
   '-pins$':
     type: object
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH v3 05/11] dt-bindings: interrupt-controller: apple,aic: Add power-domains property
  2021-11-24  7:34 [PATCH v3 00/11] Apple SoC PMGR device power states driver Hector Martin
                   ` (3 preceding siblings ...)
  2021-11-24  7:34 ` [PATCH v3 04/11] dt-bindings: pinctrl: apple,pinctrl: " Hector Martin
@ 2021-11-24  7:34 ` Hector Martin
  2021-11-29  0:58   ` Rob Herring
  2021-11-24  7:34 ` [PATCH v3 06/11] dt-bindings: power: Add apple,pmgr-pwrstate binding Hector Martin
                   ` (6 subsequent siblings)
  11 siblings, 1 reply; 23+ messages in thread
From: Hector Martin @ 2021-11-24  7:34 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Hector Martin, Marc Zyngier, Rob Herring, Arnd Bergmann,
	Linus Walleij, Alyssa Rosenzweig, Krzysztof Kozlowski,
	Greg Kroah-Hartman, Mark Kettenis, Philipp Zabel,
	Rafael J. Wysocki, Johan Hovold, devicetree, linux-pm,
	linux-kernel, linux-samsung-soc, linux-serial

This will bind to the PMGR pwrstate nodes that control power/clock
gating to SoC blocks. The AIC driver doesn't do runtime-pm and likely
never will (since it is system-critical), but it makes sense to describe
the power domain relationship the devicetree properly.

Signed-off-by: Hector Martin <marcan@marcan.st>
---
 .../devicetree/bindings/interrupt-controller/apple,aic.yaml    | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/interrupt-controller/apple,aic.yaml b/Documentation/devicetree/bindings/interrupt-controller/apple,aic.yaml
index cf6c091a07b1..97359024709a 100644
--- a/Documentation/devicetree/bindings/interrupt-controller/apple,aic.yaml
+++ b/Documentation/devicetree/bindings/interrupt-controller/apple,aic.yaml
@@ -65,6 +65,9 @@ properties:
       Specifies base physical address and size of the AIC registers.
     maxItems: 1
 
+  power-domains:
+    maxItems: 1
+
 required:
   - compatible
   - '#interrupt-cells'
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH v3 06/11] dt-bindings: power: Add apple,pmgr-pwrstate binding
  2021-11-24  7:34 [PATCH v3 00/11] Apple SoC PMGR device power states driver Hector Martin
                   ` (4 preceding siblings ...)
  2021-11-24  7:34 ` [PATCH v3 05/11] dt-bindings: interrupt-controller: apple,aic: " Hector Martin
@ 2021-11-24  7:34 ` Hector Martin
  2021-11-24  7:34 ` [PATCH v3 07/11] dt-bindings: arm: apple: Add apple,pmgr binding Hector Martin
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 23+ messages in thread
From: Hector Martin @ 2021-11-24  7:34 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Hector Martin, Marc Zyngier, Rob Herring, Arnd Bergmann,
	Linus Walleij, Alyssa Rosenzweig, Krzysztof Kozlowski,
	Greg Kroah-Hartman, Mark Kettenis, Philipp Zabel,
	Rafael J. Wysocki, Johan Hovold, devicetree, linux-pm,
	linux-kernel, linux-samsung-soc, linux-serial, Mark Kettenis,
	Rob Herring

This syscon child node represents a single SoC device controlled by the
PMGR block. This layout allows us to declare all device power state
controls (power/clock gating and reset) in the device tree, including
dependencies, instead of hardcoding it into the driver. The register
layout is uniform.

Each pmgr-pwrstate node provides genpd and reset features, to be
consumed by downstream device nodes.

Future SoCs are expected to use backwards compatible registers, and the
"apple,pmgr-pwrstate" represents any such interfaces (possibly with
additional features gated by the more specific compatible), allowing
them to be bound without driver updates. If a backwards incompatible
change is introduced in future SoCs, it will require a new compatible,
such as "apple,pmgr-pwrstate-v2".

Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Hector Martin <marcan@marcan.st>
---
 .../bindings/power/apple,pmgr-pwrstate.yaml   | 71 +++++++++++++++++++
 1 file changed, 71 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/power/apple,pmgr-pwrstate.yaml

diff --git a/Documentation/devicetree/bindings/power/apple,pmgr-pwrstate.yaml b/Documentation/devicetree/bindings/power/apple,pmgr-pwrstate.yaml
new file mode 100644
index 000000000000..5056d08b8261
--- /dev/null
+++ b/Documentation/devicetree/bindings/power/apple,pmgr-pwrstate.yaml
@@ -0,0 +1,71 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/power/apple,pmgr-pwrstate.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Apple SoC PMGR Power States
+
+maintainers:
+  - Hector Martin <marcan@marcan.st>
+
+allOf:
+  - $ref: "power-domain.yaml#"
+
+description: |
+  Apple SoCs include PMGR blocks responsible for power management,
+  which can control various clocks, resets, power states, and
+  performance features. This binding describes the device power
+  state registers, which control power states and resets.
+
+  Each instance of a power controller within the PMGR syscon node
+  represents a generic power domain provider, as documented in
+  Documentation/devicetree/bindings/power/power-domain.yaml.
+  The provider controls a single SoC block. The power hierarchy is
+  represented via power-domains relationships between these nodes.
+
+  See Documentation/devicetree/bindings/arm/apple/apple,pmgr.yaml
+  for the top-level PMGR node documentation.
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - apple,t8103-pmgr-pwrstate
+          - apple,t6000-pmgr-pwrstate
+      - const: apple,pmgr-pwrstate
+
+  reg:
+    maxItems: 1
+
+  "#power-domain-cells":
+    const: 0
+
+  "#reset-cells":
+    const: 0
+
+  power-domains:
+    description:
+      Reference to parent power domains. A domain may have multiple parents,
+      and all will be powered up when it is powered.
+    minItems: 1
+    maxItems: 8 # Arbitrary, should be enough
+
+  label:
+    description:
+      Specifies the name of the SoC domain being controlled. This is used to
+      name the power/reset domains.
+
+  apple,always-on:
+    description:
+      Forces this power domain to always be powered up.
+    type: boolean
+
+required:
+  - compatible
+  - reg
+  - "#power-domain-cells"
+  - "#reset-cells"
+  - label
+
+additionalProperties: false
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH v3 07/11] dt-bindings: arm: apple: Add apple,pmgr binding
  2021-11-24  7:34 [PATCH v3 00/11] Apple SoC PMGR device power states driver Hector Martin
                   ` (5 preceding siblings ...)
  2021-11-24  7:34 ` [PATCH v3 06/11] dt-bindings: power: Add apple,pmgr-pwrstate binding Hector Martin
@ 2021-11-24  7:34 ` Hector Martin
  2021-11-28 16:24   ` Rob Herring
  2021-11-24  7:34 ` [PATCH v3 08/11] soc: apple: Add driver for Apple PMGR power state controls Hector Martin
                   ` (4 subsequent siblings)
  11 siblings, 1 reply; 23+ messages in thread
From: Hector Martin @ 2021-11-24  7:34 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Hector Martin, Marc Zyngier, Rob Herring, Arnd Bergmann,
	Linus Walleij, Alyssa Rosenzweig, Krzysztof Kozlowski,
	Greg Kroah-Hartman, Mark Kettenis, Philipp Zabel,
	Rafael J. Wysocki, Johan Hovold, devicetree, linux-pm,
	linux-kernel, linux-samsung-soc, linux-serial, Mark Kettenis

The PMGR block in Apple Silicon SoCs is responsible for SoC power
management. There are two PMGRs in T8103, with different register
layouts but compatible registers. In order to support this as well
as future SoC generations with backwards-compatible registers, we
declare these blocks as syscons and bind to individual registers
in child nodes. Each register controls one SoC device.

The respective apple compatibles are defined in case device-specific
quirks are necessary in the future, but currently these nodes are
expected to be bound by the generic syscon driver.

Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
Signed-off-by: Hector Martin <marcan@marcan.st>
---
 .../bindings/arm/apple/apple,pmgr.yaml        | 134 ++++++++++++++++++
 1 file changed, 134 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/apple/apple,pmgr.yaml

diff --git a/Documentation/devicetree/bindings/arm/apple/apple,pmgr.yaml b/Documentation/devicetree/bindings/arm/apple/apple,pmgr.yaml
new file mode 100644
index 000000000000..b6b5d3a912b3
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/apple/apple,pmgr.yaml
@@ -0,0 +1,134 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/arm/apple/apple,pmgr.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Apple SoC Power Manager (PMGR)
+
+maintainers:
+  - Hector Martin <marcan@marcan.st>
+
+description: |
+  Apple SoCs include PMGR blocks responsible for power management,
+  which can control various clocks, resets, power states, and
+  performance features. This node represents the PMGR as a syscon,
+  with sub-nodes representing individual features.
+
+properties:
+  $nodename:
+    pattern: "^power-management@[0-9a-f]+$"
+
+  compatible:
+    items:
+      - enum:
+          - apple,t8103-pmgr
+          - apple,t6000-pmgr
+      - const: apple,pmgr
+      - const: syscon
+      - const: simple-mfd
+
+  reg:
+    maxItems: 1
+
+  "#address-cells":
+    const: 1
+
+  "#size-cells":
+    const: 1
+
+patternProperties:
+  "power-controller@[0-9a-f]+$":
+    description:
+      The individual power management domains within this controller
+    type: object
+    $ref: /power/apple,pmgr-pwrstate.yaml#
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    soc {
+        #address-cells = <2>;
+        #size-cells = <2>;
+
+        power-management@23b700000 {
+            compatible = "apple,t8103-pmgr", "apple,pmgr", "syscon", "simple-mfd";
+            #address-cells = <1>;
+            #size-cells = <1>;
+            reg = <0x2 0x3b700000 0x0 0x14000>;
+
+            ps_sio: power-controller@1c0 {
+                compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+                reg = <0x1c0 8>;
+                #power-domain-cells = <0>;
+                #reset-cells = <0>;
+                label = "sio";
+                apple,always-on;
+            };
+
+            ps_uart_p: power-controller@220 {
+                compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+                reg = <0x220 8>;
+                #power-domain-cells = <0>;
+                #reset-cells = <0>;
+                label = "uart_p";
+                power-domains = <&ps_sio>;
+            };
+
+            ps_uart0: power-controller@270 {
+                compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+                reg = <0x270 8>;
+                #power-domain-cells = <0>;
+                #reset-cells = <0>;
+                label = "uart0";
+                power-domains = <&ps_uart_p>;
+            };
+        };
+
+        power-management@23d280000 {
+            compatible = "apple,t8103-pmgr", "apple,pmgr", "syscon", "simple-mfd";
+            #address-cells = <1>;
+            #size-cells = <1>;
+            reg = <0x2 0x3d280000 0x0 0xc000>;
+
+            ps_aop_filter: power-controller@4000 {
+                compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+                reg = <0x4000 8>;
+                #power-domain-cells = <0>;
+                #reset-cells = <0>;
+                label = "aop_filter";
+            };
+
+            ps_aop_base: power-controller@4010 {
+                compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+                reg = <0x4010 8>;
+                #power-domain-cells = <0>;
+                #reset-cells = <0>;
+                label = "aop_base";
+                power-domains = <&ps_aop_filter>;
+            };
+
+            ps_aop_shim: power-controller@4038 {
+                compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+                reg = <0x4038 8>;
+                #power-domain-cells = <0>;
+                #reset-cells = <0>;
+                label = "aop_shim";
+                power-domains = <&ps_aop_base>;
+            };
+
+            ps_aop_uart0: power-controller@4048 {
+                compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+                reg = <0x4048 8>;
+                #power-domain-cells = <0>;
+                #reset-cells = <0>;
+                label = "aop_uart0";
+                power-domains = <&ps_aop_shim>;
+            };
+        };
+    };
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH v3 08/11] soc: apple: Add driver for Apple PMGR power state controls
  2021-11-24  7:34 [PATCH v3 00/11] Apple SoC PMGR device power states driver Hector Martin
                   ` (6 preceding siblings ...)
  2021-11-24  7:34 ` [PATCH v3 07/11] dt-bindings: arm: apple: Add apple,pmgr binding Hector Martin
@ 2021-11-24  7:34 ` Hector Martin
  2021-11-24  7:34 ` [PATCH v3 09/11] arm64: dts: apple: t8103: Add PMGR nodes Hector Martin
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 23+ messages in thread
From: Hector Martin @ 2021-11-24  7:34 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Hector Martin, Marc Zyngier, Rob Herring, Arnd Bergmann,
	Linus Walleij, Alyssa Rosenzweig, Krzysztof Kozlowski,
	Greg Kroah-Hartman, Mark Kettenis, Philipp Zabel,
	Rafael J. Wysocki, Johan Hovold, devicetree, linux-pm,
	linux-kernel, linux-samsung-soc, linux-serial

Implements genpd and reset providers for downstream devices. Each
instance of the driver binds to a single register and represents a
single SoC power domain.

The driver does not currently implement all features (clockgate-only
state, misc flags), but we declare the respective registers for
documentation purposes. These features will be added as they become
useful for downstream devices.

This also creates the apple/soc tree and Kconfig submenu.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Hector Martin <marcan@marcan.st>
---
 drivers/soc/Kconfig                     |   1 +
 drivers/soc/Makefile                    |   1 +
 drivers/soc/apple/Kconfig               |  21 ++
 drivers/soc/apple/Makefile              |   2 +
 drivers/soc/apple/apple-pmgr-pwrstate.c | 317 ++++++++++++++++++++++++
 5 files changed, 342 insertions(+)
 create mode 100644 drivers/soc/apple/Kconfig
 create mode 100644 drivers/soc/apple/Makefile
 create mode 100644 drivers/soc/apple/apple-pmgr-pwrstate.c

diff --git a/drivers/soc/Kconfig b/drivers/soc/Kconfig
index e8a30c4c5aec..a8562678c437 100644
--- a/drivers/soc/Kconfig
+++ b/drivers/soc/Kconfig
@@ -3,6 +3,7 @@ menu "SOC (System On Chip) specific Drivers"
 
 source "drivers/soc/actions/Kconfig"
 source "drivers/soc/amlogic/Kconfig"
+source "drivers/soc/apple/Kconfig"
 source "drivers/soc/aspeed/Kconfig"
 source "drivers/soc/atmel/Kconfig"
 source "drivers/soc/bcm/Kconfig"
diff --git a/drivers/soc/Makefile b/drivers/soc/Makefile
index a05e9fbcd3e0..adb30c2d4fea 100644
--- a/drivers/soc/Makefile
+++ b/drivers/soc/Makefile
@@ -4,6 +4,7 @@
 #
 
 obj-$(CONFIG_ARCH_ACTIONS)	+= actions/
+obj-$(CONFIG_ARCH_APPLE)	+= apple/
 obj-y				+= aspeed/
 obj-$(CONFIG_ARCH_AT91)		+= atmel/
 obj-y				+= bcm/
diff --git a/drivers/soc/apple/Kconfig b/drivers/soc/apple/Kconfig
new file mode 100644
index 000000000000..271092b6aee7
--- /dev/null
+++ b/drivers/soc/apple/Kconfig
@@ -0,0 +1,21 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+if ARCH_APPLE || COMPILE_TEST
+
+menu "Apple SoC drivers"
+
+config APPLE_PMGR_PWRSTATE
+	tristate "Apple SoC PMGR power state control"
+	select REGMAP
+	select MFD_SYSCON
+	select PM_GENERIC_DOMAINS
+	select RESET_CONTROLLER
+	default ARCH_APPLE
+	help
+	  The PMGR block in Apple SoCs provides high-level power state
+	  controls for SoC devices. This driver manages them through the
+	  generic power domain framework, and also provides reset support.
+
+endmenu
+
+endif
diff --git a/drivers/soc/apple/Makefile b/drivers/soc/apple/Makefile
new file mode 100644
index 000000000000..c114e84667e4
--- /dev/null
+++ b/drivers/soc/apple/Makefile
@@ -0,0 +1,2 @@
+# SPDX-License-Identifier: GPL-2.0-only
+obj-$(CONFIG_APPLE_PMGR_PWRSTATE)	+= apple-pmgr-pwrstate.o
diff --git a/drivers/soc/apple/apple-pmgr-pwrstate.c b/drivers/soc/apple/apple-pmgr-pwrstate.c
new file mode 100644
index 000000000000..8ad9d5fdefbf
--- /dev/null
+++ b/drivers/soc/apple/apple-pmgr-pwrstate.c
@@ -0,0 +1,317 @@
+// SPDX-License-Identifier: GPL-2.0-only OR MIT
+/*
+ * Apple SoC PMGR device power state driver
+ *
+ * Copyright The Asahi Linux Contributors
+ */
+
+#include <linux/bitops.h>
+#include <linux/bitfield.h>
+#include <linux/err.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/platform_device.h>
+#include <linux/pm_domain.h>
+#include <linux/regmap.h>
+#include <linux/mfd/syscon.h>
+#include <linux/reset-controller.h>
+#include <linux/module.h>
+
+#define APPLE_PMGR_RESET        BIT(31)
+#define APPLE_PMGR_AUTO_ENABLE  BIT(28)
+#define APPLE_PMGR_PS_AUTO      GENMASK(27, 24)
+#define APPLE_PMGR_PARENT_OFF   BIT(11)
+#define APPLE_PMGR_DEV_DISABLE  BIT(10)
+#define APPLE_PMGR_WAS_CLKGATED BIT(9)
+#define APPLE_PMGR_WAS_PWRGATED BIT(8)
+#define APPLE_PMGR_PS_ACTUAL    GENMASK(7, 4)
+#define APPLE_PMGR_PS_TARGET    GENMASK(3, 0)
+
+#define APPLE_PMGR_FLAGS        (APPLE_PMGR_WAS_CLKGATED | APPLE_PMGR_WAS_PWRGATED)
+
+#define APPLE_PMGR_PS_ACTIVE    0xf
+#define APPLE_PMGR_PS_CLKGATE   0x4
+#define APPLE_PMGR_PS_PWRGATE   0x0
+
+#define APPLE_PMGR_PS_SET_TIMEOUT 100
+#define APPLE_PMGR_RESET_TIME 1
+
+struct apple_pmgr_ps {
+	struct device *dev;
+	struct generic_pm_domain genpd;
+	struct reset_controller_dev rcdev;
+	struct regmap *regmap;
+	u32 offset;
+};
+
+#define genpd_to_apple_pmgr_ps(_genpd) container_of(_genpd, struct apple_pmgr_ps, genpd)
+#define rcdev_to_apple_pmgr_ps(_rcdev) container_of(_rcdev, struct apple_pmgr_ps, rcdev)
+
+static int apple_pmgr_ps_set(struct generic_pm_domain *genpd, u32 pstate, bool auto_enable)
+{
+	int ret;
+	struct apple_pmgr_ps *ps = genpd_to_apple_pmgr_ps(genpd);
+	u32 reg;
+
+	ret = regmap_read(ps->regmap, ps->offset, &reg);
+	if (ret < 0)
+		return ret;
+
+	/* Resets are synchronous, and only work if the device is powered and clocked. */
+	if (reg & APPLE_PMGR_RESET && pstate != APPLE_PMGR_PS_ACTIVE)
+		dev_err(ps->dev, "PS %s: powering off with RESET active\n",
+			genpd->name);
+
+	reg &= ~(APPLE_PMGR_AUTO_ENABLE | APPLE_PMGR_FLAGS | APPLE_PMGR_PS_TARGET);
+	reg |= FIELD_PREP(APPLE_PMGR_PS_TARGET, pstate);
+
+	dev_dbg(ps->dev, "PS %s: pwrstate = 0x%x: 0x%x\n", genpd->name, pstate, reg);
+
+	regmap_write(ps->regmap, ps->offset, reg);
+
+	ret = regmap_read_poll_timeout_atomic(
+		ps->regmap, ps->offset, reg,
+		(FIELD_GET(APPLE_PMGR_PS_ACTUAL, reg) == pstate), 1,
+		APPLE_PMGR_PS_SET_TIMEOUT);
+	if (ret < 0)
+		dev_err(ps->dev, "PS %s: Failed to reach power state 0x%x (now: 0x%x)\n",
+			genpd->name, pstate, reg);
+
+	if (auto_enable) {
+		/* Not all devices implement this; this is a no-op where not implemented. */
+		reg &= ~APPLE_PMGR_FLAGS;
+		reg |= APPLE_PMGR_AUTO_ENABLE;
+		regmap_write(ps->regmap, ps->offset, reg);
+	}
+
+	return ret;
+}
+
+static bool apple_pmgr_ps_is_active(struct apple_pmgr_ps *ps)
+{
+	u32 reg = 0;
+
+	regmap_read(ps->regmap, ps->offset, &reg);
+	/*
+	 * We consider domains as active if they are actually on, or if they have auto-PM
+	 * enabled and the intended target is on.
+	 */
+	return (FIELD_GET(APPLE_PMGR_PS_ACTUAL, reg) == APPLE_PMGR_PS_ACTIVE ||
+		(FIELD_GET(APPLE_PMGR_PS_TARGET, reg) == APPLE_PMGR_PS_ACTIVE &&
+		 reg & APPLE_PMGR_AUTO_ENABLE));
+}
+
+static int apple_pmgr_ps_power_on(struct generic_pm_domain *genpd)
+{
+	return apple_pmgr_ps_set(genpd, APPLE_PMGR_PS_ACTIVE, true);
+}
+
+static int apple_pmgr_ps_power_off(struct generic_pm_domain *genpd)
+{
+	return apple_pmgr_ps_set(genpd, APPLE_PMGR_PS_PWRGATE, false);
+}
+
+static int apple_pmgr_reset_assert(struct reset_controller_dev *rcdev, unsigned long id)
+{
+	struct apple_pmgr_ps *ps = rcdev_to_apple_pmgr_ps(rcdev);
+
+	mutex_lock(&ps->genpd.mlock);
+
+	if (ps->genpd.status == GENPD_STATE_OFF)
+		dev_err(ps->dev, "PS 0x%x: asserting RESET while powered down\n", ps->offset);
+
+	dev_dbg(ps->dev, "PS 0x%x: assert reset\n", ps->offset);
+	/* Quiesce device before asserting reset */
+	regmap_update_bits(ps->regmap, ps->offset, APPLE_PMGR_FLAGS | APPLE_PMGR_DEV_DISABLE,
+			   APPLE_PMGR_DEV_DISABLE);
+	regmap_update_bits(ps->regmap, ps->offset, APPLE_PMGR_FLAGS | APPLE_PMGR_RESET,
+			   APPLE_PMGR_RESET);
+
+	mutex_unlock(&ps->genpd.mlock);
+
+	return 0;
+}
+
+static int apple_pmgr_reset_deassert(struct reset_controller_dev *rcdev, unsigned long id)
+{
+	struct apple_pmgr_ps *ps = rcdev_to_apple_pmgr_ps(rcdev);
+
+	mutex_lock(&ps->genpd.mlock);
+
+	dev_dbg(ps->dev, "PS 0x%x: deassert reset\n", ps->offset);
+	regmap_update_bits(ps->regmap, ps->offset, APPLE_PMGR_FLAGS | APPLE_PMGR_RESET, 0);
+	regmap_update_bits(ps->regmap, ps->offset, APPLE_PMGR_FLAGS | APPLE_PMGR_DEV_DISABLE, 0);
+
+	if (ps->genpd.status == GENPD_STATE_OFF)
+		dev_err(ps->dev, "PS 0x%x: RESET was deasserted while powered down\n", ps->offset);
+
+	mutex_unlock(&ps->genpd.mlock);
+
+	return 0;
+}
+
+static int apple_pmgr_reset_reset(struct reset_controller_dev *rcdev, unsigned long id)
+{
+	int ret;
+
+	ret = apple_pmgr_reset_assert(rcdev, id);
+	if (ret)
+		return ret;
+
+	usleep_range(APPLE_PMGR_RESET_TIME, 2 * APPLE_PMGR_RESET_TIME);
+
+	return apple_pmgr_reset_deassert(rcdev, id);
+}
+
+static int apple_pmgr_reset_status(struct reset_controller_dev *rcdev, unsigned long id)
+{
+	struct apple_pmgr_ps *ps = rcdev_to_apple_pmgr_ps(rcdev);
+	u32 reg = 0;
+
+	regmap_read(ps->regmap, ps->offset, &reg);
+
+	return !!(reg & APPLE_PMGR_RESET);
+}
+
+const struct reset_control_ops apple_pmgr_reset_ops = {
+	.assert		= apple_pmgr_reset_assert,
+	.deassert	= apple_pmgr_reset_deassert,
+	.reset		= apple_pmgr_reset_reset,
+	.status		= apple_pmgr_reset_status,
+};
+
+static int apple_pmgr_reset_xlate(struct reset_controller_dev *rcdev,
+				  const struct of_phandle_args *reset_spec)
+{
+	return 0;
+}
+
+static int apple_pmgr_ps_probe(struct platform_device *pdev)
+{
+	struct device *dev = &pdev->dev;
+	struct device_node *node = dev->of_node;
+	struct apple_pmgr_ps *ps;
+	struct regmap *regmap;
+	struct of_phandle_iterator it;
+	int ret;
+	const char *name;
+	bool active;
+
+	regmap = syscon_node_to_regmap(node->parent);
+	if (IS_ERR(regmap))
+		return PTR_ERR(regmap);
+
+	ps = devm_kzalloc(dev, sizeof(*ps), GFP_KERNEL);
+	if (!ps)
+		return -ENOMEM;
+
+	ps->dev = dev;
+	ps->regmap = regmap;
+
+	ret = of_property_read_string(node, "label", &name);
+	if (ret < 0) {
+		dev_err(dev, "missing label property\n");
+		return ret;
+	}
+
+	ret = of_property_read_u32(node, "reg", &ps->offset);
+	if (ret < 0) {
+		dev_err(dev, "missing reg property\n");
+		return ret;
+	}
+
+	ps->genpd.name = name;
+	ps->genpd.power_on = apple_pmgr_ps_power_on;
+	ps->genpd.power_off = apple_pmgr_ps_power_off;
+
+	active = apple_pmgr_ps_is_active(ps);
+	if (of_property_read_bool(node, "apple,always-on")) {
+		ps->genpd.flags |= GENPD_FLAG_ALWAYS_ON;
+		if (!active) {
+			dev_warn(dev, "always-on domain %s is not on at boot\n", name);
+			/* Turn it on so pm_genpd_init does not fail */
+			active = apple_pmgr_ps_power_on(&ps->genpd) == 0;
+		}
+	}
+
+	/* Turn on auto-PM if the domain is already on */
+	if (active)
+		regmap_update_bits(regmap, ps->offset, APPLE_PMGR_FLAGS | APPLE_PMGR_AUTO_ENABLE,
+				   APPLE_PMGR_AUTO_ENABLE);
+
+	ret = pm_genpd_init(&ps->genpd, NULL, !active);
+	if (ret < 0) {
+		dev_err(dev, "pm_genpd_init failed\n");
+		return ret;
+	}
+
+	ret = of_genpd_add_provider_simple(node, &ps->genpd);
+	if (ret < 0) {
+		dev_err(dev, "of_genpd_add_provider_simple failed\n");
+		return ret;
+	}
+
+	of_for_each_phandle(&it, ret, node, "power-domains", "#power-domain-cells", -1) {
+		struct of_phandle_args parent, child;
+
+		parent.np = it.node;
+		parent.args_count = of_phandle_iterator_args(&it, parent.args, MAX_PHANDLE_ARGS);
+		child.np = node;
+		child.args_count = 0;
+		ret = of_genpd_add_subdomain(&parent, &child);
+
+		if (ret == -EPROBE_DEFER) {
+			of_node_put(parent.np);
+			goto err_remove;
+		} else if (ret < 0) {
+			dev_err(dev, "failed to add to parent domain: %d (%s -> %s)\n",
+				ret, it.node->name, node->name);
+			of_node_put(parent.np);
+			goto err_remove;
+		}
+	}
+
+	/*
+	 * Do not participate in regular PM; parent power domains are handled via the
+	 * genpd hierarchy.
+	 */
+	pm_genpd_remove_device(dev);
+
+	ps->rcdev.owner = THIS_MODULE;
+	ps->rcdev.nr_resets = 1;
+	ps->rcdev.ops = &apple_pmgr_reset_ops;
+	ps->rcdev.of_node = dev->of_node;
+	ps->rcdev.of_reset_n_cells = 0;
+	ps->rcdev.of_xlate = apple_pmgr_reset_xlate;
+
+	ret = devm_reset_controller_register(dev, &ps->rcdev);
+	if (ret < 0)
+		goto err_remove;
+
+	return 0;
+err_remove:
+	of_genpd_del_provider(node);
+	pm_genpd_remove(&ps->genpd);
+	return ret;
+}
+
+static const struct of_device_id apple_pmgr_ps_of_match[] = {
+	{ .compatible = "apple,pmgr-pwrstate" },
+	{}
+};
+
+MODULE_DEVICE_TABLE(of, apple_pmgr_ps_of_match);
+
+static struct platform_driver apple_pmgr_ps_driver = {
+	.probe = apple_pmgr_ps_probe,
+	.driver = {
+		.name = "apple-pmgr-pwrstate",
+		.of_match_table = apple_pmgr_ps_of_match,
+	},
+};
+
+MODULE_AUTHOR("Hector Martin <marcan@marcan.st>");
+MODULE_DESCRIPTION("PMGR power state driver for Apple SoCs");
+MODULE_LICENSE("GPL v2");
+
+module_platform_driver(apple_pmgr_ps_driver);
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH v3 09/11] arm64: dts: apple: t8103: Add PMGR nodes
  2021-11-24  7:34 [PATCH v3 00/11] Apple SoC PMGR device power states driver Hector Martin
                   ` (7 preceding siblings ...)
  2021-11-24  7:34 ` [PATCH v3 08/11] soc: apple: Add driver for Apple PMGR power state controls Hector Martin
@ 2021-11-24  7:34 ` Hector Martin
  2021-12-02 17:59   ` Sven Peter
  2021-11-24  7:46 ` [PATCH v3 10/11] tty: serial: samsung_tty: Support runtime PM Hector Martin
                   ` (2 subsequent siblings)
  11 siblings, 1 reply; 23+ messages in thread
From: Hector Martin @ 2021-11-24  7:34 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Hector Martin, Marc Zyngier, Rob Herring, Arnd Bergmann,
	Linus Walleij, Alyssa Rosenzweig, Krzysztof Kozlowski,
	Greg Kroah-Hartman, Mark Kettenis, Philipp Zabel,
	Rafael J. Wysocki, Johan Hovold, devicetree, linux-pm,
	linux-kernel, linux-samsung-soc, linux-serial

This adds the two PMGR nodes and all known power state subnodes. Since
there are a large number of them, let's put them in a separate file to
include.

Signed-off-by: Hector Martin <marcan@marcan.st>
---
 arch/arm64/boot/dts/apple/t8103-pmgr.dtsi | 1136 +++++++++++++++++++++
 arch/arm64/boot/dts/apple/t8103.dtsi      |   24 +
 2 files changed, 1160 insertions(+)
 create mode 100644 arch/arm64/boot/dts/apple/t8103-pmgr.dtsi

diff --git a/arch/arm64/boot/dts/apple/t8103-pmgr.dtsi b/arch/arm64/boot/dts/apple/t8103-pmgr.dtsi
new file mode 100644
index 000000000000..1310be74df1d
--- /dev/null
+++ b/arch/arm64/boot/dts/apple/t8103-pmgr.dtsi
@@ -0,0 +1,1136 @@
+// SPDX-License-Identifier: GPL-2.0+ OR MIT
+/*
+ * PMGR Power domains for the Apple T8103 "M1" SoC
+ *
+ * Copyright The Asahi Linux Contributors
+ */
+
+
+&pmgr {
+	ps_sbr: power-controller@100 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x100 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "sbr";
+		apple,always-on; /* Core device */
+	};
+
+	ps_aic: power-controller@108 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x108 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "aic";
+		apple,always-on; /* Core device */
+	};
+
+	ps_dwi: power-controller@110 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x110 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "dwi";
+		apple,always-on; /* Core device */
+	};
+
+	ps_soc_spmi0: power-controller@118 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x118 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "soc_spmi0";
+	};
+
+	ps_soc_spmi1: power-controller@120 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x120 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "soc_spmi1";
+	};
+
+	ps_soc_spmi2: power-controller@128 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x128 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "soc_spmi2";
+	};
+
+	ps_gpio: power-controller@130 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x130 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "gpio";
+	};
+
+	ps_pms_busif: power-controller@138 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x138 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "pms_busif";
+		apple,always-on; /* Core device */
+	};
+
+	ps_pms: power-controller@140 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x140 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "pms";
+		apple,always-on; /* Core device */
+	};
+
+	ps_pms_fpwm0: power-controller@148 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x148 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "pms_fpwm0";
+		power-domains = <&ps_pms>;
+	};
+
+	ps_pms_fpwm1: power-controller@150 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x150 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "pms_fpwm1";
+		power-domains = <&ps_pms>;
+	};
+
+	ps_pms_fpwm2: power-controller@158 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x158 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "pms_fpwm2";
+		power-domains = <&ps_pms>;
+	};
+
+	ps_pms_fpwm3: power-controller@160 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x160 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "pms_fpwm3";
+		power-domains = <&ps_pms>;
+	};
+
+	ps_pms_fpwm4: power-controller@168 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x168 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "pms_fpwm4";
+		power-domains = <&ps_pms>;
+	};
+
+	ps_soc_dpe: power-controller@170 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x170 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "soc_dpe";
+		apple,always-on; /* Core device */
+	};
+
+	ps_pmgr_soc_ocla: power-controller@178 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x178 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "pmgr_soc_ocla";
+	};
+
+	ps_ispsens0: power-controller@180 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x180 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "ispsens0";
+	};
+
+	ps_ispsens1: power-controller@188 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x188 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "ispsens1";
+	};
+
+	ps_ispsens2: power-controller@190 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x190 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "ispsens2";
+	};
+
+	ps_ispsens3: power-controller@198 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x198 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "ispsens3";
+	};
+
+	ps_pcie_ref: power-controller@1a0 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x1a0 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "pcie_ref";
+	};
+
+	ps_aft0: power-controller@1a8 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x1a8 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "aft0";
+	};
+
+	ps_devc0_ivdmc: power-controller@1b0 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x1b0 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "devc0_ivdmc";
+	};
+
+	ps_imx: power-controller@1b8 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x1b8 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "imx";
+		apple,always-on; /* Apple fabric, critical block */
+	};
+
+	ps_sio_busif: power-controller@1c0 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x1c0 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "sio_busif";
+	};
+
+	ps_sio: power-controller@1c8 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x1c8 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "sio";
+		power-domains = <&ps_sio_busif>;
+	};
+
+	ps_sio_cpu: power-controller@1d0 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x1d0 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "sio_cpu";
+		power-domains = <&ps_sio>;
+	};
+
+	ps_fpwm0: power-controller@1d8 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x1d8 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "fpwm0";
+	};
+
+	ps_fpwm1: power-controller@1e0 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x1e0 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "fpwm1";
+	};
+
+	ps_fpwm2: power-controller@1e8 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x1e8 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "fpwm2";
+	};
+
+	ps_i2c0: power-controller@1f0 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x1f0 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "i2c0";
+		power-domains = <&ps_sio>;
+	};
+
+	ps_i2c1: power-controller@1f8 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x1f8 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "i2c1";
+		power-domains = <&ps_sio>;
+	};
+
+	ps_i2c2: power-controller@200 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x200 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "i2c2";
+		power-domains = <&ps_sio>;
+	};
+
+	ps_i2c3: power-controller@208 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x208 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "i2c3";
+		power-domains = <&ps_sio>;
+	};
+
+	ps_i2c4: power-controller@210 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x210 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "i2c4";
+		power-domains = <&ps_sio>;
+	};
+
+	ps_spi_p: power-controller@218 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x218 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "spi_p";
+		power-domains = <&ps_sio>;
+	};
+
+	ps_uart_p: power-controller@220 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x220 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "uart_p";
+		power-domains = <&ps_sio>;
+	};
+
+	ps_audio_p: power-controller@228 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x228 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "audio_p";
+		power-domains = <&ps_sio>;
+	};
+
+	ps_sio_adma: power-controller@230 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x230 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "sio_adma";
+		power-domains = <&ps_sio>, <&ps_pms>;
+	};
+
+	ps_aes: power-controller@238 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x238 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "aes";
+		power-domains = <&ps_sio>;
+	};
+
+	ps_spi0: power-controller@240 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x240 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "spi0";
+		power-domains = <&ps_sio>, <&ps_spi_p>;
+	};
+
+	ps_spi1: power-controller@248 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x248 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "spi1";
+		power-domains = <&ps_sio>, <&ps_spi_p>;
+	};
+
+	ps_spi2: power-controller@250 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x250 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "spi2";
+		power-domains = <&ps_sio>, <&ps_spi_p>;
+	};
+
+	ps_spi3: power-controller@258 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x258 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "spi3";
+		power-domains = <&ps_sio>, <&ps_spi_p>;
+	};
+
+	ps_uart_n: power-controller@268 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x268 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "uart_n";
+		power-domains = <&ps_uart_p>;
+	};
+
+	ps_uart0: power-controller@270 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x270 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "uart0";
+		power-domains = <&ps_uart_p>;
+	};
+
+	ps_uart1: power-controller@278 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x278 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "uart1";
+		power-domains = <&ps_uart_p>;
+	};
+
+	ps_uart2: power-controller@280 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x280 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "uart2";
+		power-domains = <&ps_uart_p>;
+	};
+
+	ps_uart3: power-controller@288 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x288 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "uart3";
+		power-domains = <&ps_uart_p>;
+	};
+
+	ps_uart4: power-controller@290 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x290 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "uart4";
+		power-domains = <&ps_uart_p>;
+	};
+
+	ps_uart5: power-controller@298 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x298 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "uart5";
+		power-domains = <&ps_uart_p>;
+	};
+
+	ps_uart6: power-controller@2a0 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x2a0 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "uart6";
+		power-domains = <&ps_uart_p>;
+	};
+
+	ps_uart7: power-controller@2a8 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x2a8 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "uart7";
+		power-domains = <&ps_uart_p>;
+	};
+
+	ps_uart8: power-controller@2b0 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x2b0 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "uart8";
+		power-domains = <&ps_uart_p>;
+	};
+
+	ps_mca0: power-controller@2b8 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x2b8 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "mca0";
+		power-domains = <&ps_audio_p>, <&ps_sio_adma>;
+	};
+
+	ps_mca1: power-controller@2c0 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x2c0 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "mca1";
+		power-domains = <&ps_audio_p>, <&ps_sio_adma>;
+	};
+
+	ps_mca2: power-controller@2c8 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x2c8 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "mca2";
+		power-domains = <&ps_audio_p>, <&ps_sio_adma>;
+	};
+
+	ps_mca3: power-controller@2d0 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x2d0 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "mca3";
+		power-domains = <&ps_audio_p>, <&ps_sio_adma>;
+	};
+
+	ps_mca4: power-controller@2d8 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x2d8 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "mca4";
+		power-domains = <&ps_audio_p>, <&ps_sio_adma>;
+	};
+
+	ps_mca5: power-controller@2e0 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x2e0 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "mca5";
+		power-domains = <&ps_audio_p>, <&ps_sio_adma>;
+	};
+
+	ps_dpa0: power-controller@2e8 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x2e8 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "dpa0";
+		power-domains = <&ps_audio_p>;
+	};
+
+	ps_dpa1: power-controller@2f0 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x2f0 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "dpa1";
+		power-domains = <&ps_audio_p>;
+	};
+
+	ps_mcc: power-controller@2f8 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x2f8 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "mcc";
+		apple,always-on; /* Memory controller */
+	};
+
+	ps_spi4: power-controller@260 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x260 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "spi4";
+		power-domains = <&ps_sio>, <&ps_spi_p>;
+	};
+
+	ps_dcs0: power-controller@300 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x300 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "dcs0";
+		apple,always-on; /* LPDDR4 interface */
+	};
+
+	ps_dcs1: power-controller@310 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x310 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "dcs1";
+		apple,always-on; /* LPDDR4 interface */
+	};
+
+	ps_dcs2: power-controller@308 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x308 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "dcs2";
+		apple,always-on; /* LPDDR4 interface */
+	};
+
+	ps_dcs3: power-controller@318 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x318 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "dcs3";
+		apple,always-on; /* LPDDR4 interface */
+	};
+
+	ps_smx: power-controller@340 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x340 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "smx";
+		apple,always-on; /* Apple fabric, critical block */
+	};
+
+	ps_apcie: power-controller@348 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x348 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "apcie";
+		power-domains = <&ps_imx>, <&ps_pcie_ref>;
+	};
+
+	ps_rmx: power-controller@350 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x350 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "rmx";
+		/* Apple Fabric, display/image stuff: this can power down */
+	};
+
+	ps_mmx: power-controller@358 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x358 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "mmx";
+		/* Apple Fabric, media stuff: this can power down */
+	};
+
+	ps_disp0_fe: power-controller@360 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x360 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "disp0_fe";
+		power-domains = <&ps_rmx>;
+		apple,always-on; /* TODO: figure out if we can enable PM here */
+	};
+
+	ps_dispext_fe: power-controller@368 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x368 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "dispext_fe";
+		power-domains = <&ps_rmx>;
+	};
+
+	ps_dispext_cpu0: power-controller@378 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x378 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "dispext_cpu0";
+		power-domains = <&ps_dispext_fe>;
+	};
+
+	ps_jpg: power-controller@3c0 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x3c0 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "jpg";
+		power-domains = <&ps_mmx>;
+	};
+
+	ps_msr: power-controller@3c8 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x3c8 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "msr";
+		power-domains = <&ps_mmx>;
+	};
+
+	ps_msr_ase_core: power-controller@3d0 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x3d0 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "msr_ase_core";
+	};
+
+	ps_pmp: power-controller@3d8 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x3d8 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "pmp";
+	};
+
+	ps_pms_sram: power-controller@3e0 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x3e0 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "pms_sram";
+	};
+
+	ps_apcie_gp: power-controller@3e8 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x3e8 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "apcie_gp";
+		power-domains = <&ps_apcie>;
+	};
+
+	ps_ans2: power-controller@3f0 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x3f0 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "ans2";
+		/*
+		 * The ADT makes ps_apcie_st depend on ps_ans2 instead, but this
+		 * doesn't make much sense since ANS2 uses APCIE_ST.
+		 */
+		power-domains = <&ps_apcie_st>;
+	};
+
+	ps_gfx: power-controller@3f8 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x3f8 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "gfx";
+	};
+
+	ps_dcs4: power-controller@320 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x320 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "dcs4";
+		apple,always-on; /* LPDDR4 interface */
+	};
+
+	ps_dcs5: power-controller@330 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x330 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "dcs5";
+		apple,always-on; /* LPDDR4 interface */
+	};
+
+	ps_dcs6: power-controller@328 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x328 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "dcs6";
+		apple,always-on; /* LPDDR4 interface */
+	};
+
+	ps_dcs7: power-controller@338 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x338 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "dcs7";
+		apple,always-on; /* LPDDR4 interface */
+	};
+
+	ps_dispdfr_fe: power-controller@3a8 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x3a8 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "dispdfr_fe";
+		power-domains = <&ps_rmx>;
+	};
+
+	ps_dispdfr_be: power-controller@3b0 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x3b0 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "dispdfr_be";
+		power-domains = <&ps_dispdfr_fe>;
+	};
+
+	ps_mipi_dsi: power-controller@3b8 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x3b8 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "mipi_dsi";
+		power-domains = <&ps_dispdfr_be>;
+	};
+
+	ps_isp_sys: power-controller@400 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x400 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "isp_sys";
+		power-domains = <&ps_rmx>;
+	};
+
+	ps_venc_sys: power-controller@408 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x408 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "venc_sys";
+		power-domains = <&ps_mmx>;
+	};
+
+	ps_avd_sys: power-controller@410 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x410 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "avd_sys";
+		power-domains = <&ps_mmx>;
+	};
+
+	ps_apcie_st: power-controller@418 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x418 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "apcie_st";
+		power-domains = <&ps_apcie>;
+	};
+
+	ps_ane_sys: power-controller@470 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x470 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "ane_sys";
+	};
+
+	ps_atc0_common: power-controller@420 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x420 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "atc0_common";
+	};
+
+	ps_atc0_pcie: power-controller@428 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x428 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "atc0_pcie";
+		power-domains = <&ps_atc0_common>;
+	};
+
+	ps_atc0_cio: power-controller@430 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x430 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "atc0_cio";
+		power-domains = <&ps_atc0_common>;
+	};
+
+	ps_atc0_cio_pcie: power-controller@438 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x438 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "atc0_cio_pcie";
+		power-domains = <&ps_atc0_cio>;
+	};
+
+	ps_atc0_cio_usb: power-controller@440 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x440 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "atc0_cio_usb";
+		power-domains = <&ps_atc0_cio>;
+	};
+
+	ps_atc1_common: power-controller@448 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x448 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "atc1_common";
+	};
+
+	ps_atc1_pcie: power-controller@450 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x450 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "atc1_pcie";
+		power-domains = <&ps_atc1_common>;
+	};
+
+	ps_atc1_cio: power-controller@458 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x458 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "atc1_cio";
+		power-domains = <&ps_atc1_common>;
+	};
+
+	ps_atc1_cio_pcie: power-controller@460 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x460 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "atc1_cio_pcie";
+		power-domains = <&ps_atc1_cio>;
+	};
+
+	ps_atc1_cio_usb: power-controller@468 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x468 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "atc1_cio_usb";
+		power-domains = <&ps_atc1_cio>;
+	};
+
+	ps_sep: power-controller@c00 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0xc00 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "sep";
+		apple,always-on; /* Locked on */
+	};
+
+	ps_venc_dma: power-controller@8000 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x8000 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "venc_dma";
+		power-domains = <&ps_venc_sys>;
+	};
+
+	ps_venc_pipe4: power-controller@8008 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x8008 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "venc_pipe4";
+		power-domains = <&ps_venc_dma>;
+	};
+
+	ps_venc_pipe5: power-controller@8010 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x8010 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "venc_pipe5";
+		power-domains = <&ps_venc_dma>;
+	};
+
+	ps_venc_me0: power-controller@8018 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x8018 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "venc_me0";
+		power-domains = <&ps_venc_pipe4>, <&ps_venc_pipe5>;
+	};
+
+	ps_venc_me1: power-controller@8020 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x8020 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "venc_me1";
+		power-domains = <&ps_venc_pipe4>, <&ps_venc_pipe5>;
+	};
+
+	ps_ane_sys_cpu: power-controller@c000 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0xc000 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "ane_sys_cpu";
+		power-domains = <&ps_ane_sys>;
+	};
+
+	ps_disp0_cpu0: power-controller@10018 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x10018 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "disp0_cpu0";
+		power-domains = <&ps_disp0_fe>;
+		apple,always-on; /* TODO: figure out if we can enable PM here */
+	};
+};
+
+&pmgr_mini {
+	ps_debug: power-controller@58 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x58 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "debug";
+		apple,always-on; /* Core AON device */
+	};
+
+	ps_nub_spmi0: power-controller@60 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x60 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "nub_spmi0";
+		apple,always-on; /* Core AON device */
+	};
+
+	ps_nub_aon: power-controller@70 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x70 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "nub_aon";
+		apple,always-on; /* Core AON device */
+	};
+
+	ps_nub_gpio: power-controller@80 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x80 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "nub_gpio";
+		apple,always-on; /* Core AON device */
+	};
+
+	ps_nub_fabric: power-controller@a8 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0xa8 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "nub_fabric";
+		apple,always-on; /* Core AON device */
+	};
+
+	ps_nub_sram: power-controller@b0 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0xb0 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "nub_sram";
+		apple,always-on; /* Core AON device */
+	};
+
+	ps_debug_usb: power-controller@b8 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0xb8 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "debug_usb";
+		apple,always-on; /* Core AON device */
+		power-domains = <&ps_debug>;
+	};
+
+	ps_debug_auth: power-controller@c0 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0xc0 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "debug_auth";
+		apple,always-on; /* Core AON device */
+		power-domains = <&ps_debug>;
+	};
+
+	ps_nub_spmi1: power-controller@68 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x68 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "nub_spmi1";
+		apple,always-on; /* Core AON device */
+	};
+
+	ps_msg: power-controller@78 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x78 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "msg";
+	};
+
+	ps_atc0_usb_aon: power-controller@88 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x88 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "atc0_usb_aon";
+	};
+
+	ps_atc1_usb_aon: power-controller@90 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x90 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "atc1_usb_aon";
+	};
+
+	ps_atc0_usb: power-controller@98 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0x98 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "atc0_usb";
+		power-domains = <&ps_atc0_usb_aon>, <&ps_atc0_common>;
+	};
+
+	ps_atc1_usb: power-controller@a0 {
+		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
+		reg = <0xa0 4>;
+		#power-domain-cells = <0>;
+		#reset-cells = <0>;
+		label = "atc1_usb";
+		power-domains = <&ps_atc1_usb_aon>, <&ps_atc1_common>;
+	};
+};
diff --git a/arch/arm64/boot/dts/apple/t8103.dtsi b/arch/arm64/boot/dts/apple/t8103.dtsi
index fc8b2bb06ffe..0487ac64fca3 100644
--- a/arch/arm64/boot/dts/apple/t8103.dtsi
+++ b/arch/arm64/boot/dts/apple/t8103.dtsi
@@ -123,6 +123,7 @@ serial0: serial@235200000 {
 			 */
 			clocks = <&clk24>, <&clk24>;
 			clock-names = "uart", "clk_uart_baud0";
+			power-domains = <&ps_uart0>;
 			status = "disabled";
 		};
 
@@ -131,11 +132,20 @@ aic: interrupt-controller@23b100000 {
 			#interrupt-cells = <3>;
 			interrupt-controller;
 			reg = <0x2 0x3b100000 0x0 0x8000>;
+			power-domains = <&ps_aic>;
+		};
+
+		pmgr: power-management@23b700000 {
+			compatible = "apple,t8103-pmgr", "apple,pmgr", "syscon", "simple-mfd";
+			#address-cells = <1>;
+			#size-cells = <1>;
+			reg = <0x2 0x3b700000 0 0x14000>;
 		};
 
 		pinctrl_ap: pinctrl@23c100000 {
 			compatible = "apple,t8103-pinctrl", "apple,pinctrl";
 			reg = <0x2 0x3c100000 0x0 0x100000>;
+			power-domains = <&ps_gpio>;
 
 			gpio-controller;
 			#gpio-cells = <2>;
@@ -159,6 +169,13 @@ pcie_pins: pcie-pins {
 			};
 		};
 
+		pmgr_mini: power-management@23d280000 {
+			compatible = "apple,t8103-pmgr", "apple,pmgr", "syscon", "simple-mfd";
+			#address-cells = <1>;
+			#size-cells = <1>;
+			reg = <0x2 0x3d280000 0 0x4000>;
+		};
+
 		pinctrl_aop: pinctrl@24a820000 {
 			compatible = "apple,t8103-pinctrl", "apple,pinctrl";
 			reg = <0x2 0x4a820000 0x0 0x4000>;
@@ -182,6 +199,7 @@ pinctrl_aop: pinctrl@24a820000 {
 		pinctrl_nub: pinctrl@23d1f0000 {
 			compatible = "apple,t8103-pinctrl", "apple,pinctrl";
 			reg = <0x2 0x3d1f0000 0x0 0x4000>;
+			power-domains = <&ps_nub_gpio>;
 
 			gpio-controller;
 			#gpio-cells = <2>;
@@ -225,6 +243,7 @@ pcie0_dart_0: dart@681008000 {
 			#iommu-cells = <1>;
 			interrupt-parent = <&aic>;
 			interrupts = <AIC_IRQ 696 IRQ_TYPE_LEVEL_HIGH>;
+			power-domains = <&ps_apcie_gp>;
 		};
 
 		pcie0_dart_1: dart@682008000 {
@@ -233,6 +252,7 @@ pcie0_dart_1: dart@682008000 {
 			#iommu-cells = <1>;
 			interrupt-parent = <&aic>;
 			interrupts = <AIC_IRQ 699 IRQ_TYPE_LEVEL_HIGH>;
+			power-domains = <&ps_apcie_gp>;
 		};
 
 		pcie0_dart_2: dart@683008000 {
@@ -241,6 +261,7 @@ pcie0_dart_2: dart@683008000 {
 			#iommu-cells = <1>;
 			interrupt-parent = <&aic>;
 			interrupts = <AIC_IRQ 702 IRQ_TYPE_LEVEL_HIGH>;
+			power-domains = <&ps_apcie_gp>;
 		};
 
 		pcie0: pcie@690000000 {
@@ -275,6 +296,7 @@ pcie0: pcie@690000000 {
 			ranges = <0x43000000 0x6 0xa0000000 0x6 0xa0000000 0x0 0x20000000>,
 				 <0x02000000 0x0 0xc0000000 0x6 0xc0000000 0x0 0x40000000>;
 
+			power-domains = <&ps_apcie_gp>;
 			pinctrl-0 = <&pcie_pins>;
 			pinctrl-names = "default";
 
@@ -340,3 +362,5 @@ port02: pci@2,0 {
 		};
 	};
 };
+
+#include "t8103-pmgr.dtsi"
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH v3 10/11] tty: serial: samsung_tty: Support runtime PM
  2021-11-24  7:34 [PATCH v3 00/11] Apple SoC PMGR device power states driver Hector Martin
                   ` (8 preceding siblings ...)
  2021-11-24  7:34 ` [PATCH v3 09/11] arm64: dts: apple: t8103: Add PMGR nodes Hector Martin
@ 2021-11-24  7:46 ` Hector Martin
  2021-12-07  9:18   ` Krzysztof Kozlowski
  2021-11-24  7:46 ` [PATCH v3 11/11] arm64: dts: apple: t8103: Add UART2 Hector Martin
  2021-12-07  5:30 ` [PATCH v3 00/11] Apple SoC PMGR device power states driver Hector Martin
  11 siblings, 1 reply; 23+ messages in thread
From: Hector Martin @ 2021-11-24  7:46 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Hector Martin, Marc Zyngier, Rob Herring, Arnd Bergmann,
	Linus Walleij, Alyssa Rosenzweig, Krzysztof Kozlowski,
	Greg Kroah-Hartman, Mark Kettenis, Philipp Zabel,
	Rafael J. Wysocki, Johan Hovold, devicetree, linux-pm,
	linux-kernel, linux-samsung-soc, linux-serial

This allows idle UART devices to be suspended using the standard
runtime-PM framework. The logic is modeled after stm32-usart.

Signed-off-by: Hector Martin <marcan@marcan.st>
---
 drivers/tty/serial/samsung_tty.c | 93 ++++++++++++++++++++------------
 1 file changed, 59 insertions(+), 34 deletions(-)

diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c
index ca084c10d0bb..75c87d7240d9 100644
--- a/drivers/tty/serial/samsung_tty.c
+++ b/drivers/tty/serial/samsung_tty.c
@@ -40,6 +40,7 @@
 #include <linux/clk.h>
 #include <linux/cpufreq.h>
 #include <linux/of.h>
+#include <linux/pm_runtime.h>
 #include <asm/irq.h>
 
 /* UART name and device definitions */
@@ -1381,31 +1382,49 @@ static void exynos_usi_init(struct uart_port *port)
 
 /* power power management control */
 
-static void s3c24xx_serial_pm(struct uart_port *port, unsigned int level,
-			      unsigned int old)
+static int __maybe_unused s3c24xx_serial_runtime_suspend(struct device *dev)
 {
+	struct uart_port *port = dev_get_drvdata(dev);
 	struct s3c24xx_uart_port *ourport = to_ourport(port);
 	int timeout = 10000;
 
-	ourport->pm_level = level;
+	while (--timeout && !s3c24xx_serial_txempty_nofifo(port))
+		udelay(100);
 
-	switch (level) {
-	case 3:
-		while (--timeout && !s3c24xx_serial_txempty_nofifo(port))
-			udelay(100);
+	if (!IS_ERR(ourport->baudclk))
+		clk_disable_unprepare(ourport->baudclk);
 
-		if (!IS_ERR(ourport->baudclk))
-			clk_disable_unprepare(ourport->baudclk);
+	clk_disable_unprepare(ourport->clk);
+	return 0;
+};
 
-		clk_disable_unprepare(ourport->clk);
-		break;
+static int __maybe_unused s3c24xx_serial_runtime_resume(struct device *dev)
+{
+	struct uart_port *port = dev_get_drvdata(dev);
+	struct s3c24xx_uart_port *ourport = to_ourport(port);
 
-	case 0:
-		clk_prepare_enable(ourport->clk);
+	clk_prepare_enable(ourport->clk);
 
-		if (!IS_ERR(ourport->baudclk))
-			clk_prepare_enable(ourport->baudclk);
+	if (!IS_ERR(ourport->baudclk))
+		clk_prepare_enable(ourport->baudclk);
+	return 0;
+};
 
+static void s3c24xx_serial_pm(struct uart_port *port, unsigned int level,
+			      unsigned int old)
+{
+	struct s3c24xx_uart_port *ourport = to_ourport(port);
+
+	ourport->pm_level = level;
+
+	switch (level) {
+	case UART_PM_STATE_OFF:
+		pm_runtime_mark_last_busy(port->dev);
+		pm_runtime_put_sync(port->dev);
+		break;
+
+	case UART_PM_STATE_ON:
+		pm_runtime_get_sync(port->dev);
 		exynos_usi_init(port);
 		break;
 	default:
@@ -2282,18 +2301,15 @@ static int s3c24xx_serial_probe(struct platform_device *pdev)
 		}
 	}
 
+	pm_runtime_get_noresume(&pdev->dev);
+	pm_runtime_set_active(&pdev->dev);
+	pm_runtime_enable(&pdev->dev);
+
 	dev_dbg(&pdev->dev, "%s: adding port\n", __func__);
 	uart_add_one_port(&s3c24xx_uart_drv, &ourport->port);
 	platform_set_drvdata(pdev, &ourport->port);
 
-	/*
-	 * Deactivate the clock enabled in s3c24xx_serial_init_port here,
-	 * so that a potential re-enablement through the pm-callback overlaps
-	 * and keeps the clock enabled in this case.
-	 */
-	clk_disable_unprepare(ourport->clk);
-	if (!IS_ERR(ourport->baudclk))
-		clk_disable_unprepare(ourport->baudclk);
+	pm_runtime_put_sync(&pdev->dev);
 
 	ret = s3c24xx_serial_cpufreq_register(ourport);
 	if (ret < 0)
@@ -2307,10 +2323,21 @@ static int s3c24xx_serial_probe(struct platform_device *pdev)
 static int s3c24xx_serial_remove(struct platform_device *dev)
 {
 	struct uart_port *port = s3c24xx_dev_to_port(&dev->dev);
+	struct s3c24xx_uart_port *ourport = to_ourport(port);
 
 	if (port) {
+		pm_runtime_get_sync(&dev->dev);
+
 		s3c24xx_serial_cpufreq_deregister(to_ourport(port));
 		uart_remove_one_port(&s3c24xx_uart_drv, port);
+
+		clk_disable_unprepare(ourport->clk);
+		if (!IS_ERR(ourport->baudclk))
+			clk_disable_unprepare(ourport->baudclk);
+
+		pm_runtime_disable(&dev->dev);
+		pm_runtime_set_suspended(&dev->dev);
+		pm_runtime_put_noidle(&dev->dev);
 	}
 
 	uart_unregister_driver(&s3c24xx_uart_drv);
@@ -2319,8 +2346,8 @@ static int s3c24xx_serial_remove(struct platform_device *dev)
 }
 
 /* UART power management code */
-#ifdef CONFIG_PM_SLEEP
-static int s3c24xx_serial_suspend(struct device *dev)
+
+static int __maybe_unused s3c24xx_serial_suspend(struct device *dev)
 {
 	struct uart_port *port = s3c24xx_dev_to_port(dev);
 
@@ -2330,7 +2357,7 @@ static int s3c24xx_serial_suspend(struct device *dev)
 	return 0;
 }
 
-static int s3c24xx_serial_resume(struct device *dev)
+static int __maybe_unused s3c24xx_serial_resume(struct device *dev)
 {
 	struct uart_port *port = s3c24xx_dev_to_port(dev);
 	struct s3c24xx_uart_port *ourport = to_ourport(port);
@@ -2350,7 +2377,7 @@ static int s3c24xx_serial_resume(struct device *dev)
 	return 0;
 }
 
-static int s3c24xx_serial_resume_noirq(struct device *dev)
+static int __maybe_unused s3c24xx_serial_resume_noirq(struct device *dev)
 {
 	struct uart_port *port = s3c24xx_dev_to_port(dev);
 	struct s3c24xx_uart_port *ourport = to_ourport(port);
@@ -2420,16 +2447,14 @@ static int s3c24xx_serial_resume_noirq(struct device *dev)
 }
 
 static const struct dev_pm_ops s3c24xx_serial_pm_ops = {
+#ifdef CONFIG_PM_SLEEP
 	.suspend = s3c24xx_serial_suspend,
 	.resume = s3c24xx_serial_resume,
 	.resume_noirq = s3c24xx_serial_resume_noirq,
+#endif
+	SET_RUNTIME_PM_OPS(s3c24xx_serial_runtime_suspend,
+			   s3c24xx_serial_runtime_resume, NULL)
 };
-#define SERIAL_SAMSUNG_PM_OPS	(&s3c24xx_serial_pm_ops)
-
-#else /* !CONFIG_PM_SLEEP */
-
-#define SERIAL_SAMSUNG_PM_OPS	NULL
-#endif /* CONFIG_PM_SLEEP */
 
 /* Console code */
 
@@ -2921,7 +2946,7 @@ static struct platform_driver samsung_serial_driver = {
 	.id_table	= s3c24xx_serial_driver_ids,
 	.driver		= {
 		.name	= "samsung-uart",
-		.pm	= SERIAL_SAMSUNG_PM_OPS,
+		.pm	= &s3c24xx_serial_pm_ops,
 		.of_match_table	= of_match_ptr(s3c24xx_uart_dt_match),
 	},
 };
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH v3 11/11] arm64: dts: apple: t8103: Add UART2
  2021-11-24  7:34 [PATCH v3 00/11] Apple SoC PMGR device power states driver Hector Martin
                   ` (9 preceding siblings ...)
  2021-11-24  7:46 ` [PATCH v3 10/11] tty: serial: samsung_tty: Support runtime PM Hector Martin
@ 2021-11-24  7:46 ` Hector Martin
  2021-12-07  5:30 ` [PATCH v3 00/11] Apple SoC PMGR device power states driver Hector Martin
  11 siblings, 0 replies; 23+ messages in thread
From: Hector Martin @ 2021-11-24  7:46 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Hector Martin, Marc Zyngier, Rob Herring, Arnd Bergmann,
	Linus Walleij, Alyssa Rosenzweig, Krzysztof Kozlowski,
	Greg Kroah-Hartman, Mark Kettenis, Philipp Zabel,
	Rafael J. Wysocki, Johan Hovold, devicetree, linux-pm,
	linux-kernel, linux-samsung-soc, linux-serial, Mark Kettenis

This UART is connected to the debug port of the WLAN module. It is
mostly useless, but makes for a good test case for runtime-pm without
having to unbind the console from the main system UART.

Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
Signed-off-by: Hector Martin <marcan@marcan.st>
---
 arch/arm64/boot/dts/apple/t8103-j274.dts |  5 +++++
 arch/arm64/boot/dts/apple/t8103.dtsi     | 12 ++++++++++++
 2 files changed, 17 insertions(+)

diff --git a/arch/arm64/boot/dts/apple/t8103-j274.dts b/arch/arm64/boot/dts/apple/t8103-j274.dts
index 33a80f9501dc..86ea1b0a6cc8 100644
--- a/arch/arm64/boot/dts/apple/t8103-j274.dts
+++ b/arch/arm64/boot/dts/apple/t8103-j274.dts
@@ -17,6 +17,7 @@ / {
 
 	aliases {
 		serial0 = &serial0;
+		serial2 = &serial2;
 		ethernet0 = &ethernet0;
 	};
 
@@ -45,6 +46,10 @@ &serial0 {
 	status = "okay";
 };
 
+&serial2 {
+	status = "okay";
+};
+
 /*
  * Force the bus number assignments so that we can declare some of the
  * on-board devices and properties that are populated by the bootloader
diff --git a/arch/arm64/boot/dts/apple/t8103.dtsi b/arch/arm64/boot/dts/apple/t8103.dtsi
index 0487ac64fca3..26b5d68a5c7b 100644
--- a/arch/arm64/boot/dts/apple/t8103.dtsi
+++ b/arch/arm64/boot/dts/apple/t8103.dtsi
@@ -127,6 +127,18 @@ serial0: serial@235200000 {
 			status = "disabled";
 		};
 
+		serial2: serial@235208000 {
+			compatible = "apple,s5l-uart";
+			reg = <0x2 0x35208000 0x0 0x1000>;
+			reg-io-width = <4>;
+			interrupt-parent = <&aic>;
+			interrupts = <AIC_IRQ 607 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&clk24>, <&clk24>;
+			clock-names = "uart", "clk_uart_baud0";
+			power-domains = <&ps_uart2>;
+			status = "disabled";
+		};
+
 		aic: interrupt-controller@23b100000 {
 			compatible = "apple,t8103-aic", "apple,aic";
 			#interrupt-cells = <3>;
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Re: [PATCH v3 07/11] dt-bindings: arm: apple: Add apple,pmgr binding
  2021-11-24  7:34 ` [PATCH v3 07/11] dt-bindings: arm: apple: Add apple,pmgr binding Hector Martin
@ 2021-11-28 16:24   ` Rob Herring
  0 siblings, 0 replies; 23+ messages in thread
From: Rob Herring @ 2021-11-28 16:24 UTC (permalink / raw)
  To: Hector Martin
  Cc: Alyssa Rosenzweig, linux-arm-kernel, Marc Zyngier, Philipp Zabel,
	Mark Kettenis, Rafael J. Wysocki, Greg Kroah-Hartman,
	Mark Kettenis, Krzysztof Kozlowski, Arnd Bergmann, linux-pm,
	devicetree, linux-samsung-soc, linux-serial, Rob Herring,
	Johan Hovold, linux-kernel, Linus Walleij

On Wed, 24 Nov 2021 16:34:17 +0900, Hector Martin wrote:
> The PMGR block in Apple Silicon SoCs is responsible for SoC power
> management. There are two PMGRs in T8103, with different register
> layouts but compatible registers. In order to support this as well
> as future SoC generations with backwards-compatible registers, we
> declare these blocks as syscons and bind to individual registers
> in child nodes. Each register controls one SoC device.
> 
> The respective apple compatibles are defined in case device-specific
> quirks are necessary in the future, but currently these nodes are
> expected to be bound by the generic syscon driver.
> 
> Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
> Signed-off-by: Hector Martin <marcan@marcan.st>
> ---
>  .../bindings/arm/apple/apple,pmgr.yaml        | 134 ++++++++++++++++++
>  1 file changed, 134 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/arm/apple/apple,pmgr.yaml
> 

Reviewed-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v3 02/11] dt-bindings: i2c: apple,i2c: Add power-domains property
  2021-11-24  7:34 ` [PATCH v3 02/11] dt-bindings: i2c: apple,i2c: Add power-domains property Hector Martin
@ 2021-11-29  0:54   ` Rob Herring
  0 siblings, 0 replies; 23+ messages in thread
From: Rob Herring @ 2021-11-29  0:54 UTC (permalink / raw)
  To: Hector Martin
  Cc: Krzysztof Kozlowski, Mark Kettenis, Johan Hovold,
	Rafael J. Wysocki, linux-serial, Arnd Bergmann, Philipp Zabel,
	Alyssa Rosenzweig, Linus Walleij, linux-kernel, Rob Herring,
	devicetree, Greg Kroah-Hartman, Marc Zyngier, linux-arm-kernel,
	linux-samsung-soc, linux-pm

On Wed, 24 Nov 2021 16:34:12 +0900, Hector Martin wrote:
> This will bind to the PMGR pwrstate nodes that control power/clock
> gating to SoC blocks. The i2c driver doesn't do runtime-pm yet, so
> initially this will just keep the domain on permanently.
> 
> Signed-off-by: Hector Martin <marcan@marcan.st>
> ---
>  Documentation/devicetree/bindings/i2c/apple,i2c.yaml | 3 +++
>  1 file changed, 3 insertions(+)
> 

Acked-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v3 03/11] dt-bindings: iommu: apple,dart: Add power-domains property
  2021-11-24  7:34 ` [PATCH v3 03/11] dt-bindings: iommu: apple,dart: " Hector Martin
@ 2021-11-29  0:54   ` Rob Herring
  0 siblings, 0 replies; 23+ messages in thread
From: Rob Herring @ 2021-11-29  0:54 UTC (permalink / raw)
  To: Hector Martin
  Cc: Rob Herring, devicetree, linux-arm-kernel, Marc Zyngier,
	Arnd Bergmann, linux-pm, linux-kernel, Johan Hovold,
	Rafael J. Wysocki, linux-serial, Greg Kroah-Hartman,
	Mark Kettenis, Philipp Zabel, linux-samsung-soc,
	Krzysztof Kozlowski, Linus Walleij, Alyssa Rosenzweig

On Wed, 24 Nov 2021 16:34:13 +0900, Hector Martin wrote:
> This will bind to the PMGR pwrstate nodes that control power/clock
> gating to SoC blocks. The DART driver doesn't do runtime-pm yet, so
> initially this will just keep the domain on permanently.
> 
> Signed-off-by: Hector Martin <marcan@marcan.st>
> ---
>  Documentation/devicetree/bindings/iommu/apple,dart.yaml | 3 +++
>  1 file changed, 3 insertions(+)
> 

Acked-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v3 04/11] dt-bindings: pinctrl: apple,pinctrl: Add power-domains property
  2021-11-24  7:34 ` [PATCH v3 04/11] dt-bindings: pinctrl: apple,pinctrl: " Hector Martin
@ 2021-11-29  0:58   ` Rob Herring
  0 siblings, 0 replies; 23+ messages in thread
From: Rob Herring @ 2021-11-29  0:58 UTC (permalink / raw)
  To: Hector Martin
  Cc: Johan Hovold, Rob Herring, Arnd Bergmann, Mark Kettenis,
	linux-arm-kernel, Alyssa Rosenzweig, Rafael J. Wysocki,
	Philipp Zabel, linux-pm, Marc Zyngier, linux-kernel,
	Krzysztof Kozlowski, linux-serial, Greg Kroah-Hartman,
	devicetree, Linus Walleij, linux-samsung-soc

On Wed, 24 Nov 2021 16:34:14 +0900, Hector Martin wrote:
> This will bind to the PMGR pwrstate nodes that control power/clock
> gating to SoC blocks. The pinctrl driver doesn't do runtime-pm yet, so
> initially this will just keep the domain on permanently.
> 
> Signed-off-by: Hector Martin <marcan@marcan.st>
> ---
>  Documentation/devicetree/bindings/pinctrl/apple,pinctrl.yaml | 3 +++
>  1 file changed, 3 insertions(+)
> 

Acked-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v3 05/11] dt-bindings: interrupt-controller: apple,aic: Add power-domains property
  2021-11-24  7:34 ` [PATCH v3 05/11] dt-bindings: interrupt-controller: apple,aic: " Hector Martin
@ 2021-11-29  0:58   ` Rob Herring
  0 siblings, 0 replies; 23+ messages in thread
From: Rob Herring @ 2021-11-29  0:58 UTC (permalink / raw)
  To: Hector Martin
  Cc: Krzysztof Kozlowski, Marc Zyngier, devicetree, Arnd Bergmann,
	Philipp Zabel, Johan Hovold, Rob Herring, Linus Walleij,
	linux-kernel, linux-pm, Alyssa Rosenzweig, Mark Kettenis,
	Rafael J. Wysocki, linux-serial, Greg Kroah-Hartman,
	linux-arm-kernel, linux-samsung-soc

On Wed, 24 Nov 2021 16:34:15 +0900, Hector Martin wrote:
> This will bind to the PMGR pwrstate nodes that control power/clock
> gating to SoC blocks. The AIC driver doesn't do runtime-pm and likely
> never will (since it is system-critical), but it makes sense to describe
> the power domain relationship the devicetree properly.
> 
> Signed-off-by: Hector Martin <marcan@marcan.st>
> ---
>  .../devicetree/bindings/interrupt-controller/apple,aic.yaml    | 3 +++
>  1 file changed, 3 insertions(+)
> 

Acked-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v3 09/11] arm64: dts: apple: t8103: Add PMGR nodes
  2021-11-24  7:34 ` [PATCH v3 09/11] arm64: dts: apple: t8103: Add PMGR nodes Hector Martin
@ 2021-12-02 17:59   ` Sven Peter
  0 siblings, 0 replies; 23+ messages in thread
From: Sven Peter @ 2021-12-02 17:59 UTC (permalink / raw)
  To: Hector Martin, linux-arm-kernel
  Cc: Marc Zyngier, Rob Herring, Arnd Bergmann, Linus Walleij,
	Alyssa Rosenzweig, Krzysztof Kozlowski, Greg Kroah-Hartman,
	Mark Kettenis, Philipp Zabel, Rafael J. Wysocki, Johan Hovold,
	devicetree, linux-pm, linux-kernel, linux-samsung-soc,
	linux-serial



On Wed, Nov 24, 2021, at 08:34, Hector Martin wrote:
> This adds the two PMGR nodes and all known power state subnodes. Since
> there are a large number of them, let's put them in a separate file to
> include.
>
> Signed-off-by: Hector Martin <marcan@marcan.st>
> ---
>  arch/arm64/boot/dts/apple/t8103-pmgr.dtsi | 1136 +++++++++++++++++++++
>  arch/arm64/boot/dts/apple/t8103.dtsi      |   24 +
>  2 files changed, 1160 insertions(+)
>  create mode 100644 arch/arm64/boot/dts/apple/t8103-pmgr.dtsi
>
> diff --git a/arch/arm64/boot/dts/apple/t8103-pmgr.dtsi 
> b/arch/arm64/boot/dts/apple/t8103-pmgr.dtsi
> new file mode 100644
> index 000000000000..1310be74df1d
> --- /dev/null
> +++ b/arch/arm64/boot/dts/apple/t8103-pmgr.dtsi
> @@ -0,0 +1,1136 @@
> +// SPDX-License-Identifier: GPL-2.0+ OR MIT
> +/*
> + * PMGR Power domains for the Apple T8103 "M1" SoC
> + *
> + * Copyright The Asahi Linux Contributors
> + */
> +
> +

[...]

> +	ps_atc0_usb_aon: power-controller@88 {
> +		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
> +		reg = <0x88 4>;
> +		#power-domain-cells = <0>;
> +		#reset-cells = <0>;
> +		label = "atc0_usb_aon";
> +	};
> +
> +	ps_atc1_usb_aon: power-controller@90 {
> +		compatible = "apple,t8103-pmgr-pwrstate", "apple,pmgr-pwrstate";
> +		reg = <0x90 4>;
> +		#power-domain-cells = <0>;
> +		#reset-cells = <0>;
> +		label = "atc1_usb_aon";
> +	};

These two nodes have AON in their name but can be powered off.
Is this intentional and Apple just labels things a bit weird in the ADT
again?


With that confirmed:

Reviewed-by: Sven Peter <sven@svenpeter.dev>




Best,

Sven

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v3 00/11] Apple SoC PMGR device power states driver
  2021-11-24  7:34 [PATCH v3 00/11] Apple SoC PMGR device power states driver Hector Martin
                   ` (10 preceding siblings ...)
  2021-11-24  7:46 ` [PATCH v3 11/11] arm64: dts: apple: t8103: Add UART2 Hector Martin
@ 2021-12-07  5:30 ` Hector Martin
  2021-12-07  7:53   ` Krzysztof Kozlowski
  11 siblings, 1 reply; 23+ messages in thread
From: Hector Martin @ 2021-12-07  5:30 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Marc Zyngier, Rob Herring, Arnd Bergmann, Linus Walleij,
	Alyssa Rosenzweig, Krzysztof Kozlowski, Greg Kroah-Hartman,
	Mark Kettenis, Philipp Zabel, Rafael J. Wysocki, Johan Hovold,
	devicetree, linux-pm, linux-kernel, linux-samsung-soc,
	linux-serial

On 24/11/2021 16.34, Hector Martin wrote:
> This series adds the driver for the Apple PMGR device power state
> registers. These registers can clockgate and (in some cases) powergate
> specific SoC blocks. They also control the reset line, and can have
> additional features such as automatic power management.
> 
> The current driver supports only the lowest/highest power states,
> provided via the genpd framework, plus reset support provided via
> the reset subsystem.
> 
> Apple's PMGRs (there are two in the T8103) have a uniform register
> bit layout (sometimes with varying features). To be able to support
> multiple SoC generations as well as express pd relationships
> dynamically, this binding describes each PMGR power state control
> as a single devicetree node. Future SoC generations are expected to
> retain backwards compatibility, allowing this driver to work on them
> with only DT changes.
> 
> #1: MAINTAINERS updates, to go via the SoC tree to avert merge hell
> #2-#5: Adds power-domains properties to existing device bindings
> #6-#7: Adds the new pmgr device tree bindings
> #8: The driver itself.
> #9: Instantiates the driver in t8103.dtsi. This adds the entire PMGR
>      node tree and references the relevant nodes from existing devices.
> #7: Adds runtime-pm support to the Samsung UART driver, as a first
>      working consumer.
> #8: Instantiates a second UART, to more easily test this.
> 
> There are currently no consumers for the reset functionality, so
> it is untested, but we will be testing it soon with the NVMe driver
> (as it is required to allow driver re-binding to work properly).
> 
> == Changes since v2 ==
> - DT schema review comments & patch order fix
> - Added the power-domains properties to devices that already mainlined
> - Now adds the entire PMGR tree. This turns off all devices we do not
>    currently instantiate, and adds power-domains to those we do. The
>    nodes were initially generated with [1] and manually tweaked. all
>    the labels match the ADT labels (lowercased), which might be used
>    by the bootloader in the future to conditionally disable nodes
>    based on hardware configuration.
> - Dropped apple,t8103-minipmgr, since I don't expect we will ever need
>    to tell apart multiple PMGR instances within a SoC, and added
>    apple,t6000-pmgr{-pwrstate} for the new SoCs.
> - Driver now unconditionally enables auto-PM for all devices. This
>    seems to be safe and should save power (it is not implemented for
>    all devices; if not implemented, the bit just doesn't exist and is
>    ignored).
> - If an always-on device is not powered on at boot, turn it on and
>    print a warning. This avoids the PM core complaining. We still
>    want to know if/when this happens, but let's not outright fail.
> - Other minor fixes (use PS names instead of offsets for messages,
>    do not spuriously clear flag bits).
> 
> On the way the parent node is handled: I've decided that these syscon
> nodes will only ever contain pwrstates and nothing else. We now size
> them based on the register range that contains pwrstate controls
> (rounded up to page size). t6000 has 3 PMGRs and t6001 has 4, and
> we shouldn't have to care about telling apart the multiple instances.
> Anything else PMGR does that needs a driver will be handled by
> entirely separate nodes in the future.
> 
> Re t6001 and t6000 (and the rumored t6002), t6000 is basically a
> cut-down version of t6001 (and t6002 is rumored to be two t6001
> dies), down to the die floorplan, so I'm quite certain we won't need
> t6001/2-specific compatibles for anything shared. The t6000 devicetree
> will just #include the t6001 one and remove the missing devices.
> Hence, everything for this SoC series is going to have compatibles
> named apple,t6000-* (except the extra instances of some blocks in
> t6001 which look like they may have differences; PMGR isn't one of
> them, but some multimedia stuff might).
> 
> [1] https://github.com/AsahiLinux/m1n1/blob/main/proxyclient/tools/pmgr_adt2dt.py
> 
> Hector Martin (11):
>    MAINTAINERS: Add PMGR power state files to ARM/APPLE MACHINE
>    dt-bindings: i2c: apple,i2c: Add power-domains property
>    dt-bindings: iommu: apple,dart: Add power-domains property
>    dt-bindings: pinctrl: apple,pinctrl: Add power-domains property
>    dt-bindings: interrupt-controller: apple,aic: Add power-domains
>      property
>    dt-bindings: power: Add apple,pmgr-pwrstate binding
>    dt-bindings: arm: apple: Add apple,pmgr binding
>    soc: apple: Add driver for Apple PMGR power state controls
>    arm64: dts: apple: t8103: Add PMGR nodes
>    tty: serial: samsung_tty: Support runtime PM
>    arm64: dts: apple: t8103: Add UART2
> 
>   .../bindings/arm/apple/apple,pmgr.yaml        |  134 ++
>   .../devicetree/bindings/i2c/apple,i2c.yaml    |    3 +
>   .../interrupt-controller/apple,aic.yaml       |    3 +
>   .../devicetree/bindings/iommu/apple,dart.yaml |    3 +
>   .../bindings/pinctrl/apple,pinctrl.yaml       |    3 +
>   .../bindings/power/apple,pmgr-pwrstate.yaml   |   71 ++
>   MAINTAINERS                                   |    3 +
>   arch/arm64/boot/dts/apple/t8103-j274.dts      |    5 +
>   arch/arm64/boot/dts/apple/t8103-pmgr.dtsi     | 1136 +++++++++++++++++
>   arch/arm64/boot/dts/apple/t8103.dtsi          |   36 +
>   drivers/soc/Kconfig                           |    1 +
>   drivers/soc/Makefile                          |    1 +
>   drivers/soc/apple/Kconfig                     |   21 +
>   drivers/soc/apple/Makefile                    |    2 +
>   drivers/soc/apple/apple-pmgr-pwrstate.c       |  317 +++++
>   drivers/tty/serial/samsung_tty.c              |   93 +-
>   16 files changed, 1798 insertions(+), 34 deletions(-)
>   create mode 100644 Documentation/devicetree/bindings/arm/apple/apple,pmgr.yaml
>   create mode 100644 Documentation/devicetree/bindings/power/apple,pmgr-pwrstate.yaml
>   create mode 100644 arch/arm64/boot/dts/apple/t8103-pmgr.dtsi
>   create mode 100644 drivers/soc/apple/Kconfig
>   create mode 100644 drivers/soc/apple/Makefile
>   create mode 100644 drivers/soc/apple/apple-pmgr-pwrstate.c
> 

Applied everything except the samsung_tty change to asahi-soc/dt (DT 
changes) and asahi-soc/pmgr (just the driver). Thanks everyone for the 
reviews!

Krzysztof: feel free to take that patch through tty if you think it's in 
good shape. I'm not sure how much power UART runtime-pm will save us, 
but at least it's a decent test case, so it's probably worth having.

-- 
Hector Martin (marcan@marcan.st)
Public Key: https://mrcn.st/pub

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v3 00/11] Apple SoC PMGR device power states driver
  2021-12-07  5:30 ` [PATCH v3 00/11] Apple SoC PMGR device power states driver Hector Martin
@ 2021-12-07  7:53   ` Krzysztof Kozlowski
  2021-12-07  8:06     ` Greg Kroah-Hartman
  0 siblings, 1 reply; 23+ messages in thread
From: Krzysztof Kozlowski @ 2021-12-07  7:53 UTC (permalink / raw)
  To: Hector Martin, linux-arm-kernel
  Cc: Marc Zyngier, Rob Herring, Arnd Bergmann, Linus Walleij,
	Alyssa Rosenzweig, Greg Kroah-Hartman, Mark Kettenis,
	Philipp Zabel, Rafael J. Wysocki, Johan Hovold, devicetree,
	linux-pm, linux-kernel, linux-samsung-soc, linux-serial

On 07/12/2021 06:30, Hector Martin wrote:
> On 24/11/2021 16.34, Hector Martin wrote:
>> This series adds the driver for the Apple PMGR device power state
>> registers. These registers can clockgate and (in some cases) powergate
>> specific SoC blocks. They also control the reset line, and can have
>> additional features such as automatic power management.
>>
>> The current driver supports only the lowest/highest power states,
>> provided via the genpd framework, plus reset support provided via
>> the reset subsystem.
>>
>> Apple's PMGRs (there are two in the T8103) have a uniform register
>> bit layout (sometimes with varying features). To be able to support
>> multiple SoC generations as well as express pd relationships
>> dynamically, this binding describes each PMGR power state control
>> as a single devicetree node. Future SoC generations are expected to
>> retain backwards compatibility, allowing this driver to work on them
>> with only DT changes.
>>
>> #1: MAINTAINERS updates, to go via the SoC tree to avert merge hell
>> #2-#5: Adds power-domains properties to existing device bindings
>> #6-#7: Adds the new pmgr device tree bindings
>> #8: The driver itself.
>> #9: Instantiates the driver in t8103.dtsi. This adds the entire PMGR
>>      node tree and references the relevant nodes from existing devices.
>> #7: Adds runtime-pm support to the Samsung UART driver, as a first
>>      working consumer.
>> #8: Instantiates a second UART, to more easily test this.
>>
>> There are currently no consumers for the reset functionality, so
>> it is untested, but we will be testing it soon with the NVMe driver
>> (as it is required to allow driver re-binding to work properly).
>>
>> == Changes since v2 ==
>> - DT schema review comments & patch order fix
>> - Added the power-domains properties to devices that already mainlined
>> - Now adds the entire PMGR tree. This turns off all devices we do not
>>    currently instantiate, and adds power-domains to those we do. The
>>    nodes were initially generated with [1] and manually tweaked. all
>>    the labels match the ADT labels (lowercased), which might be used
>>    by the bootloader in the future to conditionally disable nodes
>>    based on hardware configuration.
>> - Dropped apple,t8103-minipmgr, since I don't expect we will ever need
>>    to tell apart multiple PMGR instances within a SoC, and added
>>    apple,t6000-pmgr{-pwrstate} for the new SoCs.
>> - Driver now unconditionally enables auto-PM for all devices. This
>>    seems to be safe and should save power (it is not implemented for
>>    all devices; if not implemented, the bit just doesn't exist and is
>>    ignored).
>> - If an always-on device is not powered on at boot, turn it on and
>>    print a warning. This avoids the PM core complaining. We still
>>    want to know if/when this happens, but let's not outright fail.
>> - Other minor fixes (use PS names instead of offsets for messages,
>>    do not spuriously clear flag bits).
>>
>> On the way the parent node is handled: I've decided that these syscon
>> nodes will only ever contain pwrstates and nothing else. We now size
>> them based on the register range that contains pwrstate controls
>> (rounded up to page size). t6000 has 3 PMGRs and t6001 has 4, and
>> we shouldn't have to care about telling apart the multiple instances.
>> Anything else PMGR does that needs a driver will be handled by
>> entirely separate nodes in the future.
>>
>> Re t6001 and t6000 (and the rumored t6002), t6000 is basically a
>> cut-down version of t6001 (and t6002 is rumored to be two t6001
>> dies), down to the die floorplan, so I'm quite certain we won't need
>> t6001/2-specific compatibles for anything shared. The t6000 devicetree
>> will just #include the t6001 one and remove the missing devices.
>> Hence, everything for this SoC series is going to have compatibles
>> named apple,t6000-* (except the extra instances of some blocks in
>> t6001 which look like they may have differences; PMGR isn't one of
>> them, but some multimedia stuff might).
>>
>> [1] https://github.com/AsahiLinux/m1n1/blob/main/proxyclient/tools/pmgr_adt2dt.py
>>
>> Hector Martin (11):
>>    MAINTAINERS: Add PMGR power state files to ARM/APPLE MACHINE
>>    dt-bindings: i2c: apple,i2c: Add power-domains property
>>    dt-bindings: iommu: apple,dart: Add power-domains property
>>    dt-bindings: pinctrl: apple,pinctrl: Add power-domains property
>>    dt-bindings: interrupt-controller: apple,aic: Add power-domains
>>      property
>>    dt-bindings: power: Add apple,pmgr-pwrstate binding
>>    dt-bindings: arm: apple: Add apple,pmgr binding
>>    soc: apple: Add driver for Apple PMGR power state controls
>>    arm64: dts: apple: t8103: Add PMGR nodes
>>    tty: serial: samsung_tty: Support runtime PM
>>    arm64: dts: apple: t8103: Add UART2
>>
>>   .../bindings/arm/apple/apple,pmgr.yaml        |  134 ++
>>   .../devicetree/bindings/i2c/apple,i2c.yaml    |    3 +
>>   .../interrupt-controller/apple,aic.yaml       |    3 +
>>   .../devicetree/bindings/iommu/apple,dart.yaml |    3 +
>>   .../bindings/pinctrl/apple,pinctrl.yaml       |    3 +
>>   .../bindings/power/apple,pmgr-pwrstate.yaml   |   71 ++
>>   MAINTAINERS                                   |    3 +
>>   arch/arm64/boot/dts/apple/t8103-j274.dts      |    5 +
>>   arch/arm64/boot/dts/apple/t8103-pmgr.dtsi     | 1136 +++++++++++++++++
>>   arch/arm64/boot/dts/apple/t8103.dtsi          |   36 +
>>   drivers/soc/Kconfig                           |    1 +
>>   drivers/soc/Makefile                          |    1 +
>>   drivers/soc/apple/Kconfig                     |   21 +
>>   drivers/soc/apple/Makefile                    |    2 +
>>   drivers/soc/apple/apple-pmgr-pwrstate.c       |  317 +++++
>>   drivers/tty/serial/samsung_tty.c              |   93 +-
>>   16 files changed, 1798 insertions(+), 34 deletions(-)
>>   create mode 100644 Documentation/devicetree/bindings/arm/apple/apple,pmgr.yaml
>>   create mode 100644 Documentation/devicetree/bindings/power/apple,pmgr-pwrstate.yaml
>>   create mode 100644 arch/arm64/boot/dts/apple/t8103-pmgr.dtsi
>>   create mode 100644 drivers/soc/apple/Kconfig
>>   create mode 100644 drivers/soc/apple/Makefile
>>   create mode 100644 drivers/soc/apple/apple-pmgr-pwrstate.c
>>
> 
> Applied everything except the samsung_tty change to asahi-soc/dt (DT 
> changes) and asahi-soc/pmgr (just the driver). Thanks everyone for the 
> reviews!
> 
> Krzysztof: feel free to take that patch through tty if you think it's in 
> good shape. I'm not sure how much power UART runtime-pm will save us, 
> but at least it's a decent test case, so it's probably worth having.

The tty/serial driver change goes via Greg's tree.


Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v3 00/11] Apple SoC PMGR device power states driver
  2021-12-07  7:53   ` Krzysztof Kozlowski
@ 2021-12-07  8:06     ` Greg Kroah-Hartman
  0 siblings, 0 replies; 23+ messages in thread
From: Greg Kroah-Hartman @ 2021-12-07  8:06 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Hector Martin, linux-arm-kernel, Marc Zyngier, Rob Herring,
	Arnd Bergmann, Linus Walleij, Alyssa Rosenzweig, Mark Kettenis,
	Philipp Zabel, Rafael J. Wysocki, Johan Hovold, devicetree,
	linux-pm, linux-kernel, linux-samsung-soc, linux-serial

On Tue, Dec 07, 2021 at 08:53:33AM +0100, Krzysztof Kozlowski wrote:
> On 07/12/2021 06:30, Hector Martin wrote:
> > On 24/11/2021 16.34, Hector Martin wrote:
> >> This series adds the driver for the Apple PMGR device power state
> >> registers. These registers can clockgate and (in some cases) powergate
> >> specific SoC blocks. They also control the reset line, and can have
> >> additional features such as automatic power management.
> >>
> >> The current driver supports only the lowest/highest power states,
> >> provided via the genpd framework, plus reset support provided via
> >> the reset subsystem.
> >>
> >> Apple's PMGRs (there are two in the T8103) have a uniform register
> >> bit layout (sometimes with varying features). To be able to support
> >> multiple SoC generations as well as express pd relationships
> >> dynamically, this binding describes each PMGR power state control
> >> as a single devicetree node. Future SoC generations are expected to
> >> retain backwards compatibility, allowing this driver to work on them
> >> with only DT changes.
> >>
> >> #1: MAINTAINERS updates, to go via the SoC tree to avert merge hell
> >> #2-#5: Adds power-domains properties to existing device bindings
> >> #6-#7: Adds the new pmgr device tree bindings
> >> #8: The driver itself.
> >> #9: Instantiates the driver in t8103.dtsi. This adds the entire PMGR
> >>      node tree and references the relevant nodes from existing devices.
> >> #7: Adds runtime-pm support to the Samsung UART driver, as a first
> >>      working consumer.
> >> #8: Instantiates a second UART, to more easily test this.
> >>
> >> There are currently no consumers for the reset functionality, so
> >> it is untested, but we will be testing it soon with the NVMe driver
> >> (as it is required to allow driver re-binding to work properly).
> >>
> >> == Changes since v2 ==
> >> - DT schema review comments & patch order fix
> >> - Added the power-domains properties to devices that already mainlined
> >> - Now adds the entire PMGR tree. This turns off all devices we do not
> >>    currently instantiate, and adds power-domains to those we do. The
> >>    nodes were initially generated with [1] and manually tweaked. all
> >>    the labels match the ADT labels (lowercased), which might be used
> >>    by the bootloader in the future to conditionally disable nodes
> >>    based on hardware configuration.
> >> - Dropped apple,t8103-minipmgr, since I don't expect we will ever need
> >>    to tell apart multiple PMGR instances within a SoC, and added
> >>    apple,t6000-pmgr{-pwrstate} for the new SoCs.
> >> - Driver now unconditionally enables auto-PM for all devices. This
> >>    seems to be safe and should save power (it is not implemented for
> >>    all devices; if not implemented, the bit just doesn't exist and is
> >>    ignored).
> >> - If an always-on device is not powered on at boot, turn it on and
> >>    print a warning. This avoids the PM core complaining. We still
> >>    want to know if/when this happens, but let's not outright fail.
> >> - Other minor fixes (use PS names instead of offsets for messages,
> >>    do not spuriously clear flag bits).
> >>
> >> On the way the parent node is handled: I've decided that these syscon
> >> nodes will only ever contain pwrstates and nothing else. We now size
> >> them based on the register range that contains pwrstate controls
> >> (rounded up to page size). t6000 has 3 PMGRs and t6001 has 4, and
> >> we shouldn't have to care about telling apart the multiple instances.
> >> Anything else PMGR does that needs a driver will be handled by
> >> entirely separate nodes in the future.
> >>
> >> Re t6001 and t6000 (and the rumored t6002), t6000 is basically a
> >> cut-down version of t6001 (and t6002 is rumored to be two t6001
> >> dies), down to the die floorplan, so I'm quite certain we won't need
> >> t6001/2-specific compatibles for anything shared. The t6000 devicetree
> >> will just #include the t6001 one and remove the missing devices.
> >> Hence, everything for this SoC series is going to have compatibles
> >> named apple,t6000-* (except the extra instances of some blocks in
> >> t6001 which look like they may have differences; PMGR isn't one of
> >> them, but some multimedia stuff might).
> >>
> >> [1] https://github.com/AsahiLinux/m1n1/blob/main/proxyclient/tools/pmgr_adt2dt.py
> >>
> >> Hector Martin (11):
> >>    MAINTAINERS: Add PMGR power state files to ARM/APPLE MACHINE
> >>    dt-bindings: i2c: apple,i2c: Add power-domains property
> >>    dt-bindings: iommu: apple,dart: Add power-domains property
> >>    dt-bindings: pinctrl: apple,pinctrl: Add power-domains property
> >>    dt-bindings: interrupt-controller: apple,aic: Add power-domains
> >>      property
> >>    dt-bindings: power: Add apple,pmgr-pwrstate binding
> >>    dt-bindings: arm: apple: Add apple,pmgr binding
> >>    soc: apple: Add driver for Apple PMGR power state controls
> >>    arm64: dts: apple: t8103: Add PMGR nodes
> >>    tty: serial: samsung_tty: Support runtime PM
> >>    arm64: dts: apple: t8103: Add UART2
> >>
> >>   .../bindings/arm/apple/apple,pmgr.yaml        |  134 ++
> >>   .../devicetree/bindings/i2c/apple,i2c.yaml    |    3 +
> >>   .../interrupt-controller/apple,aic.yaml       |    3 +
> >>   .../devicetree/bindings/iommu/apple,dart.yaml |    3 +
> >>   .../bindings/pinctrl/apple,pinctrl.yaml       |    3 +
> >>   .../bindings/power/apple,pmgr-pwrstate.yaml   |   71 ++
> >>   MAINTAINERS                                   |    3 +
> >>   arch/arm64/boot/dts/apple/t8103-j274.dts      |    5 +
> >>   arch/arm64/boot/dts/apple/t8103-pmgr.dtsi     | 1136 +++++++++++++++++
> >>   arch/arm64/boot/dts/apple/t8103.dtsi          |   36 +
> >>   drivers/soc/Kconfig                           |    1 +
> >>   drivers/soc/Makefile                          |    1 +
> >>   drivers/soc/apple/Kconfig                     |   21 +
> >>   drivers/soc/apple/Makefile                    |    2 +
> >>   drivers/soc/apple/apple-pmgr-pwrstate.c       |  317 +++++
> >>   drivers/tty/serial/samsung_tty.c              |   93 +-
> >>   16 files changed, 1798 insertions(+), 34 deletions(-)
> >>   create mode 100644 Documentation/devicetree/bindings/arm/apple/apple,pmgr.yaml
> >>   create mode 100644 Documentation/devicetree/bindings/power/apple,pmgr-pwrstate.yaml
> >>   create mode 100644 arch/arm64/boot/dts/apple/t8103-pmgr.dtsi
> >>   create mode 100644 drivers/soc/apple/Kconfig
> >>   create mode 100644 drivers/soc/apple/Makefile
> >>   create mode 100644 drivers/soc/apple/apple-pmgr-pwrstate.c
> >>
> > 
> > Applied everything except the samsung_tty change to asahi-soc/dt (DT 
> > changes) and asahi-soc/pmgr (just the driver). Thanks everyone for the 
> > reviews!
> > 
> > Krzysztof: feel free to take that patch through tty if you think it's in 
> > good shape. I'm not sure how much power UART runtime-pm will save us, 
> > but at least it's a decent test case, so it's probably worth having.
> 
> The tty/serial driver change goes via Greg's tree.

I'll be glad to take it if you ack it :)

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v3 10/11] tty: serial: samsung_tty: Support runtime PM
  2021-11-24  7:46 ` [PATCH v3 10/11] tty: serial: samsung_tty: Support runtime PM Hector Martin
@ 2021-12-07  9:18   ` Krzysztof Kozlowski
  2021-12-09 10:48     ` Andy Shevchenko
  0 siblings, 1 reply; 23+ messages in thread
From: Krzysztof Kozlowski @ 2021-12-07  9:18 UTC (permalink / raw)
  To: Hector Martin, linux-arm-kernel
  Cc: Marc Zyngier, Rob Herring, Arnd Bergmann, Linus Walleij,
	Alyssa Rosenzweig, Greg Kroah-Hartman, Mark Kettenis,
	Philipp Zabel, Rafael J. Wysocki, Johan Hovold, devicetree,
	linux-pm, linux-kernel, linux-samsung-soc, linux-serial

On 24/11/2021 08:46, Hector Martin wrote:
> This allows idle UART devices to be suspended using the standard
> runtime-PM framework. The logic is modeled after stm32-usart.
> 
> Signed-off-by: Hector Martin <marcan@marcan.st>
> ---
>  drivers/tty/serial/samsung_tty.c | 93 ++++++++++++++++++++------------
>  1 file changed, 59 insertions(+), 34 deletions(-)
> 

Looks good.

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>



Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v3 10/11] tty: serial: samsung_tty: Support runtime PM
  2021-12-07  9:18   ` Krzysztof Kozlowski
@ 2021-12-09 10:48     ` Andy Shevchenko
  0 siblings, 0 replies; 23+ messages in thread
From: Andy Shevchenko @ 2021-12-09 10:48 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Hector Martin, linux-arm Mailing List, Marc Zyngier, Rob Herring,
	Arnd Bergmann, Linus Walleij, Alyssa Rosenzweig,
	Greg Kroah-Hartman, Mark Kettenis, Philipp Zabel,
	Rafael J. Wysocki, Johan Hovold, devicetree, Linux PM,
	Linux Kernel Mailing List, Linux Samsung SOC,
	open list:SERIAL DRIVERS

On Tue, Dec 7, 2021 at 4:39 PM Krzysztof Kozlowski
<krzysztof.kozlowski@canonical.com> wrote:
> On 24/11/2021 08:46, Hector Martin wrote:
> > This allows idle UART devices to be suspended using the standard
> > runtime-PM framework. The logic is modeled after stm32-usart.

Guys, have you seen this activity:
https://lore.kernel.org/linux-serial/YbGyNW2EQlA%2F+VIg@atomide.com/T/#t?

The idea eventually is to bring the serial core to do this for us. Can
you test that series and see if it has a use in your case?

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2021-12-09 10:49 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-24  7:34 [PATCH v3 00/11] Apple SoC PMGR device power states driver Hector Martin
2021-11-24  7:34 ` [PATCH v3 01/11] MAINTAINERS: Add PMGR power state files to ARM/APPLE MACHINE Hector Martin
2021-11-24  7:34 ` [PATCH v3 02/11] dt-bindings: i2c: apple,i2c: Add power-domains property Hector Martin
2021-11-29  0:54   ` Rob Herring
2021-11-24  7:34 ` [PATCH v3 03/11] dt-bindings: iommu: apple,dart: " Hector Martin
2021-11-29  0:54   ` Rob Herring
2021-11-24  7:34 ` [PATCH v3 04/11] dt-bindings: pinctrl: apple,pinctrl: " Hector Martin
2021-11-29  0:58   ` Rob Herring
2021-11-24  7:34 ` [PATCH v3 05/11] dt-bindings: interrupt-controller: apple,aic: " Hector Martin
2021-11-29  0:58   ` Rob Herring
2021-11-24  7:34 ` [PATCH v3 06/11] dt-bindings: power: Add apple,pmgr-pwrstate binding Hector Martin
2021-11-24  7:34 ` [PATCH v3 07/11] dt-bindings: arm: apple: Add apple,pmgr binding Hector Martin
2021-11-28 16:24   ` Rob Herring
2021-11-24  7:34 ` [PATCH v3 08/11] soc: apple: Add driver for Apple PMGR power state controls Hector Martin
2021-11-24  7:34 ` [PATCH v3 09/11] arm64: dts: apple: t8103: Add PMGR nodes Hector Martin
2021-12-02 17:59   ` Sven Peter
2021-11-24  7:46 ` [PATCH v3 10/11] tty: serial: samsung_tty: Support runtime PM Hector Martin
2021-12-07  9:18   ` Krzysztof Kozlowski
2021-12-09 10:48     ` Andy Shevchenko
2021-11-24  7:46 ` [PATCH v3 11/11] arm64: dts: apple: t8103: Add UART2 Hector Martin
2021-12-07  5:30 ` [PATCH v3 00/11] Apple SoC PMGR device power states driver Hector Martin
2021-12-07  7:53   ` Krzysztof Kozlowski
2021-12-07  8:06     ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).