From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6D578C433EF for ; Tue, 7 Dec 2021 05:32:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:Cc:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=WWzzu0RI2ZfYoliU6bw7RC+xGADmiMjhVCl4tdj/XTU=; b=2iri0SPq2x9kmV1tc/I0uVFm4i PBg7otvY0PwzqgWOdHkJGSJ9m+UrFxf7+ZLAYoWMgSa5Q/hyVV8yaVR7zn2QKzY/QazlhsFj5PYdN bXR2SVUDl1PT9aeWy77GyFVJqEwVDxXaoNruu+qpOTld4nWUGF4qLDuMT+EzjpZ5hHkCR3PsqKPWn sqYaH5PPKSyq+eGHIKCrYeckjFKrOuYvNbi2sGCsCG33RiOgUKzrbpXKKKJw1XCqTwjLA1NAsVIOY PtR62uBsFLPp2f2sdmx4gydgH5FhcE5cjPbwbbjqT9gXEHZO0mIMcSjXQHTx8H5Uc5OjrF0MgglPp lRWGNlKg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1muT4A-006zNW-HO; Tue, 07 Dec 2021 05:31:02 +0000 Received: from marcansoft.com ([2a01:298:fe:f::2] helo=mail.marcansoft.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1muT44-006zMV-DF for linux-arm-kernel@lists.infradead.org; Tue, 07 Dec 2021 05:30:59 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: marcan@marcan.st) by mail.marcansoft.com (Postfix) with ESMTPSA id A87FF41EF0; Tue, 7 Dec 2021 05:30:49 +0000 (UTC) Subject: Re: [PATCH v3 00/11] Apple SoC PMGR device power states driver To: linux-arm-kernel@lists.infradead.org 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@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-serial@vger.kernel.org References: <20211124073419.181799-1-marcan@marcan.st> From: Hector Martin Message-ID: <8fdf7a68-1a24-89eb-96d6-93c3f334621c@marcan.st> Date: Tue, 7 Dec 2021 14:30:46 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20211124073419.181799-1-marcan@marcan.st> Content-Language: es-ES X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211206_213056_645099_0FE7916A X-CRM114-Status: GOOD ( 42.18 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel