* [PATCH v5 0/6] Add support for new Mali GPUs
@ 2025-07-21 11:13 Karunika Choo
2025-07-21 11:13 ` [PATCH v5 1/6] drm/panthor: Add panthor_hw and move gpu_info initialization into it Karunika Choo
` (5 more replies)
0 siblings, 6 replies; 16+ messages in thread
From: Karunika Choo @ 2025-07-21 11:13 UTC (permalink / raw)
To: dri-devel
Cc: nd, Boris Brezillon, Steven Price, Liviu Dudau, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
linux-kernel
This patch series introduces some minor refactoring to enable support
for new Mali GPUs.
Key changes:
- Addition of cache maintenance via the FLUSH_CACHES GPU command for all
supported GPUs in place of FLUSH_MEM and FLUSH_PT MMU_AS commands.
- Added SHAREABLE_CACHE support for GPUs from Mali-Gx20 onwards if
coherency is enabled.
- Fixed minor issue with the setting of the coherency protocol.
Firmware for these GPUs can be found here:
https://gitlab.com/dliviu/linux-firmware
Patch Breakdown:
[PATCH 1]: Adds panthor_hw and refactors gpu_info initialization into
it, laying the foundation for subsequent changes.
[PATCH 2]: Simplifies the method of determining the GPU model name
while making it more extensible.
[PATCH 3]: Adds support for Mali-G710, Mali-G510 and Mali-G310.
[PATCH 4]: Adds support for Mali-Gx15 GPUs.
[PATCH 5]: Adds cache maintenance via FLUSH_CACHES GPU command due to
the deprecation of FLUSH_MEM and FLUSH_PT MMU_AS commands
from Mali-Gx20 onwards. This feature is extended to all
previous GPUs as this method of cache maintenance is
already supported.
[PATCH 6]: Adds support for Mali-Gx20 and Mali-Gx25 GPUs. This also
adds SHAREABLE_CACHE support, in addition to fixing a minor
issue with setting the coherency protocol.
v5:
- Removed all of the GPU-specific initialization boilerplate as it was
not being used.
- Merged [PATCH 1/7] and [PATCH 2/7] into one.
- Fixed issue with getting model name before the gpu_info struct is
populated.
- Merged AMBA_FEATURES and AMBA_ENABLE into GPU_COHERENCY_FEATURES and
GPU_COHERENCY_PROTOCOL registers respectively. Reworked the fields of
GPU_COHERENCY_FEATURES and added SHAREABLE_CACHE support.
- Link to v4: https://lore.kernel.org/all/20250602143216.2621881-1-karunika.choo@arm.com/
v4:
- Split 64-bit register accessor patches into another patch series.
- link: https://lore.kernel.org/dri-devel/20250417123725.2733201-1-karunika.choo@arm.com/
- Switched to using arch_major for comparison instead of arch_id in
panthor_hw.c.
- Removed the gpu_info_init function pointer in favour of a single
function to handle minor register changes. The function names have
also been adjusted accordingly.
- Moved the patch to support Mali-G710, Mali-G510 and Mali-G310 forwards
to [PATCH 4/7].
- Extended support to perform cache maintenance via GPU_CONTROL to
Mali-Gx10 and Mali-Gx15 GPUs.
- Link to v2: https://lore.kernel.org/all/20250320111741.1937892-1-karunika.choo@arm.com/
v3:
- Kindly ignore this patch series as there were duplicate patches being
included.
v2:
- Removed handling for register base addresses as they are not yet
needed.
- Merged gpu_info handling into panthor_hw.c as they depend on the same
arch_id matching mechanism.
- Made gpu_info initialization a GPU-specific function.
- Removed unnecessary changes for cache maintenance via GPU_CONTROL.
- Removed unnecessary pre-parsing of register fields from v1. Retaining
current implementation as much as possible.
- Added support for G710, G715, G720, and G725 series of Mali GPUs.
- Link to v1: https://lore.kernel.org/all/20241219170521.64879-1-karunika.choo@arm.com/
Karunika Choo (6):
drm/panthor: Add panthor_hw and move gpu_info initialization into it
drm/panthor: Simplify getting the GPU model name
drm/panthor: Add support for Mali-G710, Mali-G510 and Mali-G310
drm/panthor: Add support for Mali-Gx15 family of GPUs
drm/panthor: Make MMU cache maintenance use FLUSH_CACHES command
drm/panthor: Add support for Mali-Gx20 and Mali-Gx25 GPUs
drivers/gpu/drm/panthor/Makefile | 1 +
drivers/gpu/drm/panthor/panthor_device.c | 7 +-
drivers/gpu/drm/panthor/panthor_fw.c | 5 +
drivers/gpu/drm/panthor/panthor_gpu.c | 103 ++-----------------
drivers/gpu/drm/panthor/panthor_hw.c | 125 +++++++++++++++++++++++
drivers/gpu/drm/panthor/panthor_hw.h | 11 ++
drivers/gpu/drm/panthor/panthor_mmu.c | 33 ++++++
drivers/gpu/drm/panthor/panthor_regs.h | 22 +++-
include/uapi/drm/panthor_drm.h | 3 +
9 files changed, 214 insertions(+), 96 deletions(-)
create mode 100644 drivers/gpu/drm/panthor/panthor_hw.c
create mode 100644 drivers/gpu/drm/panthor/panthor_hw.h
--
2.49.0
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH v5 1/6] drm/panthor: Add panthor_hw and move gpu_info initialization into it
2025-07-21 11:13 [PATCH v5 0/6] Add support for new Mali GPUs Karunika Choo
@ 2025-07-21 11:13 ` Karunika Choo
2025-07-21 14:30 ` Liviu Dudau
2025-07-21 11:13 ` [PATCH v5 2/6] drm/panthor: Simplify getting the GPU model name Karunika Choo
` (4 subsequent siblings)
5 siblings, 1 reply; 16+ messages in thread
From: Karunika Choo @ 2025-07-21 11:13 UTC (permalink / raw)
To: dri-devel
Cc: nd, Boris Brezillon, Steven Price, Liviu Dudau, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
linux-kernel
This patch introduces panthor_hw and moves the initialization of the
gpu_info struct into panthor_hw.c in preparation of handling future GPU
register and naming changes.
Future GPU support can be added by extending panthor_gpu_info_init()
with the necessary register reads behind GPU architecture version guards
if the change is minor. For more complex changes, the function can be
forked and the appropriate function will need to be called based on the
GPU architecture version.
Signed-off-by: Karunika Choo <karunika.choo@arm.com>
---
drivers/gpu/drm/panthor/Makefile | 1 +
drivers/gpu/drm/panthor/panthor_device.c | 5 +
drivers/gpu/drm/panthor/panthor_gpu.c | 95 -------------------
drivers/gpu/drm/panthor/panthor_hw.c | 113 +++++++++++++++++++++++
drivers/gpu/drm/panthor/panthor_hw.h | 11 +++
5 files changed, 130 insertions(+), 95 deletions(-)
create mode 100644 drivers/gpu/drm/panthor/panthor_hw.c
create mode 100644 drivers/gpu/drm/panthor/panthor_hw.h
diff --git a/drivers/gpu/drm/panthor/Makefile b/drivers/gpu/drm/panthor/Makefile
index 15294719b09c..02db21748c12 100644
--- a/drivers/gpu/drm/panthor/Makefile
+++ b/drivers/gpu/drm/panthor/Makefile
@@ -8,6 +8,7 @@ panthor-y := \
panthor_gem.o \
panthor_gpu.o \
panthor_heap.o \
+ panthor_hw.o \
panthor_mmu.o \
panthor_sched.o
diff --git a/drivers/gpu/drm/panthor/panthor_device.c b/drivers/gpu/drm/panthor/panthor_device.c
index f0b2da5b2b96..81df49880bd8 100644
--- a/drivers/gpu/drm/panthor/panthor_device.c
+++ b/drivers/gpu/drm/panthor/panthor_device.c
@@ -18,6 +18,7 @@
#include "panthor_device.h"
#include "panthor_fw.h"
#include "panthor_gpu.h"
+#include "panthor_hw.h"
#include "panthor_mmu.h"
#include "panthor_regs.h"
#include "panthor_sched.h"
@@ -244,6 +245,10 @@ int panthor_device_init(struct panthor_device *ptdev)
return ret;
}
+ ret = panthor_hw_init(ptdev);
+ if (ret)
+ goto err_rpm_put;
+
ret = panthor_gpu_init(ptdev);
if (ret)
goto err_rpm_put;
diff --git a/drivers/gpu/drm/panthor/panthor_gpu.c b/drivers/gpu/drm/panthor/panthor_gpu.c
index cb7a335e07d7..5e2c3173ae27 100644
--- a/drivers/gpu/drm/panthor/panthor_gpu.c
+++ b/drivers/gpu/drm/panthor/panthor_gpu.c
@@ -37,40 +37,6 @@ struct panthor_gpu {
wait_queue_head_t reqs_acked;
};
-/**
- * struct panthor_model - GPU model description
- */
-struct panthor_model {
- /** @name: Model name. */
- const char *name;
-
- /** @arch_major: Major version number of architecture. */
- u8 arch_major;
-
- /** @product_major: Major version number of product. */
- u8 product_major;
-};
-
-/**
- * GPU_MODEL() - Define a GPU model. A GPU product can be uniquely identified
- * by a combination of the major architecture version and the major product
- * version.
- * @_name: Name for the GPU model.
- * @_arch_major: Architecture major.
- * @_product_major: Product major.
- */
-#define GPU_MODEL(_name, _arch_major, _product_major) \
-{\
- .name = __stringify(_name), \
- .arch_major = _arch_major, \
- .product_major = _product_major, \
-}
-
-static const struct panthor_model gpu_models[] = {
- GPU_MODEL(g610, 10, 7),
- {},
-};
-
#define GPU_INTERRUPTS_MASK \
(GPU_IRQ_FAULT | \
GPU_IRQ_PROTM_FAULT | \
@@ -83,66 +49,6 @@ static void panthor_gpu_coherency_set(struct panthor_device *ptdev)
ptdev->coherent ? GPU_COHERENCY_PROT_BIT(ACE_LITE) : GPU_COHERENCY_NONE);
}
-static void panthor_gpu_init_info(struct panthor_device *ptdev)
-{
- const struct panthor_model *model;
- u32 arch_major, product_major;
- u32 major, minor, status;
- unsigned int i;
-
- ptdev->gpu_info.gpu_id = gpu_read(ptdev, GPU_ID);
- ptdev->gpu_info.csf_id = gpu_read(ptdev, GPU_CSF_ID);
- ptdev->gpu_info.gpu_rev = gpu_read(ptdev, GPU_REVID);
- ptdev->gpu_info.core_features = gpu_read(ptdev, GPU_CORE_FEATURES);
- ptdev->gpu_info.l2_features = gpu_read(ptdev, GPU_L2_FEATURES);
- ptdev->gpu_info.tiler_features = gpu_read(ptdev, GPU_TILER_FEATURES);
- ptdev->gpu_info.mem_features = gpu_read(ptdev, GPU_MEM_FEATURES);
- ptdev->gpu_info.mmu_features = gpu_read(ptdev, GPU_MMU_FEATURES);
- ptdev->gpu_info.thread_features = gpu_read(ptdev, GPU_THREAD_FEATURES);
- ptdev->gpu_info.max_threads = gpu_read(ptdev, GPU_THREAD_MAX_THREADS);
- ptdev->gpu_info.thread_max_workgroup_size = gpu_read(ptdev, GPU_THREAD_MAX_WORKGROUP_SIZE);
- ptdev->gpu_info.thread_max_barrier_size = gpu_read(ptdev, GPU_THREAD_MAX_BARRIER_SIZE);
- ptdev->gpu_info.coherency_features = gpu_read(ptdev, GPU_COHERENCY_FEATURES);
- for (i = 0; i < 4; i++)
- ptdev->gpu_info.texture_features[i] = gpu_read(ptdev, GPU_TEXTURE_FEATURES(i));
-
- ptdev->gpu_info.as_present = gpu_read(ptdev, GPU_AS_PRESENT);
-
- ptdev->gpu_info.shader_present = gpu_read64(ptdev, GPU_SHADER_PRESENT);
- ptdev->gpu_info.tiler_present = gpu_read64(ptdev, GPU_TILER_PRESENT);
- ptdev->gpu_info.l2_present = gpu_read64(ptdev, GPU_L2_PRESENT);
-
- arch_major = GPU_ARCH_MAJOR(ptdev->gpu_info.gpu_id);
- product_major = GPU_PROD_MAJOR(ptdev->gpu_info.gpu_id);
- major = GPU_VER_MAJOR(ptdev->gpu_info.gpu_id);
- minor = GPU_VER_MINOR(ptdev->gpu_info.gpu_id);
- status = GPU_VER_STATUS(ptdev->gpu_info.gpu_id);
-
- for (model = gpu_models; model->name; model++) {
- if (model->arch_major == arch_major &&
- model->product_major == product_major)
- break;
- }
-
- drm_info(&ptdev->base,
- "mali-%s id 0x%x major 0x%x minor 0x%x status 0x%x",
- model->name ?: "unknown", ptdev->gpu_info.gpu_id >> 16,
- major, minor, status);
-
- drm_info(&ptdev->base,
- "Features: L2:%#x Tiler:%#x Mem:%#x MMU:%#x AS:%#x",
- ptdev->gpu_info.l2_features,
- ptdev->gpu_info.tiler_features,
- ptdev->gpu_info.mem_features,
- ptdev->gpu_info.mmu_features,
- ptdev->gpu_info.as_present);
-
- drm_info(&ptdev->base,
- "shader_present=0x%0llx l2_present=0x%0llx tiler_present=0x%0llx",
- ptdev->gpu_info.shader_present, ptdev->gpu_info.l2_present,
- ptdev->gpu_info.tiler_present);
-}
-
static void panthor_gpu_irq_handler(struct panthor_device *ptdev, u32 status)
{
gpu_write(ptdev, GPU_INT_CLEAR, status);
@@ -205,7 +111,6 @@ int panthor_gpu_init(struct panthor_device *ptdev)
spin_lock_init(&gpu->reqs_lock);
init_waitqueue_head(&gpu->reqs_acked);
ptdev->gpu = gpu;
- panthor_gpu_init_info(ptdev);
dma_set_max_seg_size(ptdev->base.dev, UINT_MAX);
pa_bits = GPU_MMU_FEATURES_PA_BITS(ptdev->gpu_info.mmu_features);
diff --git a/drivers/gpu/drm/panthor/panthor_hw.c b/drivers/gpu/drm/panthor/panthor_hw.c
new file mode 100644
index 000000000000..3f7175cb0ab4
--- /dev/null
+++ b/drivers/gpu/drm/panthor/panthor_hw.c
@@ -0,0 +1,113 @@
+// SPDX-License-Identifier: GPL-2.0 or MIT
+/* Copyright 2025 ARM Limited. All rights reserved. */
+
+#include "panthor_device.h"
+#include "panthor_hw.h"
+#include "panthor_regs.h"
+
+/**
+ * struct panthor_model - GPU model description
+ */
+struct panthor_model {
+ /** @name: Model name. */
+ const char *name;
+
+ /** @arch_major: Major version number of architecture. */
+ u8 arch_major;
+
+ /** @product_major: Major version number of product. */
+ u8 product_major;
+};
+
+/**
+ * GPU_MODEL() - Define a GPU model. A GPU product can be uniquely identified
+ * by a combination of the major architecture version and the major product
+ * version.
+ * @_name: Name for the GPU model.
+ * @_arch_major: Architecture major.
+ * @_product_major: Product major.
+ */
+#define GPU_MODEL(_name, _arch_major, _product_major) \
+{\
+ .name = __stringify(_name), \
+ .arch_major = _arch_major, \
+ .product_major = _product_major, \
+}
+
+static const struct panthor_model gpu_models[] = {
+ GPU_MODEL(g610, 10, 7),
+ {},
+};
+
+static void panthor_gpu_info_init(struct panthor_device *ptdev)
+{
+ unsigned int i;
+
+ ptdev->gpu_info.gpu_id = gpu_read(ptdev, GPU_ID);
+ ptdev->gpu_info.csf_id = gpu_read(ptdev, GPU_CSF_ID);
+ ptdev->gpu_info.gpu_rev = gpu_read(ptdev, GPU_REVID);
+ ptdev->gpu_info.core_features = gpu_read(ptdev, GPU_CORE_FEATURES);
+ ptdev->gpu_info.l2_features = gpu_read(ptdev, GPU_L2_FEATURES);
+ ptdev->gpu_info.tiler_features = gpu_read(ptdev, GPU_TILER_FEATURES);
+ ptdev->gpu_info.mem_features = gpu_read(ptdev, GPU_MEM_FEATURES);
+ ptdev->gpu_info.mmu_features = gpu_read(ptdev, GPU_MMU_FEATURES);
+ ptdev->gpu_info.thread_features = gpu_read(ptdev, GPU_THREAD_FEATURES);
+ ptdev->gpu_info.max_threads = gpu_read(ptdev, GPU_THREAD_MAX_THREADS);
+ ptdev->gpu_info.thread_max_workgroup_size = gpu_read(ptdev, GPU_THREAD_MAX_WORKGROUP_SIZE);
+ ptdev->gpu_info.thread_max_barrier_size = gpu_read(ptdev, GPU_THREAD_MAX_BARRIER_SIZE);
+ ptdev->gpu_info.coherency_features = gpu_read(ptdev, GPU_COHERENCY_FEATURES);
+ for (i = 0; i < 4; i++)
+ ptdev->gpu_info.texture_features[i] = gpu_read(ptdev, GPU_TEXTURE_FEATURES(i));
+
+ ptdev->gpu_info.as_present = gpu_read(ptdev, GPU_AS_PRESENT);
+
+ ptdev->gpu_info.shader_present = gpu_read64(ptdev, GPU_SHADER_PRESENT);
+ ptdev->gpu_info.tiler_present = gpu_read64(ptdev, GPU_TILER_PRESENT);
+ ptdev->gpu_info.l2_present = gpu_read64(ptdev, GPU_L2_PRESENT);
+}
+
+static void panthor_hw_info_init(struct panthor_device *ptdev)
+{
+ const struct panthor_model *model;
+ u32 arch_major, product_major;
+ u32 major, minor, status;
+
+ panthor_gpu_info_init(ptdev);
+
+ arch_major = GPU_ARCH_MAJOR(ptdev->gpu_info.gpu_id);
+ product_major = GPU_PROD_MAJOR(ptdev->gpu_info.gpu_id);
+ major = GPU_VER_MAJOR(ptdev->gpu_info.gpu_id);
+ minor = GPU_VER_MINOR(ptdev->gpu_info.gpu_id);
+ status = GPU_VER_STATUS(ptdev->gpu_info.gpu_id);
+
+ for (model = gpu_models; model->name; model++) {
+ if (model->arch_major == arch_major &&
+ model->product_major == product_major)
+ break;
+ }
+
+ drm_info(&ptdev->base,
+ "mali-%s id 0x%x major 0x%x minor 0x%x status 0x%x",
+ model->name ?: "unknown", ptdev->gpu_info.gpu_id >> 16,
+ major, minor, status);
+
+ drm_info(&ptdev->base,
+ "Features: L2:%#x Tiler:%#x Mem:%#x MMU:%#x AS:%#x",
+ ptdev->gpu_info.l2_features,
+ ptdev->gpu_info.tiler_features,
+ ptdev->gpu_info.mem_features,
+ ptdev->gpu_info.mmu_features,
+ ptdev->gpu_info.as_present);
+
+ drm_info(&ptdev->base,
+ "shader_present=0x%0llx l2_present=0x%0llx tiler_present=0x%0llx",
+ ptdev->gpu_info.shader_present, ptdev->gpu_info.l2_present,
+ ptdev->gpu_info.tiler_present);
+}
+
+int panthor_hw_init(struct panthor_device *ptdev)
+{
+ panthor_hw_info_init(ptdev);
+
+ return 0;
+}
\ No newline at end of file
diff --git a/drivers/gpu/drm/panthor/panthor_hw.h b/drivers/gpu/drm/panthor/panthor_hw.h
new file mode 100644
index 000000000000..0af6acc6aa6a
--- /dev/null
+++ b/drivers/gpu/drm/panthor/panthor_hw.h
@@ -0,0 +1,11 @@
+/* SPDX-License-Identifier: GPL-2.0 or MIT */
+/* Copyright 2025 ARM Limited. All rights reserved. */
+
+#ifndef __PANTHOR_HW_H__
+#define __PANTHOR_HW_H__
+
+struct panthor_device;
+
+int panthor_hw_init(struct panthor_device *ptdev);
+
+#endif /* __PANTHOR_HW_H__ */
--
2.49.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v5 2/6] drm/panthor: Simplify getting the GPU model name
2025-07-21 11:13 [PATCH v5 0/6] Add support for new Mali GPUs Karunika Choo
2025-07-21 11:13 ` [PATCH v5 1/6] drm/panthor: Add panthor_hw and move gpu_info initialization into it Karunika Choo
@ 2025-07-21 11:13 ` Karunika Choo
2025-07-21 14:41 ` Liviu Dudau
2025-07-21 11:13 ` [PATCH v5 3/6] drm/panthor: Add support for Mali-G710, Mali-G510 and Mali-G310 Karunika Choo
` (3 subsequent siblings)
5 siblings, 1 reply; 16+ messages in thread
From: Karunika Choo @ 2025-07-21 11:13 UTC (permalink / raw)
To: dri-devel
Cc: nd, Boris Brezillon, Steven Price, Liviu Dudau, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
linux-kernel
This patch replaces the panthor_model structure with a simple switch
case based on the product_id which is in the format of:
((arch_major << 24) | product_major)
This simplifies comparison and allows extending of the function to
accommodate naming differences based on supported GPU features.
Signed-off-by: Karunika Choo <karunika.choo@arm.com>
---
drivers/gpu/drm/panthor/panthor_hw.c | 61 ++++++++--------------------
1 file changed, 17 insertions(+), 44 deletions(-)
diff --git a/drivers/gpu/drm/panthor/panthor_hw.c b/drivers/gpu/drm/panthor/panthor_hw.c
index 3f7175cb0ab4..f39010c0ca86 100644
--- a/drivers/gpu/drm/panthor/panthor_hw.c
+++ b/drivers/gpu/drm/panthor/panthor_hw.c
@@ -5,39 +5,22 @@
#include "panthor_hw.h"
#include "panthor_regs.h"
-/**
- * struct panthor_model - GPU model description
- */
-struct panthor_model {
- /** @name: Model name. */
- const char *name;
-
- /** @arch_major: Major version number of architecture. */
- u8 arch_major;
-
- /** @product_major: Major version number of product. */
- u8 product_major;
-};
-
-/**
- * GPU_MODEL() - Define a GPU model. A GPU product can be uniquely identified
- * by a combination of the major architecture version and the major product
- * version.
- * @_name: Name for the GPU model.
- * @_arch_major: Architecture major.
- * @_product_major: Product major.
- */
-#define GPU_MODEL(_name, _arch_major, _product_major) \
-{\
- .name = __stringify(_name), \
- .arch_major = _arch_major, \
- .product_major = _product_major, \
-}
+#define GPU_PROD_ID_MAKE(arch_major, prod_major) \
+ (((arch_major) << 24) | (prod_major))
+
+static char *get_gpu_model_name(struct panthor_device *ptdev)
+{
+ const u32 gpu_id = ptdev->gpu_info.gpu_id;
+ const u32 product_id = GPU_PROD_ID_MAKE(GPU_ARCH_MAJOR(gpu_id),
+ GPU_PROD_MAJOR(gpu_id));
+
+ switch (product_id) {
+ case GPU_PROD_ID_MAKE(10, 7):
+ return "Mali-G610";
+ }
-static const struct panthor_model gpu_models[] = {
- GPU_MODEL(g610, 10, 7),
- {},
-};
+ return "(Unknown Mali GPU)";
+}
static void panthor_gpu_info_init(struct panthor_device *ptdev)
{
@@ -68,27 +51,17 @@ static void panthor_gpu_info_init(struct panthor_device *ptdev)
static void panthor_hw_info_init(struct panthor_device *ptdev)
{
- const struct panthor_model *model;
- u32 arch_major, product_major;
u32 major, minor, status;
panthor_gpu_info_init(ptdev);
- arch_major = GPU_ARCH_MAJOR(ptdev->gpu_info.gpu_id);
- product_major = GPU_PROD_MAJOR(ptdev->gpu_info.gpu_id);
major = GPU_VER_MAJOR(ptdev->gpu_info.gpu_id);
minor = GPU_VER_MINOR(ptdev->gpu_info.gpu_id);
status = GPU_VER_STATUS(ptdev->gpu_info.gpu_id);
- for (model = gpu_models; model->name; model++) {
- if (model->arch_major == arch_major &&
- model->product_major == product_major)
- break;
- }
-
drm_info(&ptdev->base,
- "mali-%s id 0x%x major 0x%x minor 0x%x status 0x%x",
- model->name ?: "unknown", ptdev->gpu_info.gpu_id >> 16,
+ "%s id 0x%x major 0x%x minor 0x%x status 0x%x",
+ get_gpu_model_name(ptdev), ptdev->gpu_info.gpu_id >> 16,
major, minor, status);
drm_info(&ptdev->base,
--
2.49.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v5 3/6] drm/panthor: Add support for Mali-G710, Mali-G510 and Mali-G310
2025-07-21 11:13 [PATCH v5 0/6] Add support for new Mali GPUs Karunika Choo
2025-07-21 11:13 ` [PATCH v5 1/6] drm/panthor: Add panthor_hw and move gpu_info initialization into it Karunika Choo
2025-07-21 11:13 ` [PATCH v5 2/6] drm/panthor: Simplify getting the GPU model name Karunika Choo
@ 2025-07-21 11:13 ` Karunika Choo
2025-07-21 14:42 ` Liviu Dudau
` (2 more replies)
2025-07-21 11:13 ` [PATCH v5 4/6] drm/panthor: Add support for Mali-Gx15 family of GPUs Karunika Choo
` (2 subsequent siblings)
5 siblings, 3 replies; 16+ messages in thread
From: Karunika Choo @ 2025-07-21 11:13 UTC (permalink / raw)
To: dri-devel
Cc: nd, Boris Brezillon, Steven Price, Liviu Dudau, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
linux-kernel
This patch adds GPU model name and FW binary support for Mali-G710,
Mali-G510, and Mali-G310.
Signed-off-by: Karunika Choo <karunika.choo@arm.com>
---
drivers/gpu/drm/panthor/panthor_fw.c | 2 ++
drivers/gpu/drm/panthor/panthor_hw.c | 6 ++++++
2 files changed, 8 insertions(+)
diff --git a/drivers/gpu/drm/panthor/panthor_fw.c b/drivers/gpu/drm/panthor/panthor_fw.c
index 36f1034839c2..b7b454d16f12 100644
--- a/drivers/gpu/drm/panthor/panthor_fw.c
+++ b/drivers/gpu/drm/panthor/panthor_fw.c
@@ -1402,3 +1402,5 @@ int panthor_fw_init(struct panthor_device *ptdev)
}
MODULE_FIRMWARE("arm/mali/arch10.8/mali_csffw.bin");
+MODULE_FIRMWARE("arm/mali/arch10.10/mali_csffw.bin");
+MODULE_FIRMWARE("arm/mali/arch10.12/mali_csffw.bin");
diff --git a/drivers/gpu/drm/panthor/panthor_hw.c b/drivers/gpu/drm/panthor/panthor_hw.c
index f39010c0ca86..7f138974d43b 100644
--- a/drivers/gpu/drm/panthor/panthor_hw.c
+++ b/drivers/gpu/drm/panthor/panthor_hw.c
@@ -15,8 +15,14 @@ static char *get_gpu_model_name(struct panthor_device *ptdev)
GPU_PROD_MAJOR(gpu_id));
switch (product_id) {
+ case GPU_PROD_ID_MAKE(10, 2):
+ return "Mali-G710";
case GPU_PROD_ID_MAKE(10, 7):
return "Mali-G610";
+ case GPU_PROD_ID_MAKE(10, 3):
+ return "Mali-G510";
+ case GPU_PROD_ID_MAKE(10, 4):
+ return "Mali-G310";
}
return "(Unknown Mali GPU)";
--
2.49.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v5 4/6] drm/panthor: Add support for Mali-Gx15 family of GPUs
2025-07-21 11:13 [PATCH v5 0/6] Add support for new Mali GPUs Karunika Choo
` (2 preceding siblings ...)
2025-07-21 11:13 ` [PATCH v5 3/6] drm/panthor: Add support for Mali-G710, Mali-G510 and Mali-G310 Karunika Choo
@ 2025-07-21 11:13 ` Karunika Choo
2025-07-21 14:46 ` Liviu Dudau
2025-07-21 11:13 ` [PATCH v5 5/6] drm/panthor: Make MMU cache maintenance use FLUSH_CACHES command Karunika Choo
2025-07-21 11:13 ` [PATCH v5 6/6] drm/panthor: Add support for Mali-Gx20 and Mali-Gx25 GPUs Karunika Choo
5 siblings, 1 reply; 16+ messages in thread
From: Karunika Choo @ 2025-07-21 11:13 UTC (permalink / raw)
To: dri-devel
Cc: nd, Boris Brezillon, Steven Price, Liviu Dudau, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
linux-kernel
Mali-Gx15 introduces a new GPU_FEATURES register that provides
information about GPU-wide supported features. The register value will
be passed on to userspace via gpu_info. It also adds the following
registers that are specific to the kernel driver only:
- ASN_HASH_0~2
- DOORBELL_FEATURES
- PRFCNT_FEATURES
- SYSC_ALLOC0~7
- SYSC_PBHA_OVERRIDE0~3
Additionally, Mali-Gx15 presents an 'Immortalis' naming variant
depending on the shader core count and presence of Ray Intersection
feature support.
This patch adds:
- support for correctly identifying the model names for Mali-Gx15 GPUs.
- arch 11.8 FW binary support
Signed-off-by: Karunika Choo <karunika.choo@arm.com>
---
drivers/gpu/drm/panthor/panthor_fw.c | 1 +
drivers/gpu/drm/panthor/panthor_hw.c | 15 +++++++++++++++
drivers/gpu/drm/panthor/panthor_regs.h | 11 +++++++++++
include/uapi/drm/panthor_drm.h | 3 +++
4 files changed, 30 insertions(+)
diff --git a/drivers/gpu/drm/panthor/panthor_fw.c b/drivers/gpu/drm/panthor/panthor_fw.c
index b7b454d16f12..fa6e0b48a0b2 100644
--- a/drivers/gpu/drm/panthor/panthor_fw.c
+++ b/drivers/gpu/drm/panthor/panthor_fw.c
@@ -1404,3 +1404,4 @@ int panthor_fw_init(struct panthor_device *ptdev)
MODULE_FIRMWARE("arm/mali/arch10.8/mali_csffw.bin");
MODULE_FIRMWARE("arm/mali/arch10.10/mali_csffw.bin");
MODULE_FIRMWARE("arm/mali/arch10.12/mali_csffw.bin");
+MODULE_FIRMWARE("arm/mali/arch11.8/mali_csffw.bin");
diff --git a/drivers/gpu/drm/panthor/panthor_hw.c b/drivers/gpu/drm/panthor/panthor_hw.c
index 7f138974d43b..a7583342d797 100644
--- a/drivers/gpu/drm/panthor/panthor_hw.c
+++ b/drivers/gpu/drm/panthor/panthor_hw.c
@@ -13,6 +13,9 @@ static char *get_gpu_model_name(struct panthor_device *ptdev)
const u32 gpu_id = ptdev->gpu_info.gpu_id;
const u32 product_id = GPU_PROD_ID_MAKE(GPU_ARCH_MAJOR(gpu_id),
GPU_PROD_MAJOR(gpu_id));
+ const bool ray_intersection = !!(ptdev->gpu_info.gpu_features &
+ GPU_FEATURES_RAY_INTERSECTION);
+ const u8 shader_core_count = hweight64(ptdev->gpu_info.shader_present);
switch (product_id) {
case GPU_PROD_ID_MAKE(10, 2):
@@ -23,6 +26,15 @@ static char *get_gpu_model_name(struct panthor_device *ptdev)
return "Mali-G510";
case GPU_PROD_ID_MAKE(10, 4):
return "Mali-G310";
+ case GPU_PROD_ID_MAKE(11, 2):
+ if (shader_core_count > 10 && ray_intersection)
+ return "Mali-G715-Immortalis";
+ else if (shader_core_count >= 7)
+ return "Mali-G715";
+
+ fallthrough;
+ case GPU_PROD_ID_MAKE(11, 3):
+ return "Mali-G615";
}
return "(Unknown Mali GPU)";
@@ -53,6 +65,9 @@ static void panthor_gpu_info_init(struct panthor_device *ptdev)
ptdev->gpu_info.shader_present = gpu_read64(ptdev, GPU_SHADER_PRESENT);
ptdev->gpu_info.tiler_present = gpu_read64(ptdev, GPU_TILER_PRESENT);
ptdev->gpu_info.l2_present = gpu_read64(ptdev, GPU_L2_PRESENT);
+
+ /* Introduced in arch 11.x */
+ ptdev->gpu_info.gpu_features = gpu_read64(ptdev, GPU_FEATURES);
}
static void panthor_hw_info_init(struct panthor_device *ptdev)
diff --git a/drivers/gpu/drm/panthor/panthor_regs.h b/drivers/gpu/drm/panthor/panthor_regs.h
index 48bbfd40138c..e4c34f70a880 100644
--- a/drivers/gpu/drm/panthor/panthor_regs.h
+++ b/drivers/gpu/drm/panthor/panthor_regs.h
@@ -70,6 +70,10 @@
#define GPU_PWR_OVERRIDE0 0x54
#define GPU_PWR_OVERRIDE1 0x58
+#define GPU_FEATURES 0x60
+#define GPU_FEATURES_RAY_INTERSECTION BIT(2)
+#define GPU_PRFCNT_FEATURES 0x68
+
#define GPU_TIMESTAMP_OFFSET 0x88
#define GPU_CYCLE_COUNT 0x90
#define GPU_TIMESTAMP 0x98
@@ -81,6 +85,8 @@
#define GPU_TEXTURE_FEATURES(n) (0xB0 + ((n) * 4))
+#define GPU_DOORBELL_FEATURES 0xC0
+
#define GPU_SHADER_PRESENT 0x100
#define GPU_TILER_PRESENT 0x110
#define GPU_L2_PRESENT 0x120
@@ -107,6 +113,8 @@
#define GPU_REVID 0x280
+#define GPU_ASN_HASH(n) (0x2C0 + ((n) * 4))
+
#define GPU_COHERENCY_FEATURES 0x300
#define GPU_COHERENCY_PROT_BIT(name) BIT(GPU_COHERENCY_ ## name)
@@ -115,6 +123,9 @@
#define GPU_COHERENCY_ACE 1
#define GPU_COHERENCY_NONE 31
+#define GPU_SYSC_PBHA_OVERRIDE(n) (0x320 + ((n) * 4))
+#define GPU_SYSC_ALLOC(n) (0x340 + ((n) * 4))
+
#define MCU_CONTROL 0x700
#define MCU_CONTROL_ENABLE 1
#define MCU_CONTROL_AUTO 2
diff --git a/include/uapi/drm/panthor_drm.h b/include/uapi/drm/panthor_drm.h
index e1f43deb7eca..467d365ed7ba 100644
--- a/include/uapi/drm/panthor_drm.h
+++ b/include/uapi/drm/panthor_drm.h
@@ -327,6 +327,9 @@ struct drm_panthor_gpu_info {
/** @pad: MBZ. */
__u32 pad;
+
+ /** @gpu_features: Bitmask describing supported GPU-wide features */
+ __u64 gpu_features;
};
/**
--
2.49.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v5 5/6] drm/panthor: Make MMU cache maintenance use FLUSH_CACHES command
2025-07-21 11:13 [PATCH v5 0/6] Add support for new Mali GPUs Karunika Choo
` (3 preceding siblings ...)
2025-07-21 11:13 ` [PATCH v5 4/6] drm/panthor: Add support for Mali-Gx15 family of GPUs Karunika Choo
@ 2025-07-21 11:13 ` Karunika Choo
2025-07-21 14:54 ` Liviu Dudau
2025-07-21 11:13 ` [PATCH v5 6/6] drm/panthor: Add support for Mali-Gx20 and Mali-Gx25 GPUs Karunika Choo
5 siblings, 1 reply; 16+ messages in thread
From: Karunika Choo @ 2025-07-21 11:13 UTC (permalink / raw)
To: dri-devel
Cc: nd, Boris Brezillon, Steven Price, Liviu Dudau, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
linux-kernel
As the FLUSH_MEM and FLUSH_PT MMU_AS commands are deprecated in GPUs
from Mali-Gx20 onwards, this patch adds support for performing cache
maintenance via the FLUSH_CACHES command in GPU_COMMAND in place of
FLUSH_MEM and FLUSH_PT commands.
Mali-Gx10 and Mali-Gx15 GPUs also has support for the FLUSH_CACHES
command and will also use this by default going forward.
Signed-off-by: Karunika Choo <karunika.choo@arm.com>
---
drivers/gpu/drm/panthor/panthor_mmu.c | 33 +++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
diff --git a/drivers/gpu/drm/panthor/panthor_mmu.c b/drivers/gpu/drm/panthor/panthor_mmu.c
index 4140f697ba5a..367c89aca558 100644
--- a/drivers/gpu/drm/panthor/panthor_mmu.c
+++ b/drivers/gpu/drm/panthor/panthor_mmu.c
@@ -29,6 +29,7 @@
#include "panthor_device.h"
#include "panthor_gem.h"
+#include "panthor_gpu.h"
#include "panthor_heap.h"
#include "panthor_mmu.h"
#include "panthor_regs.h"
@@ -568,6 +569,35 @@ static void lock_region(struct panthor_device *ptdev, u32 as_nr,
write_cmd(ptdev, as_nr, AS_COMMAND_LOCK);
}
+static int mmu_hw_do_flush_on_gpu_ctrl(struct panthor_device *ptdev, int as_nr,
+ u32 op)
+{
+ const u32 l2_flush_op = CACHE_CLEAN | CACHE_INV;
+ u32 lsc_flush_op = 0;
+ int ret;
+
+ if (op == AS_COMMAND_FLUSH_MEM)
+ lsc_flush_op = CACHE_CLEAN | CACHE_INV;
+
+ ret = wait_ready(ptdev, as_nr);
+ if (ret)
+ return ret;
+
+ ret = panthor_gpu_flush_caches(ptdev, l2_flush_op, lsc_flush_op, 0);
+ if (ret)
+ return ret;
+
+ /*
+ * Explicitly unlock the region as the AS is not unlocked automatically
+ * at the end of the GPU_CONTROL cache flush command, unlike
+ * AS_COMMAND_FLUSH_MEM or AS_COMMAND_FLUSH_PT.
+ */
+ write_cmd(ptdev, as_nr, AS_COMMAND_UNLOCK);
+
+ /* Wait for the unlock command to complete */
+ return wait_ready(ptdev, as_nr);
+}
+
static int mmu_hw_do_operation_locked(struct panthor_device *ptdev, int as_nr,
u64 iova, u64 size, u32 op)
{
@@ -585,6 +615,9 @@ static int mmu_hw_do_operation_locked(struct panthor_device *ptdev, int as_nr,
if (op != AS_COMMAND_UNLOCK)
lock_region(ptdev, as_nr, iova, size);
+ if (op == AS_COMMAND_FLUSH_MEM || op == AS_COMMAND_FLUSH_PT)
+ return mmu_hw_do_flush_on_gpu_ctrl(ptdev, as_nr, op);
+
/* Run the MMU operation */
write_cmd(ptdev, as_nr, op);
--
2.49.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v5 6/6] drm/panthor: Add support for Mali-Gx20 and Mali-Gx25 GPUs
2025-07-21 11:13 [PATCH v5 0/6] Add support for new Mali GPUs Karunika Choo
` (4 preceding siblings ...)
2025-07-21 11:13 ` [PATCH v5 5/6] drm/panthor: Make MMU cache maintenance use FLUSH_CACHES command Karunika Choo
@ 2025-07-21 11:13 ` Karunika Choo
2025-07-21 14:59 ` Liviu Dudau
5 siblings, 1 reply; 16+ messages in thread
From: Karunika Choo @ 2025-07-21 11:13 UTC (permalink / raw)
To: dri-devel
Cc: nd, Boris Brezillon, Steven Price, Liviu Dudau, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
linux-kernel
This patch adds firmware binary and GPU model naming support for
Mali-Gx20 and Mali-Gx25 GPUs.
It also introduces the following registers:
- GPU_COMMAND_ARG0~1
- SHADER_PWRFEATURES
- MCU_FEATURES
The GPU_COHERENCY_FEATURES macros are slightly reworked as the
assumption that FEATURE = BIT(PROTOCOL) no longer holds with the
introduction of the SHAREABLE_CACHE_SUPPORT, which is BIT(5) on the
GPU_COHERENCY_PROTOCOL register. As such, the feature bits are now
individually defined. Further changes were also made to enable
SHAREABLE_CACHE_SUPPORT if coherency is enabled and the feature is
supported.
This patch also fixes a minor bug that incorrectly writes ACE instead of
ACE_LITE to GPU_COHERENCY_PROTOCOL if coherency is enabled.
Signed-off-by: Karunika Choo <karunika.choo@arm.com>
---
drivers/gpu/drm/panthor/panthor_device.c | 2 +-
drivers/gpu/drm/panthor/panthor_fw.c | 2 ++
drivers/gpu/drm/panthor/panthor_gpu.c | 14 ++++++++++++--
drivers/gpu/drm/panthor/panthor_hw.c | 18 ++++++++++++++++++
drivers/gpu/drm/panthor/panthor_regs.h | 11 ++++++++++-
5 files changed, 43 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/panthor/panthor_device.c b/drivers/gpu/drm/panthor/panthor_device.c
index 81df49880bd8..f547aa4159ec 100644
--- a/drivers/gpu/drm/panthor/panthor_device.c
+++ b/drivers/gpu/drm/panthor/panthor_device.c
@@ -34,7 +34,7 @@ static int panthor_gpu_coherency_init(struct panthor_device *ptdev)
* ACE protocol has never been supported for command stream frontend GPUs.
*/
if ((gpu_read(ptdev, GPU_COHERENCY_FEATURES) &
- GPU_COHERENCY_PROT_BIT(ACE_LITE)))
+ GPU_COHERENCY_FEATURE_ACE_LITE))
return 0;
drm_err(&ptdev->base, "Coherency not supported by the device");
diff --git a/drivers/gpu/drm/panthor/panthor_fw.c b/drivers/gpu/drm/panthor/panthor_fw.c
index fa6e0b48a0b2..9bf06e55eaee 100644
--- a/drivers/gpu/drm/panthor/panthor_fw.c
+++ b/drivers/gpu/drm/panthor/panthor_fw.c
@@ -1405,3 +1405,5 @@ MODULE_FIRMWARE("arm/mali/arch10.8/mali_csffw.bin");
MODULE_FIRMWARE("arm/mali/arch10.10/mali_csffw.bin");
MODULE_FIRMWARE("arm/mali/arch10.12/mali_csffw.bin");
MODULE_FIRMWARE("arm/mali/arch11.8/mali_csffw.bin");
+MODULE_FIRMWARE("arm/mali/arch12.8/mali_csffw.bin");
+MODULE_FIRMWARE("arm/mali/arch13.8/mali_csffw.bin");
diff --git a/drivers/gpu/drm/panthor/panthor_gpu.c b/drivers/gpu/drm/panthor/panthor_gpu.c
index 5e2c3173ae27..df2419706fe0 100644
--- a/drivers/gpu/drm/panthor/panthor_gpu.c
+++ b/drivers/gpu/drm/panthor/panthor_gpu.c
@@ -45,8 +45,18 @@ struct panthor_gpu {
static void panthor_gpu_coherency_set(struct panthor_device *ptdev)
{
- gpu_write(ptdev, GPU_COHERENCY_PROTOCOL,
- ptdev->coherent ? GPU_COHERENCY_PROT_BIT(ACE_LITE) : GPU_COHERENCY_NONE);
+ u32 coherency_protocol = GPU_COHERENCY_NONE;
+
+ if (ptdev->coherent) {
+ coherency_protocol = GPU_COHERENCY_ACE_LITE;
+
+ if ((gpu_read(ptdev, GPU_COHERENCY_FEATURES) &
+ GPU_COHERENCY_FEATURE_SHAREABLE_CACHE_SUPPORT))
+ coherency_protocol |=
+ GPU_COHERENCY_SHAREABLE_CACHE_SUPPORT;
+ }
+
+ gpu_write(ptdev, GPU_COHERENCY_PROTOCOL, coherency_protocol);
}
static void panthor_gpu_irq_handler(struct panthor_device *ptdev, u32 status)
diff --git a/drivers/gpu/drm/panthor/panthor_hw.c b/drivers/gpu/drm/panthor/panthor_hw.c
index a7583342d797..3fcb69a6f959 100644
--- a/drivers/gpu/drm/panthor/panthor_hw.c
+++ b/drivers/gpu/drm/panthor/panthor_hw.c
@@ -35,6 +35,24 @@ static char *get_gpu_model_name(struct panthor_device *ptdev)
fallthrough;
case GPU_PROD_ID_MAKE(11, 3):
return "Mali-G615";
+ case GPU_PROD_ID_MAKE(12, 0):
+ if (shader_core_count >= 10 && ray_intersection)
+ return "Mali-G720-Immortalis";
+ else if (shader_core_count >= 6)
+ return "Mali-G720";
+
+ fallthrough;
+ case GPU_PROD_ID_MAKE(12, 1):
+ return "Mali-G620";
+ case GPU_PROD_ID_MAKE(13, 0):
+ if (shader_core_count >= 10 && ray_intersection)
+ return "Mali-G925-Immortalis";
+ else if (shader_core_count >= 6)
+ return "Mali-G725";
+
+ fallthrough;
+ case GPU_PROD_ID_MAKE(13, 1):
+ return "Mali-G625";
}
return "(Unknown Mali GPU)";
diff --git a/drivers/gpu/drm/panthor/panthor_regs.h b/drivers/gpu/drm/panthor/panthor_regs.h
index e4c34f70a880..a9ea32e5fe39 100644
--- a/drivers/gpu/drm/panthor/panthor_regs.h
+++ b/drivers/gpu/drm/panthor/panthor_regs.h
@@ -87,6 +87,8 @@
#define GPU_DOORBELL_FEATURES 0xC0
+#define GPU_COMMAND_ARG(n) (0xD0 + ((n) * 8))
+
#define GPU_SHADER_PRESENT 0x100
#define GPU_TILER_PRESENT 0x110
#define GPU_L2_PRESENT 0x120
@@ -96,6 +98,8 @@
#define L2_READY 0x160
#define SHADER_PWRON 0x180
+#define SHADER_PWRFEATURES 0x188
+#define SHADER_PWRFEATURES_RAY_TRACING_UNIT BIT(0)
#define TILER_PWRON 0x190
#define L2_PWRON 0x1A0
@@ -116,12 +120,15 @@
#define GPU_ASN_HASH(n) (0x2C0 + ((n) * 4))
#define GPU_COHERENCY_FEATURES 0x300
-#define GPU_COHERENCY_PROT_BIT(name) BIT(GPU_COHERENCY_ ## name)
+#define GPU_COHERENCY_FEATURE_ACE_LITE BIT(0)
+#define GPU_COHERENCY_FEATURE_ACE BIT(1)
+#define GPU_COHERENCY_FEATURE_SHAREABLE_CACHE_SUPPORT BIT(5)
#define GPU_COHERENCY_PROTOCOL 0x304
#define GPU_COHERENCY_ACE_LITE 0
#define GPU_COHERENCY_ACE 1
#define GPU_COHERENCY_NONE 31
+#define GPU_COHERENCY_SHAREABLE_CACHE_SUPPORT BIT(5)
#define GPU_SYSC_PBHA_OVERRIDE(n) (0x320 + ((n) * 4))
#define GPU_SYSC_ALLOC(n) (0x340 + ((n) * 4))
@@ -137,6 +144,8 @@
#define MCU_STATUS_HALT 2
#define MCU_STATUS_FATAL 3
+#define MCU_FEATURES 0x708
+
/* Job Control regs */
#define JOB_INT_RAWSTAT 0x1000
#define JOB_INT_CLEAR 0x1004
--
2.49.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH v5 1/6] drm/panthor: Add panthor_hw and move gpu_info initialization into it
2025-07-21 11:13 ` [PATCH v5 1/6] drm/panthor: Add panthor_hw and move gpu_info initialization into it Karunika Choo
@ 2025-07-21 14:30 ` Liviu Dudau
0 siblings, 0 replies; 16+ messages in thread
From: Liviu Dudau @ 2025-07-21 14:30 UTC (permalink / raw)
To: Karunika Choo
Cc: dri-devel, nd, Boris Brezillon, Steven Price, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
linux-kernel
On Mon, Jul 21, 2025 at 12:13:39PM +0100, Karunika Choo wrote:
> This patch introduces panthor_hw and moves the initialization of the
> gpu_info struct into panthor_hw.c in preparation of handling future GPU
> register and naming changes.
>
> Future GPU support can be added by extending panthor_gpu_info_init()
> with the necessary register reads behind GPU architecture version guards
> if the change is minor. For more complex changes, the function can be
> forked and the appropriate function will need to be called based on the
> GPU architecture version.
>
> Signed-off-by: Karunika Choo <karunika.choo@arm.com>
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
Best regards,
Liviu
> ---
> drivers/gpu/drm/panthor/Makefile | 1 +
> drivers/gpu/drm/panthor/panthor_device.c | 5 +
> drivers/gpu/drm/panthor/panthor_gpu.c | 95 -------------------
> drivers/gpu/drm/panthor/panthor_hw.c | 113 +++++++++++++++++++++++
> drivers/gpu/drm/panthor/panthor_hw.h | 11 +++
> 5 files changed, 130 insertions(+), 95 deletions(-)
> create mode 100644 drivers/gpu/drm/panthor/panthor_hw.c
> create mode 100644 drivers/gpu/drm/panthor/panthor_hw.h
>
> diff --git a/drivers/gpu/drm/panthor/Makefile b/drivers/gpu/drm/panthor/Makefile
> index 15294719b09c..02db21748c12 100644
> --- a/drivers/gpu/drm/panthor/Makefile
> +++ b/drivers/gpu/drm/panthor/Makefile
> @@ -8,6 +8,7 @@ panthor-y := \
> panthor_gem.o \
> panthor_gpu.o \
> panthor_heap.o \
> + panthor_hw.o \
> panthor_mmu.o \
> panthor_sched.o
>
> diff --git a/drivers/gpu/drm/panthor/panthor_device.c b/drivers/gpu/drm/panthor/panthor_device.c
> index f0b2da5b2b96..81df49880bd8 100644
> --- a/drivers/gpu/drm/panthor/panthor_device.c
> +++ b/drivers/gpu/drm/panthor/panthor_device.c
> @@ -18,6 +18,7 @@
> #include "panthor_device.h"
> #include "panthor_fw.h"
> #include "panthor_gpu.h"
> +#include "panthor_hw.h"
> #include "panthor_mmu.h"
> #include "panthor_regs.h"
> #include "panthor_sched.h"
> @@ -244,6 +245,10 @@ int panthor_device_init(struct panthor_device *ptdev)
> return ret;
> }
>
> + ret = panthor_hw_init(ptdev);
> + if (ret)
> + goto err_rpm_put;
> +
> ret = panthor_gpu_init(ptdev);
> if (ret)
> goto err_rpm_put;
> diff --git a/drivers/gpu/drm/panthor/panthor_gpu.c b/drivers/gpu/drm/panthor/panthor_gpu.c
> index cb7a335e07d7..5e2c3173ae27 100644
> --- a/drivers/gpu/drm/panthor/panthor_gpu.c
> +++ b/drivers/gpu/drm/panthor/panthor_gpu.c
> @@ -37,40 +37,6 @@ struct panthor_gpu {
> wait_queue_head_t reqs_acked;
> };
>
> -/**
> - * struct panthor_model - GPU model description
> - */
> -struct panthor_model {
> - /** @name: Model name. */
> - const char *name;
> -
> - /** @arch_major: Major version number of architecture. */
> - u8 arch_major;
> -
> - /** @product_major: Major version number of product. */
> - u8 product_major;
> -};
> -
> -/**
> - * GPU_MODEL() - Define a GPU model. A GPU product can be uniquely identified
> - * by a combination of the major architecture version and the major product
> - * version.
> - * @_name: Name for the GPU model.
> - * @_arch_major: Architecture major.
> - * @_product_major: Product major.
> - */
> -#define GPU_MODEL(_name, _arch_major, _product_major) \
> -{\
> - .name = __stringify(_name), \
> - .arch_major = _arch_major, \
> - .product_major = _product_major, \
> -}
> -
> -static const struct panthor_model gpu_models[] = {
> - GPU_MODEL(g610, 10, 7),
> - {},
> -};
> -
> #define GPU_INTERRUPTS_MASK \
> (GPU_IRQ_FAULT | \
> GPU_IRQ_PROTM_FAULT | \
> @@ -83,66 +49,6 @@ static void panthor_gpu_coherency_set(struct panthor_device *ptdev)
> ptdev->coherent ? GPU_COHERENCY_PROT_BIT(ACE_LITE) : GPU_COHERENCY_NONE);
> }
>
> -static void panthor_gpu_init_info(struct panthor_device *ptdev)
> -{
> - const struct panthor_model *model;
> - u32 arch_major, product_major;
> - u32 major, minor, status;
> - unsigned int i;
> -
> - ptdev->gpu_info.gpu_id = gpu_read(ptdev, GPU_ID);
> - ptdev->gpu_info.csf_id = gpu_read(ptdev, GPU_CSF_ID);
> - ptdev->gpu_info.gpu_rev = gpu_read(ptdev, GPU_REVID);
> - ptdev->gpu_info.core_features = gpu_read(ptdev, GPU_CORE_FEATURES);
> - ptdev->gpu_info.l2_features = gpu_read(ptdev, GPU_L2_FEATURES);
> - ptdev->gpu_info.tiler_features = gpu_read(ptdev, GPU_TILER_FEATURES);
> - ptdev->gpu_info.mem_features = gpu_read(ptdev, GPU_MEM_FEATURES);
> - ptdev->gpu_info.mmu_features = gpu_read(ptdev, GPU_MMU_FEATURES);
> - ptdev->gpu_info.thread_features = gpu_read(ptdev, GPU_THREAD_FEATURES);
> - ptdev->gpu_info.max_threads = gpu_read(ptdev, GPU_THREAD_MAX_THREADS);
> - ptdev->gpu_info.thread_max_workgroup_size = gpu_read(ptdev, GPU_THREAD_MAX_WORKGROUP_SIZE);
> - ptdev->gpu_info.thread_max_barrier_size = gpu_read(ptdev, GPU_THREAD_MAX_BARRIER_SIZE);
> - ptdev->gpu_info.coherency_features = gpu_read(ptdev, GPU_COHERENCY_FEATURES);
> - for (i = 0; i < 4; i++)
> - ptdev->gpu_info.texture_features[i] = gpu_read(ptdev, GPU_TEXTURE_FEATURES(i));
> -
> - ptdev->gpu_info.as_present = gpu_read(ptdev, GPU_AS_PRESENT);
> -
> - ptdev->gpu_info.shader_present = gpu_read64(ptdev, GPU_SHADER_PRESENT);
> - ptdev->gpu_info.tiler_present = gpu_read64(ptdev, GPU_TILER_PRESENT);
> - ptdev->gpu_info.l2_present = gpu_read64(ptdev, GPU_L2_PRESENT);
> -
> - arch_major = GPU_ARCH_MAJOR(ptdev->gpu_info.gpu_id);
> - product_major = GPU_PROD_MAJOR(ptdev->gpu_info.gpu_id);
> - major = GPU_VER_MAJOR(ptdev->gpu_info.gpu_id);
> - minor = GPU_VER_MINOR(ptdev->gpu_info.gpu_id);
> - status = GPU_VER_STATUS(ptdev->gpu_info.gpu_id);
> -
> - for (model = gpu_models; model->name; model++) {
> - if (model->arch_major == arch_major &&
> - model->product_major == product_major)
> - break;
> - }
> -
> - drm_info(&ptdev->base,
> - "mali-%s id 0x%x major 0x%x minor 0x%x status 0x%x",
> - model->name ?: "unknown", ptdev->gpu_info.gpu_id >> 16,
> - major, minor, status);
> -
> - drm_info(&ptdev->base,
> - "Features: L2:%#x Tiler:%#x Mem:%#x MMU:%#x AS:%#x",
> - ptdev->gpu_info.l2_features,
> - ptdev->gpu_info.tiler_features,
> - ptdev->gpu_info.mem_features,
> - ptdev->gpu_info.mmu_features,
> - ptdev->gpu_info.as_present);
> -
> - drm_info(&ptdev->base,
> - "shader_present=0x%0llx l2_present=0x%0llx tiler_present=0x%0llx",
> - ptdev->gpu_info.shader_present, ptdev->gpu_info.l2_present,
> - ptdev->gpu_info.tiler_present);
> -}
> -
> static void panthor_gpu_irq_handler(struct panthor_device *ptdev, u32 status)
> {
> gpu_write(ptdev, GPU_INT_CLEAR, status);
> @@ -205,7 +111,6 @@ int panthor_gpu_init(struct panthor_device *ptdev)
> spin_lock_init(&gpu->reqs_lock);
> init_waitqueue_head(&gpu->reqs_acked);
> ptdev->gpu = gpu;
> - panthor_gpu_init_info(ptdev);
>
> dma_set_max_seg_size(ptdev->base.dev, UINT_MAX);
> pa_bits = GPU_MMU_FEATURES_PA_BITS(ptdev->gpu_info.mmu_features);
> diff --git a/drivers/gpu/drm/panthor/panthor_hw.c b/drivers/gpu/drm/panthor/panthor_hw.c
> new file mode 100644
> index 000000000000..3f7175cb0ab4
> --- /dev/null
> +++ b/drivers/gpu/drm/panthor/panthor_hw.c
> @@ -0,0 +1,113 @@
> +// SPDX-License-Identifier: GPL-2.0 or MIT
> +/* Copyright 2025 ARM Limited. All rights reserved. */
> +
> +#include "panthor_device.h"
> +#include "panthor_hw.h"
> +#include "panthor_regs.h"
> +
> +/**
> + * struct panthor_model - GPU model description
> + */
> +struct panthor_model {
> + /** @name: Model name. */
> + const char *name;
> +
> + /** @arch_major: Major version number of architecture. */
> + u8 arch_major;
> +
> + /** @product_major: Major version number of product. */
> + u8 product_major;
> +};
> +
> +/**
> + * GPU_MODEL() - Define a GPU model. A GPU product can be uniquely identified
> + * by a combination of the major architecture version and the major product
> + * version.
> + * @_name: Name for the GPU model.
> + * @_arch_major: Architecture major.
> + * @_product_major: Product major.
> + */
> +#define GPU_MODEL(_name, _arch_major, _product_major) \
> +{\
> + .name = __stringify(_name), \
> + .arch_major = _arch_major, \
> + .product_major = _product_major, \
> +}
> +
> +static const struct panthor_model gpu_models[] = {
> + GPU_MODEL(g610, 10, 7),
> + {},
> +};
> +
> +static void panthor_gpu_info_init(struct panthor_device *ptdev)
> +{
> + unsigned int i;
> +
> + ptdev->gpu_info.gpu_id = gpu_read(ptdev, GPU_ID);
> + ptdev->gpu_info.csf_id = gpu_read(ptdev, GPU_CSF_ID);
> + ptdev->gpu_info.gpu_rev = gpu_read(ptdev, GPU_REVID);
> + ptdev->gpu_info.core_features = gpu_read(ptdev, GPU_CORE_FEATURES);
> + ptdev->gpu_info.l2_features = gpu_read(ptdev, GPU_L2_FEATURES);
> + ptdev->gpu_info.tiler_features = gpu_read(ptdev, GPU_TILER_FEATURES);
> + ptdev->gpu_info.mem_features = gpu_read(ptdev, GPU_MEM_FEATURES);
> + ptdev->gpu_info.mmu_features = gpu_read(ptdev, GPU_MMU_FEATURES);
> + ptdev->gpu_info.thread_features = gpu_read(ptdev, GPU_THREAD_FEATURES);
> + ptdev->gpu_info.max_threads = gpu_read(ptdev, GPU_THREAD_MAX_THREADS);
> + ptdev->gpu_info.thread_max_workgroup_size = gpu_read(ptdev, GPU_THREAD_MAX_WORKGROUP_SIZE);
> + ptdev->gpu_info.thread_max_barrier_size = gpu_read(ptdev, GPU_THREAD_MAX_BARRIER_SIZE);
> + ptdev->gpu_info.coherency_features = gpu_read(ptdev, GPU_COHERENCY_FEATURES);
> + for (i = 0; i < 4; i++)
> + ptdev->gpu_info.texture_features[i] = gpu_read(ptdev, GPU_TEXTURE_FEATURES(i));
> +
> + ptdev->gpu_info.as_present = gpu_read(ptdev, GPU_AS_PRESENT);
> +
> + ptdev->gpu_info.shader_present = gpu_read64(ptdev, GPU_SHADER_PRESENT);
> + ptdev->gpu_info.tiler_present = gpu_read64(ptdev, GPU_TILER_PRESENT);
> + ptdev->gpu_info.l2_present = gpu_read64(ptdev, GPU_L2_PRESENT);
> +}
> +
> +static void panthor_hw_info_init(struct panthor_device *ptdev)
> +{
> + const struct panthor_model *model;
> + u32 arch_major, product_major;
> + u32 major, minor, status;
> +
> + panthor_gpu_info_init(ptdev);
> +
> + arch_major = GPU_ARCH_MAJOR(ptdev->gpu_info.gpu_id);
> + product_major = GPU_PROD_MAJOR(ptdev->gpu_info.gpu_id);
> + major = GPU_VER_MAJOR(ptdev->gpu_info.gpu_id);
> + minor = GPU_VER_MINOR(ptdev->gpu_info.gpu_id);
> + status = GPU_VER_STATUS(ptdev->gpu_info.gpu_id);
> +
> + for (model = gpu_models; model->name; model++) {
> + if (model->arch_major == arch_major &&
> + model->product_major == product_major)
> + break;
> + }
> +
> + drm_info(&ptdev->base,
> + "mali-%s id 0x%x major 0x%x minor 0x%x status 0x%x",
> + model->name ?: "unknown", ptdev->gpu_info.gpu_id >> 16,
> + major, minor, status);
> +
> + drm_info(&ptdev->base,
> + "Features: L2:%#x Tiler:%#x Mem:%#x MMU:%#x AS:%#x",
> + ptdev->gpu_info.l2_features,
> + ptdev->gpu_info.tiler_features,
> + ptdev->gpu_info.mem_features,
> + ptdev->gpu_info.mmu_features,
> + ptdev->gpu_info.as_present);
> +
> + drm_info(&ptdev->base,
> + "shader_present=0x%0llx l2_present=0x%0llx tiler_present=0x%0llx",
> + ptdev->gpu_info.shader_present, ptdev->gpu_info.l2_present,
> + ptdev->gpu_info.tiler_present);
> +}
> +
> +int panthor_hw_init(struct panthor_device *ptdev)
> +{
> + panthor_hw_info_init(ptdev);
> +
> + return 0;
> +}
> \ No newline at end of file
> diff --git a/drivers/gpu/drm/panthor/panthor_hw.h b/drivers/gpu/drm/panthor/panthor_hw.h
> new file mode 100644
> index 000000000000..0af6acc6aa6a
> --- /dev/null
> +++ b/drivers/gpu/drm/panthor/panthor_hw.h
> @@ -0,0 +1,11 @@
> +/* SPDX-License-Identifier: GPL-2.0 or MIT */
> +/* Copyright 2025 ARM Limited. All rights reserved. */
> +
> +#ifndef __PANTHOR_HW_H__
> +#define __PANTHOR_HW_H__
> +
> +struct panthor_device;
> +
> +int panthor_hw_init(struct panthor_device *ptdev);
> +
> +#endif /* __PANTHOR_HW_H__ */
> --
> 2.49.0
>
--
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
¯\_(ツ)_/¯
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v5 2/6] drm/panthor: Simplify getting the GPU model name
2025-07-21 11:13 ` [PATCH v5 2/6] drm/panthor: Simplify getting the GPU model name Karunika Choo
@ 2025-07-21 14:41 ` Liviu Dudau
0 siblings, 0 replies; 16+ messages in thread
From: Liviu Dudau @ 2025-07-21 14:41 UTC (permalink / raw)
To: Karunika Choo
Cc: dri-devel, nd, Boris Brezillon, Steven Price, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
linux-kernel
On Mon, Jul 21, 2025 at 12:13:40PM +0100, Karunika Choo wrote:
> This patch replaces the panthor_model structure with a simple switch
> case based on the product_id which is in the format of:
> ((arch_major << 24) | product_major)
>
> This simplifies comparison and allows extending of the function to
> accommodate naming differences based on supported GPU features.
>
> Signed-off-by: Karunika Choo <karunika.choo@arm.com>
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
Best regards,
Liviu
> ---
> drivers/gpu/drm/panthor/panthor_hw.c | 61 ++++++++--------------------
> 1 file changed, 17 insertions(+), 44 deletions(-)
>
> diff --git a/drivers/gpu/drm/panthor/panthor_hw.c b/drivers/gpu/drm/panthor/panthor_hw.c
> index 3f7175cb0ab4..f39010c0ca86 100644
> --- a/drivers/gpu/drm/panthor/panthor_hw.c
> +++ b/drivers/gpu/drm/panthor/panthor_hw.c
> @@ -5,39 +5,22 @@
> #include "panthor_hw.h"
> #include "panthor_regs.h"
>
> -/**
> - * struct panthor_model - GPU model description
> - */
> -struct panthor_model {
> - /** @name: Model name. */
> - const char *name;
> -
> - /** @arch_major: Major version number of architecture. */
> - u8 arch_major;
> -
> - /** @product_major: Major version number of product. */
> - u8 product_major;
> -};
> -
> -/**
> - * GPU_MODEL() - Define a GPU model. A GPU product can be uniquely identified
> - * by a combination of the major architecture version and the major product
> - * version.
> - * @_name: Name for the GPU model.
> - * @_arch_major: Architecture major.
> - * @_product_major: Product major.
> - */
> -#define GPU_MODEL(_name, _arch_major, _product_major) \
> -{\
> - .name = __stringify(_name), \
> - .arch_major = _arch_major, \
> - .product_major = _product_major, \
> -}
> +#define GPU_PROD_ID_MAKE(arch_major, prod_major) \
> + (((arch_major) << 24) | (prod_major))
> +
> +static char *get_gpu_model_name(struct panthor_device *ptdev)
> +{
> + const u32 gpu_id = ptdev->gpu_info.gpu_id;
> + const u32 product_id = GPU_PROD_ID_MAKE(GPU_ARCH_MAJOR(gpu_id),
> + GPU_PROD_MAJOR(gpu_id));
> +
> + switch (product_id) {
> + case GPU_PROD_ID_MAKE(10, 7):
> + return "Mali-G610";
> + }
>
> -static const struct panthor_model gpu_models[] = {
> - GPU_MODEL(g610, 10, 7),
> - {},
> -};
> + return "(Unknown Mali GPU)";
> +}
>
> static void panthor_gpu_info_init(struct panthor_device *ptdev)
> {
> @@ -68,27 +51,17 @@ static void panthor_gpu_info_init(struct panthor_device *ptdev)
>
> static void panthor_hw_info_init(struct panthor_device *ptdev)
> {
> - const struct panthor_model *model;
> - u32 arch_major, product_major;
> u32 major, minor, status;
>
> panthor_gpu_info_init(ptdev);
>
> - arch_major = GPU_ARCH_MAJOR(ptdev->gpu_info.gpu_id);
> - product_major = GPU_PROD_MAJOR(ptdev->gpu_info.gpu_id);
> major = GPU_VER_MAJOR(ptdev->gpu_info.gpu_id);
> minor = GPU_VER_MINOR(ptdev->gpu_info.gpu_id);
> status = GPU_VER_STATUS(ptdev->gpu_info.gpu_id);
>
> - for (model = gpu_models; model->name; model++) {
> - if (model->arch_major == arch_major &&
> - model->product_major == product_major)
> - break;
> - }
> -
> drm_info(&ptdev->base,
> - "mali-%s id 0x%x major 0x%x minor 0x%x status 0x%x",
> - model->name ?: "unknown", ptdev->gpu_info.gpu_id >> 16,
> + "%s id 0x%x major 0x%x minor 0x%x status 0x%x",
> + get_gpu_model_name(ptdev), ptdev->gpu_info.gpu_id >> 16,
> major, minor, status);
>
> drm_info(&ptdev->base,
> --
> 2.49.0
>
--
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
¯\_(ツ)_/¯
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v5 3/6] drm/panthor: Add support for Mali-G710, Mali-G510 and Mali-G310
2025-07-21 11:13 ` [PATCH v5 3/6] drm/panthor: Add support for Mali-G710, Mali-G510 and Mali-G310 Karunika Choo
@ 2025-07-21 14:42 ` Liviu Dudau
2025-07-22 8:29 ` Erik Faye-Lund
2025-07-24 5:34 ` Chia-I Wu
2 siblings, 0 replies; 16+ messages in thread
From: Liviu Dudau @ 2025-07-21 14:42 UTC (permalink / raw)
To: Karunika Choo
Cc: dri-devel, nd, Boris Brezillon, Steven Price, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
linux-kernel
On Mon, Jul 21, 2025 at 12:13:41PM +0100, Karunika Choo wrote:
> This patch adds GPU model name and FW binary support for Mali-G710,
> Mali-G510, and Mali-G310.
>
> Signed-off-by: Karunika Choo <karunika.choo@arm.com>
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
Best regards,
Liviu
> ---
> drivers/gpu/drm/panthor/panthor_fw.c | 2 ++
> drivers/gpu/drm/panthor/panthor_hw.c | 6 ++++++
> 2 files changed, 8 insertions(+)
>
> diff --git a/drivers/gpu/drm/panthor/panthor_fw.c b/drivers/gpu/drm/panthor/panthor_fw.c
> index 36f1034839c2..b7b454d16f12 100644
> --- a/drivers/gpu/drm/panthor/panthor_fw.c
> +++ b/drivers/gpu/drm/panthor/panthor_fw.c
> @@ -1402,3 +1402,5 @@ int panthor_fw_init(struct panthor_device *ptdev)
> }
>
> MODULE_FIRMWARE("arm/mali/arch10.8/mali_csffw.bin");
> +MODULE_FIRMWARE("arm/mali/arch10.10/mali_csffw.bin");
> +MODULE_FIRMWARE("arm/mali/arch10.12/mali_csffw.bin");
> diff --git a/drivers/gpu/drm/panthor/panthor_hw.c b/drivers/gpu/drm/panthor/panthor_hw.c
> index f39010c0ca86..7f138974d43b 100644
> --- a/drivers/gpu/drm/panthor/panthor_hw.c
> +++ b/drivers/gpu/drm/panthor/panthor_hw.c
> @@ -15,8 +15,14 @@ static char *get_gpu_model_name(struct panthor_device *ptdev)
> GPU_PROD_MAJOR(gpu_id));
>
> switch (product_id) {
> + case GPU_PROD_ID_MAKE(10, 2):
> + return "Mali-G710";
> case GPU_PROD_ID_MAKE(10, 7):
> return "Mali-G610";
> + case GPU_PROD_ID_MAKE(10, 3):
> + return "Mali-G510";
> + case GPU_PROD_ID_MAKE(10, 4):
> + return "Mali-G310";
> }
>
> return "(Unknown Mali GPU)";
> --
> 2.49.0
>
--
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
¯\_(ツ)_/¯
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v5 4/6] drm/panthor: Add support for Mali-Gx15 family of GPUs
2025-07-21 11:13 ` [PATCH v5 4/6] drm/panthor: Add support for Mali-Gx15 family of GPUs Karunika Choo
@ 2025-07-21 14:46 ` Liviu Dudau
0 siblings, 0 replies; 16+ messages in thread
From: Liviu Dudau @ 2025-07-21 14:46 UTC (permalink / raw)
To: Karunika Choo
Cc: dri-devel, nd, Boris Brezillon, Steven Price, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
linux-kernel
On Mon, Jul 21, 2025 at 12:13:42PM +0100, Karunika Choo wrote:
> Mali-Gx15 introduces a new GPU_FEATURES register that provides
> information about GPU-wide supported features. The register value will
> be passed on to userspace via gpu_info. It also adds the following
> registers that are specific to the kernel driver only:
> - ASN_HASH_0~2
> - DOORBELL_FEATURES
> - PRFCNT_FEATURES
> - SYSC_ALLOC0~7
> - SYSC_PBHA_OVERRIDE0~3
>
> Additionally, Mali-Gx15 presents an 'Immortalis' naming variant
> depending on the shader core count and presence of Ray Intersection
> feature support.
>
> This patch adds:
> - support for correctly identifying the model names for Mali-Gx15 GPUs.
> - arch 11.8 FW binary support
>
> Signed-off-by: Karunika Choo <karunika.choo@arm.com>
> ---
> drivers/gpu/drm/panthor/panthor_fw.c | 1 +
> drivers/gpu/drm/panthor/panthor_hw.c | 15 +++++++++++++++
> drivers/gpu/drm/panthor/panthor_regs.h | 11 +++++++++++
> include/uapi/drm/panthor_drm.h | 3 +++
> 4 files changed, 30 insertions(+)
>
> diff --git a/drivers/gpu/drm/panthor/panthor_fw.c b/drivers/gpu/drm/panthor/panthor_fw.c
> index b7b454d16f12..fa6e0b48a0b2 100644
> --- a/drivers/gpu/drm/panthor/panthor_fw.c
> +++ b/drivers/gpu/drm/panthor/panthor_fw.c
> @@ -1404,3 +1404,4 @@ int panthor_fw_init(struct panthor_device *ptdev)
> MODULE_FIRMWARE("arm/mali/arch10.8/mali_csffw.bin");
> MODULE_FIRMWARE("arm/mali/arch10.10/mali_csffw.bin");
> MODULE_FIRMWARE("arm/mali/arch10.12/mali_csffw.bin");
> +MODULE_FIRMWARE("arm/mali/arch11.8/mali_csffw.bin");
> diff --git a/drivers/gpu/drm/panthor/panthor_hw.c b/drivers/gpu/drm/panthor/panthor_hw.c
> index 7f138974d43b..a7583342d797 100644
> --- a/drivers/gpu/drm/panthor/panthor_hw.c
> +++ b/drivers/gpu/drm/panthor/panthor_hw.c
> @@ -13,6 +13,9 @@ static char *get_gpu_model_name(struct panthor_device *ptdev)
> const u32 gpu_id = ptdev->gpu_info.gpu_id;
> const u32 product_id = GPU_PROD_ID_MAKE(GPU_ARCH_MAJOR(gpu_id),
> GPU_PROD_MAJOR(gpu_id));
> + const bool ray_intersection = !!(ptdev->gpu_info.gpu_features &
> + GPU_FEATURES_RAY_INTERSECTION);
> + const u8 shader_core_count = hweight64(ptdev->gpu_info.shader_present);
>
> switch (product_id) {
> case GPU_PROD_ID_MAKE(10, 2):
> @@ -23,6 +26,15 @@ static char *get_gpu_model_name(struct panthor_device *ptdev)
> return "Mali-G510";
> case GPU_PROD_ID_MAKE(10, 4):
> return "Mali-G310";
> + case GPU_PROD_ID_MAKE(11, 2):
> + if (shader_core_count > 10 && ray_intersection)
> + return "Mali-G715-Immortalis";
> + else if (shader_core_count >= 7)
> + return "Mali-G715";
> +
> + fallthrough;
> + case GPU_PROD_ID_MAKE(11, 3):
> + return "Mali-G615";
> }
>
> return "(Unknown Mali GPU)";
> @@ -53,6 +65,9 @@ static void panthor_gpu_info_init(struct panthor_device *ptdev)
> ptdev->gpu_info.shader_present = gpu_read64(ptdev, GPU_SHADER_PRESENT);
> ptdev->gpu_info.tiler_present = gpu_read64(ptdev, GPU_TILER_PRESENT);
> ptdev->gpu_info.l2_present = gpu_read64(ptdev, GPU_L2_PRESENT);
> +
> + /* Introduced in arch 11.x */
> + ptdev->gpu_info.gpu_features = gpu_read64(ptdev, GPU_FEATURES);
> }
>
> static void panthor_hw_info_init(struct panthor_device *ptdev)
> diff --git a/drivers/gpu/drm/panthor/panthor_regs.h b/drivers/gpu/drm/panthor/panthor_regs.h
> index 48bbfd40138c..e4c34f70a880 100644
> --- a/drivers/gpu/drm/panthor/panthor_regs.h
> +++ b/drivers/gpu/drm/panthor/panthor_regs.h
> @@ -70,6 +70,10 @@
> #define GPU_PWR_OVERRIDE0 0x54
> #define GPU_PWR_OVERRIDE1 0x58
>
> +#define GPU_FEATURES 0x60
> +#define GPU_FEATURES_RAY_INTERSECTION BIT(2)
> +#define GPU_PRFCNT_FEATURES 0x68
> +
> #define GPU_TIMESTAMP_OFFSET 0x88
> #define GPU_CYCLE_COUNT 0x90
> #define GPU_TIMESTAMP 0x98
> @@ -81,6 +85,8 @@
>
> #define GPU_TEXTURE_FEATURES(n) (0xB0 + ((n) * 4))
Until they are actually used I would suggest that you remove the definitions for the
registers that are following this line.
With that change,
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
Best regards,
Liviu
>
> +#define GPU_DOORBELL_FEATURES 0xC0
> +
> #define GPU_SHADER_PRESENT 0x100
> #define GPU_TILER_PRESENT 0x110
> #define GPU_L2_PRESENT 0x120
> @@ -107,6 +113,8 @@
>
> #define GPU_REVID 0x280
>
> +#define GPU_ASN_HASH(n) (0x2C0 + ((n) * 4))
> +
> #define GPU_COHERENCY_FEATURES 0x300
> #define GPU_COHERENCY_PROT_BIT(name) BIT(GPU_COHERENCY_ ## name)
>
> @@ -115,6 +123,9 @@
> #define GPU_COHERENCY_ACE 1
> #define GPU_COHERENCY_NONE 31
>
> +#define GPU_SYSC_PBHA_OVERRIDE(n) (0x320 + ((n) * 4))
> +#define GPU_SYSC_ALLOC(n) (0x340 + ((n) * 4))
> +
> #define MCU_CONTROL 0x700
> #define MCU_CONTROL_ENABLE 1
> #define MCU_CONTROL_AUTO 2
> diff --git a/include/uapi/drm/panthor_drm.h b/include/uapi/drm/panthor_drm.h
> index e1f43deb7eca..467d365ed7ba 100644
> --- a/include/uapi/drm/panthor_drm.h
> +++ b/include/uapi/drm/panthor_drm.h
> @@ -327,6 +327,9 @@ struct drm_panthor_gpu_info {
>
> /** @pad: MBZ. */
> __u32 pad;
> +
> + /** @gpu_features: Bitmask describing supported GPU-wide features */
> + __u64 gpu_features;
> };
>
> /**
> --
> 2.49.0
>
--
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
¯\_(ツ)_/¯
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v5 5/6] drm/panthor: Make MMU cache maintenance use FLUSH_CACHES command
2025-07-21 11:13 ` [PATCH v5 5/6] drm/panthor: Make MMU cache maintenance use FLUSH_CACHES command Karunika Choo
@ 2025-07-21 14:54 ` Liviu Dudau
0 siblings, 0 replies; 16+ messages in thread
From: Liviu Dudau @ 2025-07-21 14:54 UTC (permalink / raw)
To: Karunika Choo
Cc: dri-devel, nd, Boris Brezillon, Steven Price, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
linux-kernel
On Mon, Jul 21, 2025 at 12:13:43PM +0100, Karunika Choo wrote:
> As the FLUSH_MEM and FLUSH_PT MMU_AS commands are deprecated in GPUs
> from Mali-Gx20 onwards, this patch adds support for performing cache
> maintenance via the FLUSH_CACHES command in GPU_COMMAND in place of
> FLUSH_MEM and FLUSH_PT commands.
>
> Mali-Gx10 and Mali-Gx15 GPUs also has support for the FLUSH_CACHES
> command and will also use this by default going forward.
>
> Signed-off-by: Karunika Choo <karunika.choo@arm.com>
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
Best regards,
Liviu
> ---
> drivers/gpu/drm/panthor/panthor_mmu.c | 33 +++++++++++++++++++++++++++
> 1 file changed, 33 insertions(+)
>
> diff --git a/drivers/gpu/drm/panthor/panthor_mmu.c b/drivers/gpu/drm/panthor/panthor_mmu.c
> index 4140f697ba5a..367c89aca558 100644
> --- a/drivers/gpu/drm/panthor/panthor_mmu.c
> +++ b/drivers/gpu/drm/panthor/panthor_mmu.c
> @@ -29,6 +29,7 @@
>
> #include "panthor_device.h"
> #include "panthor_gem.h"
> +#include "panthor_gpu.h"
> #include "panthor_heap.h"
> #include "panthor_mmu.h"
> #include "panthor_regs.h"
> @@ -568,6 +569,35 @@ static void lock_region(struct panthor_device *ptdev, u32 as_nr,
> write_cmd(ptdev, as_nr, AS_COMMAND_LOCK);
> }
>
> +static int mmu_hw_do_flush_on_gpu_ctrl(struct panthor_device *ptdev, int as_nr,
> + u32 op)
> +{
> + const u32 l2_flush_op = CACHE_CLEAN | CACHE_INV;
> + u32 lsc_flush_op = 0;
> + int ret;
> +
> + if (op == AS_COMMAND_FLUSH_MEM)
> + lsc_flush_op = CACHE_CLEAN | CACHE_INV;
> +
> + ret = wait_ready(ptdev, as_nr);
> + if (ret)
> + return ret;
> +
> + ret = panthor_gpu_flush_caches(ptdev, l2_flush_op, lsc_flush_op, 0);
> + if (ret)
> + return ret;
> +
> + /*
> + * Explicitly unlock the region as the AS is not unlocked automatically
> + * at the end of the GPU_CONTROL cache flush command, unlike
> + * AS_COMMAND_FLUSH_MEM or AS_COMMAND_FLUSH_PT.
> + */
> + write_cmd(ptdev, as_nr, AS_COMMAND_UNLOCK);
> +
> + /* Wait for the unlock command to complete */
> + return wait_ready(ptdev, as_nr);
> +}
> +
> static int mmu_hw_do_operation_locked(struct panthor_device *ptdev, int as_nr,
> u64 iova, u64 size, u32 op)
> {
> @@ -585,6 +615,9 @@ static int mmu_hw_do_operation_locked(struct panthor_device *ptdev, int as_nr,
> if (op != AS_COMMAND_UNLOCK)
> lock_region(ptdev, as_nr, iova, size);
>
> + if (op == AS_COMMAND_FLUSH_MEM || op == AS_COMMAND_FLUSH_PT)
> + return mmu_hw_do_flush_on_gpu_ctrl(ptdev, as_nr, op);
> +
> /* Run the MMU operation */
> write_cmd(ptdev, as_nr, op);
>
> --
> 2.49.0
>
--
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
¯\_(ツ)_/¯
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v5 6/6] drm/panthor: Add support for Mali-Gx20 and Mali-Gx25 GPUs
2025-07-21 11:13 ` [PATCH v5 6/6] drm/panthor: Add support for Mali-Gx20 and Mali-Gx25 GPUs Karunika Choo
@ 2025-07-21 14:59 ` Liviu Dudau
0 siblings, 0 replies; 16+ messages in thread
From: Liviu Dudau @ 2025-07-21 14:59 UTC (permalink / raw)
To: Karunika Choo
Cc: dri-devel, nd, Boris Brezillon, Steven Price, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
linux-kernel
On Mon, Jul 21, 2025 at 12:13:44PM +0100, Karunika Choo wrote:
> This patch adds firmware binary and GPU model naming support for
> Mali-Gx20 and Mali-Gx25 GPUs.
>
> It also introduces the following registers:
> - GPU_COMMAND_ARG0~1
> - SHADER_PWRFEATURES
> - MCU_FEATURES
>
> The GPU_COHERENCY_FEATURES macros are slightly reworked as the
> assumption that FEATURE = BIT(PROTOCOL) no longer holds with the
> introduction of the SHAREABLE_CACHE_SUPPORT, which is BIT(5) on the
> GPU_COHERENCY_PROTOCOL register. As such, the feature bits are now
> individually defined. Further changes were also made to enable
> SHAREABLE_CACHE_SUPPORT if coherency is enabled and the feature is
> supported.
>
> This patch also fixes a minor bug that incorrectly writes ACE instead of
> ACE_LITE to GPU_COHERENCY_PROTOCOL if coherency is enabled.
>
> Signed-off-by: Karunika Choo <karunika.choo@arm.com>
> ---
> drivers/gpu/drm/panthor/panthor_device.c | 2 +-
> drivers/gpu/drm/panthor/panthor_fw.c | 2 ++
> drivers/gpu/drm/panthor/panthor_gpu.c | 14 ++++++++++++--
> drivers/gpu/drm/panthor/panthor_hw.c | 18 ++++++++++++++++++
> drivers/gpu/drm/panthor/panthor_regs.h | 11 ++++++++++-
> 5 files changed, 43 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/panthor/panthor_device.c b/drivers/gpu/drm/panthor/panthor_device.c
> index 81df49880bd8..f547aa4159ec 100644
> --- a/drivers/gpu/drm/panthor/panthor_device.c
> +++ b/drivers/gpu/drm/panthor/panthor_device.c
> @@ -34,7 +34,7 @@ static int panthor_gpu_coherency_init(struct panthor_device *ptdev)
> * ACE protocol has never been supported for command stream frontend GPUs.
> */
> if ((gpu_read(ptdev, GPU_COHERENCY_FEATURES) &
> - GPU_COHERENCY_PROT_BIT(ACE_LITE)))
> + GPU_COHERENCY_FEATURE_ACE_LITE))
> return 0;
>
> drm_err(&ptdev->base, "Coherency not supported by the device");
> diff --git a/drivers/gpu/drm/panthor/panthor_fw.c b/drivers/gpu/drm/panthor/panthor_fw.c
> index fa6e0b48a0b2..9bf06e55eaee 100644
> --- a/drivers/gpu/drm/panthor/panthor_fw.c
> +++ b/drivers/gpu/drm/panthor/panthor_fw.c
> @@ -1405,3 +1405,5 @@ MODULE_FIRMWARE("arm/mali/arch10.8/mali_csffw.bin");
> MODULE_FIRMWARE("arm/mali/arch10.10/mali_csffw.bin");
> MODULE_FIRMWARE("arm/mali/arch10.12/mali_csffw.bin");
> MODULE_FIRMWARE("arm/mali/arch11.8/mali_csffw.bin");
> +MODULE_FIRMWARE("arm/mali/arch12.8/mali_csffw.bin");
> +MODULE_FIRMWARE("arm/mali/arch13.8/mali_csffw.bin");
> diff --git a/drivers/gpu/drm/panthor/panthor_gpu.c b/drivers/gpu/drm/panthor/panthor_gpu.c
> index 5e2c3173ae27..df2419706fe0 100644
> --- a/drivers/gpu/drm/panthor/panthor_gpu.c
> +++ b/drivers/gpu/drm/panthor/panthor_gpu.c
> @@ -45,8 +45,18 @@ struct panthor_gpu {
>
> static void panthor_gpu_coherency_set(struct panthor_device *ptdev)
> {
> - gpu_write(ptdev, GPU_COHERENCY_PROTOCOL,
> - ptdev->coherent ? GPU_COHERENCY_PROT_BIT(ACE_LITE) : GPU_COHERENCY_NONE);
> + u32 coherency_protocol = GPU_COHERENCY_NONE;
> +
> + if (ptdev->coherent) {
> + coherency_protocol = GPU_COHERENCY_ACE_LITE;
> +
> + if ((gpu_read(ptdev, GPU_COHERENCY_FEATURES) &
> + GPU_COHERENCY_FEATURE_SHAREABLE_CACHE_SUPPORT))
> + coherency_protocol |=
> + GPU_COHERENCY_SHAREABLE_CACHE_SUPPORT;
> + }
> +
> + gpu_write(ptdev, GPU_COHERENCY_PROTOCOL, coherency_protocol);
> }
>
> static void panthor_gpu_irq_handler(struct panthor_device *ptdev, u32 status)
> diff --git a/drivers/gpu/drm/panthor/panthor_hw.c b/drivers/gpu/drm/panthor/panthor_hw.c
> index a7583342d797..3fcb69a6f959 100644
> --- a/drivers/gpu/drm/panthor/panthor_hw.c
> +++ b/drivers/gpu/drm/panthor/panthor_hw.c
> @@ -35,6 +35,24 @@ static char *get_gpu_model_name(struct panthor_device *ptdev)
> fallthrough;
> case GPU_PROD_ID_MAKE(11, 3):
> return "Mali-G615";
> + case GPU_PROD_ID_MAKE(12, 0):
> + if (shader_core_count >= 10 && ray_intersection)
> + return "Mali-G720-Immortalis";
> + else if (shader_core_count >= 6)
> + return "Mali-G720";
> +
> + fallthrough;
> + case GPU_PROD_ID_MAKE(12, 1):
> + return "Mali-G620";
> + case GPU_PROD_ID_MAKE(13, 0):
> + if (shader_core_count >= 10 && ray_intersection)
> + return "Mali-G925-Immortalis";
> + else if (shader_core_count >= 6)
> + return "Mali-G725";
> +
> + fallthrough;
> + case GPU_PROD_ID_MAKE(13, 1):
> + return "Mali-G625";
> }
>
> return "(Unknown Mali GPU)";
> diff --git a/drivers/gpu/drm/panthor/panthor_regs.h b/drivers/gpu/drm/panthor/panthor_regs.h
> index e4c34f70a880..a9ea32e5fe39 100644
> --- a/drivers/gpu/drm/panthor/panthor_regs.h
> +++ b/drivers/gpu/drm/panthor/panthor_regs.h
> @@ -87,6 +87,8 @@
>
> #define GPU_DOORBELL_FEATURES 0xC0
>
> +#define GPU_COMMAND_ARG(n) (0xD0 + ((n) * 8))
This ...
> +
> #define GPU_SHADER_PRESENT 0x100
> #define GPU_TILER_PRESENT 0x110
> #define GPU_L2_PRESENT 0x120
> @@ -96,6 +98,8 @@
> #define L2_READY 0x160
>
> #define SHADER_PWRON 0x180
> +#define SHADER_PWRFEATURES 0x188
> +#define SHADER_PWRFEATURES_RAY_TRACING_UNIT BIT(0)
... and this are not used anywhere. Can we remove them until we add code that uses them?
> #define TILER_PWRON 0x190
> #define L2_PWRON 0x1A0
>
> @@ -116,12 +120,15 @@
> #define GPU_ASN_HASH(n) (0x2C0 + ((n) * 4))
>
> #define GPU_COHERENCY_FEATURES 0x300
> -#define GPU_COHERENCY_PROT_BIT(name) BIT(GPU_COHERENCY_ ## name)
> +#define GPU_COHERENCY_FEATURE_ACE_LITE BIT(0)
> +#define GPU_COHERENCY_FEATURE_ACE BIT(1)
> +#define GPU_COHERENCY_FEATURE_SHAREABLE_CACHE_SUPPORT BIT(5)
>
> #define GPU_COHERENCY_PROTOCOL 0x304
> #define GPU_COHERENCY_ACE_LITE 0
> #define GPU_COHERENCY_ACE 1
> #define GPU_COHERENCY_NONE 31
> +#define GPU_COHERENCY_SHAREABLE_CACHE_SUPPORT BIT(5)
>
> #define GPU_SYSC_PBHA_OVERRIDE(n) (0x320 + ((n) * 4))
> #define GPU_SYSC_ALLOC(n) (0x340 + ((n) * 4))
> @@ -137,6 +144,8 @@
> #define MCU_STATUS_HALT 2
> #define MCU_STATUS_FATAL 3
>
> +#define MCU_FEATURES 0x708
Same for this one.
With that changed,
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
Best regards,
Liviu
> +
> /* Job Control regs */
> #define JOB_INT_RAWSTAT 0x1000
> #define JOB_INT_CLEAR 0x1004
> --
> 2.49.0
>
--
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
¯\_(ツ)_/¯
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v5 3/6] drm/panthor: Add support for Mali-G710, Mali-G510 and Mali-G310
2025-07-21 11:13 ` [PATCH v5 3/6] drm/panthor: Add support for Mali-G710, Mali-G510 and Mali-G310 Karunika Choo
2025-07-21 14:42 ` Liviu Dudau
@ 2025-07-22 8:29 ` Erik Faye-Lund
2025-07-22 8:55 ` Liviu Dudau
2025-07-24 5:34 ` Chia-I Wu
2 siblings, 1 reply; 16+ messages in thread
From: Erik Faye-Lund @ 2025-07-22 8:29 UTC (permalink / raw)
To: Karunika Choo, dri-devel
Cc: nd, Boris Brezillon, Steven Price, Liviu Dudau, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
linux-kernel
On Mon, 2025-07-21 at 12:13 +0100, Karunika Choo wrote:
> This patch adds GPU model name and FW binary support for Mali-G710,
> Mali-G510, and Mali-G310.
>
> Signed-off-by: Karunika Choo <karunika.choo@arm.com>
> ---
> drivers/gpu/drm/panthor/panthor_fw.c | 2 ++
> drivers/gpu/drm/panthor/panthor_hw.c | 6 ++++++
> 2 files changed, 8 insertions(+)
>
> diff --git a/drivers/gpu/drm/panthor/panthor_fw.c
> b/drivers/gpu/drm/panthor/panthor_fw.c
> index 36f1034839c2..b7b454d16f12 100644
> --- a/drivers/gpu/drm/panthor/panthor_fw.c
> +++ b/drivers/gpu/drm/panthor/panthor_fw.c
> @@ -1402,3 +1402,5 @@ int panthor_fw_init(struct panthor_device
> *ptdev)
> }
>
> MODULE_FIRMWARE("arm/mali/arch10.8/mali_csffw.bin");
> +MODULE_FIRMWARE("arm/mali/arch10.10/mali_csffw.bin");
> +MODULE_FIRMWARE("arm/mali/arch10.12/mali_csffw.bin");
This isn't a problem with this series per-se, but these (as well as the
ones you're adding in later commits here) are all missing from here:
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/arm/mali
Any plans on upstreaming these so people without DDK access can
actually try these patches?
> diff --git a/drivers/gpu/drm/panthor/panthor_hw.c
> b/drivers/gpu/drm/panthor/panthor_hw.c
> index f39010c0ca86..7f138974d43b 100644
> --- a/drivers/gpu/drm/panthor/panthor_hw.c
> +++ b/drivers/gpu/drm/panthor/panthor_hw.c
> @@ -15,8 +15,14 @@ static char *get_gpu_model_name(struct
> panthor_device *ptdev)
> GPU_PROD_MAJOR(gpu_i
> d));
>
> switch (product_id) {
> + case GPU_PROD_ID_MAKE(10, 2):
> + return "Mali-G710";
> case GPU_PROD_ID_MAKE(10, 7):
> return "Mali-G610";
> + case GPU_PROD_ID_MAKE(10, 3):
> + return "Mali-G510";
> + case GPU_PROD_ID_MAKE(10, 4):
> + return "Mali-G310";
> }
>
> return "(Unknown Mali GPU)";
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v5 3/6] drm/panthor: Add support for Mali-G710, Mali-G510 and Mali-G310
2025-07-22 8:29 ` Erik Faye-Lund
@ 2025-07-22 8:55 ` Liviu Dudau
0 siblings, 0 replies; 16+ messages in thread
From: Liviu Dudau @ 2025-07-22 8:55 UTC (permalink / raw)
To: Erik Faye-Lund
Cc: Karunika Choo, dri-devel, nd, Boris Brezillon, Steven Price,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, linux-kernel
On Tue, Jul 22, 2025 at 10:29:21AM +0200, Erik Faye-Lund wrote:
> On Mon, 2025-07-21 at 12:13 +0100, Karunika Choo wrote:
> > This patch adds GPU model name and FW binary support for Mali-G710,
> > Mali-G510, and Mali-G310.
> >
> > Signed-off-by: Karunika Choo <karunika.choo@arm.com>
> > ---
> > drivers/gpu/drm/panthor/panthor_fw.c | 2 ++
> > drivers/gpu/drm/panthor/panthor_hw.c | 6 ++++++
> > 2 files changed, 8 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/panthor/panthor_fw.c
> > b/drivers/gpu/drm/panthor/panthor_fw.c
> > index 36f1034839c2..b7b454d16f12 100644
> > --- a/drivers/gpu/drm/panthor/panthor_fw.c
> > +++ b/drivers/gpu/drm/panthor/panthor_fw.c
> > @@ -1402,3 +1402,5 @@ int panthor_fw_init(struct panthor_device
> > *ptdev)
> > }
> >
> > MODULE_FIRMWARE("arm/mali/arch10.8/mali_csffw.bin");
> > +MODULE_FIRMWARE("arm/mali/arch10.10/mali_csffw.bin");
> > +MODULE_FIRMWARE("arm/mali/arch10.12/mali_csffw.bin");
>
> This isn't a problem with this series per-se, but these (as well as the
> ones you're adding in later commits here) are all missing from here:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/arm/mali
>
> Any plans on upstreaming these so people without DDK access can
> actually try these patches?
If you want to try the patches the cover letter has the link for the binaries.
Once we're happy with the patches I will send a pull request to linux-firmware for the binaries.
Best regards,
Liviu
>
> > diff --git a/drivers/gpu/drm/panthor/panthor_hw.c
> > b/drivers/gpu/drm/panthor/panthor_hw.c
> > index f39010c0ca86..7f138974d43b 100644
> > --- a/drivers/gpu/drm/panthor/panthor_hw.c
> > +++ b/drivers/gpu/drm/panthor/panthor_hw.c
> > @@ -15,8 +15,14 @@ static char *get_gpu_model_name(struct
> > panthor_device *ptdev)
> > GPU_PROD_MAJOR(gpu_i
> > d));
> >
> > switch (product_id) {
> > + case GPU_PROD_ID_MAKE(10, 2):
> > + return "Mali-G710";
> > case GPU_PROD_ID_MAKE(10, 7):
> > return "Mali-G610";
> > + case GPU_PROD_ID_MAKE(10, 3):
> > + return "Mali-G510";
> > + case GPU_PROD_ID_MAKE(10, 4):
> > + return "Mali-G310";
> > }
> >
> > return "(Unknown Mali GPU)";
--
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
¯\_(ツ)_/¯
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v5 3/6] drm/panthor: Add support for Mali-G710, Mali-G510 and Mali-G310
2025-07-21 11:13 ` [PATCH v5 3/6] drm/panthor: Add support for Mali-G710, Mali-G510 and Mali-G310 Karunika Choo
2025-07-21 14:42 ` Liviu Dudau
2025-07-22 8:29 ` Erik Faye-Lund
@ 2025-07-24 5:34 ` Chia-I Wu
2 siblings, 0 replies; 16+ messages in thread
From: Chia-I Wu @ 2025-07-24 5:34 UTC (permalink / raw)
To: Karunika Choo
Cc: dri-devel, nd, Boris Brezillon, Steven Price, Liviu Dudau,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, linux-kernel
On Mon, Jul 21, 2025 at 4:33 AM Karunika Choo <karunika.choo@arm.com> wrote:
>
> This patch adds GPU model name and FW binary support for Mali-G710,
> Mali-G510, and Mali-G310.
>
> Signed-off-by: Karunika Choo <karunika.choo@arm.com>
> ---
> drivers/gpu/drm/panthor/panthor_fw.c | 2 ++
> drivers/gpu/drm/panthor/panthor_hw.c | 6 ++++++
> 2 files changed, 8 insertions(+)
>
> diff --git a/drivers/gpu/drm/panthor/panthor_fw.c b/drivers/gpu/drm/panthor/panthor_fw.c
> index 36f1034839c2..b7b454d16f12 100644
> --- a/drivers/gpu/drm/panthor/panthor_fw.c
> +++ b/drivers/gpu/drm/panthor/panthor_fw.c
> @@ -1402,3 +1402,5 @@ int panthor_fw_init(struct panthor_device *ptdev)
> }
>
> MODULE_FIRMWARE("arm/mali/arch10.8/mali_csffw.bin");
> +MODULE_FIRMWARE("arm/mali/arch10.10/mali_csffw.bin");
> +MODULE_FIRMWARE("arm/mali/arch10.12/mali_csffw.bin");
> diff --git a/drivers/gpu/drm/panthor/panthor_hw.c b/drivers/gpu/drm/panthor/panthor_hw.c
> index f39010c0ca86..7f138974d43b 100644
> --- a/drivers/gpu/drm/panthor/panthor_hw.c
> +++ b/drivers/gpu/drm/panthor/panthor_hw.c
> @@ -15,8 +15,14 @@ static char *get_gpu_model_name(struct panthor_device *ptdev)
> GPU_PROD_MAJOR(gpu_id));
>
> switch (product_id) {
> + case GPU_PROD_ID_MAKE(10, 2):
> + return "Mali-G710";
> case GPU_PROD_ID_MAKE(10, 7):
> return "Mali-G610";
> + case GPU_PROD_ID_MAKE(10, 3):
> + return "Mali-G510";
> + case GPU_PROD_ID_MAKE(10, 4):
> + return "Mali-G310";
We should keep the switch cases numerically sorted, unless the current
ordering has any significance (which deserves a comment).
> }
>
> return "(Unknown Mali GPU)";
> --
> 2.49.0
>
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2025-07-24 5:34 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-21 11:13 [PATCH v5 0/6] Add support for new Mali GPUs Karunika Choo
2025-07-21 11:13 ` [PATCH v5 1/6] drm/panthor: Add panthor_hw and move gpu_info initialization into it Karunika Choo
2025-07-21 14:30 ` Liviu Dudau
2025-07-21 11:13 ` [PATCH v5 2/6] drm/panthor: Simplify getting the GPU model name Karunika Choo
2025-07-21 14:41 ` Liviu Dudau
2025-07-21 11:13 ` [PATCH v5 3/6] drm/panthor: Add support for Mali-G710, Mali-G510 and Mali-G310 Karunika Choo
2025-07-21 14:42 ` Liviu Dudau
2025-07-22 8:29 ` Erik Faye-Lund
2025-07-22 8:55 ` Liviu Dudau
2025-07-24 5:34 ` Chia-I Wu
2025-07-21 11:13 ` [PATCH v5 4/6] drm/panthor: Add support for Mali-Gx15 family of GPUs Karunika Choo
2025-07-21 14:46 ` Liviu Dudau
2025-07-21 11:13 ` [PATCH v5 5/6] drm/panthor: Make MMU cache maintenance use FLUSH_CACHES command Karunika Choo
2025-07-21 14:54 ` Liviu Dudau
2025-07-21 11:13 ` [PATCH v5 6/6] drm/panthor: Add support for Mali-Gx20 and Mali-Gx25 GPUs Karunika Choo
2025-07-21 14:59 ` Liviu Dudau
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).