From patchwork Mon Oct 25 14:47:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hector Martin X-Patchwork-Id: 12582003 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D0D9AC433F5 for ; Mon, 25 Oct 2021 14:48:53 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id A33AB60F0F for ; Mon, 25 Oct 2021 14:48:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A33AB60F0F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=marcan.st Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=qQLMrJGlNFYthD3vLIYLlyWg5V7gv3bKEzxVhMJDo18=; b=FnnLNzQkOhL7UN uHFto1qRwDQZQGQaD83JPnITOuK71WoGuCtY/7NBBQiraFWOPYf6rZof4EDT4rvsGeD8uFAQdHEhB nXkL1kFqXWv3an8uogF4U7ursOdPp6R012y91FXQIz1fXLcNpxn79mZaoYa6S9PvSHIYSSqc1SB3L 3noBOOIibvNd+/57ONiDpGqnLy0tAb57LpIP39yKl9ROUK9mPgCO44RTnrb7POdRln/73apgQpxAt vTk5qulvclOlOHbnLg5nM5yiUTslC46F50m0IpRQBvmfvdS04fZ48BmFhoN3962sTOSc7RkJCg6g1 VND/eUQfVTdjduTkfGLw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mf1GF-00GkM0-7b; Mon, 25 Oct 2021 14:47:39 +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 1mf1GB-00GkK4-6X for linux-arm-kernel@lists.infradead.org; Mon, 25 Oct 2021 14:47:37 +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: hector@marcansoft.com) by mail.marcansoft.com (Postfix) with ESMTPSA id 73AD6419B4; Mon, 25 Oct 2021 14:47:23 +0000 (UTC) From: Hector Martin To: linux-arm-kernel@lists.infradead.org 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@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: [PATCH v2 0/8] Apple SoC PMGR device power states driver Date: Mon, 25 Oct 2021 23:47:10 +0900 Message-Id: <20211025144718.157794-1-marcan@marcan.st> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211025_074735_421108_08373091 X-CRM114-Status: GOOD ( 17.26 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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-#3: Adds the required device tree bindings #4: The driver itself. #5: Somewhat unrelated DT change, but I wanted to get it out of the way for #7 #6: Instantiates the driver in t8103.dtsi. #7: Adds runtime-pm support to the Samsung UART driver, as a first 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 v1 == Mostly addressing review comments. - DT schema fixes - Reference one DT schema from the other - Full example in MFD schema - s/apple,domain-name/label/ - Split out MAINTAINERS patch - Handle failed regmap reads more sanely - Do not bind to apple,t8103-pmgr-pwrstate" Hector Martin (8): MAINTAINERS: Add PMGR power state files to ARM/APPLE MACHINE dt-bindings: arm: apple: Add apple,pmgr binding dt-bindings: power: Add apple,pmgr-pwrstate binding soc: apple: Add driver for Apple PMGR power state controls arm64: dts: apple: t8103: Rename clk24 to clkref arm64: dts: apple: t8103: Add the UART PMGR tree tty: serial: samsung_tty: Support runtime PM arm64: dts: apple: t8103: Add UART2 .../bindings/arm/apple/apple,pmgr.yaml | 149 +++++++++ .../bindings/power/apple,pmgr-pwrstate.yaml | 69 +++++ MAINTAINERS | 3 + arch/arm64/boot/dts/apple/t8103-j274.dts | 5 + arch/arm64/boot/dts/apple/t8103.dtsi | 134 ++++++++- 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 | 282 ++++++++++++++++++ drivers/tty/serial/samsung_tty.c | 93 +++--- 11 files changed, 723 insertions(+), 37 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 drivers/soc/apple/Kconfig create mode 100644 drivers/soc/apple/Makefile create mode 100644 drivers/soc/apple/apple-pmgr-pwrstate.c