Skip to content

[PW_SID:972151] [v4,1/8] power: sequencing: Add T-HEAD TH1520 GPU power sequencer driver#534

Closed
linux-riscv-bot wants to merge 8 commits into
workflow__riscv__fixesfrom
pw972151
Closed

[PW_SID:972151] [v4,1/8] power: sequencing: Add T-HEAD TH1520 GPU power sequencer driver#534
linux-riscv-bot wants to merge 8 commits into
workflow__riscv__fixesfrom
pw972151

Conversation

@linux-riscv-bot

Copy link
Copy Markdown

PR for series 972151 applied to workflow__riscv__fixes

Name: [v4,1/8] power: sequencing: Add T-HEAD TH1520 GPU power sequencer driver
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=972151
Version: 4

Michal Wilczynski added 8 commits June 14, 2025 18:21
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 is
an auxiliary driver instantiated by the AON power domain driver.

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 devm_clk_bulk_get() and
devm_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>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Extend the TH1520 AON to describe the GPU clkgen reset line, required
for proper GPU clock and reset sequencing.

The T-HEAD TH1520 GPU requires coordinated management of two clocks
(core and sys) and two resets (GPU core reset and GPU clkgen reset).
Only the clkgen reset is exposed at the AON level, to support SoC
specific initialization handled through a dedicated auxiliary power
sequencing driver. The GPU core reset remains described in the GPU
device node, as from the GPU driver's perspective, there is only a
single reset line [1].

This follows upstream maintainers' recommendations [2] to abstract SoC
specific details into the PM domain layer rather than exposing them to
drivers directly.

Link: https://lore.kernel.org/all/816db99d-7088-4c1a-af03-b9a825ac09dc@imgtec.com/ - [1]
Link: https://lore.kernel.org/all/38d9650fc11a674c8b689d6bab937acf@kernel.org/ - [2]

Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
In order to support the complex power sequencing required by the TH1520
GPU, the AON power domain driver must be responsible for initiating the
corresponding sequencer driver. This functionality is specific to
platforms where the GPU power sequencing hardware is controlled by the
AON block.

Extend the AON power domain driver to check for the presence of the
"gpu-clkgen" reset in its own device tree node.

If the property is found, create and register a new auxiliary device.
This device acts as a proxy that allows the dedicated `pwrseq-thead-gpu`
auxiliary driver to bind and take control of the sequencing logic.

Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Update the Imagination PVR DRM driver to leverage the pwrseq framework
for managing the power sequence of the GPU on the T-HEAD TH1520 SoC.

To cleanly handle the TH1520's specific power requirements in the
generic driver, this patch implements the "driver match data" pattern. A
has_pwrseq flag in a new pvr_soc_data struct is now associated with
thead,th1520-gpu compatible string in the of_device_id table.

At probe time, the driver checks this flag. If true, it calls
devm_pwrseq_get("gpu-power"), requiring a valid sequencer and deferring
probe on failure. In this mode, all power and reset control is delegated
to the pwrseq provider. If the flag is false, the driver skips this
logic and falls back to its standard manual power management. Clock
handles are still acquired directly by this driver in both cases for
other purposes like devfreq.

The runtime PM callbacks, pvr_power_device_resume() and
pvr_power_device_suspend(), are modified to call pwrseq_power_on() and
pwrseq_power_off() respectively when the sequencer is present.  A helper
function, pvr_power_off_sequence_manual(), is introduced to encapsulate
the manual power-down logic.

Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Update the img,powervr-rogue.yaml to include the T-HEAD TH1520 SoC's
specific GPU compatible string.

The thead,th1520-gpu compatible, along with its full chain
img,img-bxm-4-64, and img,img-rogue, is added to the
list of recognized GPU types.

The power-domains property requirement for img,img-bxm-4-64 is also
ensured by adding it to the relevant allOf condition.

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Add the "gpu-clkgen" reset property to the AON device tree node. This
allows the AON power domain driver to detect the capability to power
sequence the GPU and spawn the necessary pwrseq-thead-gpu auxiliary
driver for managing the GPU's complex power sequence.

