From patchwork Tue Jun 7 20:42: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: 12872366 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 AA25DC43334 for ; Tue, 7 Jun 2022 20:44:44 +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=cLA5K2AMVrHmiE P9mAbiAR7a6rF/bI6SSe+hluT+BZYYTR9RU/8C2xe4/Ct/deaJG340aLpwKPmKQtfOqVfUaQ3mX4J F3UX2o0+Zrq6KAZz+DuBsE6byG2OGL+B8kT07B8ld8pnoBkCWoAp2gUI8H8w7+5TQeCYO+OA/Dpy/ ARFyqTuRsPUT4mpLkBOJveM51+tWQYdmha9Io7jSxQ/wVSD5+LYYdBPzzvGGGHbBjBIodiMvkEc5j rCM3CgDpx+rBskredairQOHn2uNvVOMGQH9dhfGt7dAII0G1Nszx6nGL4alV2TYdVfdDNGsPRnUKP 8WoIb7mb6mTUX3NFtw1A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyg3F-009a0n-Nq; Tue, 07 Jun 2022 20:43:45 +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 1nyg2Y-009Zaj-09 for linux-arm-kernel@lists.infradead.org; Tue, 07 Jun 2022 20:43:05 +0000 Received: from localhost.localdomain ([37.4.249.155]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MiIhU-1nJHY21Qc2-00fQtG; Tue, 07 Jun 2022 22:42:52 +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 V3 01/11] dt-bindings: soc: bcm: bcm2835-pm: Convert bindings to DT schema Date: Tue, 7 Jun 2022 22:42:16 +0200 Message-Id: <20220607204226.8703-2-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220607204226.8703-1-stefan.wahren@i2se.com> References: <20220607204226.8703-1-stefan.wahren@i2se.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:4WTGubwhOIVPr9YwhBaJaKf8PK9nlhfAowCd86yrz3xA4TegCkE N/p5ejcPyEBqksMhsnV0TMuBnEVOe3FZXKoXw0XVq5FgO4c7WvwkOpr8+c2qDQJrLs1p6oN hutyED7/njCGliDuttpRkvivsszgOyZwEImbJTL1TiVgk8t6K47P4scmiNUFrWSjPyHIrzk Berda73yOzwsmLN8yhKVw== X-UI-Out-Filterresults: notjunk:1;V03:K0:AwEqJ+A2ruM=:31NUqNIjyLhYnisTfWLWuA QXxoKjlVInZ+XEWnjjsPRQnLhu+UhVDKI/+50j+R3YcU9ZDrXWXAPXl5GtPZXZ+5nS1XJZU41 LncF8s/CLziR2L5bWuUPOhJDNSHl3C5Fo2hHe85/joo6tPLld6r52O47tmA6iEMbG1xAsgcZo A++nrTqp1ukaIf1ZAM06kWXcV3dcSzKIpUWT6JL8fGptn+ezRCecaN+YMbnjBmGm5/11ehoYR lUeUDY0aeLcq2mocF0YgpS2fErGnKrgJXX/3f5IfW6/3lGRrZ8o4SN/ypP5ApseRSrAoVOjYw 14NSldyC3YdtWW5lzq7MpSIK2Q+6bq79JGaBnWKA2RiFI2w71VQm9qzTAWzNJFPnxHYic0ROT IW+S/HuqRJAmU2oBSq+SkvjbGPT8InWMUq36HeMXTAIJOOsCvCqDTBhntDu+KnpSZY+vL9GGA sS5Z+k2UNJjkKnT1Yrx+tynPAYKfY2VqZ3mukeEa30KNvBHZetsJFaklFStX+HyIqqvdK/OSO nwQ60/lWv+3PWFx0HyI4c044jGtHY9Dqaa5yqWPne6/gX7j/4NBNoouiJ+u+3JbT6q6ydO937 7IG47R9wTliyRNZquyaKbgBcgPxh94qabnLNQ//yj7707J/rulJtkuBoQeetArgcGHKCBnYHw Op58hD+u53WylTZkujZD8/zAaimFP+Qq9MiObT80O4iOiZOCUE+sHeIVIiQE4nEh9AsBUDVro uEui8Zu+2ReTKGAc9ElzFSMcXDYql2lOl6xeZ/d0IjPtRe+1ih3XDSc9ObA= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220607_134302_410877_80C00EAA X-CRM114-Status: GOOD ( 15.81 ) 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 Tue Jun 7 20:42: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: 12872373 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 5D0D8C43334 for ; Tue, 7 Jun 2022 20:46:56 +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=Y2Qr6r/EoMcrmz SBnsuxHqBWINV6ePpIah5PfBZKcGl8sSgzh/yEXGkpAEeTIQf2yLRDWAdlMRW0NBzhshVSQdxbiYS olz5RTLV8Fy5dANriQGNl/mki3qkGVyvwc40bakOjXKm0KKfQht8XNBirCpXDJE/o6n3UYXF2QYps h7rzoIVkZlWMof1HpCdkAcwOiSD7Q8Nkx1ac04u8jqzakS3RJrM/DHbdUgdVPqq+9bz/Ps6Cjvagq NtcLprbvdWRYchMZ02t28BWaN3TO1Sr8pCEr0tczEzVniC7EsABCLRsQHMe635Rr6g5lcl2e18UgF pDW9ICJrQdMXTZbwUI2Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyg5I-009bDf-O0; Tue, 07 Jun 2022 20:45:52 +0000 Received: from mout.kundenserver.de ([217.72.192.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyg2b-009ZdK-EJ for linux-arm-kernel@lists.infradead.org; Tue, 07 Jun 2022 20:43:08 +0000 Received: from localhost.localdomain ([37.4.249.155]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1N3sNa-1npm6W3bUW-00zpbQ; Tue, 07 Jun 2022 22:42:52 +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 V3 02/11] dt-bindings: soc: bcm: bcm2835-pm: Introduce reg-names Date: Tue, 7 Jun 2022 22:42:17 +0200 Message-Id: <20220607204226.8703-3-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220607204226.8703-1-stefan.wahren@i2se.com> References: <20220607204226.8703-1-stefan.wahren@i2se.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:ScX2DzfWhJCjhPEZb9S4fBK8Yxpiie8QXDn7g5Pczowbl9B7rNk eCIPHxW1g2N6tnyruYcDTURu6kzg3rfhHpZ2m2zLumTcAQuu1CZ5O36n0jpy/Xkw9FTLyvs 5LTnRQbEIT5LdOh9466rtSfihZnT5yovzT0YkvgrDQ8J7Cl6+/f80DC2GvnrS4lXEngzQsm 2v4rjgk9MonJPKbulQkGw== X-UI-Out-Filterresults: notjunk:1;V03:K0:DM8Zds5ASIw=:2u1Q45Qo2iHICcBr9QwbBe 2vnoe+Zu9BvjZ26v+dlCNvTJAFICt6S1+P7g7B+dqnCxXrxaG0oWausaUEhNwrh/OhlTnaoc6 8o4h9Qmxoje9ybgOK/j3pmJJtYJSD9jwN+uRoN+tDkSGtMMEpXCZqAz5ypomuGAIbILebcmEZ JaQXr82psAXMIUwnXtt6ul7fwBhNLL3EQrGOEQNcnlwfXl601lEY8vpqmPhmrdCvSvlUXhscc E4UGQVcJDIAifJJvHIgDTEulXD18NiaKarJyzTtpEu0wUzwoy1vvUtgxkZQp7+J5m6ZbkMwh4 vMiO28YxKWGNC75HRn/3GhL66qHCi4BFN90Jrh4MD9pvW8o+BauM2hSivMKTM9I45EqqvYSjI NxVg5V3ABX1Jy0+VxXTcW3eH2hKjeO1H776jNfys7cAHQ2IDUS/90khP7u9wKfZObecW85mht HFi0hdeAeeiIZHXvPahHBbj8747NWJcAGON0G8w7IKTuwdwzmq4uDdNMu4MAiDdimGIl5R4mm Jdk/J1cCCJjYvSpZQbGz7bx5B44hJTHNWjXJGwVM7aL2PhrQNil3/Wis5g0LlKzYZ3gb9gZR9 o4yYIGVO/qv3BKD3XS+LQ9qPdnZYA+JxXZrxmZVqeABxdRq3IiQkc8R9/qbziq7WN6ygQGiT2 wG42JRPoA0SVOWZi4PEeiKqU30VJoKTdLvVzYPkHwD/LZaZcERbR9Kg93wnpmJqSi+3YMlcuZ rNERvVwj6VGSXOuR0ZJT3EUVaeEfuwqf8i8vLGrO50YC4+W8G60+HOEL/B8= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220607_134305_951171_53EE4928 X-CRM114-Status: GOOD ( 11.33 ) 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 Tue Jun 7 20:42: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: 12872363 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 CC51CC43334 for ; Tue, 7 Jun 2022 20:44:18 +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=lW+desw3vJNF62 em+qxYhab2Bq+ivqEVfinjkLeXssRm1PCeC0/DX4yRIpDnJtUnUCbI/9LOI23aQyDl8sG31aRmnwz yvBPCbWeE9StsZMqFsCSbRiSa9BiGhdg1JWwpUX4BEVAT+qM++n1tje0KE3nxGkTF7eMxsNPdsk6L FsKl8CunmDBjBNx+I0PxibJlnNo7zZukZRI3ltdy77LEt04YDjkcrdJPu11pJ44GCImVfOPIthRAv jMzDO8Wq8b5iHHHhCdpWJmpJSskFyLpa7sBeKGcmtKOofmld/pETWzaaQmLnejcT5XMpa1BOA1/Vk ys2yU3AshL9f9jLXs0nA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyg2n-009Zpx-34; Tue, 07 Jun 2022 20:43:17 +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 1nyg2X-009Zak-FH for linux-arm-kernel@lists.infradead.org; Tue, 07 Jun 2022 20:43:03 +0000 Received: from localhost.localdomain ([37.4.249.155]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MScox-1oMcwm1Lo1-00Sxcz; Tue, 07 Jun 2022 22:42:53 +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 V3 03/11] dt-bindings: soc: bcm: bcm2835-pm: Add support for bcm2711 Date: Tue, 7 Jun 2022 22:42:18 +0200 Message-Id: <20220607204226.8703-4-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220607204226.8703-1-stefan.wahren@i2se.com> References: <20220607204226.8703-1-stefan.wahren@i2se.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:UE/dsbGoaW8um96Kb72CcCBjoIqPly7nhlflOJ/R1LK7086oAV2 Flvf1GPuLx3NDJ3OToq191jbny7IZyF8BNxp+XtGkVg4cgZnQVov7EWN/MGmeSR2Ay81nCY nkrMFZcwtUqyZQW/hVpomRS03SAaNwrpRIjRa6R+wo8lVH5XMLGMG/3IYl6XKE6luEq6Ier tjY2e9TdGVHdcW9D+ELzw== X-UI-Out-Filterresults: notjunk:1;V03:K0:fdlcL3qHbgo=:nHTsQuDu+UlZyoQQ11dz5f f3s0Dr4btHXHFPUKW/5Cyw8QmIuMHnnizwVFLuwG1ZcOpmzf6Il9rZG3ZR7he31nyTtxrY8m5 eEsF6VEX7LE3nSdWuPs8PG1l9TDvImFv6r6E41sTuHQelxRcVEv9gC83ZeEtUms7OWBa9DGPY OsQlDaKfhcgYN/MIJylf+vGvMSAokd8lSovwkfIvAp37RSBOoKgH7clxXgB91IQIbDCItR/yZ arDr2F/p527laX+XEhH9jCGtzowWN8NpvVjs7mSXXg4KonsvvpHOzf+t4gpmmTsqtRomB+6LP rtSIE9Ulu1CX0dJCeXylg057egAKDRevhOw/51RrCU1T0uSYuoIZMeIoYgNjmeWYKSq2qwLyT nK4tX/m3LNLNql67A6SKC8kMuMYyY5EztsdDVezKKIUi+7zQhrLztITYvZ4cWo8emwbLJe+j+ oYWeDk0E7aQSp9UM2F/+Vq0XJKGSwMYbACUrQRaff20hRhoYkFJ1OzdNkC8l4ZNZqIJIBMjDN 0NeOlrGqy7g6uhhSfUaddOyCb9Y4Lhz97HXV9QZUwf30vImPSm3Fg0RMoe/2rNxdHkHNcPnWg ATHOGOpww0n/Vpk3YTQrxxPjgAiWOHUrxdmMNjy0d7ZsrmyMiYzM03HVqI4ktSjCAJOg8X3Xr VS9zA05R8o21yEUOGTTcZsAa2X+Ek6CPgSLqxc1F7cyEHbbg5S4A+BUzEam8jloFHgFmLdoFv Us1dV+Zez0NvAQSqx66RUZpnmORLNsDQ7rZzXtUq7GBB3m6xB6LaFJugyfs= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220607_134301_875370_2B17E814 X-CRM114-Status: GOOD ( 11.36 ) 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 Reviewed-by: Rob Herring --- .../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 Tue Jun 7 20:42: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: 12872365 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 9313EC433EF for ; Tue, 7 Jun 2022 20:44:36 +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=24GeDyt7vnBr5E Qm+uxLZR4SFD+6wddm3yhkmIKFDFC5fONl1RPIvs3hJWq92sY6byFksNHFnjFKQxE5/yTxqaBePFc bGDdOBYLfEPws7kEMMRhz4Q8iPxzFFpw9bM2V/mivlGX/NnjfPu+PA/Bwj9+Keg/iHl2GJzdsU0TD oz3EFpmb7Zjx8sLAOQCNcl47RW3Dg8IjjQ9RQ0poj5d3nQSl3+JCxutTmAOzDECP3J1jp5fJKgsRJ rViF5XD51wQDZ1JIgyMwhZHm+9/XgOAvBrFDRLNpfK11CVm9chV+x8uw3F7OT9770yh31AfRH+gjw fYoM4Aze46FCqShfXCog==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyg35-009Zwk-S5; Tue, 07 Jun 2022 20:43:35 +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 1nyg2Y-009Zat-3o for linux-arm-kernel@lists.infradead.org; Tue, 07 Jun 2022 20:43:04 +0000 Received: from localhost.localdomain ([37.4.249.155]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MFL8J-1o0XjA3SG1-00Ffvp; Tue, 07 Jun 2022 22:42:53 +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 V3 04/11] ARM: dts: bcm2835/bcm2711: Introduce reg-names in watchdog node Date: Tue, 7 Jun 2022 22:42:19 +0200 Message-Id: <20220607204226.8703-5-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220607204226.8703-1-stefan.wahren@i2se.com> References: <20220607204226.8703-1-stefan.wahren@i2se.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:RZwyktpGBw13LEvECvmQkFP5A/2abbduZU0vURMRqnZq0osOfUw uKoCoV0KeXptqa/O5FXnTGa1ftM8W3Av21GxCDq/ne1ZzOSNjcKw0rtCfID5RW4A0HwxDwq kKg6LbBqSEcGORAZ1QcljzS7Lo2OM+mKpgwT8kJuwFG0g2KqRQBaTqx8t7vBY9Ijb/UaKql QcwRxTAD/OrOPWiFtzT+g== X-UI-Out-Filterresults: notjunk:1;V03:K0:PxIJ2dmHzpw=:3Prxuui3ya22wd3gN7zz2C AuS+8iIQcXumxmKaAaKdvfc8d+i7wYcN8ubOx6R5GdHcAyL9sPjfw8eAMGmELdNfYhpJrq6jo 3sg+IzHQCHq//Db9mzqi0Ldg2XheglE5QIiQrYc/3ycFCR3aOXZTeYbhOQ5QY8VIZA15ovsA0 703O5xyBz0+rOry/hN5jtgv6+mQJYkiJ4k8jAbyOTIPzEgRsq9Ej+TnTcGBx96k0mgFZASY9m nFNUUf0GVlQDtEQkZhY7JWToJwc30cif2oMoceie+81noJ7MttCwbhQQiOBUloxPr2CYhgvJG dF77qymf9z89BuznZkLV/5ja1Rb33kdZRsJOCq50BvzPAjY+LkXcP4Q2fZ0+I5m5FOstH3x8V dX+fqxB2sYrO+EAGo8Q/1e68+j8Ju2hvrhVudw6lOX9GZkR8mIBOyU+Sbq/7P++lF2dYNm+U/ H9ymSDyyZptxVgPmmIDjO0qK3OJS2Z9yVIlGlY1/dWDIRddH615PS7gQGPXoASLjAElMm4v/C qeNUo1zR3YgJG/ZJLZI+VdYjQ+Dnkl7EOqJpQh/q5hEEHwKfgdw+WFmpzlkdfGOPuIr4eoiSl fMtru12Zi9SMQtFLp7O+PrjGt6YhNKwDM2hiImiDtjGjGVdWDdMGbKwti+dQrqrnSFdNqUa/h QO57N9qosa1hbkZ0LvnLm4fr+TVMc06KYWZa3NA4BqZjyeSzKk5l+kXPUKRo69UV6r/ss0n7Q HLmvrLZehDrZViO5mvQNFX/OhE1r6cxRsupLilPujbbdZvVpomhqsN0I070= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220607_134302_507803_BA93AB0C X-CRM114-Status: GOOD ( 10.85 ) 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 Tue Jun 7 20:42:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 12872362 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 9A418C43334 for ; Tue, 7 Jun 2022 20:44:08 +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=IT+cfF7e5map+W KcjWbU8c52mNunRYzUvetamwGlivghufoQzBGDbRdhGxOaxWW/1D1EWn46p5tFuJLZfmsvovQEFgU KesDdv7RS6+uUwibfFYFf0y3FeVT5AzV/TM4V0hp0B1aCE3KdfoxwKg46LtdJGavNljfv+3Ls52YB IPZKXIe0o087iK9dJgzd5wu/vO20oK/ByYWhvUZW4ExNiLtZQ8xRxqNBAuz1X7OnRlQSORHRlNDrz mzaYNrKDuxcxYUn2BGU71sff5ZmOY+ElJn+UpSFnhMAAXSIPyCoym6Rs+BR5bPoGwRN0i7K4d15K/ iSXzXW3wUYe51YWLlRdQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyg2c-009Zdg-EW; Tue, 07 Jun 2022 20:43:06 +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 1nyg2X-009Zan-FI for linux-arm-kernel@lists.infradead.org; Tue, 07 Jun 2022 20:43:03 +0000 Received: from localhost.localdomain ([37.4.249.155]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1M1INQ-1nvv9A1KiQ-002nl8; Tue, 07 Jun 2022 22:42:54 +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 V3 05/11] ARM: dts: bcm2711: Use proper compatible in PM/Watchdog node Date: Tue, 7 Jun 2022 22:42:20 +0200 Message-Id: <20220607204226.8703-6-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220607204226.8703-1-stefan.wahren@i2se.com> References: <20220607204226.8703-1-stefan.wahren@i2se.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:zELN2rQeacuGlbrII61qEELxj982ZGzztwLFEicqtg86t/fczcv ZYHzq8HttUOpkM2CcqlAPiSXDXEIiI3X8ReIoWENpfCroMkFQ3yBTdr350NXYUW/uRFeMT1 YWPQlAwMKKh+uWB6JkJb1AUjpn/+qd07CwLX1J5BpTqpGi9gLcBXHePapsO8btNyIpT3b74 b4xipHoKeoCL6Ccd0vI/A== X-UI-Out-Filterresults: notjunk:1;V03:K0:tL4oKOIphs0=:NSEbR8dyNyTRa4yE/ygb74 Epz/7HgTjBZLbEFHIrpxccUKlTcn8SJZEAS/syBx1A6rAg1c8PiL4P+Z9PEnd/Sn85d88pBiT ILcZg3xlPDIkj2jzhdpDQqqELNW5ERb+Gvwpcq1yVLVr0lT0PqLMNVbmh+uTqErG9MFsrwok6 qSgwJt3D7NAP4+HLNJO4+RZLacf+04wT2ITqW3RVXvQ808SY/hvRMup7S3CKO0yPfUgw+rJaD Glt0Y03AeLdhycA3vQ/T2pO2H/QQUBFXv+lWxwWR8zrNaZrIXenIQpBveT+IgwkdVedPvzks1 BIvnzX5N8SyYm3wTOOp+Mwa9ZFNOyg8wkNT3dGZ9MUGX0XaVGuJk57rvZVeJVVBSW+1WNJHku BKuYYxhx09xqH+g6ZBYergNrw3VbyPn7C5ujMZTSQv8bqngX7MF9oA4YKkpGZ459tRfS6appb ajWfqHGO1SFLemwZrFT+dobW8e9WGBklvUWLUc+00z2V4NsL16Vc5eXoF46WJHWf4e2rnSils 6zNUwc9BTRnr58jW9zoJCcdfKGS8ubtindBST6lkckTMfReih7NJB9XZFz6F9Z6jhphPmUDTu /H+r3H5cpJct+nQm/ZxXLtiuhkh08KXutsMb4dDNY/39Uimc02kbV7EAxFl3f2IcHFB5InGTV zX4kMNvYTcIXxfdqEvWlakHLaLixshX04eBiGsA7B1Wok6LlyG/gvH11eHBNES42A87ob2dcO uV3tMxJLXGZY/WWm3H8vALixXwMBI0w4GodV5QiQk4Ak8lBVkLRedboDio4= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220607_134301_860283_781A5BEE X-CRM114-Status: GOOD ( 12.68 ) 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 Tue Jun 7 20:42:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 12872364 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 58351C43334 for ; Tue, 7 Jun 2022 20:44: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=ngLv+Bbg1fJ0qAv+2pMPkn/JNmTew6ye9ud6WHHjhfQ=; b=UOFxHMaqD/gU3/ Nna1HMdr9nna1I35d1CFj+HiaD0oPoZbsRZpmu8UjT9v1Ce7gl/NXUUw+UUVcnA0fyiSpXZLlTfQM db1Uwdt+iaDp7og8t/R36Ep8iHcQm3R1drtEGkZn38LyM9aifEOn72H2CqyQF+oLsazW3A+kRGkFZ SmG4FjjrsZTZqwUI5h66N6OtwWOmGznVbpy2qSuqpjVoJ1nkA2k4x3b6C9EasTavgcsr37/6kQXvD H7IClD0T0ILDLddX0wYxr/Oc6G8aPQXTT6gP8IAZijNggHvEJgdDdR6EovWWCmPyIXsp2aUmHoCxC yCXl3SQLosyoD/Q+9zyA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyg2w-009ZuA-QI; Tue, 07 Jun 2022 20:43:26 +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 1nyg2X-009Zax-QZ for linux-arm-kernel@lists.infradead.org; Tue, 07 Jun 2022 20:43:04 +0000 Received: from localhost.localdomain ([37.4.249.155]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MeC5x-1nNQPR3QkJ-00bK9z; Tue, 07 Jun 2022 22:42:54 +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 V3 06/11] mfd: bcm2835-pm: Use 'reg-names' to get resources Date: Tue, 7 Jun 2022 22:42:21 +0200 Message-Id: <20220607204226.8703-7-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220607204226.8703-1-stefan.wahren@i2se.com> References: <20220607204226.8703-1-stefan.wahren@i2se.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:cG6fF3HSl3wZfTdJIQrZ3NSavkU6zLTMc+DF7as8181ABXIf328 26k5rYqFUQfdBJVscR2loQHpdwcnqlsf8x/USEycm3kC1UZoOv5j8N0tohhcA3+W9Pzqci3 zZx4n+JyAn8V0VVqBlWpC7KLYmriT5gM9MU8gPcKlXrLr579VMd7U1WBqkl8vviEejDoVC1 SnhLXJapQ4DUBVBG9HMOw== X-UI-Out-Filterresults: notjunk:1;V03:K0:vPnd2XOPMCc=:w5NZEE7QONOlEW8iiUbdSy jwX/weY8plWR32CEYu32DPRdcRiOiYcLU8efhcXfSt4YKaXLLtt23oE5qCBQF6vmBocl7w05M QspjP9b7GyFMPj3Y3P2iXbFoC+p7k72v/Pp2tY9aDSN7gni9EE9uA/kAKxAnwzhKL8pO8BYqp 3lDR3YGil1V2jVia8NCjfv7spm66axanCQ5ApmHwYCzUqPKucbrm5xJtMnnrmaWmkgy6PpTYy c06IZ8B924eFpzQsBzneZNeP7yu/l4HQIwhNxRhGdD72fZ+VLcsZ5Pvr4u+QqR9XxZVWXr+z/ vgbng/7YawuNqYz5KqMnntTy8Ylyy+vgXas5pjj2iyODa1/kQgdvmxF70feRF3LU/JlhzYuZp pfIuXyk91A1O2FnQw8j5l6JIPUE9jS0pXwGLl6IZpcZ3yX0FHN6O0x0ZeBKvVBAyiLm5p1+mr 5p3Hu30o6RelUA2d/FA9CZJLj+PKeVGtNKIG2pUTuAVwjMe7UIaBctx7eOvBYTRDcCdJwdGaA UQeJ7TVAbD298FaItvy/t66coc28Nt8cXcoqyBkE90+WDoz0Ez+33dIEgXYoCyD1WOhjr+8NN VYsjKytqGRuMIQL+CupbttWof5asW+LGGxBV6e25T1rM1uE9b/dyyCw9c6pOkdyYX58nleZDk UbH4tdUXQpQRVBZ6pH0cSj6ZFcpGDmNoWcp1l8JbKjXfJvFTQDRhpWKyefpPlOQLlup3haXJk S4ySMsZGaqmXucnQHV8jjVvNegpJ4k1VOfrjNNvqCr+Tp03y7L2gMQ+MwNo= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220607_134302_200343_1982B6E1 X-CRM114-Status: GOOD ( 16.93 ) 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 Reviewed-by: Peter Robinson --- drivers/mfd/bcm2835-pm.c | 59 +++++++++++++++++++++++++++------------- 1 file changed, 40 insertions(+), 19 deletions(-) diff --git a/drivers/mfd/bcm2835-pm.c b/drivers/mfd/bcm2835-pm.c index 42fe67f1538e..ff0dae5a026d 100644 --- a/drivers/mfd/bcm2835-pm.c +++ b/drivers/mfd/bcm2835-pm.c @@ -25,9 +25,41 @@ 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 no 'reg-names' property is found we can assume we're using old + * firmware. + */ + if (!of_find_property(pm->dev->of_node, "reg-names", NULL)) { + dev_warn(pm->dev, "reg-names are missing, please update your DTB.\n"); + + 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); + } else { + 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; +} + 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 +71,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), @@ -54,20 +85,10 @@ static int bcm2835_pm_probe(struct platform_device *pdev) * 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 Tue Jun 7 20:42:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 12872370 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 817FCC43334 for ; Tue, 7 Jun 2022 20:46: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=OsXPsmR3+HYmUeby6x3BeeKnLcWxrMGWW2TfExmUYMY=; b=vfnnPgQKw/d00T GD1CGAEaBV5dunHmZEVr1+Lt1g5g2vb1hFgYw3xPgKkoC70WuCm8MJN7BZkasKWq7VQl9e/kIL/FQ zCU2YYLWwghQJuT0/+rPoI6ReDKAC2UrLeL9R+cUBITZ8Sd41T12CSBQ168eIFp5A3aIcAgF/p/r2 EzEj5telpyh6+7+HAAeATxTzr2m/6SVGHbjfwtkx+5zdkgU+U0HbcjN8Fl/VwyPs7iuVdrX6O65sF xHS0QvX78i8R3VnxBU+v0EVOnTv3btva0RcRisjKqwrLasQZWbVMWqxDdnk4Rs00x7qgttkAEDvyM gl8fqD66Ei2GetIwkn/g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyg4C-009aXY-QH; Tue, 07 Jun 2022 20:44:45 +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 1nyg2Z-009Zb1-Fh for linux-arm-kernel@lists.infradead.org; Tue, 07 Jun 2022 20:43:07 +0000 Received: from localhost.localdomain ([37.4.249.155]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1N2mS2-1nmTFT1DiO-0137vM; Tue, 07 Jun 2022 22:42:55 +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 V3 07/11] mfd: bcm2835-pm: Add support for BCM2711 Date: Tue, 7 Jun 2022 22:42:22 +0200 Message-Id: <20220607204226.8703-8-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220607204226.8703-1-stefan.wahren@i2se.com> References: <20220607204226.8703-1-stefan.wahren@i2se.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:lSN9giWbbHxeuBSiJpMoDq20z00DV4EofwBJsKST/GGjLhUr4vG fR86G2TAFazCXYlSoX5imST01qdRBOnDMns6h5CxkYYXiUer1XewXbKcnVDdvAerv139fR8 NE+6qFekxhNbPOKcjvlYJNBEuI4LfVXY7bl57ar88UZsA/URuQnCvAAQUzTUDvZ/J3d/NfA 0rEAG2hqSdDAwvyPAWSiQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:93fKr1PEShA=:iUPwPqxF2c6CKKz1QBXk7V OdP2fIrIlktq4vng1TFO78a0Oom0nNBv9cVD7Hi33vxf43/FLjZWX8l5zQh1mq7CBCkU1K8l5 jHWuBZnBnjeTRkUJlIivj1MumffNZAnVRSfSfZ/M2pSqCe5ncR86oLCrGNNnobswTI0yY2boY +TQbrkoa+dby5OOYLtaB72bBG3ebP1odNE8TERmvF6d76v25cHEN+Pj9P5+rAy3NWKWk32qK/ SZcRvCYRe49gYBFvMYpMZCqXvr9XwEQnKeDPlYhy6kfRFMa6iw7fDOFHnuzc3/SpiVKdk66pq FvE7Mqsq1nNQITj62dEC9xR2/R0xxSsT+wconmd4SBI0XBWsT+AOVna88WnVVySC0GYbrSbki BSdQ4itSe8Egt/2bhEMCCNat1bllLp4K9Bp7QxdIKqBWq2bD0rMSsPEB2QKBdc69l5xyqZQxg ipD6Np0xthOJW45lT4lVJC12RDvS7MY6csBepeCkwSdCIeN0epgfaeCrdvxk64BmnCc3mqUg0 O5whBSMpctz/IhwBw/Wgr5OYxRubCMhPYahI0XBiu2ehGqGiXquoBqpDcoQgPAuZaWWA34Z21 VpZ1jXOKSyP1fkIwZstIwjTU+t6aeFG8G79fojzAYBXPAe0KnXMHS5IcmOUWMVB8Qo7OCEDTj 2QYMSrUZX3M1+jKOpTkzpP0yNIkABDhn52ePuBKV6LMkIeb2dVBFNkR0kENk1zEXYFgOduGZd 1MbzbDYzISRXc+MSmtu/3ErnriwtT6kGqTd4CuNa4gAeDBA4jdUmymDEUiA= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220607_134303_882587_AF338F18 X-CRM114-Status: GOOD ( 20.41 ) 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") --- drivers/mfd/bcm2835-pm.c | 21 +++++++++++++++++++++ include/linux/mfd/bcm2835-pm.h | 1 + 2 files changed, 22 insertions(+) diff --git a/drivers/mfd/bcm2835-pm.c b/drivers/mfd/bcm2835-pm.c index ff0dae5a026d..4a2be669674a 100644 --- a/drivers/mfd/bcm2835-pm.c +++ b/drivers/mfd/bcm2835-pm.c @@ -28,6 +28,8 @@ static const struct mfd_cell bcm2835_power_devs[] = { static int bcm2835_pm_get_pdata(struct platform_device *pdev, struct bcm2835_pm *pm) { + bool is_bcm2711 = of_device_is_compatible(pm->dev->of_node, "brcm,bcm2711-pm"); + /* If no 'reg-names' property is found we can assume we're using old * firmware. */ @@ -39,6 +41,7 @@ static int bcm2835_pm_get_pdata(struct platform_device *pdev, return PTR_ERR(pm->base); pm->asb = devm_platform_ioremap_resource(pdev, 1); + pm->rpivid_asb = devm_platform_ioremap_resource(pdev, 2); } else { struct resource *res; @@ -50,11 +53,28 @@ static int bcm2835_pm_get_pdata(struct platform_device *pdev, "asb"); if (res) pm->asb = devm_ioremap_resource(&pdev->dev, res); + + 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->asb)) pm->asb = NULL; + if (IS_ERR(pm->rpivid_asb)) + pm->rpivid_asb = NULL; + + /* Ensure that rpivid_asb is set only for BCM2711, so subsequent + * driver can rely on this and don't get confused by broken DTB. + */ + if (pm->rpivid_asb && !is_bcm2711) { + dev_err(pm->dev, "Unexpected rpivid_asb register, please fix your DTB.\n"); + return -EINVAL; + } + return 0; } @@ -95,6 +115,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 Tue Jun 7 20:42:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 12872372 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 CFAA2C433EF for ; Tue, 7 Jun 2022 20:46:33 +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=fKvd/UjFVq/Yod AzOZBqwc/0miXg9DNev0+5ad+AoWgkyB8Hr5gSXqyYrCpaIXaXj0KXQZSSjgrPMzHlflA3gbcSBbI p4sULfqHby4mTP6MXm/va3ixdN/WyQ/uKp5OI792tEEqDmvQgqF2k8FGtXVO4HGzsv15TlD0yFfuD t0SQ1j2wb5QbhW8UYJeojTySDPc1l+GPcj+hB+dWix43aSYLeQmZXD/hhuotfWQRG9pDqlgEAVFdS boIXSDwrcTMPM2ZDEZgQgXaQ0ikS7yvEfL55cPuZsMiPDUdxoblCS5/RbmiMVrQMx1TwDApK/unGe 1GOS5FYV+KSEPQNtyWOA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyg4r-009axC-N8; Tue, 07 Jun 2022 20:45:26 +0000 Received: from mout.kundenserver.de ([217.72.192.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyg2b-009Zcq-EI for linux-arm-kernel@lists.infradead.org; Tue, 07 Jun 2022 20:43:07 +0000 Received: from localhost.localdomain ([37.4.249.155]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MauJJ-1nMJPg3BQh-00cPYl; Tue, 07 Jun 2022 22:42:55 +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 V3 08/11] soc: bcm: bcm2835-power: Refactor ASB control Date: Tue, 7 Jun 2022 22:42:23 +0200 Message-Id: <20220607204226.8703-9-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220607204226.8703-1-stefan.wahren@i2se.com> References: <20220607204226.8703-1-stefan.wahren@i2se.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:WFPoiHPB+UjDxwBJeyOPFDIsAZ2kFHIp5hl9lhT0C5P23iX8MAL hs3ueGpJWcZvTQvL5Z7lU09ZxQbRpKJ8cyCjk3ugL5KcurH9fqifJyrWeYIKYfAyEiXkFPj cdyVFM2q9qTC5ob6RzyAqEa3cjC9TKtxo8BgXaWT1cIBtzPg0Xj179/nqowi1x2il/X9fm/ oqgL4QjvRsh7yKx1srTww== X-UI-Out-Filterresults: notjunk:1;V03:K0:3PxX7hzxzDY=:2Rxbo+3IaeIwrBEm7e8a84 WwGYUk2bcj0HVIgHRla2bMbFA8ZdmBVTCn+gUMao483mw3xC+KkRSMxV5eXIAhAVzVGLK5jQj qo9AnE8OxtBqUwPFQR9Nvd3olQpSDG6jvB1XK1atq1sMOo0XwF607d07HhjUcSRE4ZDhjVsMl xtXf1GFTC7cvfCbslbCBQOGT9v12sm7M94BKIp8kpfO/lfx0dhOxRHMosDrjNpVVKxjYZEsaJ UvAJLwzHr6WyBGGGMzuAzPFQv3DFLJ2xPOX84WxBqcVZ5jgR+TfNa1CGnBKGAsUJue4dMjoZk GrVa8eRNBUCxu8nrcmeCoAq+yNV77zOBGUdPzrkG3967XnkPQlruTmadE74JoNh8Uvnt517Y9 +09+sF1KdY4FYhUT0NF8xcKqBGYUIVLexH166EBo+7r7aImFEqXSnz4CY4yaEX6sY6w3+kZgU onSO+e3L4qae8Is0QHJJ4ZCXEegWJUdATfcCGuWihzqbgRdcaSNlbzT2mRoMgRBmNSv20qx0t LtbQj7ggncMdUgHeOQHe+015eCYruphbf7j5viJZDc8eO1g8dD1CUQZOci0mNmyxwCRiqkw5C iVJon2qqroKguCI1aI2b3MFVLHdZ1ypmMi30CJxVA+nUe3zZEf/ttfM4LqSI1Q/4RwoKl8+ia kRk/N8AlG5oEl2GNEAic55D0LIDUjGIIa9dViQ1gqA+NjNJlfnmriBKlhAtlzuhDyjtJriSWI UibXpMZAIzORog1R+kF5wZK4lQaQPmni6D8SOLZjrYt3Oe6ILF3OMaX0OmY= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220607_134305_886592_A544CDF3 X-CRM114-Status: GOOD ( 14.66 ) 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 --- 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 Tue Jun 7 20:42:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 12872369 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 D83B0C433EF for ; Tue, 7 Jun 2022 20:45:28 +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=H4ulmD+TOXj158 c2IW6Od8o9n0NAqgt1EP1M/Bs80LVhXykhLeFJdX+HY3kjbYcXBULq0jL8u2o7DYifJWZbZ4VlthK zLRaQKgRAHNJOUfukDwu8zVsaVd4YzBpNYhbZ17P/JJI+CldQFwYJ3yT7zw0AV+NTqMuPQOPg5fxH zSnt/SEdiuaBq1al4e8+DSEL8XRlhK6echHh2GDZA8prdZvX77TQFNa4H7zY5wwsKmSCIf/9ELoPo KeCHYAUEbmG5gW6NlKQXicUst5nQaXY2deqW7/naq3Yt/45uN4qKS0YSrPkuAwzfcwgrATH2gJbZf eXtqZeeKDxyXfmrGboeQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyg3u-009aMV-9C; Tue, 07 Jun 2022 20:44:26 +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 1nyg2a-009ZcI-Lx for linux-arm-kernel@lists.infradead.org; Tue, 07 Jun 2022 20:43:07 +0000 Received: from localhost.localdomain ([37.4.249.155]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MxVfj-1na6uH0ufB-00xuiT; Tue, 07 Jun 2022 22:42:56 +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 V3 09/11] soc: bcm: bcm2835-power: Resolve ASB register macros Date: Tue, 7 Jun 2022 22:42:24 +0200 Message-Id: <20220607204226.8703-10-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220607204226.8703-1-stefan.wahren@i2se.com> References: <20220607204226.8703-1-stefan.wahren@i2se.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:TO0tcJhnc6nhVz7iEf0cEFHoHRyEGHAlr/i1E9NHLoKByewzB/J hyUBqfRDttjveiaVdHwzt357GJF9Oe6GPSorJlyJYsJ5LqZipZbWt9lvELJWl4laaX5tlUm 7Fvbk+lHu4r7NW5p0LowYno4vuCyDn70kiREiTozMnEjCqd7ZlbWB0JFTI/3/mVxIoppowk cNbeHiKvO8e25/ssZmC1g== X-UI-Out-Filterresults: notjunk:1;V03:K0:n6ovhqRBigY=:cuHDaTY5kjmUVkxZ1plKZr AVWZoZ4tF9bspBhvblEcptCiOVy/kJk2kOnboSUMH9ggtJiQbBh8jUXAWm6eFyHJjIksa6wx0 849a/w4l5wkY4m/i9RFxz9JUUG68qQVRAUh1p+xsIkk9OVr/9Te+/AwRZYIiIjUzOTMNOVhiu zbU18MvXAzkSfFMRx3rQGjWuGwoKWEwZ9zY1bS5N3T9bshvu/WDfz8A5VVOSbOY3Lnk7bXiGv INQcpO7AjE91DhceUohDZR3ca5tvBS/bDSbPTCEiMzo9jTWA08r62reHSo9zv7CvGzuVvJRhY ALCMxCxX+p/3m0ENqmPEBYR/q7zpBPcYLBMoHCRRWQVDt1TWcucIJmaHM8mfpDSs78KHGswSn 9Nv4uvvYhA5MrJDNsVxV+I3m9ZInSe/3lpE95zXeSlMAZ5Oen7L6bie07hhOW9zGyKRViVNx9 sAupSSvmThqOUeKjwVEIdon6PwDYSsUiKpXrgBOJC43auaW2+lG1wcqcd4C45fr3f14xNMU93 BI7KcDdN44gSaKBptz2Q2pVESDugcEY9G8zvsYBaHzjVYKqXYYTZ5fp8kxo7mkCvIeIEgX381 r99a8EoHIP0ZVgfPRV1HdhjovBt35DWcz8A4HCQGVqqaQr5Cow0WDlil0v2htjfZnK9IZZXVI 6McKmCMgKAdzHNEuLijWZZRP/S9jA3hih61AHfX0tiUutLDg/Eid8JuSdd5BGFJYpHKtMITnX u0jSp++CbcXRhrQ+0k9L925kRsdhwXUyF+J2BtzqCWrdb6zVFffWiu9GEmw= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220607_134305_087945_855DE090 X-CRM114-Status: GOOD ( 14.42 ) 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 --- 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 Tue Jun 7 20:42:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 12872368 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 60408C43334 for ; Tue, 7 Jun 2022 20:45:15 +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=Rnv7bb0yBYQJwK T9OtodFUSqc9vSjODuFohGFSyeXh3Ku1naZ9UurOrCmggTmt2oR4/UCQp4GX9oAFr3/5JPpdouIiD KUMJ2GUTMItb+GlOw1CUsGT516/2fH2byYFUdIMHZZ5N8eWQgjh+yVrggFTAIjzPNmc2iEWALMZZs XmBucrvWIOq4qbqi1V0F8xBxXUm3Bqr8WptzNrxgOsWWh/f7eIHPs/UNVN+J3+R1mUQO4QqZUDqBt lnTmDddwPwhJk1MKO7nDN1g6OpZX+RRFa2Jdppm+nLPIwLL+Lvs0G0jBieipnKRzhJmQuZkS11Dk5 eLbVSNhhiJMng662WlkA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyg3g-009aE6-2H; Tue, 07 Jun 2022 20:44:12 +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 1nyg2Z-009Zbp-FY for linux-arm-kernel@lists.infradead.org; Tue, 07 Jun 2022 20:43:06 +0000 Received: from localhost.localdomain ([37.4.249.155]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MLyzP-1oG4Qr2uED-00I0KD; Tue, 07 Jun 2022 22:42:56 +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 V3 10/11] soc: bcm: bcm2835-power: Add support for BCM2711's RPiVid ASB Date: Tue, 7 Jun 2022 22:42:25 +0200 Message-Id: <20220607204226.8703-11-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220607204226.8703-1-stefan.wahren@i2se.com> References: <20220607204226.8703-1-stefan.wahren@i2se.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:DrGPhiljN2HHySf7QaT4eoAuopHSufIfvWCuC3mvkeBvEQWoQEe ATtwlTHKorTQg94UivVxR/Bi1ZqpPRfxt9eC8yLue2HfmFqtZXi5l2D2aEP+nIJk8s1Gqc1 Ddx237LFrHMpMjm+NWGCKxlOQsg2TYpefPg7+92PzZWGf7DjqgFjQNNIYHMbcu1s1m9w8Cq dmijuFpeVBFAvbrUJlR3A== X-UI-Out-Filterresults: notjunk:1;V03:K0:hfI6Mk31Q0E=:iTaH2Nqxxp5KO18o1zeINK twrxC8hi6t1wH+4KKJe1qGI19q/k/hrANoV2prRrN4VTrpYpAqeh5eqWi25MtmE0WwYuNV3+p dG+mYZrsF2eV0oSNmjio9vFkH9tDTXNV1MlugS7InNxYjICO6BnxdIT4In8DqsHHdIvq56pBh aLfPvkHJY2CevIdiOWs6Ph46jk321o7LLsQTy2xppBXrKcCaPY+BQ7WaonLA7W4Rb2bfyXhUK LcOP2qd0pwpA8rG8bE30GzSyws2BJUIvBffDNPZUvbXNre2cilqkJL+Axo4ncdslDpoeAyfXm MuqB4ks3rehxsOY7UuptIojxLHMUkbxC4Od19UroHyULkWQ4kK+Xvvl6vYqx5LdGpDX7lX3Q8 8GVLC+CuJVkiJlkcpLY2eRuG9Y9WFC//2eVh740i0jenAEubg3dWbGa+kRe5IvaYwUjetUA61 Mq1vZ/Qy+rLNtoEHSe+gM8nTvmeG34+thQYX5Yw5FpUYrrO800nP8jLD4z13k9lLVOKgm7bID fJLUe+tY4R999URUqqlAoVf6ulx69k2Y9qoem9F2Q982Cso5MI2ld5ov+w51K8NGpgXRFr8Op Xe+l5w9z2LfnK+jL47TNIGg7H9rheJAd3g8TceasV5sqW7qiR13ENHBgo8MZDDUcAJHSyJtm+ 59El4HmHuvXQ6l05WH7FeBSooEAnJPpgN2zu4UNMuUGPupyfQI4jam9DMXwzHrEOLTkJlYOVj 7Up6I+DM49AwcHOF+0QDkkf1wBAhY6qbITvqZfx234yoS7MT+7tAEei1NQU= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220607_134303_882861_ECAD1B55 X-CRM114-Status: GOOD ( 17.04 ) 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 --- 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 Tue Jun 7 20:42:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 12872371 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 3E8EBC43334 for ; Tue, 7 Jun 2022 20:46:10 +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=LIdrq+phJpYoAi xmO/8Blu4Igl6b5aEv1i28y+bmHxgPW8lbgHoHaHmsxUWTDf1Q6MOOkakmVe5UptmqU+FDaXo/pig YwT/wesKVYUuQWxZPqsKvPcAX9iagpSLqBrX+X6gfLqp7r9IxmI6g6AfYYHYYHEGR9PvN/Z6GcUJ8 lBIqgzsD9zAMvmC77gBRIIVnOB6ugQCvzxtjct5op7Kr2YcDadMqq0IoHcq7l337JCRk85gpjglVZ Fm1SS/VUvrbXHXmeVtkRowujmcXfEYf6V/1pl6xsozUnlo3pxE3tXhBCJm58PHTBeJmpNcb58zeD1 2560y600IrH1b4F/mJaQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyg4X-009akg-Ag; Tue, 07 Jun 2022 20:45:06 +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 1nyg2a-009Zcp-Ep for linux-arm-kernel@lists.infradead.org; Tue, 07 Jun 2022 20:43:07 +0000 Received: from localhost.localdomain ([37.4.249.155]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MG9wg-1nzimL0mIW-00GVPU; Tue, 07 Jun 2022 22:42:57 +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 V3 11/11] soc: bcm: bcm2835-power: Bypass power_on/off() calls Date: Tue, 7 Jun 2022 22:42:26 +0200 Message-Id: <20220607204226.8703-12-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220607204226.8703-1-stefan.wahren@i2se.com> References: <20220607204226.8703-1-stefan.wahren@i2se.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:Wtkv+hQrAAMAAjclZalXUshwgD8klBrtNAKDIEssOEpe7Z/SDqq 99TZ71KP6KKymnZOpRenvM8uqfxL0STiZ9Jbhox1of2t+kiG8mDYh6/yMieUzMb3g5GNwMe xBx9nt4vjWuOM5preX2/9BriLsl4R0qhq+rwnqO3BI1eqKb5mIS45j1flL4dRTK4W/bzRj5 Y95BL6BxSwArG+qYiy0Ng== X-UI-Out-Filterresults: notjunk:1;V03:K0:eek+58zNOOs=:ekds34yXcLWY2ZWwiIpxNi uYRPIb99Wfa3fSUtOKbSus6urPys4OvgWtJ09/vM4/bHa9btMdtRGSykwkyd/Ee7d+ii5YpXY B+NPldToOUReIjP2gC2hpdkuUc6Q28ZIam3H2BoFr/NrZN9FvrARhW5S/6MPYhDqEoNy5hmeO xq4NpryUrTwzNd+mRngVS3X1klb80ypiTgLezrfIQqEu85sH/dEQs4DXdYk1y64gxd5kYyA9H qoB1zETJ7nVk5F+uAsHYRIcWkUxCoYR7+bv7EAqdfycv6KXsymH1qHHzMTd0TjRYJmXiTL4rh bQR1I+9U4VsdnqroPh1xh+qxncwlksm/hW5F1ABmykHRREgWV3v9Fg4KUq2zOeZgfAre6CNJ+ qVLO5e1tKWw8l82zCgwmjU1492auAhtfhq5GEPUJCcGj8kXRx5otr6JaGTU7f+iTSPpDLt6aV LUUiLAylxCD7NqP4Z6aT+Axujyu1+D5sr3DPKCmib9XYY9olbEZLe5KTrBdUsnnaFY73M7d0p wZ2DX6EarjHVMxr7sdksNVDzJ8UvPrXOiHdHnNE673VP7T26mjsBvMKz5CFzGCms36C/oOxID HS0453CF/Tm6Op66LVpx/BpUk9oTPFHjieomNCtSotgRd9uP97h0KVbxZNmSDFQ5Xon1RRdvn ufXis0kYUjqbOXDIoE5pKrfth7nu28OFwpuod58F+EPFZRBHP+/P8lmFb3cbb0Zya0wm7ofMX hOMGShcrMtDh4rY5hzJnNrxxr1YgfJ46FiBbXD2LQZcN4xEzznrEWykEzAI= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220607_134304_889964_56A068F2 X-CRM114-Status: GOOD ( 13.44 ) 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 --- 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;