mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v3 0/7] Add initial GPU support for CIX Sky1
@ 2026-11-19 12:38 Cunyuan Liu
  2026-11-19 12:38 ` [PATCH v3 1/7] drm/panthor: Add optional external reset support Cunyuan Liu
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: Cunyuan Liu @ 2026-11-19 12:38 UTC (permalink / raw)
  To: boris.brezillon, steven.price, liviu.dudau, robh, krzk+dt,
	conor+dt, gary.yang, fugang.duan, daniel.almeida, aliceryhl,
	p.zabel, daniel
  Cc: dri-devel, devicetree, linux-arm-kernel, linux-kernel,
	rust-for-linux, cix-kernel-upstream, robin.wang, cunyuan.liu

This series adds initial support for the Mali GPU on CIX Sky1 and
enables it on the Radxa Orion O6 board.

The GPU requires an external reset before the driver first accesses
the hardware. Add optional reset support to Panthor to perform this reset
during initialization.

This initial version keeps the PM firmware default clock settings and
skips devfreq. It does not read OPPs or request a performance level.
The firmware sets the default GPU frequency to 1 GHz. No devfreq
governor or GPU cooling device is registered.

Without an OPP table, the driver can only run when neither mali-supply
nor sram-supply is present and the platform provides working clocks and
power.

Configure the system-level cache before L2 power-on using the policies
from the working CIX Sky1 driver. On Sky1, devices on the MMHUB bus
cannot access the system-level cache, so buffers shared between the GPU
and MMHUB devices require a specific system-level cache policy. Without
this configuration, the GPU display output is corrupted.

The system-cache support is a separate patch and reads the policies from
DT. The proposed format is <source-id read-policy write-policy>, so the
DT only lists sources with nonzero policies. When the property is absent,
the driver leaves the registers unchanged. The format and zero-default
semantics are included for review.

The series contains seven patches:
[1/7] drm/panthor: Add optional external reset support
[2/7] drm/panthor: Allow operation without an OPP table
[3/7] dt-bindings: gpu: arm,mali-valhall-csf: Add system-cache policies
[4/7] drm/panthor: Add system-cache allocation policy support
[5/7] dt-bindings: gpu: Add CIX Sky1 Mali support
[6/7] drm/panthor: Add CIX Sky1 compatible
[7/7] arm64: dts: cix: Add GPU support for Sky1 Orion O6

Tested on Radxa Orion O6:
  - Offscreen rendering with pixel readback
  - kmscube
  - glmark2 at 1080p
  - Runtime suspend and resume with a retained EGL context
  - Reset-worker operations
  - Module unload and reload


Changes in v3:
  - Split optional reset, no-OPP operation and system-cache support into
    separate patches, as suggested by Liviu Dudau.
  - Remove the Sky1-specific skip_devfreq flag. Use the generic no-OPP
    path.
    Limit this fallback to configurations without GPU supply properties,
    retaining probe failure for supplies without an OPP table.
  - Move system-cache policies to DT and use separate read/write values,
    as suggested by Liviu Dudau and Daniel Stone. Add explicit source IDs
    so that unused entries can be omitted.
  - Validate the architecture, source IDs and policies. Restore the
    configuration through the common L2 power-on entry.
  - Drop Conor Dooley's Acked-by because the Sky1 binding now requires
    the new arm,sysc-alloc property. Please review the updated binding.

Changes in v2:
  - Use devm_reset_control_get_optional_exclusive() unconditionally,
    remove the redundant NULL check before reset_control_reset(), and
    drop needs_external_reset, as suggested by Philipp Zabel.
  - Add Conor Dooley's Acked-by to the then-unchanged binding patch.


Link to v2:
https://lore.kernel.org/all/20261109120902.125242-1-cunyuan.liu@cixtech.com/

Link to v1:
https://lore.kernel.org/all/20261106104735.1651267-1-cunyuan.liu@cixtech.com/


Best regards,
Cunyuan

Cunyuan Liu (7):
  drm/panthor: Add optional external reset support
  drm/panthor: Allow operation without an OPP table
  dt-bindings: gpu: arm,mali-valhall-csf: Add system-cache policies
  drm/panthor: Add system-cache allocation policy support
  dt-bindings: gpu: Add CIX Sky1 Mali support
  drm/panthor: Add CIX Sky1 compatible
  arm64: dts: cix: Add GPU support for Sky1 Orion O6

 .../bindings/gpu/arm,mali-valhall-csf.yaml    |  79 ++++++++
 arch/arm64/boot/dts/cix/sky1-orion-o6.dts     |   4 +
 arch/arm64/boot/dts/cix/sky1.dtsi             |  19 ++
 drivers/gpu/drm/panthor/panthor_devfreq.c     |  13 +-
 drivers/gpu/drm/panthor/panthor_device.c      |  13 ++
 drivers/gpu/drm/panthor/panthor_device.h      |   7 +-
 drivers/gpu/drm/panthor/panthor_drv.c         |   1 +
 drivers/gpu/drm/panthor/panthor_gpu.c         | 187 ++++++++++++++++++
 drivers/gpu/drm/panthor/panthor_gpu.h         |   1 +
 drivers/gpu/drm/panthor/panthor_gpu_regs.h    |  58 ++++++
 drivers/gpu/drm/panthor/panthor_hw.c          |  13 ++
 drivers/gpu/drm/panthor/panthor_hw.h          |   5 +-
 12 files changed, 394 insertions(+), 6 deletions(-)


base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
-- 
2.53.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v3 1/7] drm/panthor: Add optional external reset support
  2026-11-19 12:38 [PATCH v3 0/7] Add initial GPU support for CIX Sky1 Cunyuan Liu
@ 2026-11-19 12:38 ` Cunyuan Liu
  2026-11-19 12:38 ` [PATCH v3 2/7] drm/panthor: Allow operation without an OPP table Cunyuan Liu
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Cunyuan Liu @ 2026-11-19 12:38 UTC (permalink / raw)
  To: boris.brezillon, steven.price, liviu.dudau, robh, krzk+dt,
	conor+dt, gary.yang, fugang.duan, daniel.almeida, aliceryhl,
	p.zabel, daniel
  Cc: dri-devel, devicetree, linux-arm-kernel, linux-kernel,
	rust-for-linux, cix-kernel-upstream, robin.wang, cunyuan.liu

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@cixtech.com>
---
 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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v3 2/7] drm/panthor: Allow operation without an OPP table
  2026-11-19 12:38 [PATCH v3 0/7] Add initial GPU support for CIX Sky1 Cunyuan Liu
  2026-11-19 12:38 ` [PATCH v3 1/7] drm/panthor: Add optional external reset support Cunyuan Liu
