power: sequencing: Add T-HEAD TH1520 GPU power sequencer driver
authorMichal Wilczynski <m.wilczynski@samsung.com>
Mon, 23 Jun 2025 11:42:39 +0000 (13:42 +0200)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Tue, 24 Jun 2025 13:55:05 +0000 (15:55 +0200)
commitd4c2d9b5b7ceed14a3a835fd969bb0699b9608d3
tree893fe368a1a96ae26d6603636b4ce1752575affa
parent19272b37aa4f83ca52bdf9c16d5d81bdd1354494
power: sequencing: Add T-HEAD TH1520 GPU power sequencer driver

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>
Link: https://lore.kernel.org/r/20250623-apr_14_for_sending-v6-1-6583ce0f6c25@samsung.com
[Bartosz: use a ternary operator instead of implicitly casting the
result of a boolean expression to int]
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
MAINTAINERS
drivers/power/sequencing/Kconfig
drivers/power/sequencing/Makefile
drivers/power/sequencing/pwrseq-thead-gpu.c [new file with mode: 0644]