This commit also adds the prerequisite
dt-bindings/reset/thead,th1520-reset.h include to make the
TH1520_RESET_ID_GPU_CLKGEN available. This include was previously
dropped during a conflict resolution [1].

Link: https://lore.kernel.org/all/aAvfn2mq0Ksi8DF2@x1/ [1]

Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Add a device tree node for the IMG BXM-4-64 GPU present in the T-HEAD
TH1520 SoC used by the Lichee Pi 4A board. This node enables support for
the GPU using the drm/imagination driver.

By adding this node, the kernel can recognize and initialize the GPU,
providing graphics acceleration capabilities on the Lichee Pi 4A and
other boards based on the TH1520 SoC.

Add fixed clock gpu_mem_clk, as the MEM clock on the T-HEAD SoC can't be
controlled programatically.

Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Several RISC-V boards feature Imagination GPUs that are compatible with
the PowerVR driver. An example is the IMG BXM-4-64 GPU on the Lichee Pi
4A board. This commit adjusts the driver's Kconfig dependencies to allow
the PowerVR driver to be compiled on the RISC-V architecture.

By enabling compilation on RISC-V, we expand support for these GPUs,
providing graphics acceleration capabilities and enhancing hardware
compatibility on RISC-V platforms.

Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v4,1/8] power: sequencing: Add T-HEAD TH1520 GPU power sequencer driver"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 102.58 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v4,1/8] power: sequencing: Add T-HEAD TH1520 GPU power sequencer driver"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 961.65 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v4,1/8] power: sequencing: Add T-HEAD TH1520 GPU power sequencer driver"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1294.74 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v4,1/8] power: sequencing: Add T-HEAD TH1520 GPU power sequencer driver"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 20.81 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v4,1/8] power: sequencing: Add T-HEAD TH1520 GPU power sequencer driver"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 22.06 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v4,1/8] power: sequencing: Add T-HEAD TH1520 GPU power sequencer driver"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 2.33 seconds
Result: WARNING
Output:

