From: Michal Wilczynski <m.wilczynski@samsung.com>
To: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: Drew Fustini <drew@pdp7.com>, Guo Ren <guoren@kernel.org>,
Fu Wei <wefu@redhat.com>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Philipp Zabel <p.zabel@pengutronix.de>,
Frank Binns <frank.binns@imgtec.com>,
Matt Coster <matt.coster@imgtec.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
Paul Walmsley <paul.walmsley@sifive.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Alexandre Ghiti <alex@ghiti.fr>,
Ulf Hansson <ulf.hansson@linaro.org>,
Marek Szyprowski <m.szyprowski@samsung.com>,
linux-riscv@lists.infradead.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org,
dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v6 1/8] power: sequencing: Add T-HEAD TH1520 GPU power sequencer driver
Date: Mon, 23 Jun 2025 19:20:54 +0200 [thread overview]
Message-ID: <f41cd747-eb57-4e17-a3b1-8b30e0c6e84c@samsung.com> (raw)
In-Reply-To: <CAMRc=MfPLZ7oMVjLv+_GMoC8X+O=k+mMrQKxELho0=+Z7=HApQ@mail.gmail.com>
On 6/23/25 16:32, Bartosz Golaszewski wrote:
> On Mon, Jun 23, 2025 at 1:44 PM Michal Wilczynski
> <m.wilczynski@samsung.com> wrote:
>>
>> Introduce the pwrseq-thead-gpu driver, a power sequencer provider for
>> the Imagination BXM-4-64 GPU on the T-HEAD TH1520 SoC. This driver
>> controls an auxiliary device instantiated by the AON power domain.
>>
>> The TH1520 GPU requires a specific sequence to correctly initialize and
>> power down its resources:
>> - Enable GPU clocks (core and sys).
>> - De-assert the GPU clock generator reset (clkgen_reset).
>> - Introduce a short hardware-required delay.
>> - De-assert the GPU core reset. The power-down sequence performs these
>> steps in reverse.
>>
>> Implement this sequence via the pwrseq_power_on and pwrseq_power_off
>> callbacks.
>>
>> Crucially, the driver's match function is called when a consumer (the
>> Imagination GPU driver) requests the "gpu-power" target. During this
>> match, the sequencer uses clk_bulk_get() and
>> reset_control_get_exclusive() on the consumer's device to obtain handles
>> to the GPU's "core" and "sys" clocks, and the GPU core reset. These,
>> along with clkgen_reset obtained from parent aon node, allow it to
>> perform the complete sequence.
>>
>> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
>> Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
>> ---
>
> [snip]
>
>> +
>> + /* Additionally verify consumer device has AON as power-domain */
>> + if (pwr_spec.np != ctx->aon_node || pwr_spec.args[0] != TH1520_GPU_PD) {
>> + of_node_put(pwr_spec.np);
>> + return 0;
>> + }
>> +
>> + of_node_put(pwr_spec.np);
>> +
>> + /* If a consumer is already bound, only allow a re-match from it */
>> + if (ctx->consumer_node)
>> + return ctx->consumer_node == dev->of_node;
>> +
>
> That should be `!!(ctx->consumer_node == dev->of_node)` or preferably
> `ctx->consumer_node == dev->of_node ? 1 : 0`. I can amend it when
> applying if you have no objections. The rest looks good to me and I'd
> like to pick it up into pwrseq/for-next in the next two days.
Sure,
Thanks !
>
> Bart
>
> [snip]
>
Best regards,
--
Michal Wilczynski <m.wilczynski@samsung.com>
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next prev parent reply other threads:[~2025-06-23 21:44 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20250623114429eucas1p1e74e09e74c5873b2f7f01228073be72a@eucas1p1.samsung.com>
2025-06-23 11:42 ` [PATCH v6 0/8] Add TH1520 GPU support with power sequencing Michal Wilczynski
2025-06-23 11:42 ` [PATCH v6 1/8] power: sequencing: Add T-HEAD TH1520 GPU power sequencer driver Michal Wilczynski
2025-06-23 14:32 ` Bartosz Golaszewski
2025-06-23 17:20 ` Michal Wilczynski [this message]
2025-06-23 11:42 ` [PATCH v6 2/8] dt-bindings: firmware: thead,th1520: Add resets for GPU clkgen Michal Wilczynski
2025-06-23 11:42 ` [PATCH v6 3/8] pmdomain: thead: Instantiate GPU power sequencer via auxiliary bus Michal Wilczynski
2025-06-23 11:42 ` [PATCH v6 4/8] drm/imagination: Use pwrseq for TH1520 GPU power management Michal Wilczynski
2025-06-24 13:53 ` Matt Coster
2025-06-25 13:49 ` Michal Wilczynski
2025-06-23 11:42 ` [PATCH v6 5/8] dt-bindings: gpu: img,powervr-rogue: Add TH1520 GPU compatible Michal Wilczynski
2025-06-24 13:53 ` Matt Coster
2025-06-25 12:45 ` Michal Wilczynski
2025-06-25 13:55 ` Krzysztof Kozlowski
2025-06-25 14:18 ` Michal Wilczynski
2025-06-25 14:41 ` Krzysztof Kozlowski
2025-07-23 9:45 ` Matt Coster
2025-07-23 16:26 ` Michal Wilczynski
2025-07-23 16:50 ` Matt Coster
2025-07-23 18:25 ` Michal Wilczynski
2025-07-25 7:01 ` Krzysztof Kozlowski
2025-06-23 11:42 ` [PATCH v6 6/8] riscv: dts: thead: th1520: Add GPU clkgen reset to AON node Michal Wilczynski
2025-06-23 11:42 ` [PATCH v6 7/8] riscv: dts: thead: th1520: Add IMG BXM-4-64 GPU node Michal Wilczynski
2025-06-23 11:42 ` [PATCH v6 8/8] drm/imagination: Enable PowerVR driver for RISC-V Michal Wilczynski
2025-06-24 13:54 ` Matt Coster
2025-06-25 12:53 ` Michal Wilczynski
2025-06-24 13:58 ` (subset) [PATCH v6 0/8] Add TH1520 GPU support with power sequencing Bartosz Golaszewski
2025-06-25 10:09 ` Ulf Hansson
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=f41cd747-eb57-4e17-a3b1-8b30e0c6e84c@samsung.com \
--to=m.wilczynski@samsung.com \
--cc=airlied@gmail.com \
--cc=alex@ghiti.fr \
--cc=aou@eecs.berkeley.edu \
--cc=brgl@bgdev.pl \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=drew@pdp7.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=frank.binns@imgtec.com \
--cc=guoren@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=m.szyprowski@samsung.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=matt.coster@imgtec.com \
--cc=mripard@kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=robh@kernel.org \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
--cc=ulf.hansson@linaro.org \
--cc=wefu@redhat.com \
/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