All of lore.kernel.org
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Hector Martin <marcan@marcan.st>, linux-arm-kernel@lists.infradead.org
Cc: Marc Zyngier <maz@kernel.org>, Rob Herring <robh+dt@kernel.org>,
	Arnd Bergmann <arnd@kernel.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Alyssa Rosenzweig <alyssa@rosenzweig.io>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Mark Kettenis <mark.kettenis@xs4all.nl>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Johan Hovold <johan@kernel.org>,
	devicetree@vger.kernel.org, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
	linux-serial@vger.kernel.org
Subject: Re: [PATCH v3 00/11] Apple SoC PMGR device power states driver
Date: Tue, 7 Dec 2021 08:53:33 +0100	[thread overview]
Message-ID: <009b3350-4424-76d5-66d6-7393cdd8cd8a@kernel.org> (raw)
In-Reply-To: <8fdf7a68-1a24-89eb-96d6-93c3f334621c@marcan.st>

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

WARNING: multiple messages have this Message-ID (diff)
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Hector Martin <marcan@marcan.st>, linux-arm-kernel@lists.infradead.org
Cc: Marc Zyngier <maz@kernel.org>, Rob Herring <robh+dt@kernel.org>,
	Arnd Bergmann <arnd@kernel.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Alyssa Rosenzweig <alyssa@rosenzweig.io>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Mark Kettenis <mark.kettenis@xs4all.nl>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Johan Hovold <johan@kernel.org>,
	devicetree@vger.kernel.org, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
	linux-serial@vger.kernel.org
Subject: Re: [PATCH v3 00/11] Apple SoC PMGR device power states driver
Date: Tue, 7 Dec 2021 08:53:33 +0100	[thread overview]
Message-ID: <009b3350-4424-76d5-66d6-7393cdd8cd8a@kernel.org> (raw)
In-Reply-To: <8fdf7a68-1a24-89eb-96d6-93c3f334621c@marcan.st>

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-12-07  7:53 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 01/11] MAINTAINERS: Add PMGR power state files to ARM/APPLE MACHINE 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
2021-11-24  7:34   ` [PATCH v3 02/11] dt-bindings: i2c: apple, i2c: " Hector Martin
2021-11-29  0:54   ` [PATCH v3 02/11] dt-bindings: i2c: apple,i2c: " Rob Herring
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-24  7:34   ` [PATCH v3 03/11] dt-bindings: iommu: apple, dart: " Hector Martin
2021-11-29  0:54   ` [PATCH v3 03/11] dt-bindings: iommu: apple,dart: " Rob Herring
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-24  7:34   ` [PATCH v3 04/11] dt-bindings: pinctrl: apple, pinctrl: " Hector Martin
2021-11-29  0:58   ` [PATCH v3 04/11] dt-bindings: pinctrl: apple,pinctrl: " Rob Herring
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-24  7:34   ` [PATCH v3 05/11] dt-bindings: interrupt-controller: apple, aic: " Hector Martin
2021-11-29  0:58   ` [PATCH v3 05/11] dt-bindings: interrupt-controller: apple,aic: " Rob Herring
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   ` Hector Martin
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-28 16:24   ` Rob Herring
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   ` Hector Martin
2021-11-24  7:34 ` [PATCH v3 09/11] arm64: dts: apple: t8103: Add PMGR nodes Hector Martin
2021-11-24  7:34   ` Hector Martin
2021-12-02 17:59   ` Sven Peter
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-11-24  7:46   ` Hector Martin
2021-12-07  9:18   ` Krzysztof Kozlowski
2021-12-07  9:18     ` Krzysztof Kozlowski
2021-12-09 10:48     ` Andy Shevchenko
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-11-24  7:46   ` Hector Martin
2021-12-07  5:30 ` [PATCH v3 00/11] Apple SoC PMGR device power states driver Hector Martin
2021-12-07  5:30   ` Hector Martin
2021-12-07  7:53   ` Krzysztof Kozlowski [this message]
2021-12-07  7:53     ` Krzysztof Kozlowski
2021-12-07  8:06     ` Greg Kroah-Hartman
2021-12-07  8:06       ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=009b3350-4424-76d5-66d6-7393cdd8cd8a@kernel.org \
    --to=krzk@kernel.org \
    --cc=alyssa@rosenzweig.io \
    --cc=arnd@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=johan@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=marcan@marcan.st \
    --cc=mark.kettenis@xs4all.nl \
    --cc=maz@kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=rafael@kernel.org \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.