linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Davis <afd@ti.com>
To: "H. Nikolaus Schaller" <hns@goldelico.com>
Cc: "Frank Binns" <frank.binns@imgtec.com>,
	"Donald Robson" <donald.robson@imgtec.com>,
	"Matt Coster" <matt.coster@imgtec.com>,
	"Adam Ford" <aford173@gmail.com>,
	"Ivaylo Dimitrov" <ivo.g.dimitrov.75@gmail.com>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Chen-Yu Tsai" <wens@csie.org>,
	"Jernej Skrabec" <jernej.skrabec@gmail.com>,
	"Samuel Holland" <samuel@sholland.org>,
	"Benoît Cousson" <bcousson@baylibre.com>,
	"Tony Lindgren" <tony@atomide.com>, "Nishanth Menon" <nm@ti.com>,
	"Vignesh Raghavendra" <vigneshr@ti.com>,
	"Tero Kristo" <kristo@kernel.org>,
	"Paul Cercueil" <paul@crapouillou.net>,
	dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-sunxi@lists.linux.dev, linux-omap@vger.kernel.org,
	linux-mips@vger.kernel.org
Subject: Re: [PATCH RFC 01/10] dt-bindings: gpu: Add PowerVR Series5 SGX GPUs
Date: Tue, 5 Dec 2023 11:33:06 -0600	[thread overview]
Message-ID: <cb590a13-e0ff-49d9-8583-be613ad50dc5@ti.com> (raw)
In-Reply-To: <CFF198DA-5C42-425E-86F4-759629489ECB@goldelico.com>

On 12/5/23 2:17 AM, H. Nikolaus Schaller wrote:
> Hi Andrew,
> 
>> Am 04.12.2023 um 19:22 schrieb Andrew Davis <afd@ti.com>:
>>
>> The Imagination PowerVR Series5 "SGX" GPU is part of several SoCs from
>> multiple vendors.
> 
> Great and thanks for the new attempt to get at least the Device Tree side
> upstream. Really appreciated!
> 

Thanks for helping us maintain these GPUs with the OpenPVRSGX project :)

>> Describe how the SGX GPU is integrated in these SoC,
>> including register space and interrupts.
> 
>> Clocks, reset, and power domain
>> information is SoC specific.
> 
> Indeed. This makes it understandable why you did not directly
> take our scheme from the openpvrsgx project.
> 
>>
>> Signed-off-by: Andrew Davis <afd@ti.com>
>> ---
>> .../devicetree/bindings/gpu/img,powervr.yaml  | 69 +++++++++++++++++--
>> 1 file changed, 63 insertions(+), 6 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/gpu/img,powervr.yaml b/Documentation/devicetree/bindings/gpu/img,powervr.yaml
>> index a13298f1a1827..9f036891dad0b 100644
>> --- a/Documentation/devicetree/bindings/gpu/img,powervr.yaml
>> +++ b/Documentation/devicetree/bindings/gpu/img,powervr.yaml
>> @@ -11,11 +11,33 @@ maintainers:
>>    - Frank Binns <frank.binns@imgtec.com>
>>
>> properties:
>> +  $nodename:
>> +    pattern: '^gpu@[a-f0-9]+$'
>> +
>>    compatible:
>> -    items:
>> -      - enum:
>> -          - ti,am62-gpu
>> -      - const: img,img-axe # IMG AXE GPU model/revision is fully discoverable
>> +    oneOf:
>> +      - items:
>> +          - enum:
>> +              - ti,am62-gpu
>> +          - const: img,img-axe # IMG AXE GPU model/revision is fully discoverable
>> +      - items:
>> +          - enum:
>> +              - ti,omap3430-gpu # Rev 121
>> +              - ti,omap3630-gpu # Rev 125
> 
> Is the "Rev 121" and "Rev 125" a property of the SoC integration (clock/reset/power
> hookup etc.) or of the integrated SGX core?
> 

The Rev is a property of the SGX core, not the SoC integration. But it seems that
compatible string is being used to define both (as we see being debated in the other
thread on this series).