CHECK: Lines should not end with a '('
#257: FILE: drivers/power/sequencing/pwrseq-thead-gpu.c:173:
+		return dev_err_probe(

total: 0 errors, 0 warnings, 1 checks, 231 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

Commit 6223667f871b ("power: sequencing: Add T-HEAD TH1520 GPU power sequencer driver") has style problems, please review.

NOTE: Ignored message types: ALLOC_SIZEOF_STRUCT CAMELCASE COMMIT_LOG_LONG_LINE GIT_COMMIT_ID MACRO_ARG_REUSE NO_AUTHOR_SIGN_OFF

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.
total: 0 errors, 0 warnings, 1 checks, 231 lines checked
CHECK: Lines should not end with a '('


@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v4,1/8] power: sequencing: Add T-HEAD TH1520 GPU power sequencer driver"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 71.89 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v4,1/8] power: sequencing: Add T-HEAD TH1520 GPU power sequencer driver"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v4,1/8] power: sequencing: Add T-HEAD TH1520 GPU power sequencer driver"
kdoc
Desc: Detects for kdoc errors
Duration: 0.88 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v4,1/8] power: sequencing: Add T-HEAD TH1520 GPU power sequencer driver"
module-param
Desc: Detect module_param changes
Duration: 0.32 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v4,1/8] power: sequencing: Add T-HEAD TH1520 GPU power sequencer driver"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.22 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v4,1/8] power: sequencing: Add T-HEAD TH1520 GPU power sequencer driver"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.30 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v4,2/8] dt-bindings: firmware: thead,th1520: Add resets for GPU clkgen"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 102.82 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v4,2/8] dt-bindings: firmware: thead,th1520: Add resets for GPU clkgen"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 926.15 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v4,2/8] dt-bindings: firmware: thead,th1520: Add resets for GPU clkgen"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1249.64 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v4,2/8] dt-bindings: firmware: thead,th1520: Add resets for GPU clkgen"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 20.81 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v4,2/8] dt-bindings: firmware: thead,th1520: Add resets for GPU clkgen"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 21.85 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v4,2/8] dt-bindings: firmware: thead,th1520: Add resets for GPU clkgen"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 0.62 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v4,2/8] dt-bindings: firmware: thead,th1520: Add resets for GPU clkgen"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 71.64 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v4,2/8] dt-bindings: firmware: thead,th1520: Add resets for GPU clkgen"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v4,2/8] dt-bindings: firmware: thead,th1520: Add resets for GPU clkgen"
kdoc
Desc: Detects for kdoc errors
Duration: 0.89 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v4,2/8] dt-bindings: firmware: thead,th1520: Add resets for GPU clkgen"
module-param
Desc: Detect module_param changes
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 6: "[v4,6/8] riscv: dts: thead: th1520: Add GPU clkgen reset to AON node"
kdoc
Desc: Detects for kdoc errors
Duration: 0.90 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 6: "[v4,6/8] riscv: dts: thead: th1520: Add GPU clkgen reset to AON node"
module-param
Desc: Detect module_param changes
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 6: "[v4,6/8] riscv: dts: thead: th1520: Add GPU clkgen reset to AON node"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.22 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 6: "[v4,6/8] riscv: dts: thead: th1520: Add GPU clkgen reset to AON node"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.30 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 7: "[v4,7/8] riscv: dts: thead: th1520: Add IMG BXM-4-64 GPU node"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 102.66 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 7: "[v4,7/8] riscv: dts: thead: th1520: Add IMG BXM-4-64 GPU node"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 977.79 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 7: "[v4,7/8] riscv: dts: thead: th1520: Add IMG BXM-4-64 GPU node"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1309.78 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 7: "[v4,7/8] riscv: dts: thead: th1520: Add IMG BXM-4-64 GPU node"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 20.98 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 7: "[v4,7/8] riscv: dts: thead: th1520: Add IMG BXM-4-64 GPU node"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 21.76 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 7: "[v4,7/8] riscv: dts: thead: th1520: Add IMG BXM-4-64 GPU node"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 0.82 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 7: "[v4,7/8] riscv: dts: thead: th1520: Add IMG BXM-4-64 GPU node"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 71.56 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 7: "[v4,7/8] riscv: dts: thead: th1520: Add IMG BXM-4-64 GPU node"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 7: "[v4,7/8] riscv: dts: thead: th1520: Add IMG BXM-4-64 GPU node"
kdoc
Desc: Detects for kdoc errors
Duration: 0.86 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 7: "[v4,7/8] riscv: dts: thead: th1520: Add IMG BXM-4-64 GPU node"
module-param
Desc: Detect module_param changes
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 7: "[v4,7/8] riscv: dts: thead: th1520: Add IMG BXM-4-64 GPU node"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.22 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 7: "[v4,7/8] riscv: dts: thead: th1520: Add IMG BXM-4-64 GPU node"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.30 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 8: "[v4,8/8] drm/imagination: Enable PowerVR driver for RISC-V"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 103.42 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 8: "[v4,8/8] drm/imagination: Enable PowerVR driver for RISC-V"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 991.00 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 8: "[v4,8/8] drm/imagination: Enable PowerVR driver for RISC-V"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1331.91 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 8: "[v4,8/8] drm/imagination: Enable PowerVR driver for RISC-V"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 20.87 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 8: "[v4,8/8] drm/imagination: Enable PowerVR driver for RISC-V"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 21.96 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 8: "[v4,8/8] drm/imagination: Enable PowerVR driver for RISC-V"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 0.64 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 8: "[v4,8/8] drm/imagination: Enable PowerVR driver for RISC-V"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 71.19 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 8: "[v4,8/8] drm/imagination: Enable PowerVR driver for RISC-V"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 8: "[v4,8/8] drm/imagination: Enable PowerVR driver for RISC-V"
kdoc
Desc: Detects for kdoc errors
Duration: 1.08 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 8: "[v4,8/8] drm/imagination: Enable PowerVR driver for RISC-V"
module-param
Desc: Detect module_param changes
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 8: "[v4,8/8] drm/imagination: Enable PowerVR driver for RISC-V"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.22 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 8: "[v4,8/8] drm/imagination: Enable PowerVR driver for RISC-V"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.30 seconds
Result: PASS

@linux-riscv-bot
linux-riscv-bot deleted the pw972151 branch June 18, 2025 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant