From: Nicolas Saenz Julienne <hidden> Date: 2021-02-09 13:01:40
This series attempts to enable V3D on BCM2711, the SoC available on the
Raspberry Pi 4 family of boards.
Due to the lack of documentation some things are taken as it from
testing/downstream implementation[1], which I'm hilighting here:
- It's not clear that the following is 100% true, maybe someone can confirm:
"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."
- Patch #10 I took as is from the downstream implementation, I can't really
provide an exact explanation on what changed HW wise.
Ultimately, I need confirmation from the Broadcom folks that they are alright
with patch #12 (deleting pm ops in V3D).
With all this, I get a more or less stable experience using mesa 20.3.4 and
X11/Gnome.
Regards,
Nicolas
---
Changes since v1:
- Use 'reg-names'
- Correct ASB names
- Add missing binding patch for V3D
- Address Stefan's comments
Nicolas Saenz Julienne (16):
dt-bindings: soc: bcm: bcm2835-pm: Convert bindings to DT schema
dt-bindings: soc: bcm: bcm2835-pm: Introduce reg-names
dt-bindings: soc: bcm: bcm2835-pm: Add support for bcm2711
ARM: dts: bcm2835/bcm2711: Introduce reg-names in watchdog node
ARM: dts: bcm2711: Use proper compatible in PM/Watchdog node
mfd: bcm2835-pm: Rename asb to rpivid_asb
mfd: bcm2835-pm: Use 'reg-names' to get resources
mfd: bcm2835-pm: Add support for BCM2711
soc: bcm: bcm2835-power: Add support for BCM2711's Argon ASB
soc: bcm: bcm2835-power: Bypass power_on/off() calls
dt-bindings: gpu: v3d: Add BCM2711's compatible
drm/v3d: Get rid of pm code
drm/v3d: Add support for bcm2711
ARM: dts: bcm2711: Enable V3D
ARM: configs: Enable DRM_V3D
arm64: config: Enable DRM_V3D
.../devicetree/bindings/gpu/brcm,bcm-v3d.yaml | 1 +
.../bindings/soc/bcm/brcm,bcm2835-pm.txt | 46 ----------
.../bindings/soc/bcm/brcm,bcm2835-pm.yaml | 88 +++++++++++++++++++
arch/arm/boot/dts/bcm2711.dtsi | 15 +++-
arch/arm/boot/dts/bcm2835-common.dtsi | 1 +
arch/arm/configs/multi_v7_defconfig | 1 +
arch/arm64/configs/defconfig | 1 +
drivers/gpu/drm/v3d/Kconfig | 2 +-
drivers/gpu/drm/v3d/v3d_debugfs.c | 18 +---
drivers/gpu/drm/v3d/v3d_drv.c | 12 +--
drivers/gpu/drm/v3d/v3d_gem.c | 9 --
drivers/mfd/bcm2835-pm.c | 83 ++++++++++++-----
drivers/soc/bcm/bcm2835-power.c | 82 +++++++++++------
include/linux/mfd/bcm2835-pm.h | 3 +-
14 files changed, 225 insertions(+), 137 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
--
2.30.0
From: Nicolas Saenz Julienne <hidden> Date: 2021-02-09 13:01:41
Anticipating the introduction of BCM2711, of which we'll need to support
its new Argon 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 <redacted>
---
.../devicetree/bindings/soc/bcm/brcm,bcm2835-pm.yaml | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
@@ -26,8 +26,13 @@ properties:reg:minItems:1maxItems:2-description:Specifies base physical address and size of the two register-ranges, "PM" and "ASYNC_BRIDGE" in that order.++reg-names:+minItems:1+maxItems:2+items:+-const:pm+-const:rpivid_asb"#power-domain-cells":const:1
@@ -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;-};
@@ -0,0 +1,79 @@+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause+%YAML1.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 <nsaenzjulienne@suse.de>++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 <dt-bindings/clock/bcm2835.h>++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: Nicolas Saenz Julienne <hidden> Date: 2021-02-09 13:02:21
Add a new compatible string for BCM2711 and the option to provide a
third reg property for the board's new Argon ASB.
In BCM2711 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 <redacted>
---
.../devicetree/bindings/soc/bcm/brcm,bcm2835-pm.yaml | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
From: Nicolas Saenz Julienne <hidden> Date: 2021-02-09 13:03:11
A new compatible string was introduced specifically for BCM2711, so make
use of it.
Signed-off-by: Nicolas Saenz Julienne <redacted>
---
arch/arm/boot/dts/bcm2711.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Nicolas Saenz Julienne <hidden> Date: 2021-02-09 13:05:32
BCM2711, Raspberry Pi 4's SoC, contains a V3D core. So add its specific
compatible to the bindings.
Signed-off-by: Nicolas Saenz Julienne <redacted>
---
Documentation/devicetree/bindings/gpu/brcm,bcm-v3d.yaml | 1 +
1 file changed, 1 insertion(+)
From: Nicolas Saenz Julienne <hidden> Date: 2021-02-09 13:05:55
This enables V3D for bcm2711 (used in the Raspberry Pi 4).
Signed-off-by: Nicolas Saenz Julienne <redacted>
---
Changes since v1:
- Correct node's name address
arch/arm/boot/dts/bcm2711.dtsi | 12 ++++++++++++
1 file changed, 12 insertions(+)
@@ -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;-};
@@ -0,0 +1,79 @@+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause+%YAML1.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 <nsaenzjulienne@suse.de>++allOf:+-$ref:../../watchdog/watchdog.yaml#++properties:+compatible:+items:+-enum:+-brcm,bcm2835-pm+-const:brcm,bcm2835-pm-wdt
Odd...
+
+ reg:
+ minItems: 1
+ maxItems: 2
+ description: Specifies base physical address and size of the two register
+ ranges, "PM" and "ASYNC_BRIDGE" in that order.
The number, what they are and order are captured with:
items:
- description: PM registers
- description: ASYNC_BRIDGE registers
'Specifies base physical address and size' is every 'reg'.
From: Rob Herring <robh@kernel.org> Date: 2021-02-10 22:45:16
On Tue, Feb 09, 2021 at 01:58:58PM +0100, Nicolas Saenz Julienne wrote:
quoted hunk
Anticipating the introduction of BCM2711, of which we'll need to support
its new Argon 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 <redacted>
---
.../devicetree/bindings/soc/bcm/brcm,bcm2835-pm.yaml | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
@@ -26,8 +26,13 @@ properties:reg:minItems:1maxItems:2-description:Specifies base physical address and size of the two register-ranges, "PM" and "ASYNC_BRIDGE" in that order.
Ah, it's okay this way if you have -names. Or have items to give a bit
more detail.
From: Rob Herring <robh@kernel.org> Date: 2021-02-10 22:45:35
On Tue, 09 Feb 2021 13:58:59 +0100, Nicolas Saenz Julienne wrote:
Add a new compatible string for BCM2711 and the option to provide a
third reg property for the board's new Argon ASB.
In BCM2711 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 <redacted>
---
.../devicetree/bindings/soc/bcm/brcm,bcm2835-pm.yaml | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
From: Rob Herring <robh@kernel.org> Date: 2021-02-10 22:46:04
On Tue, 09 Feb 2021 13:59:07 +0100, Nicolas Saenz Julienne wrote:
BCM2711, Raspberry Pi 4's SoC, contains a V3D core. So add its specific
compatible to the bindings.
Signed-off-by: Nicolas Saenz Julienne <redacted>
---
Documentation/devicetree/bindings/gpu/brcm,bcm-v3d.yaml | 1 +
1 file changed, 1 insertion(+)