Device tree support for Imagination Series5 GPU
Subsystems (9)
v2 cover Device tree support for Imagination Series5 GPU
Hello all,
I know this has been tried before[0], but given the recent upstreaming of the Series6+ GPU bindings I figured it might be time to give the Series5 bindings another try.
While there is currently no mainline driver for these binding, there is an open source out-of-tree kernel-side driver available[1]. Having a stable and upstream binding for these devices allows us to describe this hardware in device tree.
This is my vision for how these bindings should look, along with some example uses in several SoC DT files. The compatible names have been updated to match what was decided on for Series6+, but otherwise most is the same as we have been using in our vendor tree for many years.
Thanks,
Andrew
Based on next-20240108.
[0]: https://lkml.org/lkml/2020/4/24/1222
[1]: https://github.com/openpvrsgx-devgroup
Changes for RFC v2:
- Added patch to rename Rogue+ binding to img,powervr-rogue.yaml
- Locked all property item counts
- Removed nodename pattern check
Andrew Davis (11):
dt-bindings: gpu: Rename img,powervr to img,powervr-rogue
dt-bindings: gpu: Add PowerVR Series5 SGX GPUs
ARM: dts: omap3: Add device tree entry for SGX GPU
ARM: dts: omap4: Add device tree entry for SGX GPU
ARM: dts: omap5: Add device tree entry for SGX GPU
ARM: dts: AM33xx: Add device tree entry for SGX GPU
ARM: dts: AM437x: Add device tree entry for SGX GPU
ARM: dts: DRA7xx: Add device tree entry for SGX GPU
arm64: dts: ti: k3-am654-main: Add device tree entry for SGX GPU
ARM: dts: sun6i: Add device tree entry for SGX GPU
MIPS: DTS: jz4780: Add device tree entry for SGX GPU
...mg,powervr.yaml => img,powervr-rogue.yaml} | 4 +-
.../bindings/gpu/img,powervr-sgx.yaml | 124 ++++++++++++++++++
MAINTAINERS | 3 +-
arch/arm/boot/dts/allwinner/sun6i-a31.dtsi | 9 ++
arch/arm/boot/dts/ti/omap/am33xx.dtsi | 9 +-
arch/arm/boot/dts/ti/omap/am3517.dtsi | 11 +-
arch/arm/boot/dts/ti/omap/am4372.dtsi | 6 +
arch/arm/boot/dts/ti/omap/dra7.dtsi | 9 +-
arch/arm/boot/dts/ti/omap/omap34xx.dtsi | 11 +-
arch/arm/boot/dts/ti/omap/omap36xx.dtsi | 9 +-
arch/arm/boot/dts/ti/omap/omap4.dtsi | 9 +-
arch/arm/boot/dts/ti/omap/omap5.dtsi | 9 +-
arch/arm64/boot/dts/ti/k3-am65-main.dtsi | 7 +
arch/mips/boot/dts/ingenic/jz4780.dtsi | 11 ++
14 files changed, 201 insertions(+), 30 deletions(-)
rename Documentation/devicetree/bindings/gpu/{img,powervr.yaml => img,powervr-rogue.yaml} (91%)
create mode 100644 Documentation/devicetree/bindings/gpu/img,powervr-sgx.yamlSignature · 1 line
2.39.2
RFC PATCH v2 1/11 dt-bindings: gpu: Rename img,powervr to img,powervr-rogue
---
.../bindings/gpu/{img,powervr.yaml => img,powervr-rogue.yaml} | 4 ++--
MAINTAINERS | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
rename Documentation/devicetree/bindings/gpu/{img,powervr.yaml => img,powervr-rogue.yaml} (91%)Documentation/devicetree/bindings/gpu/img,powervr-rogue.yaml renamed from Documentation/devicetree/bindings/gpu/img,powervr.yaml +2 -2
@@ -2,10 +2,10 @@ # Copyright (c) 2023 Imagination Technologies Ltd. %YAML 1.2 --- -$id: http://devicetree.org/schemas/gpu/img,powervr.yaml# +$id: http://devicetree.org/schemas/gpu/img,powervr-rogue.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# -title: Imagination Technologies PowerVR and IMG GPU +title: Imagination Technologies PowerVR Rogue and IMG GPUs maintainers: - Frank Binns <[email protected]>
MAINTAINERS +1 -1
@@ -10461,7 +10461,7 @@ M: Donald Robson <[email protected]> M: Matt Coster <[email protected]> S: Supported T: git git://anongit.freedesktop.org/drm/drm-misc -F: Documentation/devicetree/bindings/gpu/img,powervr.yaml +F: Documentation/devicetree/bindings/gpu/img,powervr-rogue.yaml F: Documentation/gpu/imagination/ F: drivers/gpu/drm/imagination/ F: include/uapi/drm/pvr_drm.h
Signature · 1 line
2.39.2
Re: [PATCH RFC v2 01/11] dt-bindings: gpu: Rename img, powervr to img, powervr-rogue
Andrew Davis <[email protected]> writes:
Hello Andrew,
Quoted 2 lines
Signed-off-by Andrew Davis <[email protected]>---
I think this deserves a commit message with the rationale for the rename.
Because kept an eye to the previous version, I know the reason and agree with the change. Also, if remember correctly this was suggested by Maxime?
After a adding a commit message and Suggested-by tag:
Signature · 5 lines
Best regards, Javier Martinez Canillas Core Platforms Red Hat
Re: [PATCH RFC v2 01/11] dt-bindings: gpu: Rename img,powervr to img,powervr-rogue
In reply to Andrew DavisHi Andrew,
Quoted 15 lines · Andrew Davis
Signed-off-by Andrew Davis <[email protected]>--- .../bindings/gpu/{img,powervr.yaml => img,powervr-rogue.yaml} | 4 ++-- MAINTAINERS | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) rename Documentation/devicetree/bindings/gpu/{img,powervr.yaml => img,powervr-rogue.yaml} (91%)Documentation/devicetree/bindings/gpu/img,powervr-rogue.yaml renamed from Documentation/devicetree/bindings/gpu/img,powervr.yaml +0
-0
Documentation/devicetree/bindings/gpu/img,powervr-rogue.yaml line 8
Quoted 9 lines
Documentation/devicetree/bindings/gpu/img,powervr-rogue.yaml renamed from Documentation/devicetree/bindings/gpu/img,powervr.yaml +2
-2@@ -2,10 +2,10 @@ # Copyright (c) 2023 Imagination Technologies Ltd. %YAML 1.2 --- -$id: http://devicetree.org/schemas/gpu/img,powervr.yaml# +$id: http://devicetree.org/schemas/gpu/img,powervr-rogue.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# -title: Imagination Technologies PowerVR and IMG GPU +title: Imagination Technologies PowerVR Rogue and IMG GPUs
All the GPUs that will appear in this file will be Rogues, so for me it would be more natural for 'Rogue' to come after 'IMG'. Can you change the title to:
Imagination Technologies PowerVR and IMG Rogue GPUs With that changed and Javier's suggestions addressed:
Quoted 16 lines
Documentation/devicetree/bindings/gpu/img,powervr-rogue.yaml renamed from Documentation/devicetree/bindings/gpu/img,powervr.yaml +0
-0maintainers: - Frank Binns <[email protected]>MAINTAINERS +1
-1@@ -10461,7 +10461,7 @@ M: Donald Robson <[email protected]> M: Matt Coster <[email protected]> S: Supported T: git git://anongit.freedesktop.org/drm/drm-misc -F: Documentation/devicetree/bindings/gpu/img,powervr.yaml +F: Documentation/devicetree/bindings/gpu/img,powervr-rogue.yaml F: Documentation/gpu/imagination/ F: drivers/gpu/drm/imagination/ F: include/uapi/drm/pvr_drm.h
Re: [PATCH RFC v2 01/11] dt-bindings: gpu: Rename img,powervr to img,powervr-rogue
In reply to Andrew DavisQuoted 5 lines · Andrew Davis
Signed-off-by Andrew Davis <[email protected]>--- .../bindings/gpu/{img,powervr.yaml => img,powervr-rogue.yaml} | 4 ++-- MAINTAINERS | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
If you are renaming it, why not renaming to match compatible as we usually expect?
Best regards,
Krzysztof
Re: [PATCH RFC v2 01/11] dt-bindings: gpu: Rename img,powervr to img,powervr-rogue
Quoted 10 lines · Krzysztof Kozlowski
Quoted 5 lines · Andrew Davis
Signed-off-by Andrew Davis <[email protected]>--- .../bindings/gpu/{img,powervr.yaml => img,powervr-rogue.yaml} | 4 ++-- MAINTAINERS | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)If you are renaming it, why not renaming to match compatible as we usually expect?
There are (or will be) multiple compatible strings described in this file, naming the file after just one would not fully convey the content of the file. This generic style naming seems common already for bindings with multiple compatibles.
Andrew
Quoted 3 lines
Best regards,
Krzysztof
Re: [PATCH RFC v2 01/11] dt-bindings: gpu: Rename img,powervr to img,powervr-rogue
Quoted 8 lines · Andrew Davis
Quoted 7 lines · Krzysztof Kozlowski
Quoted 5 lines · Andrew Davis
Signed-off-by Andrew Davis <[email protected]>--- .../bindings/gpu/{img,powervr.yaml => img,powervr-rogue.yaml} | 4 ++-- MAINTAINERS | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
Quoted 8 lines
Quoted 3 lines
If you are renaming it, why not renaming to match compatible as we usually expect?
There are (or will be) multiple compatible strings described in this file, naming the file after just one would not fully convey the content of the file. This generic style naming seems common already for bindings with multiple compatibles.
I saw only one compatible used as fallback. Where are more?
Best regards,
Krzysztof
RFC PATCH v2 2/11 dt-bindings: gpu: Add PowerVR Series5 SGX GPUs
In reply to Andrew DavisThe Imagination PowerVR Series5 "SGX" GPU is part of several SoCs from multiple vendors. Describe how the SGX GPU is integrated in these SoC, including register space and interrupts. Clocks, reset, and power domain information is SoC specific.
--- .../bindings/gpu/img,powervr-sgx.yaml | 124 ++++++++++++++++++ MAINTAINERS | 1 + 2 files changed, 125 insertions(+) create mode 100644 Documentation/devicetree/bindings/gpu/img,powervr-sgx.yaml
Documentation/devicetree/bindings/gpu/img,powervr-sgx.yaml new file +124 -0
@@ -0,0 +1,124 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +# Copyright (c) 2023 Imagination Technologies Ltd. +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/gpu/img,powervr-sgx.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Imagination Technologies PowerVR SGX GPUs + +maintainers: + - Frank Binns <[email protected]> + +properties: + compatible: + oneOf: + - items: + - enum: + - ti,omap3430-gpu # Rev 121 + - ti,omap3630-gpu # Rev 125 + - const: img,powervr-sgx530 + - items: + - enum: + - ingenic,jz4780-gpu # Rev 130 + - ti,omap4430-gpu # Rev 120 + - const: img,powervr-sgx540 + - items: + - enum: + - allwinner,sun6i-a31-gpu # MP2 Rev 115 + - ti,omap4470-gpu # MP1 Rev 112 + - ti,omap5432-gpu # MP2 Rev 105 + - ti,am5728-gpu # MP2 Rev 116 + - ti,am6548-gpu # MP1 Rev 117 + - const: img,powervr-sgx544 + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: true + + clock-names: + minItems: 1 + items: + - const: core + - const: mem + - const: sys + + power-domains: + maxItems: 1 + +required: + - compatible + - reg + - interrupts + +additionalProperties: false + +allOf: + - if: + properties: + compatible: + contains: + const: ti,am6548-gpu + then: + required: + - power-domains + else: + properties: + power-domains: false + - if: + properties: + compatible: + contains: + enum: + - allwinner,sun6i-a31-gpu + - ingenic,jz4780-gpu + then: + allOf: + - if: + properties: + compatible: + contains: + const: allwinner,sun6i-a31-gpu + then: + properties: + clocks: + minItems: 2 + maxItems: 2 + clock-names: + minItems: 2 + maxItems: 2 + - if: + properties: + compatible: + contains: + const: ingenic,jz4780-gpu + then: + properties: + clocks: + maxItems: 1 + clock-names: + maxItems: 1 + required: + - clocks + - clock-names + else: + properties: + clocks: false + clock-names: false + +examples: + - | + #include <dt-bindings/interrupt-controller/irq.h> + #include <dt-bindings/interrupt-controller/arm-gic.h> + #include <dt-bindings/soc/ti,sci_pm_domain.h> + + gpu@7000000 { + compatible = "ti,am6548-gpu", "img,powervr-sgx544"; + reg = <0x7000000 0x10000>; + interrupts = <GIC_SPI 162 IRQ_TYPE_LEVEL_HIGH>; + power-domains = <&k3_pds 65 TI_SCI_PD_EXCLUSIVE>; + };
MAINTAINERS +1 -0
@@ -10462,6 +10462,7 @@ M: Matt Coster <[email protected]> S: Supported T: git git://anongit.freedesktop.org/drm/drm-misc F: Documentation/devicetree/bindings/gpu/img,powervr-rogue.yaml +F: Documentation/devicetree/bindings/gpu/img,powervr-sgx.yaml F: Documentation/gpu/imagination/ F: drivers/gpu/drm/imagination/ F: include/uapi/drm/pvr_drm.h
Signature · 1 line
2.39.2
Re: [PATCH RFC v2 02/11] dt-bindings: gpu: Add PowerVR Series5 SGX GPUs
Quoted 18 lines · Andrew Davis
The Imagination PowerVR Series5 "SGX" GPU is part of several SoCs from multiple vendors. Describe how the SGX GPU is integrated in these SoC, including register space and interrupts. Clocks, reset, and power domain information is SoC specific.
Signed-off-by Andrew Davis <[email protected]>--- .../bindings/gpu/img,powervr-sgx.yaml | 124 ++++++++++++++++++ MAINTAINERS | 1 + 2 files changed, 125 insertions(+) create mode 100644 Documentation/devicetree/bindings/gpu/img,powervr-sgx.yamlDocumentation/devicetree/bindings/gpu/img,powervr-sgx.yaml new file +0
-0
Documentation/devicetree/bindings/gpu/img,powervr-sgx.yaml line 2
Quoted 2 lines
Documentation/devicetree/bindings/gpu/img,powervr-sgx.yaml new file +2
-0@@ -0,0 +1,124 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +# Copyright (c) 2023 Imagination Technologies Ltd.
Your email has @TI domain, are you sure you attribute your copyrights to Imagination?
...
Documentation/devicetree/bindings/gpu/img,powervr-sgx.yaml line 41
Quoted 8 lines
Documentation/devicetree/bindings/gpu/img,powervr-sgx.yaml new file +8
-0+ + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: true
Missing min/maxItems
Quoted 7 lines
Documentation/devicetree/bindings/gpu/img,powervr-sgx.yaml new file +7
-0+ + clock-names: + minItems: 1 + items: + - const: core + - const: mem + - const: sys
Documentation/devicetree/bindings/gpu/img,powervr-sgx.yaml line 58
Quoted 10 lines
Documentation/devicetree/bindings/gpu/img,powervr-sgx.yaml new file +10
-0+ + power-domains: + maxItems: 1 + +required: + - compatible + - reg + - interrupts + +additionalProperties: false
This goes after allOf: block.
Quoted 13 lines
Documentation/devicetree/bindings/gpu/img,powervr-sgx.yaml new file +13
-0+ +allOf: + - if: + properties: + compatible: + contains: + const: ti,am6548-gpu + then: + required: + - power-domains + else: + properties: + power-domains: false
Documentation/devicetree/bindings/gpu/img,powervr-sgx.yaml line 81
Quoted 10 lines
Documentation/devicetree/bindings/gpu/img,powervr-sgx.yaml new file +10
-0+ - if: + properties: + compatible: + contains: + enum: + - allwinner,sun6i-a31-gpu + - ingenic,jz4780-gpu + then: + allOf: + - if:
I don't understand why do you need to embed allOf inside another allOf. The upper (outer) if:then: looks entirely useless.
Documentation/devicetree/bindings/gpu/img,powervr-sgx.yaml line 93
Quoted 12 lines
Documentation/devicetree/bindings/gpu/img,powervr-sgx.yaml new file +12
-0+ properties: + compatible: + contains: + const: allwinner,sun6i-a31-gpu + then: + properties: + clocks: + minItems: 2 + maxItems: 2 + clock-names: + minItems: 2 + maxItems: 2
Best regards,
Krzysztof
Re: [PATCH RFC v2 02/11] dt-bindings: gpu: Add PowerVR Series5 SGX GPUs
Quoted 13 lines · Krzysztof Kozlowski
Quoted 12 lines · Andrew Davis
The Imagination PowerVR Series5 "SGX" GPU is part of several SoCs from multiple vendors. Describe how the SGX GPU is integrated in these SoC, including register space and interrupts. Clocks, reset, and power domain information is SoC specific.
Signed-off-by Andrew Davis <[email protected]>--- .../bindings/gpu/img,powervr-sgx.yaml | 124 ++++++++++++++++++ MAINTAINERS | 1 + 2 files changed, 125 insertions(+)create mode 100644
Documentation/devicetree/bindings/gpu/img,powervr-sgx.yaml
Quoted 12 lines
Documentation/devicetree/bindings/gpu/img,powervr-sgx.yaml line 2
Quoted 8 lines
Documentation/devicetree/bindings/gpu/img,powervr-sgx.yaml new file +2
-0@@ -0,0 +1,124 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +# Copyright (c) 2023 Imagination Technologies Ltd.Your email has @TI domain, are you sure you attribute your copyrights to Imagination?
The file started as a copy/paste from a IMG copyrighted file, even though it is now almost completely re-written I've left their (c) for good measure. I'll add an additional TI (c).
Quoted 13 lines
...
Documentation/devicetree/bindings/gpu/img,powervr-sgx.yaml line 41
Quoted 8 lines
Documentation/devicetree/bindings/gpu/img,powervr-sgx.yaml new file +8
-0+ + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: trueMissing min/maxItems
These are set in the allOf/if/then blocks below, seems if I don't set them to at least something here then I get a warning:
'clock-names', 'clocks' do not match any of the regexes: 'pinctrl-[0-9]+'
even if I define them in the allOf block below. I don't know what the min/max should be until I check the compatible in the allOf block.
Quoted 11 lines
Quoted 11 lines
Documentation/devicetree/bindings/gpu/img,powervr-sgx.yaml new file +11
-0+ + clock-names: + minItems: 1 + items: + - const: core + - const: mem + - const: sys + + power-domains: + maxItems: 1 +
Quoted 9 lines
Documentation/devicetree/bindings/gpu/img,powervr-sgx.yaml line 58
Quoted 6 lines
Documentation/devicetree/bindings/gpu/img,powervr-sgx.yaml new file +6
-0+required: + - compatible + - reg + - interrupts + +additionalProperties: falseThis goes after allOf: block.
ACK
Quoted 18 lines
Quoted 18 lines
Documentation/devicetree/bindings/gpu/img,powervr-sgx.yaml new file +18
-0+ +allOf: + - if: + properties: + compatible: + contains: + const: ti,am6548-gpu + then: + required: + - power-domains + else: + properties: + power-domains: false + - if: + properties: + compatible: + contains: + enum:
Quoted 9 lines
Documentation/devicetree/bindings/gpu/img,powervr-sgx.yaml line 81
Quoted 5 lines
Documentation/devicetree/bindings/gpu/img,powervr-sgx.yaml new file +5
-0+ - allwinner,sun6i-a31-gpu + - ingenic,jz4780-gpu + then: + allOf: + - if:I don't understand why do you need to embed allOf inside another allOf. The upper (outer) if:then: looks entirely useless.
It is so that both compatibles falls through to having clock being required.
Logic in YAML always seems messy to me, here it is in pseudo C:
if (compatible == allwinner,sun6i-a31-gpu ||
compatible == ingenic,jz4780-gpu) {
if (compatible == allwinner,sun6i-a31-gpu)
clocks: ...
if (compatible == ingenic,jz4780-gpu)
clocks: ...
required:
- clocks
- clock-names
} else { /* disallow for all others */ properties:
clocks: false
clock-names: false
}
Now if I had an "else if" that didn't force the indention to keep growing I would have used that. (does one exist?) I also cannot simply add the clock properties only for the two compats need them for the reasons above and so must add them unconditionally before then explicitly disable them in a catch-all else path.
Andrew
Quoted 17 lines
Documentation/devicetree/bindings/gpu/img,powervr-sgx.yaml line 93
Quoted 12 lines
Documentation/devicetree/bindings/gpu/img,powervr-sgx.yaml new file +12
-0+ properties: + compatible: + contains: + const: allwinner,sun6i-a31-gpu + then: + properties: + clocks: + minItems: 2 + maxItems: 2 + clock-names: + minItems: 2 + maxItems: 2Best regards,
Krzysztof
Re: [PATCH RFC v2 02/11] dt-bindings: gpu: Add PowerVR Series5 SGX GPUs
Quoted 45 lines · Andrew Davis
Quoted 13 lines · Krzysztof Kozlowski
Quoted 12 lines · Andrew Davis
The Imagination PowerVR Series5 "SGX" GPU is part of several SoCs from multiple vendors. Describe how the SGX GPU is integrated in these SoC, including register space and interrupts. Clocks, reset, and power domain information is SoC specific.
Signed-off-by Andrew Davis <[email protected]>--- .../bindings/gpu/img,powervr-sgx.yaml | 124 ++++++++++++++++++ MAINTAINERS | 1 + 2 files changed, 125 insertions(+)create mode 100644
Documentation/devicetree/bindings/gpu/img,powervr-sgx.yamlQuoted 12 lines
Documentation/devicetree/bindings/gpu/img,powervr-sgx.yaml line 2
Quoted 8 lines
Documentation/devicetree/bindings/gpu/img,powervr-sgx.yaml new file +2
-0@@ -0,0 +1,124 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +# Copyright (c) 2023 Imagination Technologies Ltd.Your email has @TI domain, are you sure you attribute your copyrights to Imagination?
The file started as a copy/paste from a IMG copyrighted file, even though it is now almost completely re-written I've left their (c) for good measure. I'll add an additional TI (c).
Quoted 13 lines
...
Documentation/devicetree/bindings/gpu/img,powervr-sgx.yaml line 41
Quoted 8 lines
Documentation/devicetree/bindings/gpu/img,powervr-sgx.yaml new file +8
-0+ + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: trueMissing min/maxItems
Quoted 1 line
These are set in the allOf/if/then blocks below, seems
I know, but we expect them here.
Quoted 8 lines
if I don't set them to at least something here then I get a warning:
'clock-names', 'clocks' do not match any of the regexes: 'pinctrl-[0-9]+'
even if I define them in the allOf block below. I don't know what the min/max should be until I check the compatible in the allOf block.
As always: the widest constraints.
...
Quoted 12 lines
Logic in YAML always seems messy to me, here it is in pseudo C:
if (compatible == allwinner,sun6i-a31-gpu ||
compatible == ingenic,jz4780-gpu) { if (compatible == allwinner,sun6i-a31-gpu) clocks: ... if (compatible == ingenic,jz4780-gpu) clocks: ... required: - clocks - clock-names } else { /* disallow for all others */
Quoted 4 lines
properties:
clocks: false
clock-names: false
}
OK, I see, that's the limitation of YAML. The point is that this code is not readable, so just list all fallbacks or variants.
Best regards,
Krzysztof
RFC PATCH v2 3/11 ARM: dts: omap3: Add device tree entry for SGX GPU
In reply to Andrew DavisAdd SGX GPU device entries to base OMAP3 dtsi files.
--- arch/arm/boot/dts/ti/omap/am3517.dtsi | 11 ++++++----- arch/arm/boot/dts/ti/omap/omap34xx.dtsi | 11 ++++++----- arch/arm/boot/dts/ti/omap/omap36xx.dtsi | 9 +++++---- 3 files changed, 17 insertions(+), 14 deletions(-)
arch/arm/boot/dts/ti/omap/am3517.dtsi +6 -5
@@ -162,12 +162,13 @@ sgx_module: target-module@50000000 { clock-names = "fck", "ick"; #address-cells = <1>; #size-cells = <1>; - ranges = <0 0x50000000 0x4000>; + ranges = <0 0x50000000 0x10000>; - /* - * Closed source PowerVR driver, no child device - * binding or driver in mainline - */ + gpu@0 { + compatible = "ti,omap3430-gpu", "img,powervr-sgx530"; + reg = <0x0 0x10000>; /* 64kB */ + interrupts = <21>; + }; }; }; };
arch/arm/boot/dts/ti/omap/omap34xx.dtsi +6 -5
@@ -164,12 +164,13 @@ sgx_module: target-module@50000000 { clock-names = "fck", "ick"; #address-cells = <1>; #size-cells = <1>; - ranges = <0 0x50000000 0x4000>; + ranges = <0 0x50000000 0x10000>; - /* - * Closed source PowerVR driver, no child device - * binding or driver in mainline - */ + gpu@0 { + compatible = "ti,omap3430-gpu", "img,powervr-sgx530"; + reg = <0x0 0x10000>; /* 64kB */ + interrupts = <21>; + }; }; };
arch/arm/boot/dts/ti/omap/omap36xx.dtsi +5 -4
@@ -211,10 +211,11 @@ sgx_module: target-module@50000000 { #size-cells = <1>; ranges = <0 0x50000000 0x2000000>; - /* - * Closed source PowerVR driver, no child device - * binding or driver in mainline - */ + gpu@0 { + compatible = "ti,omap3630-gpu", "img,powervr-sgx530"; + reg = <0x0 0x2000000>; /* 32MB */ + interrupts = <21>; + }; }; };
Signature · 1 line
2.39.2
Re: [PATCH RFC v2 03/11] ARM: dts: omap3: Add device tree entry for SGX GPU
Quoted 4 lines · Andrew Davis
Add SGX GPU device entries to base OMAP3 dtsi files.
Signed-off-by Andrew Davis <[email protected]>---
Signature · 5 lines
Best regards, Javier Martinez Canillas Core Platforms Red Hat
RFC PATCH v2 4/11 ARM: dts: omap4: Add device tree entry for SGX GPU
In reply to Andrew DavisAdd SGX GPU device entry to base OMAP4 dtsi file.
--- arch/arm/boot/dts/ti/omap/omap4.dtsi | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
arch/arm/boot/dts/ti/omap/omap4.dtsi +5 -4
@@ -501,10 +501,11 @@ sgx_module: target-module@56000000 { #size-cells = <1>; ranges = <0 0x56000000 0x2000000>; - /* - * Closed source PowerVR driver, no child device - * binding or driver in mainline - */ + gpu@0 { + compatible = "ti,omap4430-gpu", "img,powervr-sgx540"; + reg = <0x0 0x2000000>; /* 32MB */ + interrupts = <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>; + }; }; /*
Signature · 1 line
2.39.2
Re: [PATCH RFC v2 04/11] ARM: dts: omap4: Add device tree entry for SGX GPU
Quoted 4 lines · Andrew Davis
Add SGX GPU device entry to base OMAP4 dtsi file.
Signed-off-by Andrew Davis <[email protected]>---
Signature · 5 lines
Best regards, Javier Martinez Canillas Core Platforms Red Hat
Re: [PATCH RFC v2 04/11] ARM: dts: omap4: Add device tree entry for SGX GPU
In reply to Andrew DavisHi,
I just comment on this example, but it applies almost the same for all other .dtsi changes.
Quoted 14 lines
Am 08.01.2024 um 19:32 schrieb Andrew Davis <[email protected]>:
Add SGX GPU device entry to base OMAP4 dtsi file.
Signed-off-by Andrew Davis <[email protected]>---
arch/arm/boot/dts/ti/omap/omap4.dtsi| 9 +++++----1 file changed, 5 insertions(+), 4 deletions(-)arch/arm/boot/dts/ti/omap/omap4.dtsi +0
-0
arch/arm/boot/dts/ti/omap/omap4.dtsi sgx_module: target-module@56000000 { · line 504
Quoted 8 lines
arch/arm/boot/dts/ti/omap/omap4.dtsi +1
-4@@ -501,10 +501,11 @@ sgx_module: target-module@56000000 { #size-cells = <1>; ranges = <0 0x56000000 0x2000000>; - /* - * Closed source PowerVR driver, no child device - * binding or driver in mainline - */ + gpu@0 {
I wonder why we don't add a "gpu:" label here.
Almost all other subsystem nodes have one (e.g. emif:, aes:, dss:, dsi:, hdmi:, etc.), obviously for convenience when using a .dtsi file.
It would allow a board-specific DTS to easily add status = "disabled" to avoid driver probing or disabling the GPU (e.g. if there is no display).
arch/arm/boot/dts/ti/omap/omap4.dtsi sgx_module: target-module@56000000 { · line 505
Quoted 1 line
arch/arm/boot/dts/ti/omap/omap4.dtsi +1
-0+ compatible = "ti,omap4430-gpu", "img,powervr-sgx540";
It still appears to me that the "img,powervr-sgx540" (or similar) entry is redundant information.
I have experimentally updated our openpvrsgx driver and we do not have any use for this information (at least in the kernel driver):
https://github.com/goldelico/letux-kernel/commit/f2f7cb3b858ef255f52f2b82a8bb34c047337afe
It shows how easy it is to derive the sgx version and revision number if we ever need it inside the driver.
So if you want to keep a reference to powervr, it would suffice to have
arch/arm/boot/dts/ti/omap/omap4.dtsi sgx_module: target-module@56000000 { · line 506
Quoted 1 line
arch/arm/boot/dts/ti/omap/omap4.dtsi +1
-0+ compatible = "ti,omap4430-gpu", "img,powervr-sgx";
Otherwise your device tree entries compile fine and seem to work (at least in a cursory test on PandaBoard ES).
arch/arm/boot/dts/ti/omap/omap4.dtsi sgx_module: target-module@56000000 { · line 509
Quoted 4 lines
arch/arm/boot/dts/ti/omap/omap4.dtsi +3
-0+ reg = <0x0 0x2000000>; /* 32MB */ + interrupts = <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>; + }; };
BR and thanks,
Nikolaus
Maxime Ripard
maintainerRe: Re: [PATCH RFC v2 04/11] ARM: dts: omap4: Add device tree entry for SGX GPU
Hi,
Quoted 25 lines · H. Nikolaus Schaller
Quoted 14 lines
Am 08.01.2024 um 19:32 schrieb Andrew Davis <[email protected]>:
Add SGX GPU device entry to base OMAP4 dtsi file.
Signed-off-by Andrew Davis <[email protected]>---
arch/arm/boot/dts/ti/omap/omap4.dtsi| 9 +++++----1 file changed, 5 insertions(+), 4 deletions(-)arch/arm/boot/dts/ti/omap/omap4.dtsi +0
-0arch/arm/boot/dts/ti/omap/omap4.dtsi sgx_module: target-module@56000000 { · line 504
Quoted 8 lines
arch/arm/boot/dts/ti/omap/omap4.dtsi +1
-4@@ -501,10 +501,11 @@ sgx_module: target-module@56000000 { #size-cells = <1>; ranges = <0 0x56000000 0x2000000>; - /* - * Closed source PowerVR driver, no child device - * binding or driver in mainline - */ + gpu@0 {I wonder why we don't add a "gpu:" label here.
Quoted 5 lines
Almost all other subsystem nodes have one (e.g. emif:, aes:, dss:, dsi:, hdmi:, etc.), obviously for convenience when using a .dtsi file.
It would allow a board-specific DTS to easily add status = "disabled" to avoid driver probing or disabling the GPU (e.g. if there is no display).
There's no reason to disable it in the DT: the hardware block would still be there and it's rendering to memory so it still could be useful.
If there's no display on the board and you really don't want the GPU driver, then you can disable the driver or block the module loading, but it should be a distro / package / user decision, not a DT / kernel one still.
Maxime
Re: [PATCH RFC v2 04/11] ARM: dts: omap4: Add device tree entry for SGX GPU
Hi,
Quoted 30 lines
Am 15.01.2024 um 09:25 schrieb Maxime Ripard <[email protected]>:
Hi,
Quoted 25 lines · H. Nikolaus Schaller
Quoted 14 lines
Am 08.01.2024 um 19:32 schrieb Andrew Davis <[email protected]>:
Add SGX GPU device entry to base OMAP4 dtsi file.
Signed-off-by Andrew Davis <[email protected]>---
arch/arm/boot/dts/ti/omap/omap4.dtsi| 9 +++++----1 file changed, 5 insertions(+), 4 deletions(-)arch/arm/boot/dts/ti/omap/omap4.dtsi +0
-0arch/arm/boot/dts/ti/omap/omap4.dtsi sgx_module: target-module@56000000 { · line 504
Quoted 8 lines
arch/arm/boot/dts/ti/omap/omap4.dtsi +1
-4@@ -501,10 +501,11 @@ sgx_module: target-module@56000000 { #size-cells = <1>; ranges = <0 0x56000000 0x2000000>; - /* - * Closed source PowerVR driver, no child device - * binding or driver in mainline - */ + gpu@0 {I wonder why we don't add a "gpu:" label here.
Quoted 8 lines
Quoted 5 lines
Almost all other subsystem nodes have one (e.g. emif:, aes:, dss:, dsi:, hdmi:, etc.), obviously for convenience when using a .dtsi file.
It would allow a board-specific DTS to easily add status = "disabled" to avoid driver probing or disabling the GPU (e.g. if there is no display).
There's no reason to disable it in the DT: the hardware block would still be there and it's rendering to memory so it still could be useful.
Well, if you know that the board does not have a dm3730 but a dm3725 without GPU it is better to disable the GPU completely instead of loading the driver and make it detect by some internal bits that it has no GPU on the SoC.
Quoted 4 lines
If there's no display on the board and you really don't want the GPU driver, then you can disable the driver or block the module loading, but it should be a distro / package / user decision, not a DT / kernel one still.
The same holds for aes: dss: dsi: hdmi: etc. If they are not used by some board file, they don't change a single bit of the DTB [1] which IMHO would be of reasonable concern to question additional labels.
BR and thanks,
Nikolaus
[1] https://devicetree-specification.readthedocs.io/en/stable/source-language.html
"Labels are only used in the devicetree source format and are not encoded into the DTB binary."
Andreas Kemnade
maintainerRe: [PATCH RFC v2 04/11] ARM: dts: omap4: Add device tree entry for SGX GPU
Hi,
Quoted 7 lines · On Mon, 15 Jan 2024 09:55:00 +0100 "H. Nikolaus Schaller" <[email protected]>…
Quoted 2 lines
There's no reason to disable it in the DT: the hardware block would still be there and it's rendering to memory so it still could be useful.
Well, if you know that the board does not have a dm3730 but a dm3725 without GPU it is better to disable the GPU completely instead of loading the driver and make it detect by some internal bits that it has no GPU on the SoC.
That is at least some valid reason.
Quoted 8 lines
Quoted 4 lines
If there's no display on the board and you really don't want the GPU driver, then you can disable the driver or block the module loading, but it should be a distro / package / user decision, not a DT / kernel one still.
The same holds for aes: dss: dsi: hdmi: etc. If they are not used by some board file, they don't change a single bit of the DTB [1] which IMHO would be of reasonable concern to question additional labels.
There is some difference here, some hardware can just not be used without wired external pins, the gpu can be used even if no display is connected either to accelerate some remote access or you could use the gpu for something completely else...
Maybe mining bitcoins if temperate gets too low to warm you pocket ;-)
But as these labels do not harm, I have no strong opinion against it.
Regards,
Andreas
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Maxime Ripard
maintainerRe: Re: [PATCH RFC v2 04/11] ARM: dts: omap4: Add device tree entry for SGX GPU
In reply to H. Nikolaus SchallerQuoted 38 lines · H. Nikolaus Schaller
Hi,
Quoted 36 lines
Am 15.01.2024 um 09:25 schrieb Maxime Ripard <[email protected]>:
Hi,
Quoted 30 lines · H. Nikolaus Schaller
Quoted 14 lines
Am 08.01.2024 um 19:32 schrieb Andrew Davis <[email protected]>:
Add SGX GPU device entry to base OMAP4 dtsi file.
Signed-off-by Andrew Davis <[email protected]>---
arch/arm/boot/dts/ti/omap/omap4.dtsi| 9 +++++----1 file changed, 5 insertions(+), 4 deletions(-)arch/arm/boot/dts/ti/omap/omap4.dtsi +0
-0arch/arm/boot/dts/ti/omap/omap4.dtsi sgx_module: target-module@56000000 { · line 504
Quoted 8 lines
arch/arm/boot/dts/ti/omap/omap4.dtsi +1
-4@@ -501,10 +501,11 @@ sgx_module: target-module@56000000 { #size-cells = <1>; ranges = <0 0x56000000 0x2000000>; - /* - * Closed source PowerVR driver, no child device - * binding or driver in mainline - */ + gpu@0 {I wonder why we don't add a "gpu:" label here.
Almost all other subsystem nodes have one (e.g. emif:, aes:, dss:, dsi:, hdmi:, etc.), obviously for convenience when using a .dtsi file.
It would allow a board-specific DTS to easily add status = "disabled" to avoid driver probing or disabling the GPU (e.g. if there is no display).
Quoted 6 lines
Quoted 2 lines
There's no reason to disable it in the DT: the hardware block would still be there and it's rendering to memory so it still could be useful.
Well, if you know that the board does not have a dm3730 but a dm3725 without GPU it is better to disable the GPU completely instead of loading the driver and make it detect by some internal bits that it has no GPU on the SoC.
It shouldn't even be in the DTSI if it's not in the SoC.
Quoted 8 lines
Quoted 4 lines
If there's no display on the board and you really don't want the GPU driver, then you can disable the driver or block the module loading, but it should be a distro / package / user decision, not a DT / kernel one still.
The same holds for aes: dss: dsi: hdmi: etc. If they are not used by some board file, they don't change a single bit of the DTB [1] which IMHO would be of reasonable concern to question additional labels.
Not really, no. If there's no HDMI connector, the HDMI controller is useless. A GPU without a display can still be useful, depending on the workload.
Maxime
RFC PATCH v2 5/11 ARM: dts: omap5: Add device tree entry for SGX GPU
In reply to Andrew DavisAdd SGX GPU device entry to base OMAP5 dtsi file.
--- arch/arm/boot/dts/ti/omap/omap5.dtsi | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
arch/arm/boot/dts/ti/omap/omap5.dtsi +5 -4
@@ -453,10 +453,11 @@ target-module@56000000 { #size-cells = <1>; ranges = <0 0x56000000 0x2000000>; - /* - * Closed source PowerVR driver, no child device - * binding or driver in mainline - */ + gpu@0 { + compatible = "ti,omap5432-gpu", "img,powervr-sgx544"; + reg = <0x0 0x2000000>; /* 32MB */ + interrupts = <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>; + }; }; target-module@58000000 {
Signature · 1 line
2.39.2
Re: [PATCH RFC v2 05/11] ARM: dts: omap5: Add device tree entry for SGX GPU
Quoted 4 lines · Andrew Davis
Add SGX GPU device entry to base OMAP5 dtsi file.
Signed-off-by Andrew Davis <[email protected]>---
Signature · 5 lines
Best regards, Javier Martinez Canillas Core Platforms Red Hat
RFC PATCH v2 6/11 ARM: dts: AM33xx: Add device tree entry for SGX GPU
In reply to Andrew DavisAdd SGX GPU device entry to base AM33xx dtsi file.
--- arch/arm/boot/dts/ti/omap/am33xx.dtsi | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
arch/arm/boot/dts/ti/omap/am33xx.dtsi +5 -4
@@ -640,10 +640,11 @@ target-module@56000000 { #size-cells = <1>; ranges = <0 0x56000000 0x1000000>; - /* - * Closed source PowerVR driver, no child device - * binding or driver in mainline - */ + gpu@0 { + compatible = "ti,omap3630-gpu", "img,powervr-sgx530"; + reg = <0x0 0x10000>; /* 64kB */ + interrupts = <37>; + }; }; }; };
Signature · 1 line
2.39.2
Re: [PATCH RFC v2 06/11] ARM: dts: AM33xx: Add device tree entry for SGX GPU
Quoted 4 lines · Andrew Davis
Add SGX GPU device entry to base AM33xx dtsi file.
Signed-off-by Andrew Davis <[email protected]>---
Signature · 5 lines
Best regards, Javier Martinez Canillas Core Platforms Red Hat
RFC PATCH v2 7/11 ARM: dts: AM437x: Add device tree entry for SGX GPU
In reply to Andrew DavisAdd SGX GPU device entry to base AM437x dtsi file.
--- arch/arm/boot/dts/ti/omap/am4372.dtsi | 6 ++++++ 1 file changed, 6 insertions(+)
arch/arm/boot/dts/ti/omap/am4372.dtsi +6 -0
@@ -719,6 +719,12 @@ target-module@56000000 { #address-cells = <1>; #size-cells = <1>; ranges = <0 0x56000000 0x1000000>; + + gpu@0 { + compatible = "ti,omap3630-gpu", "img,powervr-sgx530"; + reg = <0x0 0x10000>; /* 64kB */ + interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>; + }; }; }; };
Signature · 1 line
2.39.2
Re: [PATCH RFC v2 07/11] ARM: dts: AM437x: Add device tree entry for SGX GPU
Quoted 4 lines · Andrew Davis
Add SGX GPU device entry to base AM437x dtsi file.
Signed-off-by Andrew Davis <[email protected]>---
Signature · 5 lines
Best regards, Javier Martinez Canillas Core Platforms Red Hat
RFC PATCH v2 8/11 ARM: dts: DRA7xx: Add device tree entry for SGX GPU
In reply to Andrew DavisAdd SGX GPU device entry to base DRA7x dtsi file.
--- arch/arm/boot/dts/ti/omap/dra7.dtsi | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
arch/arm/boot/dts/ti/omap/dra7.dtsi +8 -1
@@ -850,12 +850,19 @@ target-module@56000000 { <SYSC_IDLE_SMART>; ti,sysc-sidle = <SYSC_IDLE_FORCE>, <SYSC_IDLE_NO>, - <SYSC_IDLE_SMART>; + <SYSC_IDLE_SMART>, + <SYSC_IDLE_SMART_WKUP>; clocks = <&gpu_clkctrl DRA7_GPU_CLKCTRL 0>; clock-names = "fck"; #address-cells = <1>; #size-cells = <1>; ranges = <0 0x56000000 0x2000000>; + + gpu@0 { + compatible = "ti,am5728-gpu", "img,powervr-sgx544"; + reg = <0x0 0x10000>; /* 64kB */ + interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>; + }; }; crossbar_mpu: crossbar@4a002a48 {
Signature · 1 line
2.39.2
Re: [PATCH RFC v2 08/11] ARM: dts: DRA7xx: Add device tree entry for SGX GPU
Quoted 4 lines · Andrew Davis
Add SGX GPU device entry to base DRA7x dtsi file.
Signed-off-by Andrew Davis <[email protected]>---
Signature · 5 lines
Best regards, Javier Martinez Canillas Core Platforms Red Hat
RFC PATCH v2 9/11 arm64: dts: ti: k3-am654-main: Add device tree entry for SGX GPU
In reply to Andrew DavisAdd SGX GPU device entry to base AM654 dtsi file.
--- arch/arm64/boot/dts/ti/k3-am65-main.dtsi | 7 +++++++ 1 file changed, 7 insertions(+)
arch/arm64/boot/dts/ti/k3-am65-main.dtsi +7 -0
@@ -1050,6 +1050,13 @@ dss_ports: ports { }; }; + gpu: gpu@7000000 { + compatible = "ti,am6548-gpu", "img,powervr-sgx544"; + reg = <0x0 0x7000000 0x0 0x10000>; + interrupts = <GIC_SPI 162 IRQ_TYPE_LEVEL_HIGH>; + power-domains = <&k3_pds 65 TI_SCI_PD_EXCLUSIVE>; + }; + ehrpwm0: pwm@3000000 { compatible = "ti,am654-ehrpwm", "ti,am3352-ehrpwm"; #pwm-cells = <3>;
Signature · 1 line
2.39.2
RFC PATCH v2 10/11 ARM: dts: sun6i: Add device tree entry for SGX GPU
In reply to Andrew DavisAdd SGX GPU device entry to base sun6i-a31 dtsi file.
--- arch/arm/boot/dts/allwinner/sun6i-a31.dtsi | 9 +++++++++ 1 file changed, 9 insertions(+)
arch/arm/boot/dts/allwinner/sun6i-a31.dtsi +9 -0
@@ -962,6 +962,15 @@ mdio: mdio { }; }; + gpu: gpu@1c40000 { + compatible = "allwinner,sun6i-a31-gpu", "img,powervr-sgx544"; + reg = <0x01c40000 0x10000>; + interrupts = <GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&ccu CLK_GPU_CORE>, <&ccu CLK_GPU_MEMORY>; + clock-names = "core", "mem"; + status = "disabled"; + }; + crypto: crypto-engine@1c15000 { compatible = "allwinner,sun6i-a31-crypto", "allwinner,sun4i-a10-crypto";
Signature · 1 line
2.39.2
RFC PATCH v2 11/11 MIPS: DTS: jz4780: Add device tree entry for SGX GPU
In reply to Andrew DavisAdd SGX GPU device entry to base jz4780 dtsi file.
--- arch/mips/boot/dts/ingenic/jz4780.dtsi | 11 +++++++++++ 1 file changed, 11 insertions(+)
arch/mips/boot/dts/ingenic/jz4780.dtsi +11 -0
@@ -460,6 +460,17 @@ hdmi: hdmi@10180000 { status = "disabled"; }; + gpu: gpu@13040000 { + compatible = "ingenic,jz4780-gpu", "img,powervr-sgx540"; + reg = <0x13040000 0x4000>; + + clocks = <&cgu JZ4780_CLK_GPU>; + clock-names = "core"; + + interrupt-parent = <&intc>; + interrupts = <63>; + }; + lcdc0: lcdc0@13050000 { compatible = "ingenic,jz4780-lcd"; reg = <0x13050000 0x1800>;
Signature · 1 line
2.39.2