@ 2026-11-19 12:38 ` Cunyuan Liu
  2026-11-19 12:38 ` [PATCH v3 3/7] dt-bindings: gpu: arm,mali-valhall-csf: Add system-cache policies Cunyuan Liu
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Cunyuan Liu @ 2026-11-19 12:38 UTC (permalink / raw)
  To: boris.brezillon, steven.price, liviu.dudau, robh, krzk+dt,
	conor+dt, gary.yang, fugang.duan, daniel.almeida, aliceryhl,
	p.zabel, daniel
  Cc: dri-devel, devicetree, linux-arm-kernel, linux-kernel,
	rust-for-linux, cix-kernel-upstream, robin.wang, cunyuan.liu

Some platforms provide GPU clocks through firmware without an OPP
table that the driver can use. Failing probe when the DT has no OPP
table prevents these platforms from using the clock settings already
provided by firmware.

Continue without devfreq when devm_pm_opp_of_add_table() returns
-ENODEV, as Panfrost does. Keep the current core clock rate for
profiling and report the clock provider's rate when devfreq is not
registered.

Only allow the fallback when neither mali-supply nor sram-supply is
present. GPU supply properties require an OPP table to configure and
enable the supplies. Without these properties, the platform must provide
a usable clock and power configuration.

Signed-off-by: Cunyuan Liu <cunyuan.liu@cixtech.com>
---
 drivers/gpu/drm/panthor/panthor_devfreq.c | 13 ++++++++++++-
 drivers/gpu/drm/panthor/panthor_device.h  |  2 +-
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/panthor/panthor_devfreq.c b/drivers/gpu/drm/panthor/panthor_devfreq.c
index 2249b41ca4af..778c20f0921a 100644
--- a/drivers/gpu/drm/panthor/panthor_devfreq.c
+++ b/drivers/gpu/drm/panthor/panthor_devfreq.c
@@ -6,6 +6,7 @@
 #include <linux/devfreq_cooling.h>
 #include <linux/platform_device.h>
 #include <linux/pm_opp.h>
+#include <linux/property.h>
 
 #include <drm/drm_managed.h>
 #include <drm/drm_print.h>
@@ -172,6 +173,16 @@ int panthor_devfreq_init(struct panthor_device *ptdev)
 		}
 
 		ret = devm_pm_opp_of_add_table(dev);
+		if (ret == -ENODEV) {
+			if (device_property_present(dev, "mali-supply") ||
+			    device_property_present(dev, "sram-supply"))
+				return dev_err_probe(dev, -ENODEV,
+						     "GPU supplies require an OPP table\n");
+
+			/* Keep the clock provider's rate when no OPP table is present. */
+			ptdev->fast_rate = clk_get_rate(ptdev->clks.core);
+			return 0;
+		}
 		if (ret)
 			return ret;
 	} else {
@@ -324,7 +335,7 @@ unsigned long panthor_devfreq_get_freq(struct panthor_device *ptdev)
 	int ret;
 
 	if (!pdevfreq->devfreq)
-		return 0;
+		return clk_get_rate(ptdev->clks.core);
 
 	ret = pdevfreq->devfreq->profile->get_cur_freq(ptdev->base.dev, &freq);
 	if (ret)
diff --git a/drivers/gpu/drm/panthor/panthor_device.h b/drivers/gpu/drm/panthor/panthor_device.h
index adbc2e2f03be..f5353372c1ae 100644
--- a/drivers/gpu/drm/panthor/panthor_device.h
+++ b/drivers/gpu/drm/panthor/panthor_device.h
@@ -328,7 +328,7 @@ struct panthor_device {
 	/** @profile_mask: User-set profiling flags for job accounting. */
 	u32 profile_mask;
 
-	/** @fast_rate: Maximum device clock frequency. Set by DVFS */
+	/** @fast_rate: Maximum OPP frequency, or the clock rate without OPPs. */
 	unsigned long fast_rate;
 
 #ifdef CONFIG_DEBUG_FS
-- 
2.53.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v3 3/7] dt-bindings: gpu: arm,mali-valhall-csf: Add system-cache policies
  2026-11-19 12:38 [PATCH v3 0/7] Add initial GPU support for CIX Sky1 Cunyuan Liu
  2026-11-19 12:38 ` [PATCH v3 1/7] drm/panthor: Add optional external reset support Cunyuan Liu
  2026-11-19 12:38 ` [PATCH v3 2/7] drm/panthor: Allow operation without an OPP table Cunyuan Liu
@ 2026-11-19 12:38 ` Cunyuan Liu
  2026-11-22 16:58   ` Krzysztof Kozlowski
  2026-11-19 12:38 ` [PATCH v3 4/7] drm/panthor: Add system-cache allocation policy support Cunyuan Liu
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 10+ messages in thread
From: Cunyuan Liu @ 2026-11-19 12:38 UTC (permalink / raw)
  To: boris.brezillon, steven.price, liviu.dudau, robh, krzk+dt,
	conor+dt, gary.yang, fugang.duan, daniel.almeida, aliceryhl,
	p.zabel, daniel
  Cc: dri-devel, devicetree, linux-arm-kernel, linux-kernel,
	rust-for-linux, cix-kernel-upstream, robin.wang, cunyuan.liu

Describe system-cache allocation policies for Mali GPUs with SYSC_ALLOC
registers. The policy depends on how the GPU is integrated with the rest
of the system and belongs in DT rather than a platform table in the driver.

Use entries containing a source ID and separate read and write policies.
When the property is present, omitted sources use L2 allocation. Without
the property, the driver leaves the register settings unchanged.

Signed-off-by: Cunyuan Liu <cunyuan.liu@cixtech.com>
---
 .../bindings/gpu/arm,mali-valhall-csf.yaml    | 24 +++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/Documentation/devicetree/bindings/gpu/arm,mali-valhall-csf.yaml b/Documentation/devicetree/bindings/gpu/arm,mali-valhall-csf.yaml
index 8eccd4338a2b..4d50427edd87 100644
--- a/Documentation/devicetree/bindings/gpu/arm,mali-valhall-csf.yaml
+++ b/Documentation/devicetree/bindings/gpu/arm,mali-valhall-csf.yaml
@@ -97,6 +97,30 @@ properties:
 
   dma-coherent: true
 
+  arm,sysc-alloc:
+    $ref: /schemas/types.yaml#/definitions/uint32-matrix
+    minItems: 1
+    maxItems: 32
+    items:
+      items:
+        - description: GPU internal source ID
+          minimum: 0
+          maximum: 31
+        - description: Read allocation policy
+          enum: [0, 2, 3, 4, 5]
+        - description: Write allocation policy
+          enum: [0, 2, 3, 4, 5]
+    description:
+      System-cache allocation policies for GPU architecture 11.0.3 and later.
+      Each entry contains a source ID, a read policy and a write policy.
+      Source IDs must be unique. Reserved source IDs and access directions
+      not supported by the GPU must use zero policies. Policy values are
+      0 for L2 allocation, 2 for never allocate, 3 for always allocate,
+      4 for partial allocation and 5 for L2 partial allocation. When present,
+      all source policies start at zero and the listed entries override them.
+      Omitted sources therefore use L2 allocation. If absent, the register
+      defaults are preserved.
+
 required:
   - compatible
   - reg
-- 
2.53.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v3 4/7] drm/panthor: Add system-cache allocation policy support
  2026-11-19 12:38 [PATCH v3 0/7] Add initial GPU support for CIX Sky1 Cunyuan Liu
                   ` (2 preceding siblings ...)
  2026-11-19 12:38 ` [PATCH v3 3/7] dt-bindings: gpu: arm,mali-valhall-csf: Add system-cache policies Cunyuan Liu
@ 2026-11-19 12:38 ` Cunyuan Liu
  2026-11-19 12:38 ` [PATCH v3 5/7] dt-bindings: gpu: Add CIX Sky1 Mali support Cunyuan Liu
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Cunyuan Liu @ 2026-11-19 12:38 UTC (permalink / raw)
  To: boris.brezillon, steven.price, liviu.dudau, robh, krzk+dt,
	conor+dt, gary.yang, fugang.duan, daniel.almeida, aliceryhl,
	p.zabel, daniel
  Cc: dri-devel, devicetree, linux-arm-kernel, linux-kernel,
	rust-for-linux, cix-kernel-upstream, robin.wang, cunyuan.liu

CIX Sky1 needs system-cache allocation policies that match the platform
integration. Without these settings, GPU rendering results are displayed
incorrectly.

Read the policies from arm,sysc-alloc instead of hardcoding platform
register values. Validate the GPU architecture, source IDs and supported
read/write policies before saving the configuration. Reject duplicate
source IDs and invalid entries.

Restore the policies before L2 power-on through the common hardware
wrapper so that both legacy and PWR backends apply them after reset and
runtime resume. Leave the registers unchanged when no property is present.

Signed-off-by: Cunyuan Liu <cunyuan.liu@cixtech.com>
---
 drivers/gpu/drm/panthor/panthor_gpu.c      | 187 +++++++++++++++++++++
 drivers/gpu/drm/panthor/panthor_gpu.h      |   1 +
 drivers/gpu/drm/panthor/panthor_gpu_regs.h |  58 +++++++
 drivers/gpu/drm/panthor/panthor_hw.c       |  13 ++
 drivers/gpu/drm/panthor/panthor_hw.h       |   5 +-
 5 files changed, 260 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/panthor/panthor_gpu.c b/drivers/gpu/drm/panthor/panthor_gpu.c
index a383b04f101e..118e13e56555 100644
--- a/drivers/gpu/drm/panthor/panthor_gpu.c
+++ b/drivers/gpu/drm/panthor/panthor_gpu.c
@@ -12,6 +12,8 @@
 #include <linux/iopoll.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
+#include <linux/property.h>
+#include <linux/string.h>
 
 #include <drm/drm_drv.h>
 #include <drm/drm_managed.h>
@@ -46,6 +48,15 @@ struct panthor_gpu {
 
 	/** @cache_flush_lock: Lock to serialize cache flushes */
 	struct mutex cache_flush_lock;
+
+	/**
+	 * @sysc_alloc: System-cache allocation policies for GPU architecture
+	 * 11.0.3 and later.
+	 */
+	u32 sysc_alloc[GPU_SYSC_ALLOC_COUNT];
+
+	/** @sysc_alloc_enabled: Apply the system-cache allocation policies. */
+	bool sysc_alloc_enabled;
 };
 
 #define GPU_INTERRUPTS_MASK	\
@@ -63,6 +74,178 @@ static void panthor_gpu_coherency_set(struct panthor_device *ptdev)
 		  ptdev->gpu_info.selected_coherency);
 }
 
+enum panthor_sysc_alloc_cell {
+	PANTHOR_SYSC_ALLOC_SOURCE,
+	PANTHOR_SYSC_ALLOC_READ,
+	PANTHOR_SYSC_ALLOC_WRITE,
+	PANTHOR_SYSC_ALLOC_CELLS,
+};
+
+static bool panthor_gpu_has_sysc_alloc(u32 gpu_id)
+{
+	/* SYSC_ALLOC is available from GPU architecture 11.0.3. */
+	return GPU_ARCH_MAJOR(gpu_id) > 11 ||
+	       (GPU_ARCH_MAJOR(gpu_id) == 11 &&
+		(GPU_ARCH_MINOR(gpu_id) > 0 || GPU_ARCH_REV(gpu_id) >= 3));
+}
+
+static bool panthor_gpu_sysc_alloc_policy_valid(u32 policy)
+{
+	switch (policy) {
+	case GPU_SYSC_ALLOC_L2_ALLOC:
+	case GPU_SYSC_ALLOC_NEVER_ALLOC:
+	case GPU_SYSC_ALLOC_ALWAYS_ALLOC:
+	case GPU_SYSC_ALLOC_PARTIAL_ALLOC:
+	case GPU_SYSC_ALLOC_L2_PARTIAL_ALLOC:
+		return true;
+	default:
+		return false;
+	}
+}
+
+static bool panthor_gpu_sysc_alloc_read_supported(u32 gpu_id, u32 source)
+{
+	switch (source) {
+	case GPU_SYSC_ALLOC_R_OTHER:
+	case GPU_SYSC_ALLOC_R_CSF:
+	case GPU_SYSC_ALLOC_R_MMU:
+	case GPU_SYSC_ALLOC_R_TILER_VERT:
+	case GPU_SYSC_ALLOC_R_TILER_PTR:
+	case GPU_SYSC_ALLOC_R_TILER_INDEX:
+	case GPU_SYSC_ALLOC_R_TILER_OTHER:
+	case GPU_SYSC_ALLOC_R_IC:
+	case GPU_SYSC_ALLOC_R_ATTR:
+	case GPU_SYSC_ALLOC_R_SCM:
+	case GPU_SYSC_ALLOC_R_FSDC:
+	case GPU_SYSC_ALLOC_R_PLR:
+	case GPU_SYSC_ALLOC_R_TEX:
+	case GPU_SYSC_ALLOC_R_LSC:
+		return true;
+	case GPU_SYSC_ALLOC_R_VL:
+		/* TTIX (architecture 12, product 0) has no VL read policy. */
+		if (GPU_ARCH_MAJOR(gpu_id) == 12 && GPU_PROD_MAJOR(gpu_id) == 0)
+			return false;
+		return true;
+	case GPU_SYSC_ALLOC_R_RT:
+	case GPU_SYSC_ALLOC_R_NE_A:
+	case GPU_SYSC_ALLOC_R_NE_N:
+		if (GPU_ARCH_MAJOR(gpu_id) < 14)
+			return false;
+		return true;
+	default:
+		return false;
+	}
+}
+
+static bool panthor_gpu_sysc_alloc_write_supported(u32 gpu_id, u32 source)
+{
+	switch (source) {
+	case GPU_SYSC_ALLOC_W_OTHER:
+	case GPU_SYSC_ALLOC_W_CSF:
+	case GPU_SYSC_ALLOC_W_PCB:
+	case GPU_SYSC_ALLOC_W_TILER_PTR:
+	case GPU_SYSC_ALLOC_W_TILER_VERT_PLIST:
+	case GPU_SYSC_ALLOC_W_TILER_OTHER:
+	case GPU_SYSC_ALLOC_W_L2_EVICT:
+	case GPU_SYSC_ALLOC_W_L2_FLUSH:
+	case GPU_SYSC_ALLOC_W_TIB_COLOR:
+	case GPU_SYSC_ALLOC_W_TIB_COLOR_AFBCH:
+	case GPU_SYSC_ALLOC_W_TIB_COLOR_AFBCB:
+	case GPU_SYSC_ALLOC_W_TIB_CRC:
+	case GPU_SYSC_ALLOC_W_TIB_DS:
+	case GPU_SYSC_ALLOC_W_TIB_DS_AFBCH:
+	case GPU_SYSC_ALLOC_W_TIB_DS_AFBCB:
+	case GPU_SYSC_ALLOC_W_LSC:
+		return true;
+	case GPU_SYSC_ALLOC_W_RT:
+	case GPU_SYSC_ALLOC_W_NE_A:
+	case GPU_SYSC_ALLOC_W_NE_N:
+		if (GPU_ARCH_MAJOR(gpu_id) < 14)
+			return false;
+		return true;
+	default:
+		return false;
+	}
+}
+
+void panthor_gpu_sysc_config_set(struct panthor_device *ptdev)
+{
+	struct panthor_gpu *gpu = ptdev->gpu;
+	unsigned int i;
+
+	if (!gpu->sysc_alloc_enabled)
+		return;
+
+	for (i = 0; i < ARRAY_SIZE(gpu->sysc_alloc); i++)
+		gpu_write(gpu->iomem, GPU_SYSC_ALLOC(i), gpu->sysc_alloc[i]);
+}
+
+static int panthor_gpu_sysc_config_init(struct panthor_device *ptdev)
+{
+	struct device *dev = ptdev->base.dev;
+	struct panthor_gpu *gpu = ptdev->gpu;
+	u32 entries[GPU_SYSC_ALLOC_SOURCE_COUNT][PANTHOR_SYSC_ALLOC_CELLS];
+	u32 config[GPU_SYSC_ALLOC_COUNT] = {};
+	u32 gpu_id = ptdev->gpu_info.gpu_id;
+	u32 sources = 0;
+	unsigned int i;
+	int count;
+	int ret;
+
+	if (!device_property_present(dev, "arm,sysc-alloc"))
+		return 0;
+
+	if (!panthor_gpu_has_sysc_alloc(gpu_id))
+		return dev_err_probe(dev, -EOPNOTSUPP,
+				     "SYSC_ALLOC requires GPU architecture 11.0.3 or later\n");
+
+	count = device_property_count_u32(dev, "arm,sysc-alloc");
+	if (count < 0)
+		return dev_err_probe(dev, count, "Failed to count SYSC_ALLOC cells\n");
+	if (!count || count > ARRAY_SIZE(entries) * PANTHOR_SYSC_ALLOC_CELLS ||
+	    count % PANTHOR_SYSC_ALLOC_CELLS)
+		return dev_err_probe(dev, -EINVAL, "Invalid SYSC_ALLOC entry count\n");
+
+	ret = device_property_read_u32_array(dev, "arm,sysc-alloc", &entries[0][0], count);
+	if (ret)
+		return dev_err_probe(dev, ret, "Failed to read SYSC_ALLOC entries\n");
+
+	for (i = 0; i < count / PANTHOR_SYSC_ALLOC_CELLS; i++) {
+		u32 source = entries[i][PANTHOR_SYSC_ALLOC_SOURCE];
+		u32 read = entries[i][PANTHOR_SYSC_ALLOC_READ];
+		u32 write = entries[i][PANTHOR_SYSC_ALLOC_WRITE];
+
+		if (source >= GPU_SYSC_ALLOC_SOURCE_COUNT)
+			return dev_err_probe(dev, -EINVAL,
+					     "Invalid SYSC_ALLOC source %u\n", source);
+		if (sources & BIT(source))
+			return dev_err_probe(dev, -EINVAL,
+					     "Duplicate SYSC_ALLOC source %u\n", source);
+		sources |= BIT(source);
+
+		if (!panthor_gpu_sysc_alloc_policy_valid(read) ||
+		    !panthor_gpu_sysc_alloc_policy_valid(write))
+			return dev_err_probe(dev, -EINVAL,
+					     "Invalid SYSC_ALLOC policies <%u %u %u>\n",
+					     source, read, write);
+
+		if ((read != GPU_SYSC_ALLOC_L2_ALLOC &&
+		     !panthor_gpu_sysc_alloc_read_supported(gpu_id, source)) ||
+		    (write != GPU_SYSC_ALLOC_L2_ALLOC &&
+		     !panthor_gpu_sysc_alloc_write_supported(gpu_id, source)))
+			return dev_err_probe(dev, -EINVAL,
+					     "Unsupported SYSC_ALLOC policies <%u %u %u>\n",
+					     source, read, write);
+
+		config[source / GPU_SYSC_ALLOC_SOURCES_PER_REG] |=
+			GPU_SYSC_ALLOC_POLICY(source, read, write);
+	}
+
+	memcpy(gpu->sysc_alloc, config, sizeof(config));
+	gpu->sysc_alloc_enabled = true;
+	return 0;
+}
+
 static void panthor_gpu_l2_config_set(struct panthor_device *ptdev)
 {
 	struct panthor_gpu *gpu = ptdev->gpu;
@@ -164,6 +347,10 @@ int panthor_gpu_init(struct panthor_device *ptdev)
 	mutex_init(&gpu->cache_flush_lock);
 	ptdev->gpu = gpu;
 
+	ret = panthor_gpu_sysc_config_init(ptdev);
+	if (ret)
+		return ret;
+
 	dma_set_max_seg_size(ptdev->base.dev, UINT_MAX);
 	pa_bits = GPU_MMU_FEATURES_PA_BITS(ptdev->gpu_info.mmu_features);
 	ret = dma_set_mask_and_coherent(ptdev->base.dev, DMA_BIT_MASK(pa_bits));
diff --git a/drivers/gpu/drm/panthor/panthor_gpu.h b/drivers/gpu/drm/panthor/panthor_gpu.h
index f615feb05609..935e4af31e0a 100644
--- a/drivers/gpu/drm/panthor/panthor_gpu.h
+++ b/drivers/gpu/drm/panthor/panthor_gpu.h
@@ -13,6 +13,7 @@ int panthor_gpu_init(struct panthor_device *ptdev);
 void panthor_gpu_unplug(struct panthor_device *ptdev);
 void panthor_gpu_suspend(struct panthor_device *ptdev);
 void panthor_gpu_resume(struct panthor_device *ptdev);
+void panthor_gpu_sysc_config_set(struct panthor_device *ptdev);
 
 int panthor_gpu_block_power_on(struct panthor_device *ptdev,
 			       const char *blk_name,
diff --git a/drivers/gpu/drm/panthor/panthor_gpu_regs.h b/drivers/gpu/drm/panthor/panthor_gpu_regs.h
index 4c5b953796e4..ec4650e7ced5 100644
--- a/drivers/gpu/drm/panthor/panthor_gpu_regs.h
+++ b/drivers/gpu/drm/panthor/panthor_gpu_regs.h
@@ -116,4 +116,62 @@
 #define   GPU_COHERENCY_ACE				1
 #define   GPU_COHERENCY_NONE				31
 
+#define GPU_SYSC_ALLOC_COUNT				8
+#define GPU_SYSC_ALLOC_SOURCES_PER_REG			4
+#define GPU_SYSC_ALLOC_SOURCE_COUNT			\
+	(GPU_SYSC_ALLOC_COUNT * GPU_SYSC_ALLOC_SOURCES_PER_REG)
+#define GPU_SYSC_ALLOC(n)				(0x340 + (n) * 4)
+#define   GPU_SYSC_ALLOC_READ_POLICY			GENMASK(3, 0)
+#define   GPU_SYSC_ALLOC_WRITE_POLICY			GENMASK(7, 4)
+#define   GPU_SYSC_ALLOC_POLICY(source, read, write) \
+	((FIELD_PREP(GPU_SYSC_ALLOC_READ_POLICY, read) | \
+	  FIELD_PREP(GPU_SYSC_ALLOC_WRITE_POLICY, write)) << \
+	 (((source) % GPU_SYSC_ALLOC_SOURCES_PER_REG) * BITS_PER_BYTE))
+
+#define GPU_SYSC_ALLOC_L2_ALLOC				0
+#define GPU_SYSC_ALLOC_NEVER_ALLOC			2
+#define GPU_SYSC_ALLOC_ALWAYS_ALLOC			3
+#define GPU_SYSC_ALLOC_PARTIAL_ALLOC			4
+#define GPU_SYSC_ALLOC_L2_PARTIAL_ALLOC			5
+
+/* Internal source IDs have separate read and write meanings. */
+#define GPU_SYSC_ALLOC_R_OTHER				0x00
+#define GPU_SYSC_ALLOC_R_CSF				0x02
+#define GPU_SYSC_ALLOC_R_MMU				0x04
+#define GPU_SYSC_ALLOC_R_TILER_VERT			0x08
+#define GPU_SYSC_ALLOC_R_TILER_PTR			0x09
+#define GPU_SYSC_ALLOC_R_TILER_INDEX			0x0a
+#define GPU_SYSC_ALLOC_R_TILER_OTHER			0x0b
+#define GPU_SYSC_ALLOC_R_IC				0x10
+#define GPU_SYSC_ALLOC_R_ATTR				0x11
+#define GPU_SYSC_ALLOC_R_SCM				0x12
+#define GPU_SYSC_ALLOC_R_FSDC				0x13
+#define GPU_SYSC_ALLOC_R_VL				0x14
+#define GPU_SYSC_ALLOC_R_PLR				0x15
+#define GPU_SYSC_ALLOC_R_RT				0x17
+#define GPU_SYSC_ALLOC_R_TEX				0x18
+#define GPU_SYSC_ALLOC_R_NE_A				0x19
+#define GPU_SYSC_ALLOC_R_NE_N				0x1a
+#define GPU_SYSC_ALLOC_R_LSC				0x1c
+
+#define GPU_SYSC_ALLOC_W_OTHER				0x00
+#define GPU_SYSC_ALLOC_W_CSF				0x02
+#define GPU_SYSC_ALLOC_W_PCB				0x07
+#define GPU_SYSC_ALLOC_W_TILER_PTR			0x09
+#define GPU_SYSC_ALLOC_W_TILER_VERT_PLIST		0x0a
+#define GPU_SYSC_ALLOC_W_TILER_OTHER			0x0b
+#define GPU_SYSC_ALLOC_W_L2_EVICT			0x0c
+#define GPU_SYSC_ALLOC_W_L2_FLUSH			0x0d
+#define GPU_SYSC_ALLOC_W_TIB_COLOR			0x10
+#define GPU_SYSC_ALLOC_W_TIB_COLOR_AFBCH		0x11
+#define GPU_SYSC_ALLOC_W_TIB_COLOR_AFBCB		0x12
+#define GPU_SYSC_ALLOC_W_TIB_CRC			0x13
+#define GPU_SYSC_ALLOC_W_TIB_DS				0x14
+#define GPU_SYSC_ALLOC_W_TIB_DS_AFBCH			0x15
+#define GPU_SYSC_ALLOC_W_TIB_DS_AFBCB			0x16
+#define GPU_SYSC_ALLOC_W_RT				0x17
+#define GPU_SYSC_ALLOC_W_NE_A				0x19
+#define GPU_SYSC_ALLOC_W_NE_N				0x1a
+#define GPU_SYSC_ALLOC_W_LSC				0x1c
+
 #endif /* __PANTHOR_GPU_REGS_H__ */
diff --git a/drivers/gpu/drm/panthor/panthor_hw.c b/drivers/gpu/drm/panthor/panthor_hw.c
index ea1e222ef121..86de88163e50 100644
--- a/drivers/gpu/drm/panthor/panthor_hw.c
+++ b/drivers/gpu/drm/panthor/panthor_hw.c
@@ -59,6 +59,19 @@ static struct panthor_hw_entry panthor_hw_match[] = {
 	},
 };
 
+/**
+ * panthor_hw_l2_power_on() - Restore cache policies and power on L2
+ * @ptdev: Device.
+ *
+ * Return: 0 on success, a negative error code otherwise.
+ */
+int panthor_hw_l2_power_on(struct panthor_device *ptdev)
+{
+	panthor_gpu_sysc_config_set(ptdev);
+
+	return ptdev->hw->ops.l2_power_on(ptdev);
+}
+
 static int panthor_hw_set_power_tracing(struct device *dev, void *data)
 {
 	struct panthor_device *ptdev = dev_get_drvdata(dev);
diff --git a/drivers/gpu/drm/panthor/panthor_hw.h b/drivers/gpu/drm/panthor/panthor_hw.h
index f797663893b2..fbcd44edd429 100644
--- a/drivers/gpu/drm/panthor/panthor_hw.h
+++ b/drivers/gpu/drm/panthor/panthor_hw.h
@@ -46,10 +46,7 @@ static inline int panthor_hw_soft_reset(struct panthor_device *ptdev)
 	return ptdev->hw->ops.soft_reset(ptdev);
 }
 
-static inline int panthor_hw_l2_power_on(struct panthor_device *ptdev)
-{
-	return ptdev->hw->ops.l2_power_on(ptdev);
-}
+int panthor_hw_l2_power_on(struct panthor_device *ptdev);
 
 static inline void panthor_hw_l2_power_off(struct panthor_device *ptdev)
 {
-- 
2.53.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v3 5/7] dt-bindings: gpu: Add CIX Sky1 Mali support
  2026-11-19 12:38 [PATCH v3 0/7] Add initial GPU support for CIX Sky1 Cunyuan Liu
                   ` (3 preceding siblings ...)
  2026-11-19 12:38 ` [PATCH v3 4/7] drm/panthor: Add system-cache allocation policy support Cunyuan Liu
@ 2026-11-19 12:38 ` Cunyuan Liu
  2026-11-22 17:01   ` Krzysztof Kozlowski
  2026-11-19 12:38 ` [PATCH v3 6/7] drm/panthor: Add CIX Sky1 compatible Cunyuan Liu
  2026-11-19 12:38 ` [PATCH v3 7/7] arm64: dts: cix: Add GPU support for Sky1 Orion O6 Cunyuan Liu
  6 siblings, 1 reply; 10+ messages in thread
From: Cunyuan Liu @ 2026-11-19 12:38 UTC (permalink / raw)
  To: boris.brezillon, steven.price, liviu.dudau, robh, krzk+dt,
	conor+dt, gary.yang, fugang.duan, daniel.almeida, aliceryhl,
	p.zabel, daniel
  Cc: dri-devel, devicetree, linux-arm-kernel, linux-kernel,
	rust-for-linux, cix-kernel-upstream, robin.wang, cunyuan.liu

Describe the Mali CSF GPU on CIX Sky1. It uses core and stacks clocks,
an external reset and a GPU power domain.

Add the compatible string, resource requirements and an example. Require
the system-cache allocation policies needed by the Sky1 integration.

Signed-off-by: Cunyuan Liu <cunyuan.liu@cixtech.com>
---
 .../bindings/gpu/arm,mali-valhall-csf.yaml    | 55 +++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/Documentation/devicetree/bindings/gpu/arm,mali-valhall-csf.yaml b/Documentation/devicetree/bindings/gpu/arm,mali-valhall-csf.yaml
index 4d50427edd87..0c558fc6c779 100644
--- a/Documentation/devicetree/bindings/gpu/arm,mali-valhall-csf.yaml
+++ b/Documentation/devicetree/bindings/gpu/arm,mali-valhall-csf.yaml
@@ -18,6 +18,7 @@ properties:
     oneOf:
       - items:
           - enum:
+              - cix,sky1-mali
               - mediatek,mt8196-mali
               - nxp,imx95-mali            # G310
               - rockchip,rk3588-mali
@@ -51,6 +52,9 @@ properties:
           - stacks
       - const: stacks
 
+  resets:
+    maxItems: 1
+
   nvmem-cells:
     items:
       - description: bitmask of functional shader cores
@@ -170,6 +174,35 @@ allOf:
         - nvmem-cells
         - nvmem-cell-names
         - power-domains
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: cix,sky1-mali
+    then:
+      properties:
+        clocks:
+          minItems: 2
+          maxItems: 2
+        clock-names:
+          items:
+            - const: core
+            - const: stacks
+        power-domains:
+          maxItems: 1
+        power-domain-names: false
+        mali-supply: false
+        sram-supply: false
+        nvmem-cells: false
+        nvmem-cell-names: false
+      required:
+        - clock-names
+        - resets
+        - power-domains
+        - arm,sysc-alloc
+    else:
+      properties:
+        resets: false
 
 examples:
   - |
@@ -220,4 +253,26 @@ examples:
         power-domains = <&gpufreq>;
     };
 
+  - |
+    #include <dt-bindings/clock/cix,sky1.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/reset/cix,sky1-s5-system-control.h>
+
+    gpu@15010000 {
+        compatible = "cix,sky1-mali", "arm,mali-valhall-csf";
+        reg = <0x15010000 0x480000>;
+        interrupts = <GIC_SPI 237 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 239 IRQ_TYPE_LEVEL_HIGH>;
+        interrupt-names = "job", "mmu", "gpu";
+        clocks = <&scmi_clk CLK_TREE_GPU_CLK_CORE>,
+                 <&scmi_clk CLK_TREE_GPU_CLK_STACKS>;
+        clock-names = "core", "stacks";
+        resets = <&s5_syscon SKY1_GPU_RESET_N>;
+        power-domains = <&smc_devpd 21>;
+        arm,sysc-alloc = <2 3 2>, <4 3 0>, <16 2 2>,
+                         <17 2 3>, <18 2 5>, <21 2 3>,
+                         <22 0 5>, <24 2 0>, <28 2 3>;
+    };
+
 ...
-- 
2.53.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v3 6/7] drm/panthor: Add CIX Sky1 compatible
  2026-11-19 12:38 [PATCH v3 0/7] Add initial GPU support for CIX Sky1 Cunyuan Liu
                   ` (4 preceding siblings ...)
  2026-11-19 12:38 ` [PATCH v3 5/7] dt-bindings: gpu: Add CIX Sky1 Mali support Cunyuan Liu
@ 2026-11-19 12:38 ` Cunyuan Liu
  2026-11-19 12:38 ` [PATCH v3 7/7] arm64: dts: cix: Add GPU support for Sky1 Orion O6 Cunyuan Liu
  6 siblings, 0 replies; 10+ messages in thread
From: Cunyuan Liu @ 2026-11-19 12:38 UTC (permalink / raw)
  To: boris.brezillon, steven.price, liviu.dudau, robh, krzk+dt,
	conor+dt, gary.yang, fugang.duan, daniel.almeida, aliceryhl,
	p.zabel, daniel
  Cc: dri-devel, devicetree, linux-arm-kernel, linux-kernel,
	rust-for-linux, cix-kernel-upstream, robin.wang, cunyuan.liu

Add a match entry for the Mali GPU on CIX Sky1 using the
cix,sky1-mali compatible string.

Signed-off-by: Cunyuan Liu <cunyuan.liu@cixtech.com>
---
 drivers/gpu/drm/panthor/panthor_drv.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/panthor/panthor_drv.c b/drivers/gpu/drm/panthor/panthor_drv.c
index dc8d0191aef4..51fff7eba4a2 100644
--- a/drivers/gpu/drm/panthor/panthor_drv.c
+++ b/drivers/gpu/drm/panthor/panthor_drv.c
@@ -1878,6 +1878,7 @@ static const struct panthor_soc_data soc_data_mediatek_mt8196 = {
 };
 
 static const struct of_device_id dt_match[] = {
+	{ .compatible = "cix,sky1-mali" },
 	{ .compatible = "mediatek,mt8196-mali", .data = &soc_data_mediatek_mt8196, },
 	{ .compatible = "rockchip,rk3588-mali" },
 	{ .compatible = "arm,mali-valhall-csf" },
-- 
2.53.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v3 7/7] arm64: dts: cix: Add GPU support for Sky1 Orion O6
  2026-11-19 12:38 [PATCH v3 0/7] Add initial GPU support for CIX Sky1 Cunyuan Liu
                   ` (5 preceding siblings ...)
  2026-11-19 12:38 ` [PATCH v3 6/7] drm/panthor: Add CIX Sky1 compatible Cunyuan Liu
@ 2026-11-19 12:38 ` Cunyuan Liu
  6 siblings, 0 replies; 10+ messages in thread
From: Cunyuan Liu @ 2026-11-19 12:38 UTC (permalink / raw)
  To: boris.brezillon, steven.price, liviu.dudau, robh, krzk+dt,
	conor+dt, gary.yang, fugang.duan, daniel.almeida, aliceryhl,
	p.zabel, daniel
  Cc: dri-devel, devicetree, linux-arm-kernel, linux-kernel,
	rust-for-linux, cix-kernel-upstream, robin.wang, cunyuan.liu

Add the Sky1 Mali GPU node with its registers, interrupts, clocks,
external reset and GPU power domain. Describe its system-cache allocation
policies using separate read and write values for each source.

Keep the node disabled in the SoC file and enable it on Orion O6.

Signed-off-by: Cunyuan Liu <cunyuan.liu@cixtech.com>
---
 arch/arm64/boot/dts/cix/sky1-orion-o6.dts |  4 ++++
 arch/arm64/boot/dts/cix/sky1.dtsi         | 19 +++++++++++++++++++
 2 files changed, 23 insertions(+)

diff --git a/arch/arm64/boot/dts/cix/sky1-orion-o6.dts b/arch/arm64/boot/dts/cix/sky1-orion-o6.dts
index e39c87774c12..853c9c6f202c 100644
--- a/arch/arm64/boot/dts/cix/sky1-orion-o6.dts
+++ b/arch/arm64/boot/dts/cix/sky1-orion-o6.dts
@@ -52,6 +52,10 @@ &fch_gpio3 {
 	status = "okay";
 };
 
+&gpu {
+	status = "okay";
+};
+
 &iomuxc {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_hog>;
diff --git a/arch/arm64/boot/dts/cix/sky1.dtsi b/arch/arm64/boot/dts/cix/sky1.dtsi
index 0a820f45feb9..969725993fcb 100644
--- a/arch/arm64/boot/dts/cix/sky1.dtsi
+++ b/arch/arm64/boot/dts/cix/sky1.dtsi
@@ -762,6 +762,25 @@ ppi_partition1: interrupt-partition-1 {
 			};
 		};
 
+		gpu: gpu@15010000 {
+			compatible = "cix,sky1-mali", "arm,mali-valhall-csf";
+			reg = <0x0 0x15010000 0x0 0x480000>;
+			interrupts = <GIC_SPI 237 IRQ_TYPE_LEVEL_HIGH 0>,
+				     <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH 0>,
+				     <GIC_SPI 239 IRQ_TYPE_LEVEL_HIGH 0>;
+			interrupt-names = "job", "mmu", "gpu";
+			clocks = <&scmi_clk CLK_TREE_GPU_CLK_CORE>,
+				 <&scmi_clk CLK_TREE_GPU_CLK_STACKS>;
+			clock-names = "core", "stacks";
+			resets = <&s5_syscon SKY1_GPU_RESET_N>;
+			power-domains = <&smc_devpd SKY1_PD_GPU>;
+			arm,sysc-alloc = <2 3 2>, <4 3 0>, <16 2 2>,
+					 <17 2 3>, <18 2 5>, <21 2 3>,
+					 <22 0 5>, <24 2 0>, <28 2 3>;
+
+			status = "disabled";
+		};
+
 		s5_syscon: syscon@16000000 {
 			compatible = "cix,sky1-s5-system-control", "syscon";
 			reg = <0x0 0x16000000 0x0 0x1000>;
-- 
2.53.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v3 3/7] dt-bindings: gpu: arm,mali-valhall-csf: Add system-cache policies
  2026-11-19 12:38 ` [PATCH v3 3/7] dt-bindings: gpu: arm,mali-valhall-csf: Add system-cache policies Cunyuan Liu
@ 2026-11-22 16:58   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 10+ messages in thread
From: Krzysztof Kozlowski @ 2026-11-22 16:58 UTC (permalink / raw)
  To: Cunyuan Liu
  Cc: boris.brezillon, steven.price, liviu.dudau, robh, krzk+dt,
	conor+dt, gary.yang, fugang.duan, daniel.almeida, aliceryhl,
	p.zabel, daniel, dri-devel, devicetree, linux-arm-kernel,
	linux-kernel, rust-for-linux, cix-kernel-upstream, robin.wang

On Thu, Nov 19, 2026 at 08:38:46PM +0800, Cunyuan Liu wrote:
> Describe system-cache allocation policies for Mali GPUs with SYSC_ALLOC
> registers. The policy depends on how the GPU is integrated with the rest
> of the system and belongs in DT rather than a platform table in the driver.

Explain why.


> 
> Use entries containing a source ID and separate read and write policies.
> When the property is present, omitted sources use L2 allocation. Without
> the property, the driver leaves the register settings unchanged.
> 
> Signed-off-by: Cunyuan Liu <cunyuan.liu@cixtech.com>
> ---
>  .../bindings/gpu/arm,mali-valhall-csf.yaml    | 24 +++++++++++++++++++
>  1 file changed, 24 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/gpu/arm,mali-valhall-csf.yaml b/Documentation/devicetree/bindings/gpu/arm,mali-valhall-csf.yaml
> index 8eccd4338a2b..4d50427edd87 100644
> --- a/Documentation/devicetree/bindings/gpu/arm,mali-valhall-csf.yaml
> +++ b/Documentation/devicetree/bindings/gpu/arm,mali-valhall-csf.yaml
> @@ -97,6 +97,30 @@ properties:
>  
>    dma-coherent: true
>  
> +  arm,sysc-alloc:
> +    $ref: /schemas/types.yaml#/definitions/uint32-matrix
> +    minItems: 1
> +    maxItems: 32
> +    items:
> +      items:
> +        - description: GPU internal source ID
> +          minimum: 0
> +          maximum: 31
> +        - description: Read allocation policy
> +          enum: [0, 2, 3, 4, 5]
> +        - description: Write allocation policy
> +          enum: [0, 2, 3, 4, 5]
> +    description:
> +      System-cache allocation policies for GPU architecture 11.0.3 and later.
> +      Each entry contains a source ID, a read policy and a write policy.
> +      Source IDs must be unique. Reserved source IDs and access directions
> +      not supported by the GPU must use zero policies. Policy values are
> +      0 for L2 allocation, 2 for never allocate, 3 for always allocate,
> +      4 for partial allocation and 5 for L2 partial allocation. When present,
> +      all source policies start at zero and the listed entries override them.
> +      Omitted sources therefore use L2 allocation. If absent, the register
> +      defaults are preserved.

Looks like integration specific, so implied by the compatible.

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v3 5/7] dt-bindings: gpu: Add CIX Sky1 Mali support
  2026-11-19 12:38 ` [PATCH v3 5/7] dt-bindings: gpu: Add CIX Sky1 Mali support Cunyuan Liu
@ 2026-11-22 17:01   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 10+ messages in thread
From: Krzysztof Kozlowski @ 2026-11-22 17:01 UTC (permalink / raw)
  To: Cunyuan Liu
  Cc: boris.brezillon, steven.price, liviu.dudau, robh, krzk+dt,
	conor+dt, gary.yang, fugang.duan, daniel.almeida, aliceryhl,
	p.zabel, daniel, dri-devel, devicetree, linux-arm-kernel,
	linux-kernel, rust-for-linux, cix-kernel-upstream, robin.wang

On Thu, Nov 19, 2026 at 08:38:48PM +0800, Cunyuan Liu wrote:
> Describe the Mali CSF GPU on CIX Sky1. It uses core and stacks clocks,
> an external reset and a GPU power domain.
> 
> Add the compatible string, resource requirements and an example. Require
> the system-cache allocation policies needed by the Sky1 integration.
> 
> Signed-off-by: Cunyuan Liu <cunyuan.liu@cixtech.com>
> ---
>  .../bindings/gpu/arm,mali-valhall-csf.yaml    | 55 +++++++++++++++++++
>  1 file changed, 55 insertions(+)

So what changed here exactly that you decided to drop review? I run b4
diff and there is no relevant difference.

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2026-11-22 17:01 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-19 12:38 [PATCH v3 0/7] Add initial GPU support for CIX Sky1 Cunyuan Liu
2026-11-19 12:38 ` [PATCH v3 1/7] drm/panthor: Add optional external reset support Cunyuan Liu
2026-11-19 12:38 ` [PATCH v3 2/7] drm/panthor: Allow operation without an OPP table Cunyuan Liu
2026-11-19 12:38 ` [PATCH v3 3/7] dt-bindings: gpu: arm,mali-valhall-csf: Add system-cache policies Cunyuan Liu
2026-11-22 16:58   ` Krzysztof Kozlowski
2026-11-19 12:38 ` [PATCH v3 4/7] drm/panthor: Add system-cache allocation policy support Cunyuan Liu
2026-11-19 12:38 ` [PATCH v3 5/7] dt-bindings: gpu: Add CIX Sky1 Mali support Cunyuan Liu
2026-11-22 17:01   ` Krzysztof Kozlowski
2026-11-19 12:38 ` [PATCH v3 6/7] drm/panthor: Add CIX Sky1 compatible Cunyuan Liu
2026-11-19 12:38 ` [PATCH v3 7/7] arm64: dts: cix: Add GPU support for Sky1 Orion O6 Cunyuan Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®