[PATCH v3 1/7] drm/panthor: Add optional external reset support
From: Cunyuan Liu
Date: Thu Nov 19 2026 - 07:39:44 EST
The GPU on CIX Sky1 needs an external reset before the driver first
accesses the hardware. Without this reset, the GPU hardware cannot be
accessed correctly.
Acquire an optional exclusive reset for all platforms and apply it after
enabling the clocks during initial probe. Platforms without a reset keep
working through the reset framework NULL handling.
Signed-off-by: Cunyuan Liu <cunyuan.liu@xxxxxxxxxxx>
---
drivers/gpu/drm/panthor/panthor_device.c | 13 +++++++++++++
drivers/gpu/drm/panthor/panthor_device.h | 5 +++++
2 files changed, 18 insertions(+)
diff --git a/drivers/gpu/drm/panthor/panthor_device.c b/drivers/gpu/drm/panthor/panthor_device.c
index 9687c59de350..a3a32abec5f7 100644
--- a/drivers/gpu/drm/panthor/panthor_device.c
+++ b/drivers/gpu/drm/panthor/panthor_device.c
@@ -229,6 +229,11 @@ int panthor_device_init(struct panthor_device *ptdev)
return ret;
}
+ ptdev->reset_control = devm_reset_control_get_optional_exclusive(ptdev->base.dev, NULL);
+ if (IS_ERR(ptdev->reset_control))
+ return dev_err_probe(ptdev->base.dev, PTR_ERR(ptdev->reset_control),
+ "Failed to get GPU reset\n");
+
ret = panthor_devfreq_init(ptdev);
if (ret)
return ret;
@@ -511,6 +516,12 @@ int panthor_device_resume(struct device *dev)
if (ret)
goto err_disable_stacks_clk;
+ if (!panthor_device_is_initialized(ptdev)) {
+ ret = reset_control_reset(ptdev->reset_control);
+ if (ret)
+ goto err_disable_coregroup_clk;
+ }
+
panthor_devfreq_resume(ptdev);
if (panthor_device_is_initialized(ptdev) &&
@@ -553,6 +564,8 @@ int panthor_device_resume(struct device *dev)
err_suspend_devfreq:
panthor_devfreq_suspend(ptdev);
+
+err_disable_coregroup_clk:
clk_disable_unprepare(ptdev->clks.coregroup);
err_disable_stacks_clk:
diff --git a/drivers/gpu/drm/panthor/panthor_device.h b/drivers/gpu/drm/panthor/panthor_device.h
index b55a3f9edd41..adbc2e2f03be 100644
--- a/drivers/gpu/drm/panthor/panthor_device.h
+++ b/drivers/gpu/drm/panthor/panthor_device.h
@@ -19,6 +19,8 @@
#include <drm/gpu_scheduler.h>
#include <drm/panthor_drm.h>
+struct reset_control;
+
struct panthor_csf;
struct panthor_csf_ctx;
struct panthor_device;
@@ -138,6 +140,9 @@ struct panthor_device {
/** @soc_data: Optional SoC data. */
const struct panthor_soc_data *soc_data;
+ /** @reset_control: Optional external GPU reset. */
+ struct reset_control *reset_control;
+
/** @phys_addr: Physical address of the iomem region. */
phys_addr_t phys_addr;
--
2.53.0