linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Philipp Rossak <embed3d@gmail.com>
To: "H. Nikolaus Schaller" <hns@goldelico.com>,
	Maxime Ripard <maxime@cerno.tech>
Cc: "Neil Armstrong" <narmstrong@baylibre.com>,
	"Mark Rutland" <mark.rutland@arm.com>,
	"David Airlie" <airlied@linux.ie>,
	"James Hogan" <jhogan@kernel.org>,
	"open list:DRM PANEL DRIVERS" <dri-devel@lists.freedesktop.org>,
	linux-mips@vger.kernel.org,
	"Paul Cercueil" <paul@crapouillou.net>,
	linux-samsung-soc@vger.kernel.org,
	"Discussions about the Letux Kernel"
	<letux-kernel@openphoenux.org>,
	"Paul Burton" <paulburton@kernel.org>,
	"Krzysztof Kozlowski" <krzk@kernel.org>,
	"Tony Lindgren" <tony@atomide.com>,
	"Chen-Yu Tsai" <wens@csie.org>, "Kukjin Kim" <kgene@kernel.org>,
	devicetree@vger.kernel.org,
	"Benoît Cousson" <bcousson@baylibre.com>,
	"Rob Herring" <robh+dt@kernel.org>,
	linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	"Thomas Bogendoerfer" <tsbogend@alpha.franken.de>,
	openpvrsgx-devgroup@letux.org, linux-kernel@vger.kernel.org,
	"Ralf Baechle" <ralf@linux-mips.org>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	kernel@pyra-handheld.com
Subject: Re: [PATCH v6 01/12] dt-bindings: add img, pvrsgx.yaml for Imagination GPUs
Date: Sun, 19 Apr 2020 01:02:59 +0200	[thread overview]
Message-ID: <9f33a2ae-2825-bc2d-6e3b-c09a5d226e81@gmail.com> (raw)
In-Reply-To: <C8816F10-8773-4ECD-B42D-6EEF642476EB@goldelico.com>

Hi Nikolaus,
Hi Maxime,

>>> TI SoC seem to be the broadest number of available users
>>> of sgx5xx in the past and nowadays. Others are more the exception.
>>
>> And maybe TI has some complicated stuff around the GPU that others don't have?
> 
> Looks so.

I can only agree on this.

