From patchwork Fri Feb 5 13:52:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Saenz Julienne X-Patchwork-Id: 12070171 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 82638C433DB for ; Fri, 5 Feb 2021 13:54:55 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 11AF864FC6 for ; Fri, 5 Feb 2021 13:54:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 11AF864FC6 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=w3mM/qv9CHQBMCt3mb/WXulijDgHHe+T4EWEg1QSKTM=; b=IeCzBGHGGurTXNYL6XxV4To5o nS4U2EObZ5lZLhhIALip+QBquc6CFzByQiq2Adzz11VUtgaliyTUtErYxIJXgwzI0qWUZt+92rlow csBcjoLVFAC7u+FyuTPlHvkbhhc1krv8LOk5A/4Q/P2LYezG5CEi0rKdbU5pi4eZ2gPziVC1ozbzH FOPiBcyKi/Y/li9fEHBfNUPz6iM2VhE7Sw2tPaiseMtDvifA1ZlGMcS6WIvB4J0tCOcCysfNPyF6f DKGJwGGaPI1APM8+lefQSAKZoduRnxcMDhrOHFI69Q4a4IWdDCNMi+zgsqOVKE/H6son+1m2t4SDn 6PDcBkTxw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l81Y9-0003xs-1W; Fri, 05 Feb 2021 13:53:29 +0000 Received: from mx2.suse.de ([195.135.220.15]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l81Xf-0003mp-2S; Fri, 05 Feb 2021 13:53:00 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id B18E9ACD4; Fri, 5 Feb 2021 13:52:57 +0000 (UTC) From: Nicolas Saenz Julienne To: f.fainelli@gmail.com, Saenz Julienne , bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Ray Jui , Scott Branden Subject: [RFC/PATCH 01/11] dt-bindings: soc: bcm: bcm2835-pm: Convert bindings to DT schema Date: Fri, 5 Feb 2021 14:52:37 +0100 Message-Id: <20210205135249.2924-2-nsaenzjulienne@suse.de> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210205135249.2924-1-nsaenzjulienne@suse.de> References: <20210205135249.2924-1-nsaenzjulienne@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210205_085259_426441_3781D7CE X-CRM114-Status: GOOD ( 16.49 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, Rob Herring , phil@raspberrypi.com, wahrenst@gmx.net Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This converts the brcm,bcm2835-pc bindings from text to proper schema. Signed-off-by: Nicolas Saenz Julienne --- .../bindings/soc/bcm/brcm,bcm2835-pm.txt | 46 ----------- .../bindings/soc/bcm/brcm,bcm2835-pm.yaml | 79 +++++++++++++++++++ 2 files changed, 79 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..5e0555fc0666 --- /dev/null +++ b/Documentation/devicetree/bindings/soc/bcm/brcm,bcm2835-pm.yaml @@ -0,0 +1,79 @@ +# 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: + - enum: + - brcm,bcm2835-pm + - const: brcm,bcm2835-pm-wdt + + reg: + minItems: 1 + maxItems: 2 + description: Specifies base physical address and size of the two register + ranges, "PM" and "ASYNC_BRIDGE" in that order. + + "#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@0 { + 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 Fri Feb 5 13:52:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Saenz Julienne X-Patchwork-Id: 12070175 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B30B6C433E0 for ; Fri, 5 Feb 2021 13:55:10 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3BF2B64DF6 for ; Fri, 5 Feb 2021 13:55:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3BF2B64DF6 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=oULPTY2V2rTW8eLXLN7me2PwPythO+SdNG21mmqPA0o=; b=h/sO5FdQBFwd3cWNDOG97YKeX GVdYbtL6Q/fKdzW0GjD1VDw0vBs01ynZ3REVicXYaOw23uNUnLDOkMR81dA69Lopi8XQ4J8VXqtWM UEOKmn2+IyElR/ndOcYlX7rLNQq95VvSjUp2/EbV9L1k7LIi2BMGc1uWmyeF9kVXkxjwCxEa4qtsb GB8+2cuPle2/PZDwAuXTTj1tha9SRnr4xC3UTWYkQ54DoALC1f7PSlExQWf0qVZh73RN6Ld+YTIUK i3a9tAOfG/tTZrjfHv2TQtf883kqHv4FBLrGH2/MirEmNRvH3x8YsjyGr+hOTwUc5B94kg0ZhLPRq lTUFVHdKw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l81YI-00040G-Ii; Fri, 05 Feb 2021 13:53:38 +0000 Received: from mx2.suse.de ([195.135.220.15]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l81Xf-0003n8-LW; Fri, 05 Feb 2021 13:53:02 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 97A71AE55; Fri, 5 Feb 2021 13:52:58 +0000 (UTC) From: Nicolas Saenz Julienne To: f.fainelli@gmail.com, Saenz Julienne , bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Ray Jui , Scott Branden Subject: [RFC/PATCH 02/11] dt-bindings: soc: bcm: brcm, bcm2835-pm: Add support for bcm2711 Date: Fri, 5 Feb 2021 14:52:38 +0100 Message-Id: <20210205135249.2924-3-nsaenzjulienne@suse.de> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210205135249.2924-1-nsaenzjulienne@suse.de> References: <20210205135249.2924-1-nsaenzjulienne@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210205_085259_869054_17EAAC87 X-CRM114-Status: GOOD ( 11.60 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, Rob Herring , phil@raspberrypi.com, wahrenst@gmx.net 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 Argon ASB. The new Argon 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: Nicolas Saenz Julienne --- .../devicetree/bindings/soc/bcm/brcm,bcm2835-pm.yaml | 7 ++++--- 1 file changed, 4 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 5e0555fc0666..a1f2e25e68db 100644 --- a/Documentation/devicetree/bindings/soc/bcm/brcm,bcm2835-pm.yaml +++ b/Documentation/devicetree/bindings/soc/bcm/brcm,bcm2835-pm.yaml @@ -21,13 +21,14 @@ properties: items: - enum: - brcm,bcm2835-pm + - brcm,bcm2711-pm - const: brcm,bcm2835-pm-wdt reg: minItems: 1 - maxItems: 2 - description: Specifies base physical address and size of the two register - ranges, "PM" and "ASYNC_BRIDGE" in that order. + maxItems: 3 + description: Specifies base physical address and size of the register + ranges, "PM", "ASYNC_BRIDGE" and "ARGON_BRIDGE" in that order. "#power-domain-cells": const: 1 From patchwork Fri Feb 5 13:52:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Saenz Julienne X-Patchwork-Id: 12070173 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6565BC433DB for ; Fri, 5 Feb 2021 13:55:08 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EC00764DF6 for ; Fri, 5 Feb 2021 13:55:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EC00764DF6 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=iZEopyYyuuU5wj93/7Sw0i+jecgsFkoFHrqfQt8lDnk=; b=g5H0fuVosmuFsq6207SDt8ahb 1wklN1nT4Ka5wROHbnL44BK/OXNCUD1vQLkV+PYhOq8N4JIPwiuXb98HWpj7ORJYgAs3oSmyrxVJO 09YjnmONNMtiQqWSsBfbC5m2/UWsG7DPvPh6hZ4NYO3rLYaGRBYSopBcv0DonMQeSKbuq9EQFqBl8 edK1Sld3Wb3yF8MILQVHZFqJF8ZALYVhtxGEcvtIBIgYlLiuncQL0BHSqLIQsQdPN5agoSAUmYKiA BZq4Hm/1KSIvcBFj+SgEtuqEcNlOpQcKRLc+6uyrGxUlVRPJ1pdkkQI+Wq4RbiGtAASm0TYh7KEc6 Y5QvzdGdg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l81YN-00042a-2d; Fri, 05 Feb 2021 13:53:43 +0000 Received: from mx2.suse.de ([195.135.220.15]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l81Xg-0003ny-FH; Fri, 05 Feb 2021 13:53:03 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 61D30ACAC; Fri, 5 Feb 2021 13:52:59 +0000 (UTC) From: Nicolas Saenz Julienne To: f.fainelli@gmail.com, Saenz Julienne , bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Rob Herring Subject: [RFC/PATCH 03/11] ARM: dts: bcm2711: Use proper compatible in PM/Watchdog node Date: Fri, 5 Feb 2021 14:52:39 +0100 Message-Id: <20210205135249.2924-4-nsaenzjulienne@suse.de> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210205135249.2924-1-nsaenzjulienne@suse.de> References: <20210205135249.2924-1-nsaenzjulienne@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210205_085300_696610_F555EE66 X-CRM114-Status: GOOD ( 13.13 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, phil@raspberrypi.com, wahrenst@gmx.net Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org A new compatible string was introduced specifically for BCM2711, so make use of it. Signed-off-by: Nicolas Saenz Julienne --- 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 462b1dfb0385..537498a93a3a 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 Fri Feb 5 13:52:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Saenz Julienne X-Patchwork-Id: 12070179 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6C1E9C433DB for ; Fri, 5 Feb 2021 13:55:18 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E56B964DF6 for ; Fri, 5 Feb 2021 13:55:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E56B964DF6 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=leici1ueQSbk3ulf3JkduuU2NgUJ5Ivm0KTbMgW6/I4=; b=wSoHhjJb3Ctfw9NI+V794/U0I NEq7o0qJ7SXOEQR+g/eVbSNeQNEiP+K/hg66m5G6v0YUdIrVxote83A1lKfwTT6Zk7cSsgDBPO7Gw Z9n/Way4P1+ao4mpgydt4TKJsOzKTn/4qsi1B8GOs09hZHiAhczZ4Am5Km/5fDJTsFOSI0l2ZUm/+ xG1vo/+EL9bqaZjCNUH/3V872NguoTK8GagrYkFM0AkL/RsYsAwjBDpyb1RLQ4SMtJ77Zh9mLSFH4 gqMLTearSgQuC/VsfGRnosodglZcOYhvOi4h/shauxMgyvIdmQsYiD8sKJ8QtJIsn3mNL/n0Kaes/ nu7wYE4oQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l81YV-00046R-DE; Fri, 05 Feb 2021 13:53:51 +0000 Received: from mx2.suse.de ([195.135.220.15]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l81Xh-0003oo-Ke; Fri, 05 Feb 2021 13:53:06 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 62858ACBA; Fri, 5 Feb 2021 13:53:00 +0000 (UTC) From: Nicolas Saenz Julienne To: f.fainelli@gmail.com, Saenz Julienne , bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Lee Jones , Ray Jui , Scott Branden Subject: [RFC/PATCH 04/11] mfd: bcm2835-pm: Add support for BCM2711 Date: Fri, 5 Feb 2021 14:52:40 +0100 Message-Id: <20210205135249.2924-5-nsaenzjulienne@suse.de> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210205135249.2924-1-nsaenzjulienne@suse.de> References: <20210205135249.2924-1-nsaenzjulienne@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210205_085301_965147_60F1864F X-CRM114-Status: GOOD ( 23.03 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, phil@raspberrypi.com, wahrenst@gmx.net Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org In BCM2711 the new ARGON 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 registers, so get both of them and pass them into 'bcm2835-power,' which will take care of selecting which one to use accordingly. We're being extra careful when dealing with older firmware. We can't assume all V3D users will use the new "brcm,bcm2711-pm" compatible string, so use the fact that a 3rd resource is present in firmware as a hint we're running on BCM2711. Signed-off-by: Nicolas Saenz Julienne --- drivers/mfd/bcm2835-pm.c | 55 ++++++++++++++++++++++++++-------- include/linux/mfd/bcm2835-pm.h | 1 + 2 files changed, 43 insertions(+), 13 deletions(-) diff --git a/drivers/mfd/bcm2835-pm.c b/drivers/mfd/bcm2835-pm.c index 42fe67f1538e..98c6943d3cd0 100644 --- a/drivers/mfd/bcm2835-pm.c +++ b/drivers/mfd/bcm2835-pm.c @@ -6,6 +6,7 @@ * the WDT and power drivers. */ +#include #include #include #include @@ -17,6 +18,9 @@ #include #include +#define BCM2835 BIT(1) +#define BCM2711 BIT(2) + static const struct mfd_cell bcm2835_pm_devs[] = { { .name = "bcm2835-wdt" }, }; @@ -30,6 +34,7 @@ static int bcm2835_pm_probe(struct platform_device *pdev) struct resource *res; struct device *dev = &pdev->dev; struct bcm2835_pm *pm; + bool is_bcm2711; int ret; pm = devm_kzalloc(dev, sizeof(*pm), GFP_KERNEL); @@ -38,6 +43,7 @@ static int bcm2835_pm_probe(struct platform_device *pdev) platform_set_drvdata(pdev, pm); pm->dev = dev; + is_bcm2711 = (uintptr_t)device_get_match_data(&pdev->dev) & BCM2711; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); pm->base = devm_ioremap_resource(dev, res); @@ -50,30 +56,53 @@ static int bcm2835_pm_probe(struct platform_device *pdev) if (ret) return ret; - /* We'll use the presence of the AXI ASB regs in the - * bcm2835-pm binding as the key for whether we can reference - * the full PM register range and support power domains. + /* To support old firmware, check if a third resource was defined and + * use that as a hint that we're on bcm2711. */ + res = platform_get_resource(pdev, IORESOURCE_MEM, 2); + if (res) { + pm->arsan_asb = devm_ioremap_resource(dev, res); + if (IS_ERR(pm->arsan_asb)) { + dev_err(dev, "Failed to map Arsan ASB: %ld\n", + PTR_ERR(pm->arsan_asb)); + return PTR_ERR(pm->arsan_asb); + } + + if (!is_bcm2711) { + dev_warn(dev, "Using an outdated DT, please update it\n"); + is_bcm2711 = true; + } + } + + if (is_bcm2711 && !pm->arsan_asb) { + dev_err(dev, "Arsan ASB resource missing\n"); + return -EINVAL; + } + res = platform_get_resource(pdev, IORESOURCE_MEM, 1); if (res) { pm->asb = devm_ioremap_resource(dev, res); - if (IS_ERR(pm->asb)) + if (IS_ERR(pm->asb)) { + dev_err(dev, "Failed to map ASB: %ld\n", PTR_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; + } } + /* We'll use the presence of the ASB regs in the bcm2835-pm binding as + * the key for whether we can reference the full PM register range and + * support power domains. + */ + if (pm->asb) + return devm_mfd_add_devices(dev, -1, bcm2835_power_devs, + ARRAY_SIZE(bcm2835_power_devs), + NULL, 0, NULL); return 0; } static const struct of_device_id bcm2835_pm_of_match[] = { - { .compatible = "brcm,bcm2835-pm-wdt", }, - { .compatible = "brcm,bcm2835-pm", }, + { .compatible = "brcm,bcm2835-pm-wdt", .data = (void *)BCM2835}, + { .compatible = "brcm,bcm2835-pm", .data = (void *)BCM2835}, + { .compatible = "brcm,bcm2711-pm", .data = (void *)BCM2711}, {}, }; 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..536e3c85347c 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 *arsan_asb; }; #endif /* BCM2835_MFD_PM_H */ From patchwork Fri Feb 5 13:52:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Saenz Julienne X-Patchwork-Id: 12070181 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 60DD8C433DB for ; Fri, 5 Feb 2021 13:55:22 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DD4BA64FC0 for ; Fri, 5 Feb 2021 13:55:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DD4BA64FC0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=KDoNRyTlzBLi9+FN3JNwaNZ8PRWBbU/AQH3zgstB1oM=; b=fYh2B5iPzfU96WPAbzZvEXlh2 JuvhUbm67WrtWpq6OGxzmf+GajGZbT4qZFQyBOVR+X2HpDP7A751GvfO9/+J0gYVnggxWUmyKVLP5 HXyGGDR0wJpbMBCDERlGoX36NEJ1ljam8Mbjp2sBOz6Y3isozvwr9ZNBz5NKEGCkhM0jCwfcvQPXK /K6cWujCR9Idv3Zj76zgmF+mqHoYjKjPOMZqzEzM8DazhXc2WgttMulWt9TdDT4Ew7dIT6LYpTYz6 8X4JtFtU+8dqGYFcBIBPLmUseheqLsOqYG7qkTcr3MVdWVflmI0wpAPvQ+DacrsgIlQnzdem8q67x tkZ119wqg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l81Ye-0004AD-Ae; Fri, 05 Feb 2021 13:54:00 +0000 Received: from mx2.suse.de ([195.135.220.15]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l81Xi-0003pK-BF; Fri, 05 Feb 2021 13:53:08 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 4EC00AD78; Fri, 5 Feb 2021 13:53:01 +0000 (UTC) From: Nicolas Saenz Julienne To: f.fainelli@gmail.com, Saenz Julienne , bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Ray Jui , Scott Branden Subject: [RFC/PATCH 05/11] soc: bcm: bcm2835-power: Add support for BCM2711's ARSAN ASB Date: Fri, 5 Feb 2021 14:52:41 +0100 Message-Id: <20210205135249.2924-6-nsaenzjulienne@suse.de> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210205135249.2924-1-nsaenzjulienne@suse.de> References: <20210205135249.2924-1-nsaenzjulienne@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210205_085302_734578_69BD81A2 X-CRM114-Status: GOOD ( 17.29 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, phil@raspberrypi.com, wahrenst@gmx.net Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org In BCM2711 the new ARGON 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->arsan_asb' is populated as a hint that we're on BCM2711. On top of that introduce the macro ASB_BASE() which will select the correct ASB register base, based on whether we're trying to access V3D and which platform we're on. Signed-off-by: Nicolas Saenz Julienne --- drivers/soc/bcm/bcm2835-power.c | 66 ++++++++++++++++++++------------- 1 file changed, 41 insertions(+), 25 deletions(-) diff --git a/drivers/soc/bcm/bcm2835-power.c b/drivers/soc/bcm/bcm2835-power.c index 1e0041ec8132..17bc71fd243c 100644 --- a/drivers/soc/bcm/bcm2835-power.c +++ b/drivers/soc/bcm/bcm2835-power.c @@ -126,8 +126,9 @@ #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)) +#define ASB_BASE(is_v3d) (is_v3d && power->arsan_asb ? power->arsan_asb : power->asb) +#define ASB_READ(reg, is_v3d) readl(ASB_BASE(is_v3d) + (reg)) +#define ASB_WRITE(reg, val, is_v3d) writel(PM_PASSWORD | (val), ASB_BASE(is_v3d) + (reg)) struct bcm2835_power_domain { struct generic_pm_domain base; @@ -142,13 +143,16 @@ struct bcm2835_power { void __iomem *base; /* AXI Async bridge registers. */ void __iomem *asb; + /* ARSAN bridge registers. */ + void __iomem *arsan_asb; struct genpd_onecell_data pd_xlate; struct bcm2835_power_domain domains[BCM2835_POWER_DOMAIN_COUNT]; struct reset_controller_dev reset; }; -static int bcm2835_asb_enable(struct bcm2835_power *power, u32 reg) +static int bcm2835_asb_enable(struct bcm2835_power *power, u32 reg, + bool is_v3d) { u64 start; @@ -158,8 +162,8 @@ 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); - while (ASB_READ(reg) & ASB_ACK) { + ASB_WRITE(reg, ASB_READ(reg, is_v3d) & ~ASB_REQ_STOP, is_v3d); + while (ASB_READ(reg, is_v3d) & ASB_ACK) { cpu_relax(); if (ktime_get_ns() - start >= 1000) return -ETIMEDOUT; @@ -168,7 +172,8 @@ 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_disable(struct bcm2835_power *power, u32 reg, + bool is_v3d) { u64 start; @@ -178,8 +183,8 @@ static int bcm2835_asb_disable(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); - while (!(ASB_READ(reg) & ASB_ACK)) { + ASB_WRITE(reg, ASB_READ(reg, is_v3d) | ASB_REQ_STOP, is_v3d); + while (!(ASB_READ(reg, is_v3d) & ASB_ACK)) { cpu_relax(); if (ktime_get_ns() - start >= 1000) return -ETIMEDOUT; @@ -274,7 +279,8 @@ static int bcm2835_asb_power_on(struct bcm2835_power_domain *pd, u32 pm_reg, u32 asb_m_reg, u32 asb_s_reg, - u32 reset_flags) + u32 reset_flags, + bool is_v3d) { struct bcm2835_power *power = pd->power; int ret; @@ -301,13 +307,13 @@ static int bcm2835_asb_power_on(struct bcm2835_power_domain *pd, goto err_enable_resets; } - ret = bcm2835_asb_enable(power, asb_m_reg); + ret = bcm2835_asb_enable(power, asb_m_reg, is_v3d); if (ret) { dev_err(power->dev, "Failed to enable ASB master for %s\n", pd->base.name); goto err_disable_clk; } - ret = bcm2835_asb_enable(power, asb_s_reg); + ret = bcm2835_asb_enable(power, asb_s_reg, is_v3d); if (ret) { dev_err(power->dev, "Failed to enable ASB slave for %s\n", pd->base.name); @@ -317,7 +323,7 @@ static int bcm2835_asb_power_on(struct bcm2835_power_domain *pd, return 0; err_disable_asb_master: - bcm2835_asb_disable(power, asb_m_reg); + bcm2835_asb_disable(power, asb_m_reg, is_v3d); err_disable_clk: clk_disable_unprepare(pd->clk); err_enable_resets: @@ -329,22 +335,23 @@ static int bcm2835_asb_power_off(struct bcm2835_power_domain *pd, u32 pm_reg, u32 asb_m_reg, u32 asb_s_reg, - u32 reset_flags) + u32 reset_flags, + bool is_v3d) { struct bcm2835_power *power = pd->power; int ret; - ret = bcm2835_asb_disable(power, asb_s_reg); + ret = bcm2835_asb_disable(power, asb_s_reg, is_v3d); if (ret) { dev_warn(power->dev, "Failed to disable ASB slave for %s\n", pd->base.name); return ret; } - ret = bcm2835_asb_disable(power, asb_m_reg); + ret = bcm2835_asb_disable(power, asb_m_reg, is_v3d); if (ret) { dev_warn(power->dev, "Failed to disable ASB master for %s\n", pd->base.name); - bcm2835_asb_enable(power, asb_s_reg); + bcm2835_asb_enable(power, asb_s_reg, is_v3d); return ret; } @@ -369,7 +376,7 @@ static int bcm2835_power_pd_power_on(struct generic_pm_domain *domain) case BCM2835_POWER_DOMAIN_GRAFX_V3D: return bcm2835_asb_power_on(pd, PM_GRAFX, ASB_V3D_M_CTRL, ASB_V3D_S_CTRL, - PM_V3DRSTN); + PM_V3DRSTN, true); case BCM2835_POWER_DOMAIN_IMAGE: return bcm2835_power_power_on(pd, PM_IMAGE); @@ -377,17 +384,17 @@ static int bcm2835_power_pd_power_on(struct generic_pm_domain *domain) case BCM2835_POWER_DOMAIN_IMAGE_PERI: return bcm2835_asb_power_on(pd, PM_IMAGE, 0, 0, - PM_PERIRSTN); + PM_PERIRSTN, false); case BCM2835_POWER_DOMAIN_IMAGE_ISP: return bcm2835_asb_power_on(pd, PM_IMAGE, ASB_ISP_M_CTRL, ASB_ISP_S_CTRL, - PM_ISPRSTN); + PM_ISPRSTN, false); case BCM2835_POWER_DOMAIN_IMAGE_H264: return bcm2835_asb_power_on(pd, PM_IMAGE, ASB_H264_M_CTRL, ASB_H264_S_CTRL, - PM_H264RSTN); + PM_H264RSTN, false); case BCM2835_POWER_DOMAIN_USB: PM_WRITE(PM_USB, PM_USB_CTRLEN); @@ -435,7 +442,7 @@ static int bcm2835_power_pd_power_off(struct generic_pm_domain *domain) case BCM2835_POWER_DOMAIN_GRAFX_V3D: return bcm2835_asb_power_off(pd, PM_GRAFX, ASB_V3D_M_CTRL, ASB_V3D_S_CTRL, - PM_V3DRSTN); + PM_V3DRSTN, true); case BCM2835_POWER_DOMAIN_IMAGE: return bcm2835_power_power_off(pd, PM_IMAGE); @@ -443,17 +450,17 @@ static int bcm2835_power_pd_power_off(struct generic_pm_domain *domain) case BCM2835_POWER_DOMAIN_IMAGE_PERI: return bcm2835_asb_power_off(pd, PM_IMAGE, 0, 0, - PM_PERIRSTN); + PM_PERIRSTN, false); case BCM2835_POWER_DOMAIN_IMAGE_ISP: return bcm2835_asb_power_off(pd, PM_IMAGE, ASB_ISP_M_CTRL, ASB_ISP_S_CTRL, - PM_ISPRSTN); + PM_ISPRSTN, false); case BCM2835_POWER_DOMAIN_IMAGE_H264: return bcm2835_asb_power_off(pd, PM_IMAGE, ASB_H264_M_CTRL, ASB_H264_S_CTRL, - PM_H264RSTN); + PM_H264RSTN, false); case BCM2835_POWER_DOMAIN_USB: PM_WRITE(PM_USB, 0); @@ -626,13 +633,22 @@ static int bcm2835_power_probe(struct platform_device *pdev) power->dev = dev; power->base = pm->base; power->asb = pm->asb; + power->arsan_asb = pm->arsan_asb; - id = ASB_READ(ASB_AXI_BRDG_ID); + id = ASB_READ(ASB_AXI_BRDG_ID, false); if (id != 0x62726467 /* "BRDG" */) { dev_err(dev, "ASB register ID returned 0x%08x\n", id); return -ENODEV; } + if (pm->arsan_asb) { + id = ASB_READ(ASB_AXI_BRDG_ID, true); + if (id != 0x62726467 /* "BRDG" */) { + dev_err(dev, "ARSAN 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 Fri Feb 5 13:52:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Saenz Julienne X-Patchwork-Id: 12070177 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 38361C433DB for ; Fri, 5 Feb 2021 13:55:16 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BE1A864FC9 for ; Fri, 5 Feb 2021 13:55:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BE1A864FC9 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=S5a9m+3qXMwR5VWRQNBTlf6+ngLqW+Na3VPz4U2ibzg=; b=1xFaBPaYAgjigRAqc1O3pbUuo 5IOHsqoaxHS6lPZPK0oMt3Spjfj79zDktt3CvFPoFk72hYHUm74imaxAB6xbwIMBzE5cDeSOF7XeC JEEOl7ngtbArLZ4DiDQZynDzxv28neVUca7dxEn71M/4nXhZWcmofnGqB1ZNyyUHq8pCnbx6q0oDh WyqWrHf9Upe0za4bkMyEbfyLiQFAwaL0mucPGSkhyNdZhdmfKNV87r3vyNumHVPb+4OUX/mRP3zKJ 1fpAi9rKS4P2l6N44L+ez75Af4BHPqnqH9IozzN1zHXszyaUCsfHRhbdLj11OALKcuHfEmgxDhsmE dUS4V48jg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l81YZ-000484-1s; Fri, 05 Feb 2021 13:53:55 +0000 Received: from mx2.suse.de ([195.135.220.15]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l81Xj-0003pk-9d; Fri, 05 Feb 2021 13:53:06 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 241F5AEC4; Fri, 5 Feb 2021 13:53:02 +0000 (UTC) From: Nicolas Saenz Julienne To: f.fainelli@gmail.com, Saenz Julienne , bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Ray Jui , Scott Branden Subject: [RFC/PATCH 06/11] soc: bcm: bcm2835-power: Bypass power_on/off() calls Date: Fri, 5 Feb 2021 14:52:42 +0100 Message-Id: <20210205135249.2924-7-nsaenzjulienne@suse.de> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210205135249.2924-1-nsaenzjulienne@suse.de> References: <20210205135249.2924-1-nsaenzjulienne@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210205_085303_527658_64701F71 X-CRM114-Status: GOOD ( 13.38 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, phil@raspberrypi.com, wahrenst@gmx.net Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Bypass power_on/power_off() when running on BCM2711 as they are not needed. Signed-off-by: Nicolas Saenz Julienne --- 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 17bc71fd243c..ea65f459161d 100644 --- a/drivers/soc/bcm/bcm2835-power.c +++ b/drivers/soc/bcm/bcm2835-power.c @@ -197,6 +197,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->arsan_asb) + return 0; + /* Enable functional isolation */ PM_WRITE(pm_reg, PM_READ(pm_reg) & ~PM_ISFUNC); @@ -218,6 +222,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->arsan_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; From patchwork Fri Feb 5 13:52:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Saenz Julienne X-Patchwork-Id: 12070185 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C98D8C433E0 for ; Fri, 5 Feb 2021 13:55:40 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4EE8464FC4 for ; Fri, 5 Feb 2021 13:55:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4EE8464FC4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=2Zr+x7U7xLo7rOaBkcjyI6/C+/MQydJzzyxaygNuXdY=; b=frYIsRNwVWvtB3yO3HHOE83y4 yAG5fBGYWKZywqo+4Hpg7atJqY5jBQjYv9BMcpvozsIi7UacG9HMLdvvndTpOLpDYUtK9WhbooMEo +AByqH3rXlnK1kOIGm6loxybPT2gm1HkofNdzMx95l/Vfxsir9x9aRbQyfNp6eTsCqW8vj9CiVyH7 8Hcm1DX0TD7Eyg9szfHy3KmZpgw3cud34fD1yszYQhaO9Pojd1y+u5LTFMFqaeMDvUEtMCcrhzBVK MV5+0I417ifbq4jVnZIInVOHSHogG5B/tn8PqEzC47RJJuws+and7pGAGrsxr1k9Ml1+uHaf+n4Bw wipCwZ6AQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l81Yr-0004IM-74; Fri, 05 Feb 2021 13:54:13 +0000 Received: from mx2.suse.de ([195.135.220.15]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l81Xk-0003qb-F8; Fri, 05 Feb 2021 13:53:10 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 58F50AED2; Fri, 5 Feb 2021 13:53:03 +0000 (UTC) From: Nicolas Saenz Julienne To: f.fainelli@gmail.com, Saenz Julienne , bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Eric Anholt Subject: [RFC/PATCH 07/11] drm/v3d: Get rid of pm code Date: Fri, 5 Feb 2021 14:52:43 +0100 Message-Id: <20210205135249.2924-8-nsaenzjulienne@suse.de> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210205135249.2924-1-nsaenzjulienne@suse.de> References: <20210205135249.2924-1-nsaenzjulienne@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210205_085305_892267_38F38F76 X-CRM114-Status: GOOD ( 18.98 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, wahrenst@gmx.net, Daniel Vetter , phil@raspberrypi.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Runtime PM doesn't seem to work correctly on this driver. On top of that, commit 8b6864e3e138 (drm/v3d/v3d_drv: Remove unused static variable 'v3d_v3d_pm_ops') hints that it most likely never did properly as the driver's PM ops were not hooked-up. So, in order to support regular operation with V3D on BCM2711 (Raspberry Pi 4), get rid of the PM code. PM will be reinstated once we figure out the underlying issues. Signed-off-by: Nicolas Saenz Julienne --- drivers/gpu/drm/v3d/v3d_debugfs.c | 18 +----------------- drivers/gpu/drm/v3d/v3d_drv.c | 11 ----------- drivers/gpu/drm/v3d/v3d_gem.c | 9 --------- 3 files changed, 1 insertion(+), 37 deletions(-) diff --git a/drivers/gpu/drm/v3d/v3d_debugfs.c b/drivers/gpu/drm/v3d/v3d_debugfs.c index e76b24bb8828..e1d5f3423059 100644 --- a/drivers/gpu/drm/v3d/v3d_debugfs.c +++ b/drivers/gpu/drm/v3d/v3d_debugfs.c @@ -4,7 +4,6 @@ #include #include #include -#include #include #include @@ -130,11 +129,7 @@ static int v3d_v3d_debugfs_ident(struct seq_file *m, void *unused) struct drm_device *dev = node->minor->dev; struct v3d_dev *v3d = to_v3d_dev(dev); u32 ident0, ident1, ident2, ident3, cores; - int ret, core; - - ret = pm_runtime_get_sync(v3d->drm.dev); - if (ret < 0) - return ret; + int core; ident0 = V3D_READ(V3D_HUB_IDENT0); ident1 = V3D_READ(V3D_HUB_IDENT1); @@ -187,9 +182,6 @@ static int v3d_v3d_debugfs_ident(struct seq_file *m, void *unused) (misccfg & V3D_MISCCFG_OVRTMUOUT) != 0); } - pm_runtime_mark_last_busy(v3d->drm.dev); - pm_runtime_put_autosuspend(v3d->drm.dev); - return 0; } @@ -217,11 +209,6 @@ static int v3d_measure_clock(struct seq_file *m, void *unused) uint32_t cycles; int core = 0; int measure_ms = 1000; - int ret; - - ret = pm_runtime_get_sync(v3d->drm.dev); - if (ret < 0) - return ret; if (v3d->ver >= 40) { V3D_CORE_WRITE(core, V3D_V4_PCTR_0_SRC_0_3, @@ -245,9 +232,6 @@ static int v3d_measure_clock(struct seq_file *m, void *unused) cycles / (measure_ms * 1000), (cycles / (measure_ms * 100)) % 10); - pm_runtime_mark_last_busy(v3d->drm.dev); - pm_runtime_put_autosuspend(v3d->drm.dev); - return 0; } diff --git a/drivers/gpu/drm/v3d/v3d_drv.c b/drivers/gpu/drm/v3d/v3d_drv.c index 99e22beea90b..7a3336443a12 100644 --- a/drivers/gpu/drm/v3d/v3d_drv.c +++ b/drivers/gpu/drm/v3d/v3d_drv.c @@ -19,7 +19,6 @@ #include #include #include -#include #include #include @@ -43,7 +42,6 @@ static int v3d_get_param_ioctl(struct drm_device *dev, void *data, { struct v3d_dev *v3d = to_v3d_dev(dev); struct drm_v3d_get_param *args = data; - int ret; static const u32 reg_map[] = { [DRM_V3D_PARAM_V3D_UIFCFG] = V3D_HUB_UIFCFG, [DRM_V3D_PARAM_V3D_HUB_IDENT1] = V3D_HUB_IDENT1, @@ -69,17 +67,12 @@ static int v3d_get_param_ioctl(struct drm_device *dev, void *data, if (args->value != 0) return -EINVAL; - ret = pm_runtime_get_sync(v3d->drm.dev); - if (ret < 0) - return ret; if (args->param >= DRM_V3D_PARAM_V3D_CORE0_IDENT0 && args->param <= DRM_V3D_PARAM_V3D_CORE0_IDENT2) { args->value = V3D_CORE_READ(0, offset); } else { args->value = V3D_READ(offset); } - pm_runtime_mark_last_busy(v3d->drm.dev); - pm_runtime_put_autosuspend(v3d->drm.dev); return 0; } @@ -271,10 +264,6 @@ static int v3d_platform_drm_probe(struct platform_device *pdev) return -ENOMEM; } - pm_runtime_use_autosuspend(dev); - pm_runtime_set_autosuspend_delay(dev, 50); - pm_runtime_enable(dev); - ret = v3d_gem_init(drm); if (ret) goto dma_free; diff --git a/drivers/gpu/drm/v3d/v3d_gem.c b/drivers/gpu/drm/v3d/v3d_gem.c index 4eb354226972..75582b03470b 100644 --- a/drivers/gpu/drm/v3d/v3d_gem.c +++ b/drivers/gpu/drm/v3d/v3d_gem.c @@ -6,7 +6,6 @@ #include #include #include -#include #include #include #include @@ -372,9 +371,6 @@ v3d_job_free(struct kref *ref) dma_fence_put(job->irq_fence); dma_fence_put(job->done_fence); - pm_runtime_mark_last_busy(job->v3d->drm.dev); - pm_runtime_put_autosuspend(job->v3d->drm.dev); - kfree(job); } @@ -441,10 +437,6 @@ v3d_job_init(struct v3d_dev *v3d, struct drm_file *file_priv, job->v3d = v3d; job->free = free; - ret = pm_runtime_get_sync(v3d->drm.dev); - if (ret < 0) - return ret; - xa_init_flags(&job->deps, XA_FLAGS_ALLOC); ret = drm_syncobj_find_fence(file_priv, in_sync, 0, 0, &in_fence); @@ -460,7 +452,6 @@ v3d_job_init(struct v3d_dev *v3d, struct drm_file *file_priv, return 0; fail: xa_destroy(&job->deps); - pm_runtime_put_autosuspend(v3d->drm.dev); return ret; } From patchwork Fri Feb 5 13:52:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Saenz Julienne X-Patchwork-Id: 12070183 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CFC6DC433DB for ; Fri, 5 Feb 2021 13:55:35 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 23EAB64FC4 for ; Fri, 5 Feb 2021 13:55:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 23EAB64FC4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=yvZMym7fZ2oKnWtyg62mW8W4Yc6nisD+w9PsCTEDKOM=; b=C0HWXe52SNmSbcupcW5kOpSSi VjoJT34iZl/plsooTy6oozI61BuodoOkguAAOGyfZrnFMuCMLn2HzcMapbvITXaDXF6fStxa3bWoY yohRdpvZcwZpd8Pu26GvZ3EEqd2q6WP8uFAC/hT5VojJ9P8G0QnnlE3Pj7k0/7ngoNbBjTStgC8az sjpjVHfdF0+P/8YLnxJ2Z1qGypGDK383EjADW6Xex8AhJRSrMlSNYc/QO1hivvyb3DQ8v2qpfCIb6 2j2PtI/KDoQzoWSdinWO9QGJnyzThCjiFxxwX01bVNws2O3xkI5ue+c7d55hR8dNlE2NCrKxR1wZR mjVDBCbZQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l81Ym-0004FF-7c; Fri, 05 Feb 2021 13:54:08 +0000 Received: from mx2.suse.de ([195.135.220.15]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l81Xl-0003qn-9S; Fri, 05 Feb 2021 13:53:09 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 3AEC8AEE6; Fri, 5 Feb 2021 13:53:04 +0000 (UTC) From: Nicolas Saenz Julienne To: f.fainelli@gmail.com, Saenz Julienne , bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Eric Anholt Subject: [RFC/PATCH 08/11] drm/v3d: Add support for bcm2711 Date: Fri, 5 Feb 2021 14:52:44 +0100 Message-Id: <20210205135249.2924-9-nsaenzjulienne@suse.de> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210205135249.2924-1-nsaenzjulienne@suse.de> References: <20210205135249.2924-1-nsaenzjulienne@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210205_085305_854365_6301ACBE X-CRM114-Status: GOOD ( 16.43 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, wahrenst@gmx.net, Daniel Vetter , phil@raspberrypi.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add compatible string and Kconfig options for bcm2711. Signed-off-by: Nicolas Saenz Julienne --- drivers/gpu/drm/v3d/Kconfig | 2 +- drivers/gpu/drm/v3d/v3d_drv.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/v3d/Kconfig b/drivers/gpu/drm/v3d/Kconfig index 9a5c44606337..b0e048697964 100644 --- a/drivers/gpu/drm/v3d/Kconfig +++ b/drivers/gpu/drm/v3d/Kconfig @@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0-only config DRM_V3D tristate "Broadcom V3D 3.x and newer" - depends on ARCH_BCM || ARCH_BCMSTB || COMPILE_TEST + depends on ARCH_BCM || ARCH_BCMSTB || ARCH_BCM2835 || COMPILE_TEST depends on DRM depends on COMMON_CLK depends on MMU diff --git a/drivers/gpu/drm/v3d/v3d_drv.c b/drivers/gpu/drm/v3d/v3d_drv.c index 7a3336443a12..1504b6f84441 100644 --- a/drivers/gpu/drm/v3d/v3d_drv.c +++ b/drivers/gpu/drm/v3d/v3d_drv.c @@ -184,6 +184,7 @@ static const struct drm_driver v3d_drm_driver = { static const struct of_device_id v3d_of_match[] = { { .compatible = "brcm,7268-v3d" }, { .compatible = "brcm,7278-v3d" }, + { .compatible = "brcm,bcm2711-v3d" }, {}, }; MODULE_DEVICE_TABLE(of, v3d_of_match); From patchwork Fri Feb 5 13:52:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Saenz Julienne X-Patchwork-Id: 12070187 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D59D3C433E0 for ; Fri, 5 Feb 2021 13:55:46 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 62E2E64FC0 for ; Fri, 5 Feb 2021 13:55:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 62E2E64FC0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=dPdUbAV4/gav43Yyr5+CT60Fl/ubljKxaUYSOoTXQvY=; b=kmIAAP+0WjiuH9T5KMCvGSlW+ wl5rcgQOcRFp4gfyi4//yrEYeAvV5hQd9l0I7ucG86RAxwt2BtbHM5fFXncPq8Fcyb5u4m6Vf0CPP 8dELcUhygMW97VdQgHpqts0ZOU4AAFuLViUeULDKkpRzfkEZbq5iK7xy0JR1/yc5WN9bTRpqZ6WDB KgB3+up4wTZhWq27EFExT7uumcvyDkKZ6sP0bqV4nUkOSW204wxBmjElfKSlfirGllpuZsVQ4rVD/ FcP863yFPYj2+9b9+CinSoRPF/V0K/vV9e6EXsosX9mA5NiVG8Wa7iWRmg++SC0vvPGPglooreLKI hLXBA4lFg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l81Yu-0004KB-F7; Fri, 05 Feb 2021 13:54:16 +0000 Received: from mx2.suse.de ([195.135.220.15]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l81Xm-0003qq-3g; Fri, 05 Feb 2021 13:53:11 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id F2EC2AEE7; Fri, 5 Feb 2021 13:53:04 +0000 (UTC) From: Nicolas Saenz Julienne To: f.fainelli@gmail.com, Saenz Julienne , bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Rob Herring Subject: [RFC/PATCH 09/11] ARM: dts: bcm2711: Enable V3D Date: Fri, 5 Feb 2021 14:52:45 +0100 Message-Id: <20210205135249.2924-10-nsaenzjulienne@suse.de> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210205135249.2924-1-nsaenzjulienne@suse.de> References: <20210205135249.2924-1-nsaenzjulienne@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210205_085306_361404_4C338D42 X-CRM114-Status: GOOD ( 10.95 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, phil@raspberrypi.com, wahrenst@gmx.net Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This enables V3D for bcm2711 (used in the Raspberry Pi 4). Signed-off-by: Nicolas Saenz Julienne --- arch/arm/boot/dts/bcm2711.dtsi | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/arm/boot/dts/bcm2711.dtsi b/arch/arm/boot/dts/bcm2711.dtsi index 537498a93a3a..dd8376f474db 100644 --- a/arch/arm/boot/dts/bcm2711.dtsi +++ b/arch/arm/boot/dts/bcm2711.dtsi @@ -548,6 +548,18 @@ genet_mdio: mdio@e14 { #size-cells = <0x1>; }; }; + + v3d: gpu@7ec04000 { + compatible = "brcm,bcm2711-v3d"; + reg = <0x0 0x7ec00000 0x4000>, + <0x0 0x7ec04000 0x4000>; + reg-names = "hub", "core0"; + + power-domains = <&pm BCM2835_POWER_DOMAIN_GRAFX_V3D>; + resets = <&pm BCM2835_RESET_V3D>; + clocks = <&firmware_clocks 5>; + interrupts = ; + }; }; }; From patchwork Fri Feb 5 13:52:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Saenz Julienne X-Patchwork-Id: 12070189 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C96B9C433E0 for ; Fri, 5 Feb 2021 13:55:49 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 58FD064DF6 for ; Fri, 5 Feb 2021 13:55:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 58FD064DF6 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=pDEsuSv3nz0dJplS8bGuhmkKXz/acSpXf1ORCdS/bWw=; b=ZVxx20mYMfFA1BOBf8DsHmo3o AewPIf2X0RceaLbnGahW8KqHmjDcvEflb3OF1/z3wlhr+cC/Z8ramrdK/RJXCogq8Viy4vOahUOZq BELhZN/A0aFSO4WwYOFpZZ+hMjNjdYsieXavXY3Nh3D18lspXRFpfwJkm3rwobJm2RLxgj5iZtwCm a2VjvvxaTZyN/OVqcGzVhktrMscjvK+rnpMn8JNEwAoyqn4s+vCe8ewax8jPG3UzIUnEjG/8Zr5AK 3PS7cuYcdrHhVx6JPdpT5PoXT7+08HoL+myTR3GXzj8JVP7G8+9uNwIRFWcFAHfuZCQFciSFsqX/R 7isdMfQMA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l81Z7-0004PM-Su; Fri, 05 Feb 2021 13:54:30 +0000 Received: from mx2.suse.de ([195.135.220.15]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l81Xn-0003rV-1q; Fri, 05 Feb 2021 13:53:12 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id C0879AF13; Fri, 5 Feb 2021 13:53:05 +0000 (UTC) From: Nicolas Saenz Julienne To: f.fainelli@gmail.com, Saenz Julienne , bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC/PATCH 10/11] ARM: configs: Enable DRM_V3D Date: Fri, 5 Feb 2021 14:52:46 +0100 Message-Id: <20210205135249.2924-11-nsaenzjulienne@suse.de> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210205135249.2924-1-nsaenzjulienne@suse.de> References: <20210205135249.2924-1-nsaenzjulienne@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210205_085307_266771_A2BA6C3D X-CRM114-Status: GOOD ( 11.41 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Russell King , phil@raspberrypi.com, wahrenst@gmx.net Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org BCM2711, the SoC used on the Raspberry Pi 4 has a different GPU than its predecessors. Enable it. Signed-off-by: Nicolas Saenz Julienne --- arch/arm/configs/multi_v7_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig index 3823da605430..0ad4ffe4e6f6 100644 --- a/arch/arm/configs/multi_v7_defconfig +++ b/arch/arm/configs/multi_v7_defconfig @@ -713,6 +713,7 @@ CONFIG_DRM_TOSHIBA_TC358764=m CONFIG_DRM_I2C_ADV7511=m CONFIG_DRM_I2C_ADV7511_AUDIO=y CONFIG_DRM_STI=m +CONFIG_DRM_V3D=m CONFIG_DRM_VC4=m CONFIG_DRM_ETNAVIV=m CONFIG_DRM_MXSFB=m From patchwork Fri Feb 5 13:52:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Saenz Julienne X-Patchwork-Id: 12070191 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B2CB1C433E0 for ; Fri, 5 Feb 2021 13:56:01 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 477A564DF6 for ; Fri, 5 Feb 2021 13:56:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 477A564DF6 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=wUvCkAck/FVdLN4OINRyCDCmSyTLpEwR983PNqDABDw=; b=anVWC3Pz6E0uCNZNJGMUH6Yj3 kaJYVng1VrFZ8g8Valxx4hxL6QVPIwuyr7l8SF9qyxEUSJEPepMY/a96V+9GtCrU3XvzA6sAdG/ws wi7vaN1+nDholAsrwRsQSxiD7NvjxyuFjTOanrnOzcS5nvJaesnHEKGe/+JjU3jfN2k3al6j+sHzN rKNQQQkUIcGmK5hTfHMIqtnf5MQZFrEqWYXUbqECs5cwXzd1YJdNJEeNmURNhg4aHt0c2VkfsCGXX UELoLeayur4Fmj86W0iBDin4c+iFpZbb3np1lbiNjBNaFxY0HKmV/d8GvcJzWJfEhF5kwHvWe/j+i UN+iU9QSw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l81ZE-0004W5-MY; Fri, 05 Feb 2021 13:54:36 +0000 Received: from mx2.suse.de ([195.135.220.15]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l81Xn-0003rv-Mg; Fri, 05 Feb 2021 13:53:13 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 962E7AF11; Fri, 5 Feb 2021 13:53:06 +0000 (UTC) From: Nicolas Saenz Julienne To: f.fainelli@gmail.com, Saenz Julienne , bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC/PATCH 11/11] arm64: config: Enable DRM_V3D Date: Fri, 5 Feb 2021 14:52:47 +0100 Message-Id: <20210205135249.2924-12-nsaenzjulienne@suse.de> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210205135249.2924-1-nsaenzjulienne@suse.de> References: <20210205135249.2924-1-nsaenzjulienne@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210205_085307_995792_FB0BBECB X-CRM114-Status: GOOD ( 11.71 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Catalin Marinas , Will Deacon , phil@raspberrypi.com, wahrenst@gmx.net Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org BCM2711, the SoC used on the Raspberry Pi 4 has a different GPU than its predecessors. Enable it. Signed-off-by: Nicolas Saenz Julienne --- arch/arm64/configs/defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig index 5348c0be2fcf..bc31b07c4c63 100644 --- a/arch/arm64/configs/defconfig +++ b/arch/arm64/configs/defconfig @@ -698,6 +698,7 @@ CONFIG_DRM_I2C_ADV7511_AUDIO=y CONFIG_DRM_DW_HDMI_AHB_AUDIO=m CONFIG_DRM_DW_HDMI_CEC=m CONFIG_DRM_IMX_DCSS=m +CONFIG_DRM_V3D=m CONFIG_DRM_VC4=m CONFIG_DRM_ETNAVIV=m CONFIG_DRM_HISI_HIBMC=m