From patchwork Wed Jun 1 12:53:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 12866888 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 8D79DC433EF for ; Wed, 1 Jun 2022 12:56:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-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=oR3bCdZikEGioa FJEAx4xK3A8YzLf2L0wNc4u7cbboEZ+i8fW5AlSuZFcH0rrOhD8540dA1j7xK2IhYorDNUsVVDLY6 THDe/hWfTnb22OqV7GILxtFX0DKZeT7WQLhHNCHvLTWrw+m84RWjPX2TibUXWyAqmeL7RIFG01/i5 UzqVzJ2xjc4I6niNfFbGe2TmXSyrjMyz7cdQNcXQZBXp45TB8h7eDrBeCNNr0L6r1caZHUXhiAQwR aS8OnIlZloAzQPvpZfIhc8t+KxfGZKrzvLx2XfCZGRBtpJIkrZ1x5vhWUAdw9kyN/wyLydUBtA2ze o1Yoaxldy68McJcmPojw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwNsU-00G7t0-Ap; Wed, 01 Jun 2022 12:55:10 +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 1nwNrX-00G7XL-W8; Wed, 01 Jun 2022 12:54:15 +0000 Received: from localhost.localdomain ([37.4.249.170]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MStGi-1oNFAN0tR8-00UKyQ; Wed, 01 Jun 2022 14:54:01 +0200 From: Stefan Wahren To: Florian Fainelli , Ray Jui , Scott Branden , Nicolas Saenz Julienne , Lee Jones Cc: Peter Robinson , Melissa Wen , Phil Elwell , bcm-kernel-feedback-list@broadcom.com, Maxime Ripard , devicetree@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Nicolas Saenz Julienne , Rob Herring , Stefan Wahren Subject: [PATCH V2 01/11] dt-bindings: soc: bcm: bcm2835-pm: Convert bindings to DT schema Date: Wed, 1 Jun 2022 14:53:34 +0200 Message-Id: <20220601125344.60602-2-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220601125344.60602-1-stefan.wahren@i2se.com> References: <20220601125344.60602-1-stefan.wahren@i2se.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:RzxRajtazIqq4GJgCi+hIZLhcI5nsPEOxAMeD2yIwbwS1wgAcXC TU2fpv5hh9D3yu8x/56se4Xtn72zfWA5nNzrcoqoKiJ6CabbupF+wAhpA8O57sA2MLvbsor QEmukNWkpa+mztMYkVQlZ3y6DnVDiFrcErOV55YoPQ36ev4NFssuHEKUvpoc2mF88XeodAR sKbfg8mabqDJw2708OO/A== X-UI-Out-Filterresults: notjunk:1;V03:K0:F52cKKHi00A=:6foQ7EocwyHvGVzcoI78pO myqBY/sA5vXRxk0KQPSI+GHaRJXqTYFmFeSUGM2BPOgm5aoKV7U6qhBAXf7wBDB67QB+v7HzL nTKbfCNzKBCLsccmx4EMLheWq40c+JWRg21SGE1tsMjQ2nQd92xO6LuLzqJpiFmFiJ4drUtPl /Y/s7yCDpvpkBN7N5aXmZ9aEQdUwj2shUKQ2/CSbfpkE1EqixH0uikfOXzL0aJwVyN0xSxL0U Z9BqExLdufPdGVa/xI2aAjjeqACKwXAS6qPL+zvnU2aXGKgdifaWOefNjmgQThvlA5g4Q0l9/ 7RVVRL+BMH5CO53PrmyRRlm4mG6jC0TNVapI106QplhKvi8qS5BQcdafC2ednewCbPkxTkQd4 0zZup4VdYelLcW2QjfRRa2Yh1IMOeDZfhD9GO7zhSJKsO7Z/2ffYlUFQ5bStMtpfZ8eT/A7w/ ue4Mq3R/RVzmtw56fOaTSjBE0ZSjUbNbWmPfErTo6axEsnOS1XNCUM6oXOiVyfN3aV7uF4GSa SwCeO2tFWMLKFkdj1XfCtatkQajUuhXPC5S2nZtjoqq/xyKtIuOSKn8d/Osc3iuF9Gh4apab9 drYc5Gy33hs+t/1oYiAQpLtG47LSDE42yR++zJ5/dh/Dc6z/b/rQACFj4/fnmrkJg6LSkNJyS gPY0m0a9X4H1IOHp/XhhJS38yhoHWbOohCx3zxY2a40yfdWMc5qJZsyEyEN8FYz8tAoy28O+/ 1ptANg0EjAmF3l/o53yTn1hTj9mSVhNvBwrRh5KSFOhTKADt4nMD9sVd7YY= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220601_055412_403419_EBA71C2C X-CRM114-Status: GOOD ( 15.57 ) 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 Wed Jun 1 12:53:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 12866884 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 2CE45C433EF for ; Wed, 1 Jun 2022 12:55:38 +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=D+MVQYSoBg6XIx+PXr/v7hb7AQkbxipol1Bg4lTlpdk=; b=jYSRQsR3DBuEp6 quu7GbeP/33k0OzjjKPKtoJUE7g2YlFheyOlTGyucMtApBS1ovDLxF4+at57Ip9Br8ChYTUUxI0wG mcGg40aUjLgCqubYFMB1TBDSfrjbS2HesYXFAJhuMATHO1L6xj1+pPuxR8gv1f3Ptj8HkQzync41e 1+91w+qZUWsEl1vis1iki9rHn7su8QcsUAHD/QVHKRNyxRPj5w5EJNVbSifLssiXDeZ2pCANsJJlj oeE4nHug3mjon3ysX370X/6DsZxhNMj0NGE7wnLrKdOSDWLn0H+OWWg5WpL28/o9ogr/+FgxoMArO Cmdb0SeLej3ObLTMePMA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwNrm-00G7dk-Gw; Wed, 01 Jun 2022 12:54:26 +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 1nwNrX-00G7XT-Vt; Wed, 01 Jun 2022 12:54:13 +0000 Received: from localhost.localdomain ([37.4.249.170]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MWRe1-1oJgGY33pj-00XtLj; Wed, 01 Jun 2022 14:54:01 +0200 From: Stefan Wahren To: Florian Fainelli , Ray Jui , Scott Branden , Nicolas Saenz Julienne , Lee Jones Cc: Peter Robinson , Melissa Wen , Phil Elwell , bcm-kernel-feedback-list@broadcom.com, Maxime Ripard , devicetree@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Nicolas Saenz Julienne , Rob Herring , Stefan Wahren Subject: [PATCH V2 02/11] dt-bindings: soc: bcm: bcm2835-pm: Introduce reg-names Date: Wed, 1 Jun 2022 14:53:35 +0200 Message-Id: <20220601125344.60602-3-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220601125344.60602-1-stefan.wahren@i2se.com> References: <20220601125344.60602-1-stefan.wahren@i2se.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:hoeQwmxA/GVKZVg04Z1I4YVKsDf+Tkzv3IjzWT+YESlmWrUeb9z 9hyjgyh6nKAr3O3XFJ/DWw8WMq+yqIPwdJqkkRyTUWVLA3b2ATAm65Ai+ZfI49/vxl7kYfs J//4xEK41NYKck92BinoO6pi7SvhlFm/qfXnYxGO7AirG2SbVL+Q1FD64Obn0bUV4ZwrCr7 9mEXdQvu8rkTRpMk9c9og== X-UI-Out-Filterresults: notjunk:1;V03:K0:/co0h6Oweko=:CiTZM66RBCzXZ15gu8rYWN ux+T+gTbIkzFXpcCKQ5x7kYxXZUtgSLoz414nKkf+OpyZsXkFN86p0kjEC6fdiq4s9gqou9tW GxIqV0fxRO8sFTtBmauXlvPM4VA4NRVwcpLdvGvZWBOZwfZLZO5zzWYJQxSNUjVbx0rzeN3De mX295BChcEiRCpVEq2IXEcDESBIwIztzbkcwoivGi0pNiClSnsp7gV/YZFxIvpKlBV7J3IT5O xgHLCoJS2jn+Y56RvEgsydr/mpUDuCD7KHc6zSPZwiicRbjGFQGfP27DIjdNj6QZhr2D88wip sqWrBaC2plTEMzDmA6ya/eiwmALcHxj1aSegMIjLi7aFB0VYdK8vcGTF3tNIvpNhG90wvCAtC mnncLiw6pOtCyjuajh5Aa3ZdH9HQaq7dlm7fH65dAVLkW37iSH6Vkco+cRf+OCZRhoLiZtMsC bcMQdlKoZM3mMtqTxXyxWaYuICh/tBvdQucxvyWEDHCxTrvy6Fk2uJ7jHUE0X40heKnJm8iJw K8MSGhMCFVdMtVDS13LI6xiUuh+czoWg2eni/2g3RcO1TPtUUEKFVcxzAAKhFhbDVnNrRV9jy qysDDB/misMt5/pSq8GlZGGl8xFrRhuBKDdbPSKcuBOdOKHCvZFIn3g8RCHz+QUe/LTkQHlnq iLnDIFdtIVfLT11CpXKCXHj50Ma+mQL+BO7FTGj37xjksRh0hA6PcS4IMahnwVAz4TRe/yJiM foDa2QOioOdSyHDOt2wjKk1Tw/5WYaCYv1167tM6tuyRqMEntPZrChuz/3M= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220601_055412_361889_9F9F73A2 X-CRM114-Status: GOOD ( 10.34 ) 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 Wed Jun 1 12:53:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 12866885 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 AE6BCC433F5 for ; Wed, 1 Jun 2022 12:55:52 +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=bOILp5y4yrX7KpiRVevQ35MjhPnoVaHSj4dIbW9WamU=; b=EAWGnRYKmPKcyn tRZQy7etrgOfZwr29zhqGlBGaV/Ga7y6o1zitMJpavjTgKLV6VRSSNrav+hCQOfFT3S9ruYusXKvo PANLiVYMm2t8I8Z8zP0qjsxv5ZMHTOlOIlXI6V+9V756QrLsOIxoin1WRjj59uyHs2FC9T2MRe7fj IySmd6JeC23V5g6kJ309iXVlizffKQshQhGl/tY41iUV2vruqi9QtJ2GIAoqaMPcL27HDLWDU4UKP s6Vun5AazjfagIhHuNfTifnskGokgQ4XR8Ed060uVJn0LDcMZ+Ms1IjuxGWI6pyics0jBRKAwLXqd ePRwHzA0Y4+WD5vZ5xYQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwNru-00G7ff-Q9; Wed, 01 Jun 2022 12:54:34 +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 1nwNrY-00G7XM-C2; Wed, 01 Jun 2022 12:54:15 +0000 Received: from localhost.localdomain ([37.4.249.170]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MFshF-1o13UD0z1D-00HKR1; Wed, 01 Jun 2022 14:54:02 +0200 From: Stefan Wahren To: Florian Fainelli , Ray Jui , Scott Branden , Nicolas Saenz Julienne , Lee Jones Cc: Peter Robinson , Melissa Wen , Phil Elwell , bcm-kernel-feedback-list@broadcom.com, Maxime Ripard , devicetree@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Stefan Wahren Subject: [PATCH V2 03/11] dt-bindings: soc: bcm: bcm2835-pm: Add support for bcm2711 Date: Wed, 1 Jun 2022 14:53:36 +0200 Message-Id: <20220601125344.60602-4-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220601125344.60602-1-stefan.wahren@i2se.com> References: <20220601125344.60602-1-stefan.wahren@i2se.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:vnscB3sbTQELFDI4dZooeDCghTEq9aNglXFxaJJHfAVkczNgyHi TsWx+F4EutCUdq+zeDaO6WpuOa3UMVA/KqS+FwtZ2SJND+5oTgrCLQj+Q5QUxnSLZYQk7fX Mrj6rFgMdMgjldnkLL4X3C8uCpL9xZIQS9ENPHlE/7cVUu0sXu9JJjZ63NAcxsH72JAv9JE +JHgyKYu3BHKK9tpQrVbw== X-UI-Out-Filterresults: notjunk:1;V03:K0:hFGZU7ttmDc=:wl0oxkYpvoUQ+/gefIezgN vrsT5Ehj5H03Fr5RhsZibhjc0TSnMDVXkV3+vsnqYpoJtN13uAH5dqhgac8RMatYfYxtpRmku tJP8Ht+X+FhxuiE/1tvXq3IDJVTq1R6dcqnHVj8pxJ8noOA4Mq+8M66WEVSFQqmVR41EzB9f2 2pygr2c334QdDOZ/B7bk2nu/nM771uzgFgqcxyBRHlHo543bNCV/HW20DCFUm1lodfmRk32KL 8qYWt5OCXTXMyR9ujEzrRLfMP01ch/4PLIdz/JcFdOj3ONZFt3rA9BUJUyF+qtXt8QDtgQOSv 3dSl7iNwPnNj2sYhZFhU17nCxI4sLvfJsff/BNmM68dw8qX4/ZcKxZJTfkfFuAy7FV9f7uL2+ DD6eMbFkRADAFdV7RVCcA4a3MMacWY7V6LgAuaUDD0HDLCt9OpSHnsrup5Rey7jo17amTKAQ6 uYHxHXL2Gr2MG2tzFRZbBaOB//gj0j2ex6m8KHEZi4P+S0ox76+zwvEgyXwx24ZgqOsqi5yVc ry19dRbyg8WRkcH+1tryMGtNe873pzjGwfjYMtzRGcHLgycf66s2kL/sMgvyXt0Os9fAPj2IJ ZmsCIZ1X4Az/xufqYdp1WXwoTlRUIwMgatUKvr5+IrgCUzpqH+COhtTFGgZIRzUWq6vx/euvi WmmRNmiIBkkSjT4QHPnX8nW0o0i/f2J642zA6GNTWnaMYdKiZhf4EuRVhrcpwtWFx1gTChmSm HnvypekzEx8pWMyZxp2vDYPq95IOv004F7GhPmyEoRtE8ezYCHZq1wdMdF8= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220601_055412_740976_57B86AA6 X-CRM114-Status: GOOD ( 11.27 ) 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 | 10 +++++++--- 1 file changed, 7 insertions(+), 3 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..f448f034a33a 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 + minItems: 1 + maxItems: 3 reg-names: + minItems: 2 items: - const: pm - const: asb + - const: rpivid_asb "#power-domain-cells": const: 1 From patchwork Wed Jun 1 12:53:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 12866892 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 0C087C433FE for ; Wed, 1 Jun 2022 12:57: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=xzIiH40KOlvcmd SkZEGEnuY1auVrQTVif3LtDseI82Zmr1D9Og4Cv3wlECc4mT5UqEJHMxYm9t8S/aZzx7DhlrGE4RV xLgPIU2VxuRUypHh5K/GZeg2tPHXcm57+FXYNGlYhQlGxoHmhot+LmUrbN9OGlegSwPY1G4qJgGyM CX6HIQit7lGLM+HyW94dL64tpU8WTEnJ8aIAEXknVKa+JO7T3r8P99K7+Yi1+2+2zqp0dvWbJid13 aBH8pov8tH326dpkTtD/iWIjCO1anIlVphgSqghFw4MWJj134BpcUgt9txTRDAqd85kjqpui02BBg YkhkL/vHITMmeBYQGo+g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwNtX-00G8PQ-9f; Wed, 01 Jun 2022 12:56:15 +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 1nwNrc-00G7Zq-QM; Wed, 01 Jun 2022 12:54:18 +0000 Received: from localhost.localdomain ([37.4.249.170]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MZTua-1oGeWy34IY-00WWq2; Wed, 01 Jun 2022 14:54:02 +0200 From: Stefan Wahren To: Florian Fainelli , Ray Jui , Scott Branden , Nicolas Saenz Julienne , Lee Jones Cc: Peter Robinson , Melissa Wen , Phil Elwell , bcm-kernel-feedback-list@broadcom.com, Maxime Ripard , devicetree@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Nicolas Saenz Julienne , Stefan Wahren Subject: [PATCH V2 04/11] ARM: dts: bcm2835/bcm2711: Introduce reg-names in watchdog node Date: Wed, 1 Jun 2022 14:53:37 +0200 Message-Id: <20220601125344.60602-5-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220601125344.60602-1-stefan.wahren@i2se.com> References: <20220601125344.60602-1-stefan.wahren@i2se.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:lit9xzx1b0RFKJ0ogZ14F1fIMSaO5r8PXWZoifFHj8upZsz0XlI GZygmRcDKdFXQDEgEzdR7V2SPUbMVCtDK1gUeZq6tZp4MB171iJ9D0qzXVSZuxYUSR04Wkf 4pvcZRVQHiXXCF4Er4psvdD67l9g3Qrs1zmK+7nbt9LFLLu3/GWhDV6A2fFiKXKxcwtjv0v AFfh3fXSF+Ab3AuNSm7xQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:6NnG3nL9ZTY=:ShG3tdiBmUD1OE1jjAzj8I 49dxgYxLcFRFUgPVVaTr5vksBiyDIYTKJSb51JgeCGKe8DjpZobSKSmYGe1AlRTUHc1nVpFOc yk3xsNa9wiRDmOGPa1jREl86CyFlUKCB252wpBbeEIry8XA41/boBpuAGFqre1xqD66oSb4gs 0mt6ghj4uY3s1vXrPjoJIR9m2o/Uf8Ig3ZjcZx5zLpqrGEDxp1qN+mYe+xchZotGBZlbZI0Su G6D9oD8tDQqWRmQtgazMUncePyojL9g6BgqEL7GlBxxDRCm9zQxi58wBJE+jU/UzsGquUaNU8 6hibjHV2F2IUg8aT7WkrrG4GOF7xjvor6sub7jxMHXp/1Wd8yrspE+B4vp4/9vv3PGxBbqMi7 CQ/rVGDuiWFLjsY1KUUADDH9EYJ1ndfREA9n5KDMKSn36bLfQ11mZaZLPRsKjeoHx0QTl7wX7 kDgekCTs1mXInqe01dbMcpDpPPrfCDOo2+K/mAeuXu2/yhATayWWpGcgXxt01kPc+dLNYhWFb XR1Ky7q4qq1virOvox4BpCqiJrxPkif9fteQB6lQvKDwi6zpJdeGRjyiW0JTbmVmrKF5ZU3tP 1dpliynk9+PceZDRn537/Ench0ZpO9SQAkTEvBSIiL4fi5olKiqL1oe8bj5NPAqPjA5OIjqTK LTy2S1UxMzq7Ah1mnHJkmBzDwyocc5jPNXvBO7i5pqWNlxsLbuKvhNjUkukAKEduzhQlFbbPp T/zhRVqFdt/dE58Wg068Bc8hUdsYvTWsOZSuHBfZUw4Cl2yzrt8yE89pUIc= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220601_055417_214269_77EAF4AF X-CRM114-Status: GOOD ( 10.43 ) 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 Wed Jun 1 12:53:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 12866893 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 EAFD1C433EF for ; Wed, 1 Jun 2022 12:58:02 +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=z1nQmJ17rEAwKg 9DK/b1/4WFVr8g4EtGLh1q4a5lB9+X8LEZQ1gzohWVn+QOVf05hqHpim3xaUV8MtMFR1BmI9k4XLc lUajTlni4xFHiQR3ByDv047B6ohZUaGAsgaYnyhNbL6c8urYbUwQj5M84pIxwHVqHWySkVDSTSzJl 0yxj2EZ8FjoMebTkPJZfVJJ9R8bIvRmmlFKXLM0oq2y6mqlLTklPcDTjGdqPY/Ak5J7K9rBRYPmDG LH/REORv9ObHSui8T0vNnVKPTUhAo8xHdPkPOaLFml3eOpju+xQfmnjJMuemQTa8enoILF3ImSTQB Sml0qsZcmGLVxFQsPRPg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwNtn-00G8YQ-Ko; Wed, 01 Jun 2022 12:56:31 +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 1nwNrc-00G7a7-RH; Wed, 01 Jun 2022 12:54:18 +0000 Received: from localhost.localdomain ([37.4.249.170]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id 1M5wY1-1ntNzM0wkF-007SY3; Wed, 01 Jun 2022 14:54:03 +0200 From: Stefan Wahren To: Florian Fainelli , Ray Jui , Scott Branden , Nicolas Saenz Julienne , Lee Jones Cc: Peter Robinson , Melissa Wen , Phil Elwell , bcm-kernel-feedback-list@broadcom.com, Maxime Ripard , devicetree@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Nicolas Saenz Julienne , Stefan Wahren Subject: [PATCH V2 05/11] ARM: dts: bcm2711: Use proper compatible in PM/Watchdog node Date: Wed, 1 Jun 2022 14:53:38 +0200 Message-Id: <20220601125344.60602-6-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220601125344.60602-1-stefan.wahren@i2se.com> References: <20220601125344.60602-1-stefan.wahren@i2se.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:J3gr76mkrEF30e7xXTMppHw0iRcruH80FKzqzmU7rUKpoooFCHq goBqwXCScdRNbYa8tNLO/Jfes4ZJLZJfbjTXDy5ItmYq/6x4LMqnAi66MoxYowIn3VMGloW UkKZ+JHErYThfw5bRM6AhoIG6CHA4l9v9oUTBPUGv+z5ia59HmZgnAto2LwAtIUZXG/gTmr YBjH01N6nRnHK7gl2UhpQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:rbZPQHIUjVE=:gPOtmf3qQE2Bnok00CljEi 0eUYGvD3JneHAPVQBz+JqbTZB8M7RPUpQSULjFdUgAWaq7wQ4wFGY9/VCIkBflB2jn4PMaATt G3zDA33FmCkrvM1R8iQVTnIPvx6aUr7aEa9qdseNb/ZtOi/DN4x8QpOe8n0W99Ioncn/udLBF AHdwtXfipR9CzZeEF2Hd0xdG57/+nXZTciUocujOf3A90HMlCA79OytzRRlHpR/k/hLGa0/ek JkwJBEI3C1MLWBI+ORjBjHdo1quKCjr++bo0ATq8G83jVHOoCURbUqDwg9X3mql8tJvALefTS 7L+v+zdFagtvQ4EC67Z9afgjUirzSA5YfnpEe0nYntzw29Jb8oyeOcw+lOqh1J1oOfVWqrTDt YBROQQI6j/h69S/gQRrPDMoIhloHDLiIdHhPmV+4ec78AiJ3K4sZaKDbOevtv5foaXVbFBMID 2Bm63S5+Og01ZZoyuMnKMWcUO2vhmOVRxjlMl4RbJNhiJ1vQyGL27T8BWVbGMAgf7tVmZw/Hk rX28f2Y3vNMiBvdZRQQkvhWuXJGRxl9TsVel3hIWpe2T1mPvcNyq+5Z7qffzYvR+z9GmVLwoK WDTnIkiqAifs/WGhClZvHetsAZBJfbwDJz9EACcSHhMcyf4mWq1vToIGTC+ILBG7nRFRQbRjF mtnJ0JUWMA1V1GWkFrPICqOCEo5tapYlvGrQSp2tgnIz70XEQIYClBpmtiGAacicaBerfXhb5 8C7YnC5q+rTjRJZ/v17j6fm3VPxjHk/nLvWNrIXHQA0+70o92Ik03kC4ffA= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220601_055417_294229_CBBA1ED3 X-CRM114-Status: GOOD ( 12.26 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 Wed Jun 1 12:53:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 12866891 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 56908C433EF for ; Wed, 1 Jun 2022 12:57:13 +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=pCPrVirAJj0cMIyZWkcKQ/b0TpnOAtpVF72um7vJuI4=; b=GcJczv0gVl95ln ufiAU70HXJqc2Ax2PcTqB6hJIBg/MR0X+oyrwUO9hs6/SJYCavCN0G8FBvBQVBHNcqiVOZlgdoF6S j5FD1v5ngwczIXUcFRamma8PQiudVHRS1p+FZhJZqwhgSKLtah7Lb2uHftyLOgYZTCfCCD7iXq9KL GbzcGfSl1vO7cMbQNdsJkJhrabaIfxWjGl0XlEY8mvD1O7rDEGzNPBleOsZiwy6SUNPwu2sxYGmFy NxivE0qLXbPXBmPFJBZiGXE7eHu/a5kfVaLfzUkaQs91/BmaXnxCkUz/slEV48fO0bFLfpbAG+zQd hs7CIAOpTdCmJtf/AH4w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwNtC-00G8EI-EC; Wed, 01 Jun 2022 12:55:54 +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 1nwNrZ-00G7Xv-VR; Wed, 01 Jun 2022 12:54:17 +0000 Received: from localhost.localdomain ([37.4.249.170]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id 1N8XLj-1nixbe314D-014ULV; Wed, 01 Jun 2022 14:54:03 +0200 From: Stefan Wahren To: Florian Fainelli , Ray Jui , Scott Branden , Nicolas Saenz Julienne , Lee Jones Cc: Peter Robinson , Melissa Wen , Phil Elwell , bcm-kernel-feedback-list@broadcom.com, Maxime Ripard , devicetree@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Nicolas Saenz Julienne , Stefan Wahren Subject: [PATCH V2 06/11] mfd: bcm2835-pm: Use 'reg-names' to get resources Date: Wed, 1 Jun 2022 14:53:39 +0200 Message-Id: <20220601125344.60602-7-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220601125344.60602-1-stefan.wahren@i2se.com> References: <20220601125344.60602-1-stefan.wahren@i2se.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:KRIALsDrTjSa+6xmrcLvnKCepvkokoF2ewcSsTHi1pIqsHCzucn /gqn6GxvXN5JyhD+rUR7k5CKXp7LTqriSCHXopR297+BQ01F4xHjYT1d3QVUh3J+6SNqH30 jLSOAvtWgzSpJRO6HUiW8W8W26d1aSCydazBxlHem+Eu5qhsZrc26sdhAWJ1TWFSkyohlx0 rrsn6WgWswrCFIvbZDvLQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:lFQyxgRSU2Y=:kPPRWky3gL/f6rWgRiosNQ bWm9fHyelePdomYcnX5LuVIuFcDE/5Sk9M67NXYKJY6p/OU7+EKVvU8SSndCeylgzXJvmChKl e48lRoAyl/LGTykwNYpIEf4q9BHN8C9/hrtyItLiWEhQ8PAlXf89wAk8g0P3ibg7hYySEELkt 8pfUy97kZQfbA6z2RbQZezSYTblXyBEpF9tSczSxLr7hEKy7/tgAdRnwaL/m0w4DvlH6wRx5j MLWxB0B/9d5fDgJGSfhul9PDKG1Yds9sz/IEjpEgc1mBc+jr65YS5EuaAZA4ggzTMcgSKlZ5u SaFGtZ0ex4p39IMN/Dd80GERwsA/xNsmddV3QNFBXsKCGUXuQx4i4aQChr6dSNu9mcRk8zRG5 TSL8aCUVBtVNRRGuhFCB2Pymm/AftFHVxi+pEzpGBY7QCyuo+/V80+2SAXMQ1TaAzgqIxL2YV ygB/0fqbJq4UeXrRDMHrI8bJ6lEaItyjfKwLqkDFNxzgg8RzjDN4MVIxeucdKynP/ybxaffeP bUMkEDj25nmOCVY0u+z2zXC2cI3ImDcXO3f5YeSzIMTggLNd1e1loBVyh2bFqvIV3tJR8DyvX jJ6z5E6pXw1nP1C/HgliCFqmCmfal01PFblW20gzueOHc1wL5D/Y5VSSOxurmqisgLJ+f3wxH iPPTiy3KdI8YC0go1qc4Zof+Y26eeLM6ENaDbbyTJn8yb5xib0e7CtRrfTE+YR5Ndrt9jCCEw ah0tvMmPoUs0YmMKRZ+sb5uG01hEWWqMWGEXdZ4/Zaz83N0PMzz1j1khhYY= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220601_055414_414217_60C2979B X-CRM114-Status: GOOD ( 16.77 ) 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..c1e81a4541d7 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 Wed Jun 1 12:53:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 12866894 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 35071C433F5 for ; Wed, 1 Jun 2022 12:58:19 +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=uIU09euvkPGHr00kQbBBFLvMpavOHDm5ndkHmdK2H1g=; b=hdoaIHOpiUcuxM u0vO0OmuY0MjNMyJEt6DaIm4mpHmGmZ/Ngv/XfW2TpjdevJHJx5Frf/uKBkotm03C8/HiogOESxBP ktyV6gciEMX6yKWceJhSrbx50+pZ2uwzKqOjk9p6jk9hRfl6TjjUiwAEFAmoMpnUsCM7TaQ6XfVjf wpwQRpj4ynXWH2v3jZolCr43+oYV4Td2jQgb1PoQ+r2yGlCXkM6dlwx19tmOgQzsQHDjNlfmztUtl Wf8566e2Lm12wNHcCbepm/+HllhNFHoZQD0GgcWy1huUGogHIHumfm7PJB7P/e9M/V4TNY2BwsBrz usR/wRpOXr71+NPPLm1w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwNuB-00G8nR-MV; Wed, 01 Jun 2022 12:56:56 +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 1nwNrc-00G7Zy-QP; Wed, 01 Jun 2022 12:54:19 +0000 Received: from localhost.localdomain ([37.4.249.170]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id 1M89TB-1nrB4J0sTr-005Ggx; Wed, 01 Jun 2022 14:54:04 +0200 From: Stefan Wahren To: Florian Fainelli , Ray Jui , Scott Branden , Nicolas Saenz Julienne , Lee Jones Cc: Peter Robinson , Melissa Wen , Phil Elwell , bcm-kernel-feedback-list@broadcom.com, Maxime Ripard , devicetree@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Stefan Wahren Subject: [PATCH V2 07/11] mfd: bcm2835-pm: Add support for BCM2711 Date: Wed, 1 Jun 2022 14:53:40 +0200 Message-Id: <20220601125344.60602-8-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220601125344.60602-1-stefan.wahren@i2se.com> References: <20220601125344.60602-1-stefan.wahren@i2se.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:eoCMsoXQgaQCbqLEG+0vcMzD3Q3Cof38P0qGymrgLmHtCmtN5WL 5fMLWYzXHiEITgTcgCV3o2OHBasBX2KXNCrWUNEAtXmP5O+xiLwobrX01OksgY2Cad2rICg OWP8B1LGkstwJilWUJEFQKPuJUfFEzANODpKQrkrBnBaj77qZp4SlefXh2h1PqV1lCM3be6 NVEsnDwG79+anVFXTmUFg== X-UI-Out-Filterresults: notjunk:1;V03:K0:sMHrttctx/E=:tWlTZd2Y5d9iI/3U+HZREv K3N8VlvGp8lNV1rZ//TRC7tY/HpebMynZPJmNEV9YTlDc3XQWi3eE5LVjcnvQ+CEDtdghfZ7k /mHiBFkvVPbW7f4C3InyI4QGOyubV+3tuG1PFYhTZ3P9pWTzsjUmJC7C8Yd4yowFShbg5xlGg Esa3Ei6jr0chrJcUzvMPyt93oMs1wV1Xe0t/F3bGCbJ+4gebDPNafFJEl1fGqZad5aMV3OUz+ b7q+RF5WtKP8OxhLWGJDwbtWr4SEAPu0rzXkjWLfpaBKE0ORZgTTmnL9or6UoRLaMWusOv6hj fVlnunQ9O6dVM7zNz9th4AJfjPw8EkAD/Ns1/mXhfK/0tx+rbDIItaCu4ZmX+kkQi2HzQ2A6h tQK2uSA7boL41D2A4V7hKUgolSOpbUDEfsBzGUGH4vhqReSTIRdy+3wkhz683Sr+fMIQPql9O g8npVOFsTe4BUpN4AppPDmBjgAmrVguTOa6En/HO5PYvjbY0Nl9sXFN1eWxeyiiBgMPa9tAXS t2lSDIchyEI2SPUP0gwQOghTW8VlSbz0RXv6jCgmxexy5pTeI1JWoUXByYGv3qqx2zmooU90n 1VGcMqH4pnIVAus0Eb15VXcHbvVhojHrdOfRFZRfTa27iAjGAINe0ai+xvmeNzstqsztDm04q gZlS11DbVioklmJ4ndAM06vXMNbKTuJTMTHJ1nMXAr0sQjihDcX6Tvnlhuj4mukVq1J5KvxFD y1zAuypbn165Q7h87Leb2Cr7ogscz7uZmIU/rC7IQqU0iitZmC8cYuUo2J0= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220601_055417_255420_2724A6CD X-CRM114-Status: GOOD ( 20.07 ) 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 [1] See: 7dbe8c62ceeb ("ARM: dts: Add minimal Raspberry Pi 4 support") Reviewed-by: Peter Robinson --- 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 c1e81a4541d7..e65aee6f9b84 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 Wed Jun 1 12:53:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 12866890 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 AD631C433EF for ; Wed, 1 Jun 2022 12:56:54 +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=XCIyh3U9NR/HAj vw3VseMmWe+TK1ppsKFjRL0TOMU9HLuKaoG9mTue4CtWMafa5rTn9ZIiGh82cex8x2b/mjRuo6UJP Rc/ppL4wEYadVrj5sb5BQ7HYWzSiRgQTVXp83nA36YKgmsecXEzM/GvZRXJlzFjJaV2OIYMEDBHLU kUwFY4JWKMid9LaI+lsmsVJ4x5Bl/h+aqDEOe7/ZaiEFMVNLHdDG6q8af4TFY50P6Z92GuIzUaY4q E58l5p+qCe/o2iHB9d/TNKqEK3tsVJ4B97kz4pOripQ5GN7nc6dBHv04/1aX8LdjO9C388e5RsJcH +eKae4xIFiaLWuVSsrvw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwNsz-00G86z-7U; Wed, 01 Jun 2022 12:55:41 +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 1nwNrZ-00G7Xe-VW; Wed, 01 Jun 2022 12:54:16 +0000 Received: from localhost.localdomain ([37.4.249.170]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id 1N9doJ-1nhrg12yCj-015ao5; Wed, 01 Jun 2022 14:54:04 +0200 From: Stefan Wahren To: Florian Fainelli , Ray Jui , Scott Branden , Nicolas Saenz Julienne , Lee Jones Cc: Peter Robinson , Melissa Wen , Phil Elwell , bcm-kernel-feedback-list@broadcom.com, Maxime Ripard , devicetree@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Stefan Wahren Subject: [PATCH V2 08/11] soc: bcm: bcm2835-power: Refactor ASB control Date: Wed, 1 Jun 2022 14:53:41 +0200 Message-Id: <20220601125344.60602-9-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220601125344.60602-1-stefan.wahren@i2se.com> References: <20220601125344.60602-1-stefan.wahren@i2se.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:Ig4+vtjVmnUOYvMLZ2d4Qk3vLDd8u7U6svJsfy+ssKl3gEGWgJA VZB7WC0Qn8GPRH87kxuYceKCOFjQ/2pW3Dp5EFwzDfVv9UUcxsmdYcFd02+fWIagA+l2hfi JkzaF5ojVXxkyobvyNQRHaJMonSeE51rtTxNnA0SqK/ut52wdaX5/4IJBNd7npSnPl6iCNd 2Is3LedXgP6pKQeMhMYpg== X-UI-Out-Filterresults: notjunk:1;V03:K0:8afz+10XBLI=:t+cC3CIIwTk+CWNjSDMwPa 1MW9daXkLIfKMPF9MyYEELoqTEMuJSL+Jqh9+uoUgsFBaYfqJqSWTZwcu/mGb/nwlfPZN/N3g O/ZStFJuX282EBKUSdkpNQ6PFlRx7mhbfwMqt4+MbNy4bmxJwwzH/KZrOBizDjtAjtcrxjpEJ km6ANnPGzUBZpE0wz/99YjmMitNv6vw8D2PNG9QvR6d7JohEzY9QIp5KCiTNYoM19oUmPb7Ar EtAghpqNuRbU70wMLAmS1ULZPacjvtWE23bcpHVV3miYtAfo1zdErJT455n53dIk0HqOJ7hjF WyxDWYVQf4nUD4DpEnLyL+GImqb9imAWVYwnVuZRYbP9h2uRcSaEdJ9u7gR9GqA8cwgsZFUe0 s81kLjoIeuV1t/Dnlp0Kd0CH/QUMzICxnrrFGleQKQ9TOZSHfTiVY50XGd7xA37/wzwaTtV+I 9HeYAQPY2jdFhONmIr63KBW9IMdm/4a9WZM5lRGnUZfY1GR/iZQxvIy5tfJXACYRWT8R+Zlvi v0BVzVYDtHizpSsBhyijeg6DuuTeA77JTwwNusvpLV3bdfwSpD8XO4rEUDONrL1mrKVuWmP2m MNmU/eZHTUKyf9TWkp+oCGlFUsDBsi1acETDGC/pWFNl7it342AJe/kJjbyWv4JOJbkMq365h gvdXcTy4dGjc4BWTIG50eZ9n5ytGzQ17JDbqn+y249sZaZBImKiyeNHMAtjr24r0Mvruv6zxz fSsVVzVfU2Yhrj9Yb/tptwvpjKIgWI/xk98IqJTwIY4aBDkuUb3ln6OU7Rs= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220601_055414_415790_4DBE653F X-CRM114-Status: GOOD ( 13.55 ) 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 Wed Jun 1 12:53:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 12866887 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 323C5C433EF for ; Wed, 1 Jun 2022 12:56:03 +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=FcSEEg5BKwpOjO +o48VmawpOSA4y4dQf9TYtXy3OCLHyrVzVwwIdWz+KYrNBOOigoLFcge1YNb2z1CSXG1mpLliblEQ sOW3ks6Nm9e7f1vC5IBwkuVtBj1m0R2p+X+wCBKo5esgwwh5ekK1QQHGmpv/1uYajrbMA8Ah6KKuh RgKJ0S19GFHysVPVCljsYuGyL0BBZyQ1C6SCG5QTk5bv0HmN4HSOUWbum3/xB5NQYS9RzC3RVz+QB Sk/W2Rw6WQFA/uoRCEpbpdcTxNakChk8JUVZyIids1hPlutbzElcWqSZQGt3GP5Wrc91L57kFH8Gt g1Efn8Wurt7pD+rKSE9Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwNsD-00G7kz-3K; Wed, 01 Jun 2022 12:54:53 +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 1nwNrZ-00G7Xf-VM; Wed, 01 Jun 2022 12:54:15 +0000 Received: from localhost.localdomain ([37.4.249.170]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id 1M3DFj-1nxDjk0o9N-003dK5; Wed, 01 Jun 2022 14:54:05 +0200 From: Stefan Wahren To: Florian Fainelli , Ray Jui , Scott Branden , Nicolas Saenz Julienne , Lee Jones Cc: Peter Robinson , Melissa Wen , Phil Elwell , bcm-kernel-feedback-list@broadcom.com, Maxime Ripard , devicetree@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Stefan Wahren Subject: [PATCH V2 09/11] soc: bcm: bcm2835-power: Resolve ASB register macros Date: Wed, 1 Jun 2022 14:53:42 +0200 Message-Id: <20220601125344.60602-10-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220601125344.60602-1-stefan.wahren@i2se.com> References: <20220601125344.60602-1-stefan.wahren@i2se.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:JNkKyC1r2Ouxj1l5dkd4fhl4awI4EFFVcTCxj3yzMZMXDV9H7q+ bpTZT9atgYRSo1UXks+A9AerEvpU5NtjEi9xxUFYGzB2wphooh0NPIIsaFLEN0RVxJec2Rm Teqzn9g3jmc7hwOzUmu4wYUB6N1JusZtWSQLVWORdo7B/q9eBKLZl9ki9jrGCqSVFrmF4ge BAIyDlsX2XIWDB8kbEPmA== X-UI-Out-Filterresults: notjunk:1;V03:K0:X57HHXOFjQA=:6ZUCnzKWj5SEpO3zBAnrTt nAbKrrmo66eCZaBgxAxv6MkQNYpYRpWo9EKMWXaFhJEo5xn8pnCwF9Ti9obr9Gezmw8Kwtvyq X2oXqrh1YO6CWpwNEGqU5HBdKBsIaim7CilRzeJCQCrV+moHtvcZSXS4XAmVO9/kZ1wG1j16X 6Eg1/IYd09izi0GiXTCOpNH9jA54BC10WMX819cEO/UZwkJ7oW/w6uk5reobwDflEo94NmAp1 l/hMDRnFnyggD0Nfb+bgieXjDvVXJIliTuN1VxnM1DTIDQ0uAVBr5hNK/P5obdqqi8n+R6fFP WT15fZ+lIIQLGlFwYOtBGksMS6oNhCYBJE4urxlFscaCNqedrvhOCv0jhrkD8DbkIkNtvJNbd /7/Evm4pwBGt49i06WifKXqdw1J4X296Z5VmD1p/+PVOK9sg5STukzhNbaO1TaXsk6cpaPR8o 3j6Lpk/nwYnGfnPf8oCxhhGzqU5MB0wF0SpdPOBU1TkjEIUk6pt7VjHJnU4G4p/Fw1nSbAj/1 BFcQ/Um4q/0sCFQEekHaiXJ0OCJ7URNg/2yvM+708gxjNddxMCBl/pjwCXcopRZLrE0X62gGA pCwDdVzI2VnJs7lTWTOoCuqzLZdh9rmBvngQYIcLZ3Iy10nlrnOkOtyArfcHY12OPg9wR6Kwy WIP8lESwBJzGtXTnxpQLJjgIwbVB9ocIMpfBBTKDXpCigN3UZzzfmVt61uSy5pVMUcOI0DwqH Rr7XGKR45VMkMe/cxRXoGRMjG5Fy8UWdKz8Fs2Lqayltan3eDjqs0aZBV1Q= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220601_055414_383976_335B7F08 X-CRM114-Status: GOOD ( 14.12 ) 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 Wed Jun 1 12:53:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 12866889 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 B0366C433F5 for ; Wed, 1 Jun 2022 12:56:43 +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=bBdHthLRqgBpfM BHWCIG6SjdA5iyUxMGDfMu17+3W+fhFg6ACQCS+ti7sb46iVR6x2MvJ8G/riyct+wCEAV6KSRN9TR oRIiBpfVO9SCRbFVZNl3EABDT4RAt5sr79dWtyOTlBgNa45n9rxoFklyOkw0XMQELPgOsl4T8hKin NZ3+bH/zRefeXiqNsKWgKdeS/LqE5c64SWhOn7ntPuCMbgnd7XtaqSyoRQOl9HG9mUHQroEYbAWLx 4G1lmMFRsXT584YUk+OBlVqacx8Z5a/Bd6cEx+7DveqNS513DTtMcfvLApUOuV3aqcqSEbu5IjbTi IT2ZYFFRl2zUhcxKN6AA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwNsk-00G80B-RJ; Wed, 01 Jun 2022 12:55: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 1nwNrY-00G7Xc-Go; Wed, 01 Jun 2022 12:54:15 +0000 Received: from localhost.localdomain ([37.4.249.170]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id 1N1Ok1-1np0HG2n99-012qRj; Wed, 01 Jun 2022 14:54:05 +0200 From: Stefan Wahren To: Florian Fainelli , Ray Jui , Scott Branden , Nicolas Saenz Julienne , Lee Jones Cc: Peter Robinson , Melissa Wen , Phil Elwell , bcm-kernel-feedback-list@broadcom.com, Maxime Ripard , devicetree@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Stefan Wahren Subject: [PATCH V2 10/11] soc: bcm: bcm2835-power: Add support for BCM2711's RPiVid ASB Date: Wed, 1 Jun 2022 14:53:43 +0200 Message-Id: <20220601125344.60602-11-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220601125344.60602-1-stefan.wahren@i2se.com> References: <20220601125344.60602-1-stefan.wahren@i2se.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:WouLfZ1osNAWPQehDCkGwbZo627Mf9I3PQE1xt7m4oyeoNlXdcW ANpkxNd3g3qxMq7y9AnI+dRDXQsyQWRkumpsRoxNAknn6yP4zEDQ5rK2gkFda82PncixtCw cI3G8srLvCF91lybgdCHXKaMIOtFhzPLoGdAMFpV+W/5+Hs3KnCwr0SD+H1vpdbPzrKIMiR ebr87Z+YyPFVAE881ZG8A== X-UI-Out-Filterresults: notjunk:1;V03:K0:avN3EM3rIUg=:KZYZy+3bqnsqBcCJ+l/Oli jN4OcD2GtiB8a0KHQxmFJYF0QhvBrXCmBu2XorG58J6CPJ4b5LLnodUrNaIpYPbL+QJxto6H8 rD9YyXLG0PPZqQZRwHKQc9vw1xPbJG4YsS6t+fyVhYxeovuVoojNs2sOErcuyMdMm5e07eMkM X3P228D5J9egPzPBke1Y4YctVq+u1gv4lsgvZPOFNNsi4X30B6Q+qdenGhaAN0EV27bWETND2 MZI2m242wqVFOZQNQiiMUGO5WNCgmw46tg2vbUfhvPow0yfz5mLT+azBPm+QCsluebqNNg9Ns IY1KBJswszM25WAW8O7N7jT8c7xugLRlZnqT3yidbbMHqQw2ME42kpGbPXk1JN+eLnzP7rJFm Es4M3wtJIr+mvCQfvuwsb4eQhzqGCizrnjPslP4dPmUrnNLLbNgEVfbKpFoeff4vFVYn83eHn LIfYKnrr3JF3zjQ9i0ibCwusIdtzqwFX3LmaI6J+yvxX5g0TplOoFGr7w7WOgeyz/m/uSTaPx QXyE57P8+cfVUTJMTt/upkfMwselynLBtBeqjDlP9jhyQupF4U4FTxSLOXbJIP7BH73W1KC/X wL5I3Osf//KKs4/yz9tKSw43cDaQka3Iv4VAHgRSvG6zdGtT/yaXkHS9SeN9Pm68HSchBP95F 1b7K+f9jg+2maqpeV9WpH3fnc6OT/iU+zlCGZPmW8ITfs3mNuJyPl0RNoup8p+6NC/Jm4KFqj GGKbTLENb0xO3xPk2uB4z0xZFBdJDjFU0qm6I93sjPyr7vTs6V4JyWNpUOs= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220601_055412_909697_D5125091 X-CRM114-Status: GOOD ( 16.70 ) 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 Wed Jun 1 12:53:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 12866886 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 0811AC433F5 for ; Wed, 1 Jun 2022 12:55:55 +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=jH67tTrxyGKRxM 0bPx5AgBC7efH6Bivyj5MFrT+fXUhZ6n86VaAOaOy3EUIIxhHQZVdaU7KPTAXSXhZXN89I6ZoGjsS BQzkfag7joTQ6+x8379EEkSp5jYd74NKWG7vwWyuZKRxsjZXjqVJeCcHGW04vW66xCtzoRL1ORuB4 xXM9wqCvIIolldJC7Ezf02hX9qwDm//h4xcoS0IHIMFybXycP4hNs0w/5mDnP9Tu9ybM6ZLiwJdvY LPaTyiFieXoKkSe93oIj9MUmNQoMMh4UuXlJ1moDW4EgDoovumVCZLfJrOFkmr2Vrk6/9lfEFDwkt xEByxh3gI7ihtocKaknw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwNs3-00G7i3-SA; Wed, 01 Jun 2022 12:54:43 +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 1nwNrY-00G7Xd-N0; Wed, 01 Jun 2022 12:54:15 +0000 Received: from localhost.localdomain ([37.4.249.170]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MEFrX-1o3mF10aAf-00ACtN; Wed, 01 Jun 2022 14:54:06 +0200 From: Stefan Wahren To: Florian Fainelli , Ray Jui , Scott Branden , Nicolas Saenz Julienne , Lee Jones Cc: Peter Robinson , Melissa Wen , Phil Elwell , bcm-kernel-feedback-list@broadcom.com, Maxime Ripard , devicetree@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Nicolas Saenz Julienne , Stefan Wahren Subject: [PATCH V2 11/11] soc: bcm: bcm2835-power: Bypass power_on/off() calls Date: Wed, 1 Jun 2022 14:53:44 +0200 Message-Id: <20220601125344.60602-12-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220601125344.60602-1-stefan.wahren@i2se.com> References: <20220601125344.60602-1-stefan.wahren@i2se.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:VJ7rsWMl2Jg6ImIz2fwWQ2RcRoEdGoGRnSkGfgd+kiIdqPBZXBz FTTmYp/RctCMbyTHdTsch14j6WX8+ssEbwhKFNWPW9pbjSTdb3hdhoUjh0H5eq2mhqB6GRn uNPWCQnybPaPyD56voqxZuZoFxrC1GeZjXzdR3AVaR6fSCJLSFBJ7AJg1nJZnCOoEhiIYZF Lgsv+YobADqv5P4hLKOmQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:W1/nx7AxilQ=:YBbbgkjQ6JYV56Q16ggyBa Abg+TLjOsl6UEQ1hSO3rg6VdJz1WbLY+q1Lu60mFggSeT2kVB4oT+Hu769X42belhTaRScRJh 39cQM9s0/6xUCKxNXndT2QCCt+F4ANQc4vX/lDlIPHHG6voKRHts5vqO+XHiUWibB4AK8VJdk Ez/BctJGedw4EL70rQp48w0g75yw0i85khmKPojS5jWh9tmL9kvNltJ2KbdDtdAhCVzArj4on W9kxtY0ybZ2dNb4mbbX4dkS3nPF1L4kJj2ZCdwxW6gsyF0EFlXY3ORnxbBdaYyufRh3NUqKnf WR7KNfVn8fXEg0NjVd3HMEFB24RqxQWpMbLEqW60HBDGh7lDYUrpzVdog0SLSq3VE/K8MAe/8 wOei+S5GqiYIiC2j6hWTywVOGjAN9YONJP2/u5CRZ6s+p2eWWSoKoRBYtAY0eTxt1Iyx/RCi9 Un42NVZvpVoYVgw39RMhGHYkq2KbiwIja59pHuMDJ3VeK9iVvYq1TxMHTU1TkBKGOALN1cUoV e83m+32ld87P/NJfJLFJ7SpqDsTy0D4W56q6kahy4OYMMKNQ/GK2n7kZA5wGPG4cQwluDH3Jo vndfFFuNPXG3Y5OPy0uIDjGqbP3aZeJE546Ym7sUtL7vffvwAzWl86GnJPgTbK6zwj0+alfi/ PyHpJyUnjABFXjdP69VLZbqAMG3VRZ/GR1KjzpxDLmHNHcDUZpn6+5MkxMawZciSFs8A4HrhR xszGuWbPQgW7aD0TEkVDfK3w1RIpMFH6uyov4J1iIu4zu75VZ6Wpv+m3qQA= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220601_055413_097254_C2D620B4 X-CRM114-Status: GOOD ( 13.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 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;