> In my understanding the Revs are different variants of the SGX core (errata
> fixes, instruction set, pipeline size etc.). And therefore the current driver code
> has to be configured by some macros to handle such cases.
> 
> So the Rev should IMHO be part of the next line:
> 
>> +          - const: img,powervr-sgx530
> 
> +          - enum:
> +              - img,powervr-sgx530-121
> +              - img,powervr-sgx530-125
> 
> We have a similar definition in the openpvrsgx code.
> Example: compatible = "ti,omap3-sgx530-121", "img,sgx530-121", "img,sgx530";
> 
> (I don't mind about the powervr- prefix).
> 
> This would allow a generic and universal sgx driver (loaded through just matching
> "img,sgx530") to handle the errata and revision specifics at runtime based on the
> compatible entry ("img,sgx530-121") and know about SoC integration ("ti,omap3-sgx530-121").
> 
> And user-space can be made to load the right firmware variant based on "img,sgx530-121"
> 
> I don't know if there is some register which allows to discover the revision long
> before the SGX subsystem is initialized and the firmware is up and running.
> 
> What I know is that it is possible to read out the revision after starting the firmware
> but it may just echo the version number of the firmware binary provided from user-space.
> 

We should be able to read out the revision (register EUR_CR_CORE_REVISION), the problem is
today the driver is built for a given revision at compile time. That is a software issue,
not something that we need to encode in DT. While the core ID (SGX5xx) can be also detected
(EUR_CR_CORE_ID), the location of that register changes, and so it does need encoded in
DT compatible.

The string "ti,omap3430-gpu" tells us the revision if we cannot detect it (as in the current
driver), and the SoC integration is generic anyway (just a reg and interrupt).

Andrew

>> +      - 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
>> @@ -40,8 +62,6 @@ properties:
>> required:
>>    - compatible
>>    - reg
>> -  - clocks
>> -  - clock-names
>>    - interrupts
>>
>> additionalProperties: false
>> @@ -56,6 +76,43 @@ allOf:
>>        properties:
>>          clocks:
>>            maxItems: 1
>> +      required:
>> +        - clocks
>> +        - clock-names
>> +  - if:
>> +      properties:
>> +        compatible:
>> +          contains:
>> +            const: ti,am654-sgx544
>> +    then:
>> +      properties:
>> +        power-domains:
>> +          minItems: 1
>> +      required:
>> +        - power-domains
>> +  - if:
>> +      properties:
>> +        compatible:
>> +          contains:
>> +            const: allwinner,sun6i-a31-gpu
>> +    then:
>> +      properties:
>> +        clocks:
>> +          minItems: 2
>> +        clock-names:
>> +          minItems: 2
>> +      required:
>> +        - clocks
>> +        - clock-names
>> +  - if:
>> +      properties:
>> +        compatible:
>> +          contains:
>> +            const: ingenic,jz4780-gpu
>> +    then:
>> +      required:
>> +        - clocks
>> +        - clock-names
>>
>> examples:
>>    - |
>> -- 
>> 2.39.2
>>
> 
> BR and thanks,
> Nikolaus

  reply	other threads:[~2023-12-05 17:33 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-04 18:22 [PATCH RFC 00/10] Device tree support for Imagination Series5 GPU Andrew Davis
2023-12-04 18:22 ` [PATCH RFC 01/10] dt-bindings: gpu: Add PowerVR Series5 SGX GPUs Andrew Davis
2023-12-05  6:57   ` Maxime Ripard
2023-12-05  8:18     ` H. Nikolaus Schaller
2023-12-05 13:29       ` Maxime Ripard
2023-12-05 13:50         ` H. Nikolaus Schaller
2023-12-07  9:20           ` Maxime Ripard
2023-12-07 10:33             ` H. Nikolaus Schaller
2023-12-15 13:33               ` Maxime Ripard
2023-12-18  9:28                 ` H. Nikolaus Schaller
2023-12-18 10:14                   ` Maxime Ripard
2023-12-18 10:54                     ` H. Nikolaus Schaller
2023-12-19 17:19                       ` Andrew Davis
2023-12-21  9:02                         ` Maxime Ripard
2023-12-21  8:58                       ` Maxime Ripard
2023-12-21 15:23                         ` H. Nikolaus Schaller
2023-12-05  7:10   ` Krzysztof Kozlowski
2023-12-05  7:56     ` Tony Lindgren
2023-12-05  8:03       ` Krzysztof Kozlowski
2023-12-05  8:10         ` Tony Lindgren
2023-12-05  8:16           ` Krzysztof Kozlowski
2023-12-05  8:30             ` Tony Lindgren
2023-12-05  8:45               ` Krzysztof Kozlowski
2023-12-05  9:02                 ` Andreas Kemnade
2023-12-05  9:27                   ` Krzysztof Kozlowski
2023-12-05  9:43                     ` Andreas Kemnade
2023-12-07  6:38                       ` Tony Lindgren
2023-12-05  8:17   ` H. Nikolaus Schaller
2023-12-05 17:33     ` Andrew Davis [this message]
2023-12-05 18:04       ` H. Nikolaus Schaller
2023-12-06 16:02         ` Conor Dooley
2023-12-06 16:15           ` Andrew Davis
2023-12-06 22:02             ` H. Nikolaus Schaller
2023-12-06 21:43           ` H. Nikolaus Schaller
2023-12-04 18:22 ` [PATCH RFC 02/10] ARM: dts: omap3: Add device tree entry for SGX GPU Andrew Davis
2023-12-04 18:22 ` [PATCH RFC 03/10] ARM: dts: omap4: " Andrew Davis
2023-12-04 18:22 ` [PATCH RFC 04/10] ARM: dts: omap5: " Andrew Davis
2023-12-04 18:22 ` [PATCH RFC 05/10] ARM: dts: AM33xx: " Andrew Davis
2023-12-04 18:22 ` [PATCH RFC 06/10] ARM: dts: AM437x: " Andrew Davis
2023-12-04 18:22 ` [PATCH RFC 07/10] ARM: dts: DRA7xx: " Andrew Davis
2023-12-04 18:22 ` [PATCH RFC 08/10] arm64: dts: ti: k3-am654-main: " Andrew Davis
2023-12-04 18:22 ` [PATCH RFC 09/10] ARM: dts: sun6i: " Andrew Davis
2023-12-04 18:22 ` [PATCH RFC 10/10] MIPS: DTS: jz4780: " Andrew Davis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cb590a13-e0ff-49d9-8583-be613ad50dc5@ti.com \
    --to=afd@ti.com \
    --cc=aford173@gmail.com \
    --cc=bcousson@baylibre.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=donald.robson@imgtec.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=frank.binns@imgtec.com \
    --cc=hns@goldelico.com \
    --cc=ivo.g.dimitrov.75@gmail.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=kristo@kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=matt.coster@imgtec.com \
    --cc=mripard@kernel.org \
    --cc=nm@ti.com \
    --cc=paul@crapouillou.net \
    --cc=robh+dt@kernel.org \
    --cc=samuel@sholland.org \
    --cc=tony@atomide.com \
    --cc=tzimmermann@suse.de \
    --cc=vigneshr@ti.com \
    --cc=wens@csie.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).