From patchwork Thu Dec 9 04:44:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hector Martin X-Patchwork-Id: 12695443 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 B62CDC433F5 for ; Thu, 9 Dec 2021 04:48:11 +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-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: 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: List-Owner; bh=SXQ19FkRZ1BxQrgAWPHQGnhx9n7q0MB31kQ4XbJJzNU=; b=J/8ZWtg6LJ9KIS Tftive2xksB7A9Md5gPifXjUJVb4fVuyzygFiEcWnvpG6PWEVQ48tuXiiqgTMPZ1E/kmmX8DdKC0x i6EtsFuLR2U8D0AbNEsfY1tLyMYNBMY7ct0RBPxLg5T44fBUvqO+JqD/HuV0J3sY/lpHnMKZw+xWO 35ZYqBczWuhpw6T9gfqx1pbekvM6NQl+VQoe5FKeHXcnFzuaNB8kUZRkV9TYvlfQH+lP9Dg88TVJa aGXeLISm6hyvGl92BDmEtcDbjwWCbww/yqL6LI3a7laN04jIS5OeG8K3eGGitsgLHrE1t4wzFM6GU WhP6wUsUAT7vLLOKbEmA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mvBK5-00Ev8s-Js; Thu, 09 Dec 2021 04:46:25 +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 1mvBJt-00Ev79-FZ for linux-arm-kernel@lists.infradead.org; Thu, 09 Dec 2021 04:46:14 +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 C73DF41EA2; Thu, 9 Dec 2021 04:46:08 +0000 (UTC) From: Hector Martin To: Sven Peter , Rob Herring Cc: Hector Martin , Mark Kettenis , Alyssa Rosenzweig , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org Subject: [PATCH 1/3] dt-bindings: power: apple, pmgr-pwrstate: Add apple, min-ps prop Date: Thu, 9 Dec 2021 13:44:59 +0900 Message-Id: <20211209044501.67028-2-marcan@marcan.st> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211209044501.67028-1-marcan@marcan.st> References: <20211209044501.67028-1-marcan@marcan.st> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211208_204613_693485_9D6E8E8A X-CRM114-Status: UNSURE ( 8.59 ) X-CRM114-Notice: Please train this message. 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 A few devices (DCP/DCPEXT) need to have the minimum power state for auto-PM configured. Add a property that allows the DT to specify this value. Signed-off-by: Hector Martin Reviewed-by: Rob Herring --- .../devicetree/bindings/power/apple,pmgr-pwrstate.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Documentation/devicetree/bindings/power/apple,pmgr-pwrstate.yaml b/Documentation/devicetree/bindings/power/apple,pmgr-pwrstate.yaml index 5056d08b8261..19a194980142 100644 --- a/Documentation/devicetree/bindings/power/apple,pmgr-pwrstate.yaml +++ b/Documentation/devicetree/bindings/power/apple,pmgr-pwrstate.yaml @@ -61,6 +61,14 @@ properties: Forces this power domain to always be powered up. type: boolean + apple,min-state: + description: + Specifies the minimum power state for auto-PM. + 0 = power gated, 4 = clock gated, 15 = on. + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 0 + maximum: 15 + required: - compatible - reg From patchwork Thu Dec 9 04:45:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hector Martin X-Patchwork-Id: 12695445 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 6C69AC433EF for ; Thu, 9 Dec 2021 04:48:41 +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-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: 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: List-Owner; bh=tWfKlgR/lWzgSumMw30g9CuEGfPt36OXMrx6Xa7e604=; b=Kw+3rLP/WY1ESt PBklnwLN4ojyl//9guohec3hTQsyEcaj/UCvkECdTA0O4h+RP52S+EgFvPPD4Kc7exrK5SL3KbSVJ jVas4XJKLM+X4BU1iwhSU5fVsDaAzImmsxTSseTkex4csaguwNEpCWAPGmcGqUx6F+mBRZciXSE5K 3lH3jRjxz4/15XJo0BCrA978mFIR4qwNTWgTT0EDGM4WmWmqffWCE8ZgJO9mZWYWYisEcNXPyvuvA 5okNQOXt1L3wsiDcTbBSZ5Mp/WxgpFpI+cnCYJCFlQKWV8OI0cCUqHJYlcn/RCXtfCkHJGeu9kyVU /bdCQr/5/hhI2FH/ZDfw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mvBKF-00EvAY-Cj; Thu, 09 Dec 2021 04:46:35 +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 1mvBJu-00Ev7Y-U7 for linux-arm-kernel@lists.infradead.org; Thu, 09 Dec 2021 04:46:16 +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 68CCA41EA7; Thu, 9 Dec 2021 04:46:11 +0000 (UTC) From: Hector Martin To: Sven Peter , Rob Herring Cc: Hector Martin , Mark Kettenis , Alyssa Rosenzweig , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org Subject: [PATCH 2/3] soc: apple: apple-pmgr-pwrstate: Add auto-PM min level support Date: Thu, 9 Dec 2021 13:45:00 +0900 Message-Id: <20211209044501.67028-3-marcan@marcan.st> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211209044501.67028-1-marcan@marcan.st> References: <20211209044501.67028-1-marcan@marcan.st> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211208_204615_154697_C89713F3 X-CRM114-Status: GOOD ( 10.96 ) 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 is seemingly required for DCP/DCPEXT, without which they refuse to boot properly. They need to be set to minimum state 4 (clock gated). Signed-off-by: Hector Martin Reviewed-by: Sven Peter --- drivers/soc/apple/apple-pmgr-pwrstate.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/soc/apple/apple-pmgr-pwrstate.c b/drivers/soc/apple/apple-pmgr-pwrstate.c index 8ad9d5fdefbf..590bb7439372 100644 --- a/drivers/soc/apple/apple-pmgr-pwrstate.c +++ b/drivers/soc/apple/apple-pmgr-pwrstate.c @@ -20,6 +20,7 @@ #define APPLE_PMGR_RESET BIT(31) #define APPLE_PMGR_AUTO_ENABLE BIT(28) #define APPLE_PMGR_PS_AUTO GENMASK(27, 24) +#define APPLE_PMGR_PS_MIN GENMASK(19, 16) #define APPLE_PMGR_PARENT_OFF BIT(11) #define APPLE_PMGR_DEV_DISABLE BIT(10) #define APPLE_PMGR_WAS_CLKGATED BIT(9) @@ -42,6 +43,7 @@ struct apple_pmgr_ps { struct reset_controller_dev rcdev; struct regmap *regmap; u32 offset; + u32 min_state; }; #define genpd_to_apple_pmgr_ps(_genpd) container_of(_genpd, struct apple_pmgr_ps, genpd) @@ -224,6 +226,12 @@ static int apple_pmgr_ps_probe(struct platform_device *pdev) ps->genpd.power_on = apple_pmgr_ps_power_on; ps->genpd.power_off = apple_pmgr_ps_power_off; + ret = of_property_read_u32(node, "apple,min-state", &ps->min_state); + if (ret >= 0) { + regmap_update_bits(regmap, ps->offset, APPLE_PMGR_FLAGS | APPLE_PMGR_PS_MIN, + FIELD_PREP(APPLE_PMGR_PS_MIN, ps->min_state)); + } + active = apple_pmgr_ps_is_active(ps); if (of_property_read_bool(node, "apple,always-on")) { ps->genpd.flags |= GENPD_FLAG_ALWAYS_ON; From patchwork Thu Dec 9 04:45:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hector Martin X-Patchwork-Id: 12695444 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 53818C433F5 for ; Thu, 9 Dec 2021 04:48:17 +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-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: 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: List-Owner; bh=X2P/hjUlhF4mp2WlXu9MyWCg1K9LbcAOx68kzSNJSG4=; b=iKUsoLYTQjkTVu xgEbNC31bEU3XtfuY5KxazqWJewkpnkVlPB9YdCleGO4TFyATbxd7OVobbm8CxeFMKJMM9EXsks2D /IVV0xUDzkZEWnhPtiOGCSrlZdRUTvGgN1jyA6A/1dltr59iNNllK4ijJ9xBFJj+jExUC7CpYsYmd 41ZB4Z6PKrAEv8rIgulz+xX2H647kQlrPyOqjnAyOP3b5JQWYhPGdvXHFnOlRmY6ex87eRfOco6P/ pQwv2u2eRS/hiAnVC9bqGSCStA0Mk4Fkdty6opB7BEciVRh0TfXcN/3FCpT/Ul3Su/m9+Ab8i9C6q DRrkrD+0a6ewZbjATMcg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mvBKP-00EvCV-AJ; Thu, 09 Dec 2021 04:46:45 +0000 Received: from marcansoft.com ([212.63.210.85] helo=mail.marcansoft.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mvBJx-00Ev82-Fv for linux-arm-kernel@lists.infradead.org; Thu, 09 Dec 2021 04:46:18 +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 0D0AE41E64; Thu, 9 Dec 2021 04:46:13 +0000 (UTC) From: Hector Martin To: Sven Peter , Rob Herring Cc: Hector Martin , Mark Kettenis , Alyssa Rosenzweig , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org Subject: [PATCH 3/3] arm64: dts: apple: t8103: Add apple, min-ps to DCP PMGR nodes Date: Thu, 9 Dec 2021 13:45:01 +0900 Message-Id: <20211209044501.67028-4-marcan@marcan.st> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211209044501.67028-1-marcan@marcan.st> References: <20211209044501.67028-1-marcan@marcan.st> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211208_204617_707530_D823D85E X-CRM114-Status: UNSURE ( 8.71 ) X-CRM114-Notice: Please train this message. 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 is required for DCP to boot successfully; it seems if power gating is allowed, they do not wake up properly. Signed-off-by: Hector Martin Reviewed-by: Sven Peter --- arch/arm64/boot/dts/apple/t8103-pmgr.dtsi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/boot/dts/apple/t8103-pmgr.dtsi b/arch/arm64/boot/dts/apple/t8103-pmgr.dtsi index 1310be74df1d..fc51bc872468 100644 --- a/arch/arm64/boot/dts/apple/t8103-pmgr.dtsi +++ b/arch/arm64/boot/dts/apple/t8103-pmgr.dtsi @@ -665,6 +665,7 @@ ps_dispext_cpu0: power-controller@378 { #reset-cells = <0>; label = "dispext_cpu0"; power-domains = <&ps_dispext_fe>; + apple,min-state = <4>; }; ps_jpg: power-controller@3c0 { @@ -1005,6 +1006,7 @@ ps_disp0_cpu0: power-controller@10018 { label = "disp0_cpu0"; power-domains = <&ps_disp0_fe>; apple,always-on; /* TODO: figure out if we can enable PM here */ + apple,min-state = <4>; }; };