> 
>>
>>> What I also assume is that developers of DTS know what they do.
>>> So the risk that there is different semantics is IMHO very low.
>>
>> Well, they know what they do if you document the binding. Let's say I have two
>> clocks now on my SoC, and you just document that you want a clocks property,
>> with a generic name in clock-names like "gpu".
> 
> Yes, that is what I want to propose for v7:
> 
>    clocks:
>      maxItems: 1
> 
>    clock-names:
>      maxItems: 1
>      items:
>        - const: gpu
> 
>>
>>> If you agree I can add the clocks/clock-names property as an
>>> optional property. This should solve omap and all others.
>>
>> With the above example, what clock should I put in there? In which order? This
>> isn't some random example pulled out of nowhere. The Allwinner A31 has (at
>> least) 4 clocks for the GPU, 1 reset line and 1 regulator, so I can only assume
>> that the GPU actually needs at least that amount to be properly integrated into
>> an SoC.
> 
> Ah, now I understand your motivation: you have access and experience with
> the A31 and you know that our proposal doesn't fit to it.
> 
>  From what I know from your description is that the A31 is quite special with
> 4 GPU clocks... Are they all really for the GPU or 3 of them for the interface
> logic (like on OMAP which separates between "functional clocks" and "interface
> clocks")? Or are there 4 groups of GPU cores with a separate clock for each one?
> 
> So what would be your proposal for the A31 DT?
> 
> Then I get a chance to compare DT snippets and try to make a mixture for
> the bindings.
> 

This is my current binding for the A83T, the A31 looks similar but there 
is still something missing, since some parts are not mainlined yet:

sun8i-a83t.dtsi:
gpu: gpu@1c400000 {
	compatible = "allwinner,sun8i-a83t-sgx544-115",
		     "img,sgx544-115", "img,sgx544";
	reg = <0x01c40000 0x10000>;
	interrupts = <GIC_SPI 129 IRQ_TYPE_LEVEL_HIGH>;
	clocks = <&ccu CLK_BUS_GPU>, <&ccu CLK_GPU_CORE>,
		 <&ccu CLK_GPU_MEMORY>, <&ccu CLK_GPU_HYD>;
	clock-names = "bus", "core", "memory", "hyd";

	resets = <&ccu RST_BUS_GPU>;
};

sun8i-a83t-bananapi-m3.dts:
&gpu {
	gpu-supply = <&reg_dcdc4>;
};


> 
>> But given that the current state on the Allwinner SoCs (at least) is that you
>> can't even read a register, it might be a good idea to delay the introduction of
>> that binding until you have something that works to avoid drowning under the
>> number of special cases to deal with backward compatibility.
> 

Maxime is right. Even if you enable the regulator, write 0x0 to the GPU 
Power Off Gating Register, deassert the reset and enable the clocks you 
are not able to read the register.
You must first run: pvrsrvctl --no-module --start (user space binaries) 
to access registers otherwise the system will stuck with the following 
message when accessing them:

./devmem2 0x01C40024
/dev/mem opened.

> Philipp has something minimal working on the A83 which works with the proposed
> binding and enabled him to read out the sgx revision register.
> 
This is not correct. In the other mail I talked about my reference 
system. This is an old 3.4.39 kernel, modified by allwinner to run on 
their SOC's which don't use the common kernel techniques. So it's very 
hacky, but they got the gpu running. I'm using this system for 
comparison, to read out registers and for reverse engineering.

My current kernel module behaves similar like the reference design, but 
right now I'm not able to run "pvrsrvctl --no-module --start" without 
errors. So the initialization never get's finalized and I see the issue 
described above.

> So if you are a specialist for the A31 SGX, please make a proposal for a binding
> that covers all the A31 needs and all other SoC we know. Or define a separate
> bindings for the A31.

The A31 and the A31s have some additional clocks mentioned in their 
datasheet (@ System Control Register/SRAM Controler). Those are not 
available in the A83T datasheet, but might be there since the memory map 
looks similar and allwinner might use the same userspace binaries for 
their devices.

 From the knowledge I gained the last 3 days, we should delay the 
patches for the A83T, A31 and A31s.
The idea of the placeholder patches was to show that from this binding 
also other devices could benefit.

Cheers,
Philipp

  reply	other threads:[~2020-04-18 23:03 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-15  8:35 [PATCH v6 00/12] ARM/MIPS: DTS: add child nodes describing the PVRSGX GPU present in some OMAP SoC and JZ4780 (and many more) H. Nikolaus Schaller
2020-04-15  8:35 ` [PATCH v6 01/12] dt-bindings: add img,pvrsgx.yaml for Imagination GPUs H. Nikolaus Schaller
2020-04-15 10:12   ` Maxime Ripard
2020-04-15 12:43     ` H. Nikolaus Schaller
2020-04-15 12:54       ` [PATCH v6 01/12] dt-bindings: add img, pvrsgx.yaml " Neil Armstrong
2020-04-15 13:17         ` H. Nikolaus Schaller
2020-04-15 14:21           ` Maxime Ripard
2020-04-15 15:09             ` H. Nikolaus Schaller
2020-04-15 16:21               ` Maxime Ripard
2020-04-15 16:42                 ` H. Nikolaus Schaller
2020-04-15 17:13                   ` Tony Lindgren
2020-04-17 10:25                   ` Maxime Ripard
2020-04-17 12:15                     ` H. Nikolaus Schaller
2020-04-18 23:02                       ` Philipp Rossak [this message]
2020-04-20  8:04                       ` Maxime Ripard
2020-04-16 20:41   ` [PATCH v6 01/12] dt-bindings: add img,pvrsgx.yaml " Rob Herring
     [not found]     ` <C7C58E41-99CB-49F6-934E-68FA458CB8B1@goldelico.com>
2020-04-21 19:02       ` [PATCH v6 01/12] dt-bindings: add img, pvrsgx.yaml " Rob Herring
2020-04-15  8:35 ` [PATCH v6 02/12] ARM: DTS: am33xx: add sgx gpu child node H. Nikolaus Schaller
2020-04-15  8:35 ` [PATCH v6 03/12] ARM: DTS: am3517: " H. Nikolaus Schaller
2020-04-15  8:35 ` [PATCH v6 04/12] ARM: DTS: omap34xx: " H. Nikolaus Schaller
2020-04-15  8:35 ` [PATCH v6 05/12] ARM: DTS: omap36xx: " H. Nikolaus Schaller
2020-04-15  8:35 ` [PATCH v6 06/12] ARM: DTS: omap4: " H. Nikolaus Schaller
2020-04-15  8:35 ` [PATCH v6 07/12] ARM: DTS: omap5: " H. Nikolaus Schaller
2020-04-15 11:38   ` Krzysztof Kozlowski
2020-04-15 11:46     ` H. Nikolaus Schaller
2020-04-15 13:47       ` Krzysztof Kozlowski
2020-04-15 14:07         ` H. Nikolaus Schaller
2020-04-15  8:35 ` [PATCH v6 08/12] arm: dts: s5pv210: Add G3D node H. Nikolaus Schaller
2020-04-15  9:15   ` Sergei Shtylyov
2020-04-15  9:26     ` H. Nikolaus Schaller
2020-04-15 11:49   ` Krzysztof Kozlowski
2020-04-15 12:50     ` H. Nikolaus Schaller
2020-04-15 13:44       ` Krzysztof Kozlowski
2020-04-15 18:17       ` Jonathan Bakker
2020-04-16  8:50         ` Krzysztof Kozlowski
2020-04-17 12:15         ` H. Nikolaus Schaller
2020-04-22  5:56   ` kbuild test robot
2020-04-15  8:35 ` [PATCH v6 09/12] ARM: dts: sun6i: a31: add sgx gpu child node H. Nikolaus Schaller
2020-04-15  8:35 ` [PATCH v6 10/12] ARM: dts: sun6i: a31s: " H. Nikolaus Schaller
2020-04-15  8:35 ` [PATCH v6 11/12] ARM: dts: sun8i: a83t: " H. Nikolaus Schaller
2020-04-15  8:35 ` [PATCH v6 12/12] MIPS: DTS: jz4780: add sgx gpu node H. Nikolaus Schaller
2020-04-15 10:10 ` [PATCH v6 00/12] ARM/MIPS: DTS: add child nodes describing the PVRSGX GPU present in some OMAP SoC and JZ4780 (and many more) Maxime Ripard
2020-04-15 12:41   ` H. Nikolaus Schaller
2020-04-15 12:46     ` Daniel Vetter
2020-04-15 13:02     ` Maxime Ripard
2020-04-15 13:04       ` H. Nikolaus Schaller
2020-04-17 12:09         ` Philipp Rossak
2020-04-20  7:38           ` Maxime Ripard
2020-04-21  9:57             ` Philipp Rossak
2020-04-21 11:21               ` Maxime Ripard
2020-04-21 14:15                 ` Tony Lindgren
2020-04-21 17:29                   ` H. Nikolaus Schaller
2020-04-21 17:39                     ` Tony Lindgren
2020-04-21 17:46                       ` Tony Lindgren
2020-04-22  6:58                     ` Maxime Ripard
2020-04-22  7:10                       ` H. Nikolaus Schaller
2020-04-22 15:13                         ` Maxime Ripard
2020-04-22 16:09                           ` H. Nikolaus Schaller
     [not found]                             ` <MC879Q.XY9S0U9R35681@crapouillou.net>
2020-04-22 17:23                               ` H. Nikolaus Schaller
2020-04-22 19:00                                 ` Philipp Rossak
2020-04-22 19:33                                   ` Tony Lindgren
2020-04-22 21:12                                     ` H. Nikolaus Schaller
2020-04-23 15:00                             ` Neil Armstrong
2020-04-23 15:45                               ` H. Nikolaus Schaller
2020-04-23 20:36                                 ` Maxime Ripard
2020-04-24  9:51                                   ` H. Nikolaus Schaller
2020-04-21 16:42                 ` Philipp Rossak
2020-04-23 20:37                   ` Maxime Ripard

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=9f33a2ae-2825-bc2d-6e3b-c09a5d226e81@gmail.com \
    --to=embed3d@gmail.com \
    --cc=airlied@linux.ie \
    --cc=bcousson@baylibre.com \
    --cc=daniel@ffwll.ch \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hns@goldelico.com \
    --cc=jhogan@kernel.org \
    --cc=kernel@pyra-handheld.com \
    --cc=kgene@kernel.org \
    --cc=krzk@kernel.org \
    --cc=letux-kernel@openphoenux.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-samsung-soc@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=maxime@cerno.tech \
    --cc=narmstrong@baylibre.com \
    --cc=openpvrsgx-devgroup@letux.org \
    --cc=paul@crapouillou.net \
    --cc=paulburton@kernel.org \
    --cc=ralf@linux-mips.org \
    --cc=robh+dt@kernel.org \
    --cc=tony@atomide.com \
    --cc=tsbogend@alpha.franken.de \
    --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).