From patchwork Sat Jun 25 11:36:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 12895335 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 5A927C433EF for ; Sat, 25 Jun 2022 11:39:05 +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=fUZa94iyENBduNfs/XlA8h6m67zGvJc9/9irEYwMBkU=; b=aqI4gcAi+RJjSb L7EsOBHkuo3dpOecEu/hLwepha64TwmEtHEoQ5jA0j1JeFYrLj/yAPreXZlb7MvpW3nQVeq4GiyYE 1aNo9AWKw0zSB+y0HIIPMBP/WK4/eJhV57IQyU5Lr6F2tbJmxE8XzKxj63R5nWiJgbpAKwLGTgStk lQdPCRmF8MI5mrFO/HzLBngUrzILc3JsCvpVqQrYwfFfpYUU2p/AnCnZDKyfOdSew+DP7DdgVnWUG VU6RJPB1+UixGZC9+IRfCVOBgFog2pUDQMaGRqHmPBqF1yjYfj+wsKDybOdzK1dvAnZLJgp4ZpKrA MLG1eBVmQU+ftu5HGtCg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o546y-005moF-J4; Sat, 25 Jun 2022 11:38:00 +0000 Received: from mout.kundenserver.de ([212.227.17.13]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o5469-005mYb-H3 for linux-arm-kernel@lists.infradead.org; Sat, 25 Jun 2022 11:37:13 +0000 Received: from localhost.localdomain ([37.4.249.155]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1N0WLC-1nhkPh1V1Y-00wTxi; Sat, 25 Jun 2022 13:37:01 +0200 From: Stefan Wahren To: Florian Fainelli , Ray Jui , Scott Branden , Lee Jones Cc: Peter Robinson , Melissa Wen , Phil Elwell , bcm-kernel-feedback-list@broadcom.com, Maxime Ripard , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Nicolas Saenz Julienne , Rob Herring , Stefan Wahren Subject: [PATCH V4 01/11] dt-bindings: soc: bcm: bcm2835-pm: Convert bindings to DT schema Date: Sat, 25 Jun 2022 13:36:09 +0200 Message-Id: <20220625113619.15944-2-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220625113619.15944-1-stefan.wahren@i2se.com> References: <20220625113619.15944-1-stefan.wahren@i2se.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:msqBF+QLUnnWMtPx4/p2yPn6zghKFQymebuRS3n1XDjJk9nJka1 r23Yv4ORbKSnV6PQGsKet8GpXQPvYvQryamimaSaHjVWC8qLpw+iIsdFoqsYmEShQ+Jsdlr H6yIl3EDxyIghzMni95c8Y0puDJoPL+W9JpEvxosem55CvbQV16R+3FfH0Y5Dzu81ME04x3 PXtVyyvEHEtXMLAx26FwA== X-UI-Out-Filterresults: notjunk:1;V03:K0:Ez0nIWd3UkI=:wNuRCL4PzCgqB9H2uGFa98 dBucIhFpQbvsjehK3nxW3b1Ot5stpY2Z+NtV8tXQx/UJXLSf41zUHe/40BwU+mi5XfPHtjpmA uCikDAlMiOhsIK8FX3uFOVTh/AWOSsRbzFj12FAyKt75YNSXZra21LlYfkukNmbOlo/q9foZm vkXxUbEAjx6fHJZijitP+VO8XcRIcYVkkrcvcpyy8M5C/4hxSrcRfsf3g5jRe2yobW9tG6bXr rnVvuCjkJVa9Mdba6ksJFQGwSLsqIrO0U91TVC7YIDSGPkh+s3go2/OD1yEQPG1UuEJ+VKJGd gz2I5A/oWBY2y7hh+6j02O8QNGmp1mbBr/w1pkXaTvwe4VeHGuWGUPfAAPZxc9gSDPxL3UB+h 5U7LMVBXFHcjyXIPKAhchqxFK/DCpvN8Mlv4gL5/j7r9wbasErBjAA4ZSLO8zGMyItR2I2kgR Oi9+eeIj1OKYlcGzW+a5cj+mmCW3JRI8xmV9xAbasAit8OACqAKN58dVQOZNfIJfGdlzxOGds Uqiu1nYTYN/2EhfqVZ2h+go2j7k3TxLiQXBJYq29vUF6JXSID/ebk5zdffHWEysVIP23Aykwh tbwBiYI/uaI+vRoqlBUODCiClyQEOvm+QgTmIRZZqhKmGCb/xH4O/DgkC49gUwmJds2FGxfMT wift5pKuCkCS7fUB/qJjW/3BhVdXrJEJoEZF3TQ2mbMPBcPf6TOwzm0qRaO2sk5XsZ4U29Ysl /QHmT+ICFrEDQdoAFsus0+G1KSyubHFcR8ix5sNePWn1Pyge0uPGcUBWK3o= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220625_043709_994076_BD4B527E X-CRM114-Status: GOOD ( 15.52 ) 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 From: Nicolas Saenz Julienne This converts the brcm,bcm2835-pm bindings from text to proper schema. Signed-off-by: Nicolas Saenz Julienne Reviewed-by: Rob Herring Signed-off-by: Stefan Wahren --- .../bindings/soc/bcm/brcm,bcm2835-pm.txt | 46 ----------- .../bindings/soc/bcm/brcm,bcm2835-pm.yaml | 77 +++++++++++++++++++ 2 files changed, 77 insertions(+), 46 deletions(-) delete mode 100644 Documentation/devicetree/bindings/soc/bcm/brcm,bcm2835-pm.txt create mode 100644 Documentation/devicetree/bindings/soc/bcm/brcm,bcm2835-pm.yaml diff --git a/Documentation/devicetree/bindings/soc/bcm/brcm,bcm2835-pm.txt b/Documentation/devicetree/bindings/soc/bcm/brcm,bcm2835-pm.txt deleted file mode 100644 index 72ff033565e5..000000000000 --- a/Documentation/devicetree/bindings/soc/bcm/brcm,bcm2835-pm.txt +++ /dev/null @@ -1,46 +0,0 @@ -BCM2835 PM (Power domains, watchdog) - -The PM block controls power domains and some reset lines, and includes -a watchdog timer. This binding supersedes the brcm,bcm2835-pm-wdt -binding which covered some of PM's register range and functionality. - -Required properties: - -- compatible: Should be "brcm,bcm2835-pm" -- reg: Specifies base physical address and size of the two - register ranges ("PM" and "ASYNC_BRIDGE" in that - order) -- clocks: a) v3d: The V3D clock from CPRMAN - b) peri_image: The PERI_IMAGE clock from CPRMAN - c) h264: The H264 clock from CPRMAN - d) isp: The ISP clock from CPRMAN -- #reset-cells: Should be 1. This property follows the reset controller - bindings[1]. -- #power-domain-cells: Should be 1. This property follows the power domain - bindings[2]. - -Optional properties: - -- timeout-sec: Contains the watchdog timeout in seconds -- system-power-controller: Whether the watchdog is controlling the - system power. This node follows the power controller bindings[3]. - -[1] Documentation/devicetree/bindings/reset/reset.txt -[2] Documentation/devicetree/bindings/power/power-domain.yaml -[3] Documentation/devicetree/bindings/power/power-controller.txt - -Example: - -pm { - compatible = "brcm,bcm2835-pm", "brcm,bcm2835-pm-wdt"; - #power-domain-cells = <1>; - #reset-cells = <1>; - reg = <0x7e100000 0x114>, - <0x7e00a000 0x24>; - clocks = <&clocks BCM2835_CLOCK_V3D>, - <&clocks BCM2835_CLOCK_PERI_IMAGE>, - <&clocks BCM2835_CLOCK_H264>, - <&clocks BCM2835_CLOCK_ISP>; - clock-names = "v3d", "peri_image", "h264", "isp"; - system-power-controller; -}; diff --git a/Documentation/devicetree/bindings/soc/bcm/brcm,bcm2835-pm.yaml b/Documentation/devicetree/bindings/soc/bcm/brcm,bcm2835-pm.yaml new file mode 100644 index 000000000000..5d1ff0f6c8ce --- /dev/null +++ b/Documentation/devicetree/bindings/soc/bcm/brcm,bcm2835-pm.yaml @@ -0,0 +1,77 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/soc/bcm/brcm,bcm2835-pm.yaml#" +$schema: "http://devicetree.org/meta-schemas/core.yaml#" + +title: BCM2835 PM (Power domains, watchdog) + +description: | + The PM block controls power domains and some reset lines, and includes a + watchdog timer. + +maintainers: + - Nicolas Saenz Julienne + +allOf: + - $ref: ../../watchdog/watchdog.yaml# + +properties: + compatible: + items: + - const: brcm,bcm2835-pm + - const: brcm,bcm2835-pm-wdt + + reg: + items: + - description: PM registers + - description: ASB registers + + "#power-domain-cells": + const: 1 + + "#reset-cells": + const: 1 + + clocks: + minItems: 4 + maxItems: 4 + + clock-names: + items: + - const: v3d + - const: peri_image + - const: h264 + - const: isp + + system-power-controller: + type: boolean + + timeout-sec: true + +required: + - compatible + - reg + - "#power-domain-cells" + - "#reset-cells" + - clocks + +additionalProperties: false + +examples: + - | + #include + + watchdog@7e100000 { + compatible = "brcm,bcm2835-pm", "brcm,bcm2835-pm-wdt"; + #power-domain-cells = <1>; + #reset-cells = <1>; + reg = <0x7e100000 0x114>, + <0x7e00a000 0x24>; + clocks = <&clocks BCM2835_CLOCK_V3D>, + <&clocks BCM2835_CLOCK_PERI_IMAGE>, + <&clocks BCM2835_CLOCK_H264>, + <&clocks BCM2835_CLOCK_ISP>; + clock-names = "v3d", "peri_image", "h264", "isp"; + system-power-controller; + }; From patchwork Sat Jun 25 11:36:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 12895330 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 688E5C433EF for ; Sat, 25 Jun 2022 11:38:24 +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=Us9miWOJQSVgErB/DhG4+NEiJci7pBPdYjZta+lLpao=; b=JEGYu4vMTJ8HJF O05PNC7ykI9skF4mZi7ZBkLriByoZwxCJp+j/mLmfZ0CQPJmeOmj/LxN89BDAItMgYTKr+r/qgNIr zFZhSES2BuYqAm/Kz3xeYlV6zcRF/mqGrXnccRzcYYvc0Zqp9gwLELCTuNaTafYF06ICdTNBIgcCj kJew4mHDC1oBMKn78MNx66vSt8Z6cPglXNR3swBqfj8NM3Dr01K2KofwC/uzjnb7U6g/DUKlQ9a4U JhWTEHcuTVXavAdjyG9qzEzOZiBpy7HWQAx9lApCMEuhK+UDzR+RyfyL5e7nbyniGsIBc2EHwYd92 pEen81exVZDIs1EqviaA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o546D-005mc8-MK; Sat, 25 Jun 2022 11:37:13 +0000 Received: from mout.kundenserver.de ([212.227.17.24]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o5469-005mYZ-H3 for linux-arm-kernel@lists.infradead.org; Sat, 25 Jun 2022 11:37:11 +0000 Received: from localhost.localdomain ([37.4.249.155]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1M7KG2-1o1lEf3Wyi-007oDS; Sat, 25 Jun 2022 13:37:01 +0200 From: Stefan Wahren To: Florian Fainelli , Ray Jui , Scott Branden , Lee Jones Cc: Peter Robinson , Melissa Wen , Phil Elwell , bcm-kernel-feedback-list@broadcom.com, Maxime Ripard , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Nicolas Saenz Julienne , Rob Herring , Stefan Wahren Subject: [PATCH V4 02/11] dt-bindings: soc: bcm: bcm2835-pm: Introduce reg-names Date: Sat, 25 Jun 2022 13:36:10 +0200 Message-Id: <20220625113619.15944-3-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220625113619.15944-1-stefan.wahren@i2se.com> References: <20220625113619.15944-1-stefan.wahren@i2se.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:eKIQue7G9SB6Q5BwxAewshoebIZdiStDCRzFQz6Zl18hup+jE2T 8eVTVRQtNALSGekn7POD5EMsULaL2SO7bGphbmbm+saG6zt4FkCic0/ZWDkpoj+no483ZS4 Cr+VVNJ0QhLXK4exwkK/v/Zfe25vMOeNO9YcNAOL2+Nuy19VoLOJRu417p9k0pHsJvtJHcf 59xNnh3u7eXDZXcVO7lRw== X-UI-Out-Filterresults: notjunk:1;V03:K0:ybvKKnSQ6Mc=:aaEI4HeR+KABosF8GpXTVy itkXOvX9TSmanh5D9DD36S50cAQ4oPcSj46NwhdE0bAnKeSjIa7fGsWxAi5wXdjQnO9cIrhfm 7drzM+mRRwvvY7T/QoBlqZgLTGepIgjwcSBIY+PyIIfhw46ZsMaP7c2OeJ0M1BxUfkqOmNY7P bNPkNDJ/DvwvZHyonWbiA23x6wRpFY9QydrIWy0HAulwG6r5S7giKLGJYFRzmJ7tk3WE5UStL 2X0A9GQt9sfYis32b1+wTez+eTQqMVBS4nX9bWrbk2VHLMjt933IB5frYnrQS/Hkt9ZWdbZCU B1QFNBMKCZdUcCDms5XIeg9O0SmqqRGVXq3+00vIuXniLuWhy7bMgBFKhRUNyQ68MifN1NpBk sznElp43lOGrzeBqUzMlZDWXCd+6gCfiFBgs/k5u758iIWCh9vS2B5sYn83TEBLHAD+AJ+WnT iEsOgmb7po1XkIK1yYsl6PKh8uaQU1SKhAqxCt1nxJmpKnbQD0b/cdYECpmip2TKC3uUUJQPR IYnw/oF9QlngKFIYNRnBCNGHpdSh/KqBY9yDar5A+BZWPJUx4THZDkbkE6htz6cq7kTrGTGeR DxvZGhjb3qyZ7s7YG4TFSgpanSw/LYNCFS7uMknOqr1AqJ7bQojlCEDqKN8lcEw34SGiiAkcW S3/WEKBxrVoN/RT7BU9SNMJPukFUV2NsoT26ycFjJaL9AhiGC93SLSIEG5Aa2zOdOc19NJUI3 snN6IHmkLAKIHOsXnaioaYK43W6LNC4Lf+Jpe8AxP9sh+vbQIILe2t8Q8/Y= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220625_043709_982562_D6BAF8F8 X-CRM114-Status: GOOD ( 10.47 ) 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 From: Nicolas Saenz Julienne Anticipating the introduction of BCM2711, of which we'll need to support its new RPiVid ASB, introduce reg-names into bcm2835-pm's binding. This will help to have a consistent mapping between resources and their meaning. Signed-off-by: Nicolas Saenz Julienne Reviewed-by: Rob Herring Signed-off-by: Stefan Wahren Reviewed-by: Peter Robinson --- .../devicetree/bindings/soc/bcm/brcm,bcm2835-pm.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/soc/bcm/brcm,bcm2835-pm.yaml b/Documentation/devicetree/bindings/soc/bcm/brcm,bcm2835-pm.yaml index 5d1ff0f6c8ce..883ab7cb96e9 100644 --- a/Documentation/devicetree/bindings/soc/bcm/brcm,bcm2835-pm.yaml +++ b/Documentation/devicetree/bindings/soc/bcm/brcm,bcm2835-pm.yaml @@ -23,9 +23,13 @@ properties: - const: brcm,bcm2835-pm-wdt reg: + minItems: 2 + maxItems: 2 + + reg-names: items: - - description: PM registers - - description: ASB registers + - const: pm + - const: asb "#power-domain-cells": const: 1 @@ -68,6 +72,7 @@ examples: #reset-cells = <1>; reg = <0x7e100000 0x114>, <0x7e00a000 0x24>; + reg-names = "pm", "asb"; clocks = <&clocks BCM2835_CLOCK_V3D>, <&clocks BCM2835_CLOCK_PERI_IMAGE>, <&clocks BCM2835_CLOCK_H264>, From patchwork Sat Jun 25 11:36:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 12895331 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 AB1B4C433EF for ; Sat, 25 Jun 2022 11:38:32 +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=meULOVU5exvDsRqqAm/0bJ5QlEPRD1Ni292en84GIY8=; b=VHhSUWOqzSZvb3 h379RAYR5lE7yCBlwP1XgXgaXDtGz4KlNARFMhHVTgFMCFxSKPvfhuXN7f6OvmzatyJDIcMkQs2R0 KjN1Q4HPD9oCOYIxpHIsSxkhsVxmn+yZrk18NkJTxWjGPZhQJ5pQ2xdMdMnJMYfZOxxoWgOzL8Set rqtMZRSwbuDpcD+rVMAqbnTj5B/mE27KyfUEMSxdHkTeSt59zveCPzHd8cDhMWSMvvcS9g8+io44+ A17+UQoEeqqHj1erOQuyaa2wQc3Z+LycdBdBaLejB/cFuEopIamXL39bBZrLpfHPxEM6OWMk5x0lq gnw7kUZAkdbVi+YFDPRw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o546V-005mgu-D8; Sat, 25 Jun 2022 11:37:31 +0000 Received: from mout.kundenserver.de ([212.227.17.10]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o546A-005mYi-4n for linux-arm-kernel@lists.infradead.org; Sat, 25 Jun 2022 11:37:13 +0000 Received: from localhost.localdomain ([37.4.249.155]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MiZof-1nPwJV1E1f-00fmBt; Sat, 25 Jun 2022 13:37:02 +0200 From: Stefan Wahren To: Florian Fainelli , Ray Jui , Scott Branden , Lee Jones Cc: Peter Robinson , Melissa Wen , Phil Elwell , bcm-kernel-feedback-list@broadcom.com, Maxime Ripard , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Stefan Wahren Subject: [PATCH V4 03/11] dt-bindings: soc: bcm: bcm2835-pm: Add support for bcm2711 Date: Sat, 25 Jun 2022 13:36:11 +0200 Message-Id: <20220625113619.15944-4-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220625113619.15944-1-stefan.wahren@i2se.com> References: <20220625113619.15944-1-stefan.wahren@i2se.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:9i2EdGao2jACaRbPfZ3kMAkkiOtV3z8AnV9nkD/4AYq9RKzOezQ 8Y+DXMPruMRnurlQV8GoNEE1wJDauVO7D+3jvkczdgh5iDs4kvEmSjjM6prP9L2k0O5Cp2f MRuDnoOIWzPGu4nCTXMFyX1TAGFuEENsNvrodz1oLKLIbPueZDmc8CVupV/qf1z5Aig3kvF 1QLxfE9ayHvVgXycAMbig== X-UI-Out-Filterresults: notjunk:1;V03:K0:WydDqxAsRgc=:UGsbIQ0dg6dlD5weOid7l5 7/IzsrLNiOctKJJopWMZdrY4aweuyf4m0b81X6n8VfDCqqdiFWGPhQvNkWVU5A8KoJy1VwujS p7g/5OjwlIkq1XvRv1EQbmUGE9jlzT+Wi/L0TtKhEYRoA+R6aT3XhqfpdOLhAa6JB5yuWxQHB GE51KyONEXOFcAQi/hpMX9gY8kfWiXLYKxa+FJRd7aIar9FHnAzTDWtOQWPdPmnulh8M7udjG YtFqMe2SscqER9FZwoml+Zx/gH0Q1Les+V77yjuPYT5IaF1lFZBMUtnnsCExTHWQOzbck6Y4O /TpSYepuHZn/LPaCpLDHGUGlPNfyaz4D1YQXOSK9MH9IYb+cuPiCd80C8TDoWo+45RkP31uWX 7T/adyvQLWH9qjdMBNajmLGoB8gUf2fU71gAoFPlJYOhM4i/SyiW9gslbTogQeFgzo7ExH4aA e6FcIB5xYj0pZVIdMRzSXkp3zlFNo3gSG/pMLSabknGLF+tMerPqTiNRBPFJW7oYf9h16VTHy LQrmdumduECmrQzkB8wIRyq/o8SN943oGeFeP9i5k2Ukkakds9GpL7bAidHB+mzVpYGQ9L3+2 PJmWdwzdnlaDCZED6X/vVN7bOQ65j0/rT3ubHgBFF1tyTj862eBYgdj8bqvqbeLsMC0zUq6XI Kdj0xS8y/ima5KKgdcCaB/XTwo9QVNd9RI2b69Xd4lPH/I3UdCysg2EVDd0dydQ2CRG7nO+Fj i9R1HfOQ7gzhNWIm8V5ZaekaNV/HHDZ6JSWJpjLdQvRJb3SPWCQhbEi2IpQ= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220625_043710_570862_2F2D585D X-CRM114-Status: GOOD ( 11.06 ) 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 Add a new compatible string for BCM2711 and the option to provide a third reg property for the board's new RPiVid ASB. In BCM2711 the new RPiVid ASB took over V3D, which is our only consumer of this driver so far. The old ASB is still be present with ISP and H264 bits but no V3D. Signed-off-by: Stefan Wahren Reviewed-by: Peter Robinson --- .../devicetree/bindings/soc/bcm/brcm,bcm2835-pm.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/soc/bcm/brcm,bcm2835-pm.yaml b/Documentation/devicetree/bindings/soc/bcm/brcm,bcm2835-pm.yaml index 883ab7cb96e9..894786640938 100644 --- a/Documentation/devicetree/bindings/soc/bcm/brcm,bcm2835-pm.yaml +++ b/Documentation/devicetree/bindings/soc/bcm/brcm,bcm2835-pm.yaml @@ -19,17 +19,21 @@ allOf: properties: compatible: items: - - const: brcm,bcm2835-pm + - enum: + - brcm,bcm2835-pm + - brcm,bcm2711-pm - const: brcm,bcm2835-pm-wdt reg: minItems: 2 - maxItems: 2 + maxItems: 3 reg-names: + minItems: 2 items: - const: pm - const: asb + - const: rpivid_asb "#power-domain-cells": const: 1 From patchwork Sat Jun 25 11:36:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 12895333 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 BD4A2C43334 for ; Sat, 25 Jun 2022 11:38: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=VDVSlLShUfOZ4kOP/8umi5174w+r9GMNTjAhmqAMp2M=; b=dFbHl83tYEtFMV Vw2RyLKzgGoUHz7RUT/Ywbp892Tjh9LYkYV0iS9QYPvEqB9HOPVFDs8oD3hvCBVkuKHtsrPwU+/pE TAboYGo1hcTxncvK+XC19zhDrguUenKtyeG9pqgq7CeLFFq2i/dHApMjyUdbN5/BT2vKcff22pMBb HWEhjfBBVOsMe57shl4ac91os+qjKxpoECq3l00H49DlgAIh6ToZ0tT7vNTsxoigVMc26/Zau4QQI c++DgKgqUbuz0otmS1S99HAbQ0dGIMyEMv9URETOj0e3yWn3aBEY7PLLD6ikH7IKpcpuY6ipRTgAM M+30kyIsQ8TYdX/D5nIg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o546d-005miS-Pz; Sat, 25 Jun 2022 11:37:39 +0000 Received: from mout.kundenserver.de ([217.72.192.73]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o5469-005mYf-Sk for linux-arm-kernel@lists.infradead.org; Sat, 25 Jun 2022 11:37:13 +0000 Received: from localhost.localdomain ([37.4.249.155]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1M8QBa-1o0eFC3CjI-004Vtm; Sat, 25 Jun 2022 13:37:02 +0200 From: Stefan Wahren To: Florian Fainelli , Ray Jui , Scott Branden , Lee Jones Cc: Peter Robinson , Melissa Wen , Phil Elwell , bcm-kernel-feedback-list@broadcom.com, Maxime Ripard , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Nicolas Saenz Julienne , Stefan Wahren Subject: [PATCH V4 04/11] ARM: dts: bcm2835/bcm2711: Introduce reg-names in watchdog node Date: Sat, 25 Jun 2022 13:36:12 +0200 Message-Id: <20220625113619.15944-5-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220625113619.15944-1-stefan.wahren@i2se.com> References: <20220625113619.15944-1-stefan.wahren@i2se.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:GPZerfO3A6nim1CXLxn5K+0IYKMNEx6tEeXkhLn7l+Mvha/8/1F pDSALibh5T4WLpHcTY4vwJsSD6ZBiVoGdyDzNxTZ72r16UeJOSEYbUKRW/jrRjkQ5LwzdLo po1/cr0v+LSszYY2kijueCAsbmf9T8925VQPXDMc0G9oo+/oNpJm+3Pch5qw29V/AmfRLIV BHHFtgP48l9Fk34OyBgQg== X-UI-Out-Filterresults: notjunk:1;V03:K0:3BDqzTMNyaU=:x0XBOjTi8uzVfAbPPI6Klw Cuv/TdFdGwKILdevintNJujzqRfRKX2LbkrKEJ5wNypF80SuIBlCyDmpsxWGpiTHPL1iBIeem z8lBNwc5xBpRmOsNw9S61v3Jz5acd+EnqIvjdfbirfwcO1k8Pn9J9RR2Qinx2LS74HdayjNcG AKsueSTkkUEEGFjdoWHnDjXLP+Dl+prqTkOeo11PreirvCxHGhJpeAMCm9FEMxVomWP/jzX3p 7eKuyzjDm/kDAMvJNYVVX70Fagt77ZFTTPv0IWdSAQ7+IbUR3LgCtTFEZXAbJs4fILq+vcErX mQ8reHl2teEmbCg7KFg7RF/m7bgHseA8YGvJ+P8hoBPogpS3fiJdQ3OhXHqGHMUqbdRvKBGxj fAOp3eFqx5xIKEeVnbae/x2gFvjqaWzrWIh9FK/I/9gLwHrHgHXkl3Zrv4bONdhYrb9pCRhbw WQwYIAVv/snbmMwfWypRDtVu2t7Urv54c+81itwP6pRtq1n/swiZpzW/z3nSktm/kBB6I0VXW 8lFXRKxC4hmYewck9I6jJ9/uPxVyWvyX32qErkwcPjuXMlnKkzi1SVDn8JJqU6Aqs+CE+I5S/ PDbYDlDYgm1RdE+DVjxwl+ku4JI+3ri1WV62sIOKz9KPeGqU1IwH2Wh1ffRLqf79l5YkgVKgg w57obrZdkkgaBCu6zfGc58lhTCqW2+wYlIyBdD6PNX8CBzJ68I5QcilQNnAWDTasALc9UsqOU GCf37G6qDpkJc2JGDHfw4mfr+JLCqLQJxu+ke90t6NM2wWv7bKfZoWWdChE= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220625_043710_276228_D4B9156C X-CRM114-Status: GOOD ( 10.48 ) 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 From: Nicolas Saenz Julienne bcm2835-pm's bindings now support explicitly setting 'reg-names,' so use them. Signed-off-by: Nicolas Saenz Julienne Signed-off-by: Stefan Wahren Reviewed-by: Peter Robinson --- arch/arm/boot/dts/bcm2711.dtsi | 1 + arch/arm/boot/dts/bcm2835-common.dtsi | 1 + 2 files changed, 2 insertions(+) diff --git a/arch/arm/boot/dts/bcm2711.dtsi b/arch/arm/boot/dts/bcm2711.dtsi index 89af57482bc8..cbb47e2c9434 100644 --- a/arch/arm/boot/dts/bcm2711.dtsi +++ b/arch/arm/boot/dts/bcm2711.dtsi @@ -113,6 +113,7 @@ pm: watchdog@7e100000 { reg = <0x7e100000 0x114>, <0x7e00a000 0x24>, <0x7ec11000 0x20>; + reg-names = "pm", "asb", "rpivid_asb"; clocks = <&clocks BCM2835_CLOCK_V3D>, <&clocks BCM2835_CLOCK_PERI_IMAGE>, <&clocks BCM2835_CLOCK_H264>, diff --git a/arch/arm/boot/dts/bcm2835-common.dtsi b/arch/arm/boot/dts/bcm2835-common.dtsi index c25e797b9060..a037d2bc5b11 100644 --- a/arch/arm/boot/dts/bcm2835-common.dtsi +++ b/arch/arm/boot/dts/bcm2835-common.dtsi @@ -62,6 +62,7 @@ pm: watchdog@7e100000 { #reset-cells = <1>; reg = <0x7e100000 0x114>, <0x7e00a000 0x24>; + reg-names = "pm", "asb"; clocks = <&clocks BCM2835_CLOCK_V3D>, <&clocks BCM2835_CLOCK_PERI_IMAGE>, <&clocks BCM2835_CLOCK_H264>, From patchwork Sat Jun 25 11:36:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 12895336 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 97A62C433EF for ; Sat, 25 Jun 2022 11:39:26 +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=laNYQLL5G/GO5Qp9LzkRNUYwGW2416s60htOBFO/OeI=; b=TJn7hNZ+x9w4Ak 8yUKj9/iF3cZdPdd8jEmfoK0if4ZQafg5rZ70cVQqhhHAhqIlJygFCAWJP4/d1eFxOcpJ8rH6pl5K utJ/kjMlmnHnaL/65WgqIoBlNfPd/PjlVqf8irtfPyWMb9qqscz4FFChjOK+OoS8909hFicEGsX1f EMAY5lM06ibViIcJhu+SBAcQJ4UbjEDMPEmOOBt0rFroUcJS+vnauQzIWjZaKH6ouuR6BA2yUa7kC 61qHnLXtWi9PpJ5v/lLJB3EPGQboUvMCbECuHprc+VXdeulXy/4gjkqhn1k56+wNPl0mFS7TzZMSq 5oBqW55LNzS+XpLQUu+Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o547M-005mzy-SU; Sat, 25 Jun 2022 11:38:25 +0000 Received: from mout.kundenserver.de ([212.227.17.10]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o546A-005mYu-4o for linux-arm-kernel@lists.infradead.org; Sat, 25 Jun 2022 11:37:13 +0000 Received: from localhost.localdomain ([37.4.249.155]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MvJo7-1nnXB80win-00rGtb; Sat, 25 Jun 2022 13:37:03 +0200 From: Stefan Wahren To: Florian Fainelli , Ray Jui , Scott Branden , Lee Jones Cc: Peter Robinson , Melissa Wen , Phil Elwell , bcm-kernel-feedback-list@broadcom.com, Maxime Ripard , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Nicolas Saenz Julienne , Stefan Wahren Subject: [PATCH V4 05/11] ARM: dts: bcm2711: Use proper compatible in PM/Watchdog node Date: Sat, 25 Jun 2022 13:36:13 +0200 Message-Id: <20220625113619.15944-6-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220625113619.15944-1-stefan.wahren@i2se.com> References: <20220625113619.15944-1-stefan.wahren@i2se.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:uBOMBLyagK1SmKhTE8nCqN0CLeBdYt7rgvwLIaQOf7+Hr2nyQGU kwHRMbirwpURogP2H314yQC7+f+peUpUF2dBCzToEerOu8XWZQycejtHhh97T3aQ1q2OPhS eRLQ0py/Ghn5bPe3kBDYD7XB3vS+p8WEmYIav8EXeE8BDO24aSHOhED5Hp3uYpWt1U4TDDZ KHNPiG283ZAv767ckaJmw== X-UI-Out-Filterresults: notjunk:1;V03:K0:B3He5QCPf7Y=:D2odPhibScCyCeV7BQDu3D GqgMqm3gb+i3B1ufg/NiCz3f1ormvKTi2tT4EDDZlC6FLS+lxhfv3v1fQEk026pv654YudmFB 1FZ/ShC7UVytuv0m6pzTGNJ6f1UACYl/7a5nj1Xo05y3kc7Ec6QwCzLNAvN5OUUtg/SazVHEJ cly869+jCGg8IX7B0aLmaZzOwM4jSzTOHKPo1PzOptuzW5FraafMXieF799DcJftdnoeDPM1h +jqIKPNDPIYP2N/NjIWiaNiwPSl0fOc/O9SlzZDLxuNNlEQzAtpZN5hayWQEGX5WLt/RU/wny f7bfJfeommki8kvnPzujkz8/TA9CE1Zb3L1KY7cdm5+Evnw/73iw1XA28Dhv6dCHkyd3YHZpz teZqYDBlJDHB2IdNtDKY9nfWIQB9ckIwoHmyWaBB0nmqO8mFo6VDP/HCwTfoOvd6V6rUT5fcO ot7rP8ncByVueB8RP1TDIR7/Lbqji9lsLs1HdwmP0z3rZnu7ddYZdzPwu6xJBJaY1pAjjHvNh SW2NKTc+Xvm0DStDciHoMk3mjtUskSyb9YQmSsbNJAJrjonmmWYfvTilATXr6LIvS+aF+CjS2 NpvhinWRcTe4hTOqKFvQYVt/qmfxwqPRMOmnxai+Yf5hdUx5gaom9GqjfAILH08/kvn75E/am pQmEbQi1+5Ji3J8cS8GNq3sQG0PYyw23Fb8olMs3RP3TZQsXTf9KGI+GQ135nPG48dK9rZIKI 2FxxFT1CKhXmuZ7Rx5jHiKJg8/67G3f1qLO0iuA+dcTKHgpgBOjfiU4LA5s= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220625_043710_568414_2EAD4009 X-CRM114-Status: GOOD ( 12.31 ) 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 From: Nicolas Saenz Julienne A new compatible string was introduced specifically for BCM2711, so make use of it. Signed-off-by: Nicolas Saenz Julienne Signed-off-by: Stefan Wahren Reviewed-by: Peter Robinson --- arch/arm/boot/dts/bcm2711.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/bcm2711.dtsi b/arch/arm/boot/dts/bcm2711.dtsi index cbb47e2c9434..5eca5207c212 100644 --- a/arch/arm/boot/dts/bcm2711.dtsi +++ b/arch/arm/boot/dts/bcm2711.dtsi @@ -107,7 +107,7 @@ dma: dma@7e007000 { }; pm: watchdog@7e100000 { - compatible = "brcm,bcm2835-pm", "brcm,bcm2835-pm-wdt"; + compatible = "brcm,bcm2711-pm", "brcm,bcm2835-pm-wdt"; #power-domain-cells = <1>; #reset-cells = <1>; reg = <0x7e100000 0x114>, From patchwork Sat Jun 25 11:36:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 12895339 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 EF27CC43334 for ; Sat, 25 Jun 2022 11:40:35 +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=UOjs7ff6SKXzRQEjAFpHmsn/VvRyAgCxZFeIjSB1lp8=; b=JRteck5t2ybPau 4TA3B2/eQfr7rCqR+kwuDMDnBPKxyyUXUZ4fJrXkN9KH1HRNKec0hn8eCTcdp+Fswa458FiSou729 GubeNVzQj7IVDQtYf/zHfQMhrnmghnESYjzZLYpNCUKGZy6+Y8hj1+6euU4JBi6s1nWj7omOfOo76 JuFyfYmw6nA1BHveyEsb4aKJBmdUJatQRf51qZ/nIgTjCg5N+cw+mq2gc82FhJdiS/Hb8Xm5gnax4 RwDdosJhb8FqILj7eqik6n5Fh/gFcM0ZCn8s0n7GRfbkYzYbA2vBiC63uB05rfwRH84Va6ffm0saU B1PoIc0jZ19ZuytGnRxA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o548Q-005nY3-EZ; Sat, 25 Jun 2022 11:39:30 +0000 Received: from mout.kundenserver.de ([217.72.192.74]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o546B-005mZ2-0K for linux-arm-kernel@lists.infradead.org; Sat, 25 Jun 2022 11:37:15 +0000 Received: from localhost.localdomain ([37.4.249.155]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MN4ux-1oLm022tlN-00J2bb; Sat, 25 Jun 2022 13:37:03 +0200 From: Stefan Wahren To: Florian Fainelli , Ray Jui , Scott Branden , Lee Jones Cc: Peter Robinson , Melissa Wen , Phil Elwell , bcm-kernel-feedback-list@broadcom.com, Maxime Ripard , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Nicolas Saenz Julienne , Stefan Wahren Subject: [PATCH V4 06/11] mfd: bcm2835-pm: Use 'reg-names' to get resources Date: Sat, 25 Jun 2022 13:36:14 +0200 Message-Id: <20220625113619.15944-7-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220625113619.15944-1-stefan.wahren@i2se.com> References: <20220625113619.15944-1-stefan.wahren@i2se.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:Ugnti44o7yL+JwvplNxLQ411MRmMUBvCV+ZWKFIrGgVUrwju5NF 1LYHQTAgCgY05WAEvaUEwu0gieCM8CKrAr85QOe32CINg8B1eetZRSO2mtXr4flbHktgJe0 1osFZHOAqkfb5B47JfPmnxfkuGeLlA489VUxAHc4hA5B7vnjdLlVH0br3z+N7R6UfTaFUBy MBlVPyBs603vCHNM95tvQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:dJnlFu0L3U0=:ukHMvfuynzxy+kApSIYOtT LAThcdySVM1zkbhRf9NCuRHvou3f1KzubMJ0qxefYBGGOsnn5nfjEpWgIjXLQO16Yimo8ByZf rAW3xeHJB6Jc3egCFIV9B7aHLjD6o948THWWGpD7pV5/3dk780AAdF8AYhbktQHyPu1KDiFv0 +6uCqwq0/2LtL4rz6hssR9NddmzJMGmAffkX4URgcZk9+p89vKi73rmdL9cIQXLIkLYja3uBi iJyAwioQ9jDlDbMSszvdAW5A8KpbO0y65hxRuA5o10DPHLEIAK/7d1AQy+NuYlKvyqm3sjCBt BI0hMvXRh8vYU8BNympa/XXbSPOhV9B5JFnh+1cdDoUBL4A7To7a5KCjkz7oR1JpbSsKhXsLd LtnKDK6XTTcbFkMJe7BfRVzeffBcwL3IpU/SA8vtO748heMnaQqkJAAGbJ2GnzDwd3mfEEkfn 93/vGLTc5BH8k4Mo8HpJQsdcXbTDD1K8+CL+ouNHCTLKSk0YriLKzMUt2okHIvBm8FUjVH7FM oeMoodA+w2L5m631w9dNI0+wT+XGwSh4ta6gg5MofGbtMjl8Cp0cZH3L1Gi8aCv5m6TH9IAcm sNtnRjaQrQIRiiO3tmFhb85AeS8GJ4hKXHW6OGNiThwaoBi0nynLaTrdfBZMQQyn2X6opzUB6 i9d4xr8UQYJBvmD0hOIR4c+iM0yft9bWsgWsf9nyzmLws31MB3J3xhh3wMNmIDPJ1KC+GgBNg bddJgmYOhfzyrAOnULbGlB/a6mRbfOF63ALoPnJEyY3f0o6+M15ZsjhU27Y= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220625_043711_403741_2570E369 X-CRM114-Status: GOOD ( 17.21 ) 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 From: Nicolas Saenz Julienne If available in firmware, find resources by their 'reg-names' position instead of relying on hardcoded offsets. Care is taken to support old firmware nonetheless. Signed-off-by: Nicolas Saenz Julienne Signed-off-by: Stefan Wahren Acked-by: Florian Fainelli --- drivers/mfd/bcm2835-pm.c | 61 +++++++++++++++++++++++++++------------- 1 file changed, 41 insertions(+), 20 deletions(-) diff --git a/drivers/mfd/bcm2835-pm.c b/drivers/mfd/bcm2835-pm.c index 42fe67f1538e..418c8a16427d 100644 --- a/drivers/mfd/bcm2835-pm.c +++ b/drivers/mfd/bcm2835-pm.c @@ -25,9 +25,40 @@ static const struct mfd_cell bcm2835_power_devs[] = { { .name = "bcm2835-power" }, }; +static int bcm2835_pm_get_pdata(struct platform_device *pdev, + struct bcm2835_pm *pm) +{ + if (of_find_property(pm->dev->of_node, "reg-names", NULL)) { + struct resource *res; + + pm->base = devm_platform_ioremap_resource_byname(pdev, "pm"); + if (IS_ERR(pm->base)) + return PTR_ERR(pm->base); + + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "asb"); + if (res) { + pm->asb = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(pm->asb)) + pm->asb = NULL; + } + + return 0; + } + + /* If no 'reg-names' property is found we can assume we're using old DTB. */ + pm->base = devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(pm->base)) + return PTR_ERR(pm->base); + + pm->asb = devm_platform_ioremap_resource(pdev, 1); + if (IS_ERR(pm->asb)) + pm->asb = NULL; + + return 0; +} + static int bcm2835_pm_probe(struct platform_device *pdev) { - struct resource *res; struct device *dev = &pdev->dev; struct bcm2835_pm *pm; int ret; @@ -39,10 +70,9 @@ static int bcm2835_pm_probe(struct platform_device *pdev) pm->dev = dev; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - pm->base = devm_ioremap_resource(dev, res); - if (IS_ERR(pm->base)) - return PTR_ERR(pm->base); + ret = bcm2835_pm_get_pdata(pdev, pm); + if (ret) + return ret; ret = devm_mfd_add_devices(dev, -1, bcm2835_pm_devs, ARRAY_SIZE(bcm2835_pm_devs), @@ -50,24 +80,15 @@ static int bcm2835_pm_probe(struct platform_device *pdev) if (ret) return ret; - /* We'll use the presence of the AXI ASB regs in the + /* + * We'll use the presence of the AXI ASB regs in the * bcm2835-pm binding as the key for whether we can reference * the full PM register range and support power domains. */ - res = platform_get_resource(pdev, IORESOURCE_MEM, 1); - if (res) { - pm->asb = devm_ioremap_resource(dev, res); - if (IS_ERR(pm->asb)) - return PTR_ERR(pm->asb); - - ret = devm_mfd_add_devices(dev, -1, - bcm2835_power_devs, - ARRAY_SIZE(bcm2835_power_devs), - NULL, 0, NULL); - if (ret) - return ret; - } - + if (pm->asb) + return devm_mfd_add_devices(dev, -1, bcm2835_power_devs, + ARRAY_SIZE(bcm2835_power_devs), + NULL, 0, NULL); return 0; } From patchwork Sat Jun 25 11:36:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 12895337 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 AAFE3C43334 for ; Sat, 25 Jun 2022 11:39:57 +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=g7eMkmhwzXxSOVwSvuSdFOAKbq036QmLKxw7KNEoavs=; b=2d1cY78z04ZGCN wU6du8bdIEzUiRgCTyd3LrAaXlE+tl4eI4+WV9/ZYDJbasDt+FQwO87WB3llwj9IHiVDkYJKr0JDH fkbf3lLQjCjykgn0SrvH3I/mS9Q9RchFx24Z0kwJBsrD2bv7y6oTjP1Txe/U+bsW2P48QtFVuerWi vC6UZrefYCSLi7zQvCL++5ZmorvqwPeg71FuCkRR7sZs/7KKjz3Zib0ocRmDlEiIxlkhFcJ2Ygv8V hZ5zp1y5waN4nCAyigBPxMGsbGbByLDbj3f1e4XLr3Zry78LYEMUkhG3cXsUAmRKV93X0gseyDbvl HneMd/04zmCbY22ZGICg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o547n-005nCJ-3q; Sat, 25 Jun 2022 11:38:52 +0000 Received: from mout.kundenserver.de ([217.72.192.74]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o546B-005mYy-0L for linux-arm-kernel@lists.infradead.org; Sat, 25 Jun 2022 11:37:14 +0000 Received: from localhost.localdomain ([37.4.249.155]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MHnZQ-1nqAOE0WFK-00EvlY; Sat, 25 Jun 2022 13:37:04 +0200 From: Stefan Wahren To: Florian Fainelli , Ray Jui , Scott Branden , Lee Jones Cc: Peter Robinson , Melissa Wen , Phil Elwell , bcm-kernel-feedback-list@broadcom.com, Maxime Ripard , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Stefan Wahren Subject: [PATCH V4 07/11] mfd: bcm2835-pm: Add support for BCM2711 Date: Sat, 25 Jun 2022 13:36:15 +0200 Message-Id: <20220625113619.15944-8-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220625113619.15944-1-stefan.wahren@i2se.com> References: <20220625113619.15944-1-stefan.wahren@i2se.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:UteCT9pRFwQtihi85KY2nNhWGA4PPpJwg9ttEATnncvc8H2XPAL hTIMxS21YGMAUxjWK9eVByCUn5uNt437ftu6nUoQx2pdLMlBYH40Wcwf8snMY0AhdQQ0YUA 0Sg3SMRY8adCURTyaBNSWCmOyMNNlx+FUG+gZyuX44rJo4ruqSSlGQqYvcyCzlb+YfJE/XH QOiIFTrbdZHqpVI9PB6tw== X-UI-Out-Filterresults: notjunk:1;V03:K0:/vTVd3zemHQ=:co7g9Oc2GYvNwk9vzUD26r GoavMAlkG5FBdYK5KRm6RgbmV8M7Ql2JTt/tbpZJfmnSrVkxqgTEX8TGqykdzJw/uu7ZamrAK rldqIq0xET/Q/yq/k916dzKu4ttW/WWaCIV28Xxs+eNhk/Xhy7djZQM9nhnydJgG5mCuxPtUR aGozr3kKCn0LEsrHqg9zp2wxCTTWpOr2Lo4dmwYsqZ/EXMMYbIZAs9s1ZNeV83keei5CQDSdr smCdr3t23zrG2oGDAd+C2EUskhv7nIaoE+sTS0TatAMvWsoxp0D2/0CsDnVxEpwAuIZrbFykh 7gRj44x3DKfx/Idf9CuNaazb0X3BrDBcfDi9+w1tojGlB5tE0znSY20RArVHmdJiLAL98ys50 8WXBA7je5TiRGBi6pTzQEjF0q53acOuh+es4M79ncizA/J1w5KNa8hY+JMcVjftUp0JaVZ76H 9pZtwhdfQmw65zJt6lkNg6+tnWLwrZnrxXhwR3n71GK8pgbFn3GUZ2hojnxy6HP0Cz2dlVlGQ NUXeIAXeSGAcNQSfAOadkJaSiTHiMwylMMj3toJqXhXMPWv5uj7U06d9Aun72Wwy964YHb1Q2 87jlKqyepGz2WUJEStz9g90o4d+11+Ch688O9oBv+zTPo4mnHglZ4dMKMY4JVJzVCheaDGVhk fRrDSapEGBcuVu59Yu8vET7LRx4Vx4NUCNjCfFNkbThzgtmDUHk04ZLbZQmE/u1+lplsvPc9+ +tN5/8I7guJ5MZL7lc/IHFk+83kKXxC/8jL4u7QDdc3vzSxieSBYcaIG7g8= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220625_043711_396496_285337EC X-CRM114-Status: GOOD ( 17.69 ) 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 In BCM2711 the new RPiVid ASB took over V3D. The old ASB is still present with the ISP and H264 bits, and V3D is in the same place in the new ASB as the old one. As per the devicetree bindings, BCM2711 will provide both the old and new ASB resources, so get both of them and pass them into 'bcm2835-power,' which will take care of selecting which one to use accordingly. Since the RPiVid ASB's resources were being provided prior to formalizing the bindings[1], also support the old DT files that didn't use 'reg-names.' Signed-off-by: Stefan Wahren Reviewed-by: Peter Robinson [1] See: 7dbe8c62ceeb ("ARM: dts: Add minimal Raspberry Pi 4 support") Acked-by: Florian Fainelli --- drivers/mfd/bcm2835-pm.c | 13 +++++++++++++ include/linux/mfd/bcm2835-pm.h | 1 + 2 files changed, 14 insertions(+) diff --git a/drivers/mfd/bcm2835-pm.c b/drivers/mfd/bcm2835-pm.c index 418c8a16427d..49cd1f03884a 100644 --- a/drivers/mfd/bcm2835-pm.c +++ b/drivers/mfd/bcm2835-pm.c @@ -42,6 +42,14 @@ static int bcm2835_pm_get_pdata(struct platform_device *pdev, pm->asb = NULL; } + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, + "rpivid_asb"); + if (res) { + pm->rpivid_asb = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(pm->rpivid_asb)) + pm->rpivid_asb = NULL; + } + return 0; } @@ -54,6 +62,10 @@ static int bcm2835_pm_get_pdata(struct platform_device *pdev, if (IS_ERR(pm->asb)) pm->asb = NULL; + pm->rpivid_asb = devm_platform_ioremap_resource(pdev, 2); + if (IS_ERR(pm->rpivid_asb)) + pm->rpivid_asb = NULL; + return 0; } @@ -95,6 +107,7 @@ static int bcm2835_pm_probe(struct platform_device *pdev) static const struct of_device_id bcm2835_pm_of_match[] = { { .compatible = "brcm,bcm2835-pm-wdt", }, { .compatible = "brcm,bcm2835-pm", }, + { .compatible = "brcm,bcm2711-pm", }, {}, }; MODULE_DEVICE_TABLE(of, bcm2835_pm_of_match); diff --git a/include/linux/mfd/bcm2835-pm.h b/include/linux/mfd/bcm2835-pm.h index ed37dc40e82a..f70a810c55f7 100644 --- a/include/linux/mfd/bcm2835-pm.h +++ b/include/linux/mfd/bcm2835-pm.h @@ -9,6 +9,7 @@ struct bcm2835_pm { struct device *dev; void __iomem *base; void __iomem *asb; + void __iomem *rpivid_asb; }; #endif /* BCM2835_MFD_PM_H */ From patchwork Sat Jun 25 11:36:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 12895334 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 3FCD6C43334 for ; Sat, 25 Jun 2022 11:38:51 +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=mun4OQyMX2K/LO2l1JXpHs1Vh9x50coBiAp3ff/4u44=; b=JO8+UQf1OpnAPX 4re9ybExRjGaH3QaYO89dVoR3atlYr5Rgzitt/4rTUEmP5p5staZlcr66pbz5csX93B4a1ESeddN3 t41eMfYau/ZQqH6FfNh79itbIPD1ZrlP0WyGGUJnKBIBUbuZvC7m6c2RNweorCdBI6QlIecJrtTGB p/VpoK8c8vjyvLR/mtJUXqMAZWKFmaSj0OlwIgKT+AgmtZjkclEllThejIdRgngkgGJukwIddYv+L OvGudHNxPDivsp5uyVbkegpTf2xt52bqZ5rsn4o1BohVHelnEhvieOE+ZzySv7pMykZzXHd0edtXV Q/ws/R5OfcaHAl/s3K7Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o546n-005mks-M5; Sat, 25 Jun 2022 11:37:49 +0000 Received: from mout.kundenserver.de ([212.227.17.10]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o546A-005mZ0-Pt for linux-arm-kernel@lists.infradead.org; Sat, 25 Jun 2022 11:37:13 +0000 Received: from localhost.localdomain ([37.4.249.155]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1N8XDT-1naHdB2HRp-014Q3j; Sat, 25 Jun 2022 13:37:04 +0200 From: Stefan Wahren To: Florian Fainelli , Ray Jui , Scott Branden , Lee Jones Cc: Peter Robinson , Melissa Wen , Phil Elwell , bcm-kernel-feedback-list@broadcom.com, Maxime Ripard , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Stefan Wahren Subject: [PATCH V4 08/11] soc: bcm: bcm2835-power: Refactor ASB control Date: Sat, 25 Jun 2022 13:36:16 +0200 Message-Id: <20220625113619.15944-9-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220625113619.15944-1-stefan.wahren@i2se.com> References: <20220625113619.15944-1-stefan.wahren@i2se.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:AQyuJ6BWAMS7izam3rfsN3EezkqlAy92xousHG1PtVIeKYqyY7u RIR9wN5UaeeQMb9/mq1P3lU012jDucCarYPA6qgdur5ZJ3ZqHoxpz2fEbzwxbMVbERG9LAD kB0wGWkxYlkHlxq8eBwTp6VOHqIwN3gdLOt9beS1YcFlSdPUd+v6aX7gTKovjZATVT2Dham Kjo3RUgFNJZdKioC1RigA== X-UI-Out-Filterresults: notjunk:1;V03:K0:dUze6tolySQ=:U8PQGkgT9Hw8WUHhlPNETh R5vsr+Ipoo7/OR3QQAyLpCoIfIhrooybsW2dCRlau2/UHa5mLNIQaE6HGdOQ50d6yAEq4llDG WvdwERA4nWFfwbmfs8DQmNv+vIrJwJqNUTfFMh38K/lOFoXQwlN3qDMPpkvomEBb02+iPmCtJ RdRG6znpu3Up3X0W3RoEvF3QFOU3kjon22nQDmsZtdtOdrMV3Ui0ACb5CmHcPU07q5i2k7CX7 PTcg3SkRDN/XsZ5QLyD0ElvEJe89N3PaCUnTOmYO709OASbIOSzcBEKAJFj7zj9mp2mZesRw8 IV9tgpucpX4KDJ9uXsGjc76RkEi0ws141tkV0drcsUyPT0wr6iz+iMVEKancBGqwHhxyf8Q6x F8mPrOXcsk/COp+ba5uL/rqlE3H3b9KD398N40j4I5/JZiBxFM6WsPAIs32Lmw+ry5JFhKD6n ZqXA1Lggddd2bi5tCtYFOjj2Z76tw0tijrJUeTNcuCCFFWUgT3tEp9W9opn5gZE7ziqDVP48N Atbuh90Yp5pFNb8eNUNyJayBSeCzlvYTLL2kj2DtjBXBHsYdcVE/ktetQ/CwLOXehPOp907qY afVB7QeqAaFDBrBzTET0L0CrWhLxtS9Glp4cxitCISs+rtB95sUCqHKgzFN2R6LWX6zEIXvs0 Zb3WMeWDiIVAE34P/DtPzgn4r04FHQPP7sps2pB2gfgu4Y3gv8DmSmmJoQcVZNQ+aQ18IyFMf Pe8LPYQOZD0UAiREtJbIf8iG/2C3KW7bqHHhfHpeCoEFVPVeZFVc/xj4Htw= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220625_043711_182453_029BCC37 X-CRM114-Status: GOOD ( 13.80 ) 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 The functions to control the async AXI bridges are almost identical. So define a general function to handle it and keep the original ones as wrapper. This should make this driver easier to extend. Signed-off-by: Stefan Wahren Reviewed-by: Peter Robinson Acked-by: Florian Fainelli --- drivers/soc/bcm/bcm2835-power.c | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/drivers/soc/bcm/bcm2835-power.c b/drivers/soc/bcm/bcm2835-power.c index 1e0041ec8132..77dc9e62b207 100644 --- a/drivers/soc/bcm/bcm2835-power.c +++ b/drivers/soc/bcm/bcm2835-power.c @@ -148,7 +148,7 @@ struct bcm2835_power { struct reset_controller_dev reset; }; -static int bcm2835_asb_enable(struct bcm2835_power *power, u32 reg) +static int bcm2835_asb_control(struct bcm2835_power *power, u32 reg, bool enable) { u64 start; @@ -158,7 +158,12 @@ static int bcm2835_asb_enable(struct bcm2835_power *power, u32 reg) start = ktime_get_ns(); /* Enable the module's async AXI bridges. */ - ASB_WRITE(reg, ASB_READ(reg) & ~ASB_REQ_STOP); + if (enable) { + ASB_WRITE(reg, ASB_READ(reg) & ~ASB_REQ_STOP); + } else { + ASB_WRITE(reg, ASB_READ(reg) | ASB_REQ_STOP); + } + while (ASB_READ(reg) & ASB_ACK) { cpu_relax(); if (ktime_get_ns() - start >= 1000) @@ -168,24 +173,14 @@ static int bcm2835_asb_enable(struct bcm2835_power *power, u32 reg) return 0; } -static int bcm2835_asb_disable(struct bcm2835_power *power, u32 reg) +static int bcm2835_asb_enable(struct bcm2835_power *power, u32 reg) { - u64 start; - - if (!reg) - return 0; - - start = ktime_get_ns(); - - /* Enable the module's async AXI bridges. */ - ASB_WRITE(reg, ASB_READ(reg) | ASB_REQ_STOP); - while (!(ASB_READ(reg) & ASB_ACK)) { - cpu_relax(); - if (ktime_get_ns() - start >= 1000) - return -ETIMEDOUT; - } + return bcm2835_asb_control(power, reg, true); +} - return 0; +static int bcm2835_asb_disable(struct bcm2835_power *power, u32 reg) +{ + return bcm2835_asb_control(power, reg, false); } static int bcm2835_power_power_off(struct bcm2835_power_domain *pd, u32 pm_reg) From patchwork Sat Jun 25 11:36:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 12895338 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 2B36BC433EF for ; Sat, 25 Jun 2022 11:40:06 +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=MLDGmHNTrsPBqFctut8UXukRxUp/wVy7NlQvBi60cAA=; b=KHVuMojF5PYIh9 frUT3xMIzXswonSd8qgYQimTeI0ZOmNlJ+O4LM8TwWYkVxo5PwB78AoCaMOF8fQq5/xE0wTqQVkHD kXfCST1i6fDOemxCpsPD347Njs6W3JiNZMk4VnJa2ZFFm0Veov7loldEmx/qDcLt6SA730mKPXxj5 XnZN0/8YgxDQhjfyh5gf0hJ7enMZ9CqSgpCru0lUjGlT5AvBOv4GKh9+oGWdsK/9eQEfFOV6cWmZ2 Wa/1TlNIMN27v8dvRiIG9K1LI29c3+0HE/EEmh3FvmkgequoZSUccrkY/Na6+RMWIB0ggZEOaV4B7 AQe6T6rPKVcaJy7EV4eg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o5484-005nMQ-P8; Sat, 25 Jun 2022 11:39:08 +0000 Received: from mout.kundenserver.de ([212.227.17.13]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o546B-005mZk-AP for linux-arm-kernel@lists.infradead.org; Sat, 25 Jun 2022 11:37:15 +0000 Received: from localhost.localdomain ([37.4.249.155]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1M5g68-1o2Iws45D0-007Fie; Sat, 25 Jun 2022 13:37:05 +0200 From: Stefan Wahren To: Florian Fainelli , Ray Jui , Scott Branden , Lee Jones Cc: Peter Robinson , Melissa Wen , Phil Elwell , bcm-kernel-feedback-list@broadcom.com, Maxime Ripard , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Stefan Wahren Subject: [PATCH V4 09/11] soc: bcm: bcm2835-power: Resolve ASB register macros Date: Sat, 25 Jun 2022 13:36:17 +0200 Message-Id: <20220625113619.15944-10-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220625113619.15944-1-stefan.wahren@i2se.com> References: <20220625113619.15944-1-stefan.wahren@i2se.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:2Q+QGWZHXKoDRXMZbItjZVy+ekN4k9/OEdA7/MWmTDYVnB984us x5IuLOc2VaLLyn3ssu+Zagtx/NbiqUjDSgDGGKgZz4ouACMw/YZ6vInlNKaHil4GlSjDv6Q w41UpwcPsJU/cBTQGsEu5ujJyGEQQjEKL6jaqnmf6mpNsO4sKNO+S4O5MnYVbGj0qkd05NU GD+bj9BFAtQlklcHW/oDw== X-UI-Out-Filterresults: notjunk:1;V03:K0:7w3fkUy2Q+Q=:6/f5oej7mFGkwVtxeIRJKo zlqZcyqgxMtnJ94jp+dz6qjbsx1mUmxOtpyuHxwrO1K7Hs2sEZ3SRhNkYS0Yji17mGva0YaIh ywi879gK6AtUOVfQM4pcbH1QyKQf8HRp4UYOivow2iNqhjDRjBrPyEK40w82X7nal68RqCAAU fPgDqlcm3+KxyHGgjXMUJoETv7wNWf/qShrlWJcM+xmuVJinEwg7iTHjLMGWpRZhupTuLE2AE 04/9wGtNEa8w+QC4YzmbCai5pEZx8vzwHSY629SjjLGwbA8E02Z2Ov52/qsMtAeNB0GhZcyb9 wS7XdYtEgEVAY2qQM4awOm5p4934OPYLfl1bvK5tnsxrmhEp7cXW3dUmLRcN26qTdjrKzhE4x vIxg46Ahybamcfxvra0dm6RXkhq4eFk1OPT9CSTMS1FPSV0bjxOqvVSdZF4a8pK8WYEJtLGJJ ugoClZRyvoQ6P/AdleCFMWr++kRJIwAsAFz4Hjhkokpzs7kyiiYsSv5Lx2DRrTbgNZ0itWP9j n6GjJHdAUVvsbUzacjBvq/GZmalGXmmADRVNsip4l5uTo7LBGplxNnjaThGe5GHDMEXpwtEZp dKZMGKXJREJa3u3zCzprKMrjX94pjA00MPb2tM4GTy631EE9UlTy5K+S2dSKwEoprGTXdkkdc KpK0XEMw0Q8OzC8rJvEgHHzd9KfwMGhO/ouu8k8qdhFS/matrv7DaDLp7iuNWVnaVPdF2ldHx 9XggfwQyyARZ2B9jJCsDpIHXoZHncF6JWZzeTuUc4HIbLWt3wglSBpNsqdo= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220625_043711_719068_1C51F954 X-CRM114-Status: GOOD ( 14.11 ) 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 The macros in order to access the ASB registers have a hard coded base address. So extending them for other platforms would make them harder to read. As a solution resolve these macros. Signed-off-by: Stefan Wahren Reviewed-by: Peter Robinson Acked-by: Florian Fainelli --- drivers/soc/bcm/bcm2835-power.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/soc/bcm/bcm2835-power.c b/drivers/soc/bcm/bcm2835-power.c index 77dc9e62b207..9c352f66e6d5 100644 --- a/drivers/soc/bcm/bcm2835-power.c +++ b/drivers/soc/bcm/bcm2835-power.c @@ -126,9 +126,6 @@ #define ASB_AXI_BRDG_ID 0x20 -#define ASB_READ(reg) readl(power->asb + (reg)) -#define ASB_WRITE(reg, val) writel(PM_PASSWORD | (val), power->asb + (reg)) - struct bcm2835_power_domain { struct generic_pm_domain base; struct bcm2835_power *power; @@ -150,7 +147,9 @@ struct bcm2835_power { static int bcm2835_asb_control(struct bcm2835_power *power, u32 reg, bool enable) { + void __iomem *base = power->asb; u64 start; + u32 val; if (!reg) return 0; @@ -159,12 +158,13 @@ static int bcm2835_asb_control(struct bcm2835_power *power, u32 reg, bool enable /* Enable the module's async AXI bridges. */ if (enable) { - ASB_WRITE(reg, ASB_READ(reg) & ~ASB_REQ_STOP); + val = readl(base + reg) & ~ASB_REQ_STOP; } else { - ASB_WRITE(reg, ASB_READ(reg) | ASB_REQ_STOP); + val = readl(base + reg) | ASB_REQ_STOP; } + writel(PM_PASSWORD | val, base + reg); - while (ASB_READ(reg) & ASB_ACK) { + while (readl(base + reg) & ASB_ACK) { cpu_relax(); if (ktime_get_ns() - start >= 1000) return -ETIMEDOUT; @@ -622,7 +622,7 @@ static int bcm2835_power_probe(struct platform_device *pdev) power->base = pm->base; power->asb = pm->asb; - id = ASB_READ(ASB_AXI_BRDG_ID); + id = readl(power->asb + ASB_AXI_BRDG_ID); if (id != 0x62726467 /* "BRDG" */) { dev_err(dev, "ASB register ID returned 0x%08x\n", id); return -ENODEV; From patchwork Sat Jun 25 11:36:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 12895340 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 1CBCBC43334 for ; Sat, 25 Jun 2022 11:41:06 +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=aVCWYUn565paPfwYGzoKBZ34+RS58/aWMpzNNDpJHJg=; b=vhX/7Nl7xWUpNf 4fiEO8KamwCfyR0ECO3/idoEIpt2MbPKLTSYE2iTgweEycbxaY6w/wr72w2mLeBHXsQaY3LWpvwb3 yjNrhq2wIrruvucS4AFt0aUk+B/2jR0XcNPzakRp8PZQFmTTD3y4/umoVYLhwxfnAuSttO6k2mzVk lI4xCrd66zlPrmOYE5HHbq1rPh1ApS5gtCd17eu6dhP77tdEYvFxzK/XUhI+VTXlTM0sh6BbDZpBo haZFWcozaxKRIUOypy9bGPeGTFAjADRJmUxI1cMQFUfMHKZSiqXqypTdsABn6Ocnu+999kFkjUzAH SIDoetsGib06y75vs0Og==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o548y-005nrB-9R; Sat, 25 Jun 2022 11:40:04 +0000 Received: from mout.kundenserver.de ([212.227.17.10]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o546B-005ma3-IV for linux-arm-kernel@lists.infradead.org; Sat, 25 Jun 2022 11:37:15 +0000 Received: from localhost.localdomain ([37.4.249.155]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1M8xsm-1nz05v1cla-006AK8; Sat, 25 Jun 2022 13:37:05 +0200 From: Stefan Wahren To: Florian Fainelli , Ray Jui , Scott Branden , Lee Jones Cc: Peter Robinson , Melissa Wen , Phil Elwell , bcm-kernel-feedback-list@broadcom.com, Maxime Ripard , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Stefan Wahren Subject: [PATCH V4 10/11] soc: bcm: bcm2835-power: Add support for BCM2711's RPiVid ASB Date: Sat, 25 Jun 2022 13:36:18 +0200 Message-Id: <20220625113619.15944-11-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220625113619.15944-1-stefan.wahren@i2se.com> References: <20220625113619.15944-1-stefan.wahren@i2se.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:CrAi4k9Wo8hscyvh6c49EdnfeKAOjVeZNKoVyBNv8a+wSJRWS4z X/dnARLoxXrNsaNJuB3fMJjmvMU76kAJIFnvdg7ZQFqHQJk2a5jmXokxxiyn0ZCZMCPrFu1 oMYRVrOpRUgB03KFIBxMrvNUpKINUwNKaiGQTrfgKzP69Kye/ORXYetqhdDfvk4CyeKOHr+ GjUm+OE04XcpEs0z20hmg== X-UI-Out-Filterresults: notjunk:1;V03:K0:l/7/A6MLRNI=:mqVwQO8FHcu1+Z0dh9v62s 1NGbvXmwIPOM/x6UOc9ib/+79IjAd/vEQgGf3cmWwuyBMn+t1eyVHS8SppX1T4E3sF2BBuadT CHxr+zZpE2ck1uSpoLY06yDbvhsmtx1l42M/2+5uvhUWxF/J1CRe+GU1dxO25FEsuWGgfgBKI i0RUZaSJ8FCO1gRbM6yckG2hhbi+W49uO9hNEEn9opj1SReUcaogh8Yno0lf3trxV1v9txL4O 7kTHjWtpVzIsjTfCPaTW97LvZhjJFV5W1utVL9ApqKeO5ujvAT/90xM/D9jGFF+m0pvqQ/RUi 7clsRhNyzgDagcQ5LIqBRl1vyuBI7FKmsO2Znyaor+nH/CmD/Qd3UlkX9TIkrhK1vM4meKeex 76oBBDcuHzgE0v3t2/0Wk+mWEEYS1sapIX5kM8WDc1SSD+g9fWBiYP5wxuS3ArVMhYT79Msyg xrABKXhUXIVvCJ8OsBDlW20jAY1R7iUaCp/9hUNoocbYYYbpwaOhcc+XSYtNwXrQ0fe2SZ8ZQ +/9f/Ui0NZgNzvT7XioW6jTqbGLbnfjrNLbW5cS366R30OPPlpRjam5t4oHWlZIVXPGlA7LSl uBWGVOobtJ5BDz6jmc8gHLSN3rR7eYcTRgoRBvIli2Ma1AIofEQLj1jCPpMEnC1Jwl7P+PeKZ bgMk6nmJFOcyvs1DgMrapS0QSfZmx6P9viKM1F+XE4jvuZfrEbDl6SNRet6tUJpEyJzsspnrW uJDtszOpgc5XvM2VVA6b8h7Xrx6nDuPM151MokCtQxGQ9DkMd+l9Vxr3Euw= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220625_043711_966395_9D8512CB X-CRM114-Status: GOOD ( 16.75 ) 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 In BCM2711 the new RPiVid ASB took over V3D. The old ASB is still present with the ISP and H264 bits, and V3D is in the same place in the new ASB as the old one. Use the fact that 'pm->rpivid_asb' is populated as a hint that we're on BCM2711. Signed-off-by: Stefan Wahren Reviewed-by: Peter Robinson Acked-by: Florian Fainelli --- drivers/soc/bcm/bcm2835-power.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/drivers/soc/bcm/bcm2835-power.c b/drivers/soc/bcm/bcm2835-power.c index 9c352f66e6d5..1e06d91c0739 100644 --- a/drivers/soc/bcm/bcm2835-power.c +++ b/drivers/soc/bcm/bcm2835-power.c @@ -126,6 +126,8 @@ #define ASB_AXI_BRDG_ID 0x20 +#define BCM2835_BRDG_ID 0x62726467 + struct bcm2835_power_domain { struct generic_pm_domain base; struct bcm2835_power *power; @@ -139,6 +141,8 @@ struct bcm2835_power { void __iomem *base; /* AXI Async bridge registers. */ void __iomem *asb; + /* RPiVid bridge registers. */ + void __iomem *rpivid_asb; struct genpd_onecell_data pd_xlate; struct bcm2835_power_domain domains[BCM2835_POWER_DOMAIN_COUNT]; @@ -151,8 +155,15 @@ static int bcm2835_asb_control(struct bcm2835_power *power, u32 reg, bool enable u64 start; u32 val; - if (!reg) + switch (reg) { + case 0: return 0; + case ASB_V3D_S_CTRL: + case ASB_V3D_M_CTRL: + if (power->rpivid_asb) + base = power->rpivid_asb; + break; + } start = ktime_get_ns(); @@ -621,13 +632,23 @@ static int bcm2835_power_probe(struct platform_device *pdev) power->dev = dev; power->base = pm->base; power->asb = pm->asb; + power->rpivid_asb = pm->rpivid_asb; id = readl(power->asb + ASB_AXI_BRDG_ID); - if (id != 0x62726467 /* "BRDG" */) { + if (id != BCM2835_BRDG_ID /* "BRDG" */) { dev_err(dev, "ASB register ID returned 0x%08x\n", id); return -ENODEV; } + if (power->rpivid_asb) { + id = readl(power->rpivid_asb + ASB_AXI_BRDG_ID); + if (id != BCM2835_BRDG_ID /* "BRDG" */) { + dev_err(dev, "RPiVid ASB register ID returned 0x%08x\n", + id); + return -ENODEV; + } + } + power->pd_xlate.domains = devm_kcalloc(dev, ARRAY_SIZE(power_domain_names), sizeof(*power->pd_xlate.domains), From patchwork Sat Jun 25 11:36:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 12895341 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 D993CC43334 for ; Sat, 25 Jun 2022 11:41:32 +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=5uXOrDrYst1b0LkcPeSh0AcqbbkJ9An567uquI6wa1E=; b=N7iajVsFsVB79a pOMhfkjeNw4j9iRCzuA5SN0HZG6wRQLxNg88jqnRsoiGakij/RLozEWuLVQ6Ix6kF4XKOroGIUUcc FV5qLaZsLNJRv9m9rec9bBjjgDrdHS+fR7u1mykO3PPOyiUOEfr8Nm/RJM48mDGMqS446lN8zR0Nm k7YrmcO8OgLFAloP7WMuG1/Qgibl5LX/wteweJz7IzHjBt38aVmKnjWsDxrTFW+UFJfKVNG0VcxRl 7v/YxMCAQ5Rjz2VzXo7tZ9ykb+Izsz9Fg908iT0+eCxDo+XFooBEbdt2KbfArn14BZZQOJYwmtKzh gWbW6jjOTfNvhMru4uow==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o549L-005o3r-9b; Sat, 25 Jun 2022 11:40:27 +0000 Received: from mout.kundenserver.de ([217.72.192.73]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o546D-005mc3-Ji for linux-arm-kernel@lists.infradead.org; Sat, 25 Jun 2022 11:37:15 +0000 Received: from localhost.localdomain ([37.4.249.155]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MgNxZ-1nS9Fe3aPP-00hy2z; Sat, 25 Jun 2022 13:37:05 +0200 From: Stefan Wahren To: Florian Fainelli , Ray Jui , Scott Branden , Lee Jones Cc: Peter Robinson , Melissa Wen , Phil Elwell , bcm-kernel-feedback-list@broadcom.com, Maxime Ripard , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Nicolas Saenz Julienne , Stefan Wahren Subject: [PATCH V4 11/11] soc: bcm: bcm2835-power: Bypass power_on/off() calls Date: Sat, 25 Jun 2022 13:36:19 +0200 Message-Id: <20220625113619.15944-12-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220625113619.15944-1-stefan.wahren@i2se.com> References: <20220625113619.15944-1-stefan.wahren@i2se.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:2PrwkBUhlX3feTxtsVZZDn4SLPgtv9Owu+n+ReAxpWPwW+CUQu/ CTWiEynQbYzHpcIvmpdxk4zbxImg9Xfro0H4ROK2q+C70L+C4IqHLfkJ1PUWyCHIaDheqcW OYSBuHy0/F4ungU8+2oIHg09DZ4gxRqMYdGZDuzXnIwAMVDQKD+zmpkj7n2U8teZGqk1J+t 3JV96p6oLrPy10pqF4q4A== X-UI-Out-Filterresults: notjunk:1;V03:K0:TsRRSqpYVLU=:frROenGdWb1y3SOA3jkZIM qQ9IleGV+nFEDrD+ysN+HWBXyUnlppwXIKyOHW/jL2fBRB+S/FcNk0DCRuT3GzDe0cU4z/L9N YHnq4tOO/bA1fL0quxPu716Tt/HPH1dWmV8NZiWZbuAA8jXCMEYdQVuwBkLRDycqbvYQSBeSY farJCjkJhCv4zfqdadiyMjKeiJhNpb5cyZODifh1hfSt5d458L8aNQu/UKwkLDNXWu2xJDPyb DnaYJ01yHvHGpQcctK9nv/mTatgqxFNuB5+MFadoUvgAZ2s2aPDG5AMWrVoEVOPMAEGxiMZXK tQdc1AmjwwOEjup63QLQEu/HB/oDBkabnZ8GotOdddIPTLEH7QgOycOaWxw54NhWEFgl17aFq GPpSG4PMhhaB67zxKOvNR1+0ADdiPCH9trwPXIJPlQAuKCUeNrekHwe4SYbzg/ZWRs7MxbxR7 f0Y1pe/Oari0m9NNwjnBxZoM4sS6l6+P3ooXtemoJNzyipzEnmMVdSZDO7enYWfiJh/09TiDv lCzFLHbGi+p1mGlzblqepsDi0VU4cscgAMPZCm0Yh/ce137cThJ4/LAeHHfkflq6vYeZc93Qp j47IdV4gyIElS9Sd9y26XaJHnANo/uu/QgXE/9weBI+NbiKXNypnLW1IvwIy3mSIx6f1fnJcy /49dGVAQoDqfJKV2tKc80KGeKL7xNI1Y4otedAvvbfw32icKYCIfMEN53LH0AlQA6O7OMu2Bx rz6pQdTOBZC1FFNIijTF24UE129FXiijW1fDMp+4rJYN/wEzH7eHZD5EIJU= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220625_043714_003631_47D9DEA2 X-CRM114-Status: GOOD ( 13.16 ) 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 From: Nicolas Saenz Julienne Bypass power_on/power_off() when running on BCM2711 as they are not needed. Signed-off-by: Nicolas Saenz Julienne Signed-off-by: Stefan Wahren Reviewed-by: Peter Robinson Acked-by: Florian Fainelli --- drivers/soc/bcm/bcm2835-power.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/soc/bcm/bcm2835-power.c b/drivers/soc/bcm/bcm2835-power.c index 1e06d91c0739..5bcd047768b6 100644 --- a/drivers/soc/bcm/bcm2835-power.c +++ b/drivers/soc/bcm/bcm2835-power.c @@ -198,6 +198,10 @@ static int bcm2835_power_power_off(struct bcm2835_power_domain *pd, u32 pm_reg) { struct bcm2835_power *power = pd->power; + /* We don't run this on BCM2711 */ + if (power->rpivid_asb) + return 0; + /* Enable functional isolation */ PM_WRITE(pm_reg, PM_READ(pm_reg) & ~PM_ISFUNC); @@ -219,6 +223,10 @@ static int bcm2835_power_power_on(struct bcm2835_power_domain *pd, u32 pm_reg) int inrush; bool powok; + /* We don't run this on BCM2711 */ + if (power->rpivid_asb) + return 0; + /* If it was already powered on by the fw, leave it that way. */ if (PM_READ(pm_reg) & PM_POWUP) return 0;