Skip to contentSkip to conversation

Support for Adreno 612 GPU

PATCH Superseded Akhil P Oommen 4 participants 11 messages Nov 25, 2024 – Dec 5, 2024

Subsystems (4)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover Support for Adreno 612 GPU

Mesa support is already available for A612. Verified Glmark2 with weston.

Some dependencies for the devicetree change are not yet available in the mailing lists. I will send it out as a separate patch later.

In v2 of this series, there is a new patch to check the LLC support by using a new QUIRK flag. This is required now because A612 is the first gpu which has gmu_wrapper along with LLC support.

---
Changes in v2:
- Added a new quirk to check LLC support (new patch). This helps to
correct LLC handling in A612's patch.
- Rebased on msm-next tip
- Captured R-b from Konrad
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Akhil P Oommen (1):
drm/msm/adreno: Introduce ADRENO_QUIRK_NO_SYSCACHE

Jie Zhang (1):
drm/msm/a6xx: Add support for Adreno 612

 drivers/gpu/drm/msm/adreno/a6xx_catalog.c | 18 ++++++++++++-
 drivers/gpu/drm/msm/adreno/a6xx_gpu.c     | 42 ++++++++++++++++++++-----------
 drivers/gpu/drm/msm/adreno/adreno_gpu.h   | 12 ++++++---
 3 files changed, 54 insertions(+), 18 deletions(-)

---
base-commit: f4a867a46862c1743501bbe8c813238456ec8699
change-id: 20241031-a612-gpu-support-d6330f17d01f

Best regards,

Signature · 1 line
Akhil P Oommen <[email protected]>
#1 lore raw

PATCH v2 1/2 drm/msm/adreno: Introduce ADRENO_QUIRK_NO_SYSCACHE

There are a few chipsets which don't have system cache a.k.a LLC. Currently, the assumption in the driver is that the system cache availability correlates with the presence of GMU or RPMH, which is not true. For instance, Snapdragon 6 Gen 1 has RPMH and a GPU with a full blown GMU, but doesnot have a system cache. So, introduce an Adreno Quirk flag to check support for system cache instead of using gmu_wrapper flag.

---
 drivers/gpu/drm/msm/adreno/a6xx_catalog.c | 3 ++-
 drivers/gpu/drm/msm/adreno/a6xx_gpu.c     | 7 +------
 drivers/gpu/drm/msm/adreno/adreno_gpu.h   | 1 +
 3 files changed, 4 insertions(+), 7 deletions(-)
drivers/gpu/drm/msm/adreno/a6xx_catalog.c +2 -1
index 0c560e84ad5a..5e389f6b8b8a 100644
@@ -682,6 +682,7 @@ static const struct adreno_info a6xx_gpus[] = {
 		},
 		.gmem = (SZ_128K + SZ_4K),
 		.inactive_period = DRM_MSM_INACTIVE_PERIOD,
+		.quirks = ADRENO_QUIRK_NO_SYSCACHE,
 		.init = a6xx_gpu_init,
 		.zapfw = "a610_zap.mdt",
 		.a6xx = &(const struct a6xx_info) {
@@ -1331,7 +1332,7 @@ static const struct adreno_info a7xx_gpus[] = {
 		},
 		.gmem = SZ_128K,
 		.inactive_period = DRM_MSM_INACTIVE_PERIOD,
-		.quirks = ADRENO_QUIRK_HAS_HW_APRIV,
+		.quirks = ADRENO_QUIRK_HAS_HW_APRIV | ADRENO_QUIRK_NO_SYSCACHE,
 		.init = a6xx_gpu_init,
 		.zapfw = "a702_zap.mbn",
 		.a6xx = &(const struct a6xx_info) {
drivers/gpu/drm/msm/adreno/a6xx_gpu.c +1 -6
index 019610341df1..a8b928d0f320 100644
@@ -1863,10 +1863,6 @@ static void a7xx_llc_activate(struct a6xx_gpu *a6xx_gpu)
 
 static void a6xx_llc_slices_destroy(struct a6xx_gpu *a6xx_gpu)
 {
-	/* No LLCC on non-RPMh (and by extension, non-GMU) SoCs */
-	if (adreno_has_gmu_wrapper(&a6xx_gpu->base))
-		return;
-
 	llcc_slice_putd(a6xx_gpu->llc_slice);
 	llcc_slice_putd(a6xx_gpu->htw_llc_slice);
 }
@@ -1876,8 +1872,7 @@ static void a6xx_llc_slices_init(struct platform_device *pdev,
 {
 	struct device_node *phandle;
 
-	/* No LLCC on non-RPMh (and by extension, non-GMU) SoCs */
-	if (adreno_has_gmu_wrapper(&a6xx_gpu->base))
+	if (a6xx_gpu->base.info->quirks & ADRENO_QUIRK_NO_SYSCACHE)
 		return;
 
 	/*
drivers/gpu/drm/msm/adreno/adreno_gpu.h +1 -0
index e71f420f8b3a..398be2218110 100644
@@ -57,6 +57,7 @@ enum adreno_family {
 #define ADRENO_QUIRK_HAS_HW_APRIV		BIT(3)
 #define ADRENO_QUIRK_HAS_CACHED_COHERENT	BIT(4)
 #define ADRENO_QUIRK_PREEMPTION			BIT(5)
+#define ADRENO_QUIRK_NO_SYSCACHE		BIT(6)
 
 /* Helper for formating the chip_id in the way that userspace tools like
  * crashdec expect.
Signature · 1 line
2.45.2
#2 lore raw

Re: [PATCH v2 1/2] drm/msm/adreno: Introduce ADRENO_QUIRK_NO_SYSCACHE

Quoted 41 lines · Akhil P Oommen

There are a few chipsets which don't have system cache a.k.a LLC. Currently, the assumption in the driver is that the system cache availability correlates with the presence of GMU or RPMH, which is not true. For instance, Snapdragon 6 Gen 1 has RPMH and a GPU with a full blown GMU, but doesnot have a system cache. So, introduce an Adreno Quirk flag to check support for system cache instead of using gmu_wrapper flag.

---
 drivers/gpu/drm/msm/adreno/a6xx_catalog.c | 3 ++-
 drivers/gpu/drm/msm/adreno/a6xx_gpu.c     | 7 +------
 drivers/gpu/drm/msm/adreno/adreno_gpu.h   | 1 +
 3 files changed, 4 insertions(+), 7 deletions(-)
drivers/gpu/drm/msm/adreno/a6xx_catalog.c +2 -1
index 0c560e84ad5a..5e389f6b8b8a 100644
@@ -682,6 +682,7 @@ static const struct adreno_info a6xx_gpus[] = {
 		},
 		.gmem = (SZ_128K + SZ_4K),
 		.inactive_period = DRM_MSM_INACTIVE_PERIOD,
+		.quirks = ADRENO_QUIRK_NO_SYSCACHE,
 		.init = a6xx_gpu_init,
 		.zapfw = "a610_zap.mdt",
 		.a6xx = &(const struct a6xx_info) {
@@ -1331,7 +1332,7 @@ static const struct adreno_info a7xx_gpus[] = {
 		},
 		.gmem = SZ_128K,
 		.inactive_period = DRM_MSM_INACTIVE_PERIOD,
-		.quirks = ADRENO_QUIRK_HAS_HW_APRIV,
+		.quirks = ADRENO_QUIRK_HAS_HW_APRIV | ADRENO_QUIRK_NO_SYSCACHE,
 		.init = a6xx_gpu_init,
 		.zapfw = "a702_zap.mbn",
 		.a6xx = &(const struct a6xx_info) {
drivers/gpu/drm/msm/adreno/a6xx_gpu.c +0 -0
index 019610341df1..a8b928d0f320 100644

drivers/gpu/drm/msm/adreno/a6xx_gpu.c static void a7xx_llc_activate(struct a6xx_gpu *a6xx_gpu) · line 1869

Quoted 7 lines
drivers/gpu/drm/msm/adreno/a6xx_gpu.c +0 -4
@@ -1863,10 +1863,6 @@ static void a7xx_llc_activate(struct a6xx_gpu *a6xx_gpu)
 
 static void a6xx_llc_slices_destroy(struct a6xx_gpu *a6xx_gpu)
 {
-	/* No LLCC on non-RPMh (and by extension, non-GMU) SoCs */
-	if (adreno_has_gmu_wrapper(&a6xx_gpu->base))
-		return;
-

Shouldn't it also be a NO_SYSCACHE check?

Quoted 29 lines
drivers/gpu/drm/msm/adreno/a6xx_gpu.c +1 -2
 	llcc_slice_putd(a6xx_gpu->llc_slice);
 	llcc_slice_putd(a6xx_gpu->htw_llc_slice);
 }
@@ -1876,8 +1872,7 @@ static void a6xx_llc_slices_init(struct platform_device *pdev,
 {
 	struct device_node *phandle;
 
-	/* No LLCC on non-RPMh (and by extension, non-GMU) SoCs */
-	if (adreno_has_gmu_wrapper(&a6xx_gpu->base))
+	if (a6xx_gpu->base.info->quirks & ADRENO_QUIRK_NO_SYSCACHE)
 		return;
 
 	/*
drivers/gpu/drm/msm/adreno/adreno_gpu.h +1 -0
index e71f420f8b3a..398be2218110 100644
@@ -57,6 +57,7 @@ enum adreno_family {
 #define ADRENO_QUIRK_HAS_HW_APRIV		BIT(3)
 #define ADRENO_QUIRK_HAS_CACHED_COHERENT	BIT(4)
 #define ADRENO_QUIRK_PREEMPTION			BIT(5)
+#define ADRENO_QUIRK_NO_SYSCACHE		BIT(6)
 
 /* Helper for formating the chip_id in the way that userspace tools like
  * crashdec expect.
Signature · 2 lines
-- 
2.45.2
Signature · 2 lines
With best wishes
Dmitry
#3 lore raw

Re: [PATCH v2 1/2] drm/msm/adreno: Introduce ADRENO_QUIRK_NO_SYSCACHE

In reply to Akhil P Oommen
Quoted 28 lines · Akhil P Oommen

There are a few chipsets which don't have system cache a.k.a LLC. Currently, the assumption in the driver is that the system cache availability correlates with the presence of GMU or RPMH, which is not true. For instance, Snapdragon 6 Gen 1 has RPMH and a GPU with a full blown GMU, but doesnot have a system cache. So, introduce an Adreno Quirk flag to check support for system cache instead of using gmu_wrapper flag.

---
 drivers/gpu/drm/msm/adreno/a6xx_catalog.c | 3 ++-
 drivers/gpu/drm/msm/adreno/a6xx_gpu.c     | 7 +------
 drivers/gpu/drm/msm/adreno/adreno_gpu.h   | 1 +
 3 files changed, 4 insertions(+), 7 deletions(-)
drivers/gpu/drm/msm/adreno/a6xx_catalog.c +1 -0
index 0c560e84ad5a..5e389f6b8b8a 100644
@@ -682,6 +682,7 @@ static const struct adreno_info a6xx_gpus[] = {
 		},
 		.gmem = (SZ_128K + SZ_4K),
 		.inactive_period = DRM_MSM_INACTIVE_PERIOD,
+		.quirks = ADRENO_QUIRK_NO_SYSCACHE,
 		.init = a6xx_gpu_init,
 		.zapfw = "a610_zap.mdt",
 		.a6xx = &(const struct a6xx_info) {

drivers/gpu/drm/msm/adreno/a6xx_catalog.c static const struct adreno_info a7xx_gpus[] = { · line 1338

Quoted 8 lines
drivers/gpu/drm/msm/adreno/a6xx_catalog.c +1 -1
@@ -1331,7 +1332,7 @@ static const struct adreno_info a7xx_gpus[] = {
 		},
 		.gmem = SZ_128K,
 		.inactive_period = DRM_MSM_INACTIVE_PERIOD,
-		.quirks = ADRENO_QUIRK_HAS_HW_APRIV,
+		.quirks = ADRENO_QUIRK_HAS_HW_APRIV | ADRENO_QUIRK_NO_SYSCACHE,
 		.init = a6xx_gpu_init,
 		.zapfw = "a702_zap.mbn",
 		.a6xx = &(const struct a6xx_info) {

+a619_holi

Quoted 16 lines
drivers/gpu/drm/msm/adreno/a6xx_gpu.c +0 -4
index 019610341df1..a8b928d0f320 100644
@@ -1863,10 +1863,6 @@ static void a7xx_llc_activate(struct a6xx_gpu *a6xx_gpu)
 
 static void a6xx_llc_slices_destroy(struct a6xx_gpu *a6xx_gpu)
 {
-	/* No LLCC on non-RPMh (and by extension, non-GMU) SoCs */
-	if (adreno_has_gmu_wrapper(&a6xx_gpu->base))
-		return;
-
 	llcc_slice_putd(a6xx_gpu->llc_slice);
 	llcc_slice_putd(a6xx_gpu->htw_llc_slice);
 }

drivers/gpu/drm/msm/adreno/a6xx_gpu.c static void a6xx_llc_slices_init(struct platform_device *pdev, · line 1876

Quoted 7 lines
drivers/gpu/drm/msm/adreno/a6xx_gpu.c +1 -2
@@ -1876,8 +1872,7 @@ static void a6xx_llc_slices_init(struct platform_device *pdev,
 {
 	struct device_node *phandle;
 
-	/* No LLCC on non-RPMh (and by extension, non-GMU) SoCs */
-	if (adreno_has_gmu_wrapper(&a6xx_gpu->base))
+	if (a6xx_gpu->base.info->quirks & ADRENO_QUIRK_NO_SYSCACHE)
 		return;

I think A612 is the "quirky" one here.. it has some sort of a GMU, but we're choosing not to implement it. maybe a check for

if (adreno_has_gmu_wrapper && !adreno_is_a612)

would be clearer here, with a comment that RGMU support is not implemented

But going further, I'm a bit concerned about dt-bindings.. If we implement RGMU on the driver side in the future, that will require DT changes which will make the currently proposed description invalid.

I think a better angle would be to add a adreno_has_rgmu() func with a qcom,adreno-rgmu compatible and plumb it correctly from the get-go.

This way, we can avoid this syscache quirk as well.

Konrad

#4 lore raw

Re: [PATCH v2 1/2] drm/msm/adreno: Introduce ADRENO_QUIRK_NO_SYSCACHE

Quoted 74 lines · Konrad Dybcio
Quoted 28 lines · Akhil P Oommen

There are a few chipsets which don't have system cache a.k.a LLC. Currently, the assumption in the driver is that the system cache availability correlates with the presence of GMU or RPMH, which is not true. For instance, Snapdragon 6 Gen 1 has RPMH and a GPU with a full blown GMU, but doesnot have a system cache. So, introduce an Adreno Quirk flag to check support for system cache instead of using gmu_wrapper flag.

---
 drivers/gpu/drm/msm/adreno/a6xx_catalog.c | 3 ++-
 drivers/gpu/drm/msm/adreno/a6xx_gpu.c     | 7 +------
 drivers/gpu/drm/msm/adreno/adreno_gpu.h   | 1 +
 3 files changed, 4 insertions(+), 7 deletions(-)
drivers/gpu/drm/msm/adreno/a6xx_catalog.c +1 -0
index 0c560e84ad5a..5e389f6b8b8a 100644
@@ -682,6 +682,7 @@ static const struct adreno_info a6xx_gpus[] = {
 		},
 		.gmem = (SZ_128K + SZ_4K),
 		.inactive_period = DRM_MSM_INACTIVE_PERIOD,
+		.quirks = ADRENO_QUIRK_NO_SYSCACHE,
 		.init = a6xx_gpu_init,
 		.zapfw = "a610_zap.mdt",
 		.a6xx = &(const struct a6xx_info) {

drivers/gpu/drm/msm/adreno/a6xx_catalog.c static const struct adreno_info a7xx_gpus[] = { · line 1338

Quoted 8 lines
drivers/gpu/drm/msm/adreno/a6xx_catalog.c +1 -1
@@ -1331,7 +1332,7 @@ static const struct adreno_info a7xx_gpus[] = {
 		},
 		.gmem = SZ_128K,
 		.inactive_period = DRM_MSM_INACTIVE_PERIOD,
-		.quirks = ADRENO_QUIRK_HAS_HW_APRIV,
+		.quirks = ADRENO_QUIRK_HAS_HW_APRIV | ADRENO_QUIRK_NO_SYSCACHE,
 		.init = a6xx_gpu_init,
 		.zapfw = "a702_zap.mbn",
 		.a6xx = &(const struct a6xx_info) {

+a619_holi

Quoted 16 lines
drivers/gpu/drm/msm/adreno/a6xx_gpu.c +0 -4
index 019610341df1..a8b928d0f320 100644
@@ -1863,10 +1863,6 @@ static void a7xx_llc_activate(struct a6xx_gpu *a6xx_gpu)
 
 static void a6xx_llc_slices_destroy(struct a6xx_gpu *a6xx_gpu)
 {
-	/* No LLCC on non-RPMh (and by extension, non-GMU) SoCs */
-	if (adreno_has_gmu_wrapper(&a6xx_gpu->base))
-		return;
-
 	llcc_slice_putd(a6xx_gpu->llc_slice);
 	llcc_slice_putd(a6xx_gpu->htw_llc_slice);
 }

drivers/gpu/drm/msm/adreno/a6xx_gpu.c static void a6xx_llc_slices_init(struct platform_device *pdev, · line 1876

Quoted 7 lines
drivers/gpu/drm/msm/adreno/a6xx_gpu.c +1 -2
@@ -1876,8 +1872,7 @@ static void a6xx_llc_slices_init(struct platform_device *pdev,
 {
 	struct device_node *phandle;
 
-	/* No LLCC on non-RPMh (and by extension, non-GMU) SoCs */
-	if (adreno_has_gmu_wrapper(&a6xx_gpu->base))
+	if (a6xx_gpu->base.info->quirks & ADRENO_QUIRK_NO_SYSCACHE)
 		return;

I think A612 is the "quirky" one here.. it has some sort of a GMU, but we're choosing not to implement it. maybe a check for

if (adreno_has_gmu_wrapper && !adreno_is_a612)

would be clearer here, with a comment that RGMU support is not implemented

Quoted 9 lines

But going further, I'm a bit concerned about dt-bindings.. If we implement RGMU on the driver side in the future, that will require DT changes which will make the currently proposed description invalid.

I think a better angle would be to add a adreno_has_rgmu() func with a qcom,adreno-rgmu compatible and plumb it correctly from the get-go.

This way, we can avoid this syscache quirk as well.

I am aware of at least Adreno 710 which doesn't have syscache, but has proper GMU. And I don't see any reason why there couldn't be another one in future to save silicon area. So, a quirk flag doesn't seem so bad in this case.

The correct way to avoid this quirk flag is by making LLCC driver return a proper error to detect the absence of syscache. Currently, it just returns EPROBE_DEFER which put driver in an infinite probe loop.

Agree about the dt binding suggestion. I will define a new compatible string for rgmu.

-Akhil.

Quoted 1 line

Konrad

#5 lore raw

Re: [PATCH v2 1/2] drm/msm/adreno: Introduce ADRENO_QUIRK_NO_SYSCACHE

Quoted 86 lines · Akhil P Oommen
Quoted 74 lines · Konrad Dybcio
Quoted 28 lines · Akhil P Oommen

There are a few chipsets which don't have system cache a.k.a LLC. Currently, the assumption in the driver is that the system cache availability correlates with the presence of GMU or RPMH, which is not true. For instance, Snapdragon 6 Gen 1 has RPMH and a GPU with a full blown GMU, but doesnot have a system cache. So, introduce an Adreno Quirk flag to check support for system cache instead of using gmu_wrapper flag.

---
 drivers/gpu/drm/msm/adreno/a6xx_catalog.c | 3 ++-
 drivers/gpu/drm/msm/adreno/a6xx_gpu.c     | 7 +------
 drivers/gpu/drm/msm/adreno/adreno_gpu.h   | 1 +
 3 files changed, 4 insertions(+), 7 deletions(-)
drivers/gpu/drm/msm/adreno/a6xx_catalog.c +1 -0
index 0c560e84ad5a..5e389f6b8b8a 100644
@@ -682,6 +682,7 @@ static const struct adreno_info a6xx_gpus[] = {
             },
             .gmem = (SZ_128K + SZ_4K),
             .inactive_period = DRM_MSM_INACTIVE_PERIOD,
+            .quirks = ADRENO_QUIRK_NO_SYSCACHE,
             .init = a6xx_gpu_init,
             .zapfw = "a610_zap.mdt",
             .a6xx = &(const struct a6xx_info) {

drivers/gpu/drm/msm/adreno/a6xx_catalog.c static const struct adreno_info a7xx_gpus[] = { · line 1338

Quoted 8 lines
drivers/gpu/drm/msm/adreno/a6xx_catalog.c +1 -1
@@ -1331,7 +1332,7 @@ static const struct adreno_info a7xx_gpus[] = {
             },
             .gmem = SZ_128K,
             .inactive_period = DRM_MSM_INACTIVE_PERIOD,
-            .quirks = ADRENO_QUIRK_HAS_HW_APRIV,
+            .quirks = ADRENO_QUIRK_HAS_HW_APRIV | ADRENO_QUIRK_NO_SYSCACHE,
             .init = a6xx_gpu_init,
             .zapfw = "a702_zap.mbn",
             .a6xx = &(const struct a6xx_info) {

+a619_holi

Quoted 16 lines
drivers/gpu/drm/msm/adreno/a6xx_gpu.c +0 -4
index 019610341df1..a8b928d0f320 100644
@@ -1863,10 +1863,6 @@ static void a7xx_llc_activate(struct a6xx_gpu *a6xx_gpu)
 
 static void a6xx_llc_slices_destroy(struct a6xx_gpu *a6xx_gpu)
 {
-    /* No LLCC on non-RPMh (and by extension, non-GMU) SoCs */
-    if (adreno_has_gmu_wrapper(&a6xx_gpu->base))
-            return;
-
     llcc_slice_putd(a6xx_gpu->llc_slice);
     llcc_slice_putd(a6xx_gpu->htw_llc_slice);
 }

drivers/gpu/drm/msm/adreno/a6xx_gpu.c static void a6xx_llc_slices_init(struct platform_device *pdev, · line 1876

Quoted 7 lines
drivers/gpu/drm/msm/adreno/a6xx_gpu.c +1 -2
@@ -1876,8 +1872,7 @@ static void a6xx_llc_slices_init(struct platform_device *pdev,
 {
     struct device_node *phandle;
 
-    /* No LLCC on non-RPMh (and by extension, non-GMU) SoCs */
-    if (adreno_has_gmu_wrapper(&a6xx_gpu->base))
+    if (a6xx_gpu->base.info->quirks & ADRENO_QUIRK_NO_SYSCACHE)
             return;

I think A612 is the "quirky" one here.. it has some sort of a GMU, but we're choosing not to implement it. maybe a check for

if (adreno_has_gmu_wrapper && !adreno_is_a612)

would be clearer here, with a comment that RGMU support is not implemented

Quoted 9 lines

But going further, I'm a bit concerned about dt-bindings.. If we implement RGMU on the driver side in the future, that will require DT changes which will make the currently proposed description invalid.

I think a better angle would be to add a adreno_has_rgmu() func with a qcom,adreno-rgmu compatible and plumb it correctly from the get-go.

This way, we can avoid this syscache quirk as well.

Quoted 8 lines

I am aware of at least Adreno 710 which doesn't have syscache, but has proper GMU. And I don't see any reason why there couldn't be another one in future to save silicon area. So, a quirk flag doesn't seem so bad in this case.

The correct way to avoid this quirk flag is by making LLCC driver return a proper error to detect the absence of syscache. Currently, it just returns EPROBE_DEFER which put driver in an infinite probe loop.

Hmm, this seems solvable? llcc has a node in the dt, so it seems like it should be able to tell the difference between not existing and not being probed yet. Something maybe like, initialize drv_data to NULL instead of -EPROBE_DEFER, and then in the various entry points, if (!drv_data) return not_probed_helper(); which would check if a compatible node exists in dt?

BR,
-R

Quoted 7 lines

Agree about the dt binding suggestion. I will define a new compatible string for rgmu.

-Akhil.

Quoted 1 line

Konrad

#6 lore raw

Re: [PATCH v2 1/2] drm/msm/adreno: Introduce ADRENO_QUIRK_NO_SYSCACHE

Quoted 97 lines · Rob Clark
Quoted 86 lines · Akhil P Oommen
Quoted 74 lines · Konrad Dybcio
Quoted 28 lines · Akhil P Oommen

There are a few chipsets which don't have system cache a.k.a LLC. Currently, the assumption in the driver is that the system cache availability correlates with the presence of GMU or RPMH, which is not true. For instance, Snapdragon 6 Gen 1 has RPMH and a GPU with a full blown GMU, but doesnot have a system cache. So, introduce an Adreno Quirk flag to check support for system cache instead of using gmu_wrapper flag.

---
 drivers/gpu/drm/msm/adreno/a6xx_catalog.c | 3 ++-
 drivers/gpu/drm/msm/adreno/a6xx_gpu.c     | 7 +------
 drivers/gpu/drm/msm/adreno/adreno_gpu.h   | 1 +
 3 files changed, 4 insertions(+), 7 deletions(-)
drivers/gpu/drm/msm/adreno/a6xx_catalog.c +1 -0
index 0c560e84ad5a..5e389f6b8b8a 100644
@@ -682,6 +682,7 @@ static const struct adreno_info a6xx_gpus[] = {
             },
             .gmem = (SZ_128K + SZ_4K),
             .inactive_period = DRM_MSM_INACTIVE_PERIOD,
+            .quirks = ADRENO_QUIRK_NO_SYSCACHE,
             .init = a6xx_gpu_init,
             .zapfw = "a610_zap.mdt",
             .a6xx = &(const struct a6xx_info) {

drivers/gpu/drm/msm/adreno/a6xx_catalog.c static const struct adreno_info a7xx_gpus[] = { · line 1338

Quoted 8 lines
drivers/gpu/drm/msm/adreno/a6xx_catalog.c +1 -1
@@ -1331,7 +1332,7 @@ static const struct adreno_info a7xx_gpus[] = {
             },
             .gmem = SZ_128K,
             .inactive_period = DRM_MSM_INACTIVE_PERIOD,
-            .quirks = ADRENO_QUIRK_HAS_HW_APRIV,
+            .quirks = ADRENO_QUIRK_HAS_HW_APRIV | ADRENO_QUIRK_NO_SYSCACHE,
             .init = a6xx_gpu_init,
             .zapfw = "a702_zap.mbn",
             .a6xx = &(const struct a6xx_info) {

+a619_holi

Quoted 16 lines
drivers/gpu/drm/msm/adreno/a6xx_gpu.c +0 -4
index 019610341df1..a8b928d0f320 100644
@@ -1863,10 +1863,6 @@ static void a7xx_llc_activate(struct a6xx_gpu *a6xx_gpu)
 
 static void a6xx_llc_slices_destroy(struct a6xx_gpu *a6xx_gpu)
 {
-    /* No LLCC on non-RPMh (and by extension, non-GMU) SoCs */
-    if (adreno_has_gmu_wrapper(&a6xx_gpu->base))
-            return;
-
     llcc_slice_putd(a6xx_gpu->llc_slice);
     llcc_slice_putd(a6xx_gpu->htw_llc_slice);
 }

drivers/gpu/drm/msm/adreno/a6xx_gpu.c static void a6xx_llc_slices_init(struct platform_device *pdev, · line 1876

Quoted 7 lines
drivers/gpu/drm/msm/adreno/a6xx_gpu.c +1 -2
@@ -1876,8 +1872,7 @@ static void a6xx_llc_slices_init(struct platform_device *pdev,
 {
     struct device_node *phandle;
 
-    /* No LLCC on non-RPMh (and by extension, non-GMU) SoCs */
-    if (adreno_has_gmu_wrapper(&a6xx_gpu->base))
+    if (a6xx_gpu->base.info->quirks & ADRENO_QUIRK_NO_SYSCACHE)
             return;

I think A612 is the "quirky" one here.. it has some sort of a GMU, but we're choosing not to implement it. maybe a check for

if (adreno_has_gmu_wrapper && !adreno_is_a612)

would be clearer here, with a comment that RGMU support is not implemented

Quoted 9 lines

But going further, I'm a bit concerned about dt-bindings.. If we implement RGMU on the driver side in the future, that will require DT changes which will make the currently proposed description invalid.

I think a better angle would be to add a adreno_has_rgmu() func with a qcom,adreno-rgmu compatible and plumb it correctly from the get-go.

This way, we can avoid this syscache quirk as well.

Quoted 8 lines

I am aware of at least Adreno 710 which doesn't have syscache, but has proper GMU. And I don't see any reason why there couldn't be another one in future to save silicon area. So, a quirk flag doesn't seem so bad in this case.

The correct way to avoid this quirk flag is by making LLCC driver return a proper error to detect the absence of syscache. Currently, it just returns EPROBE_DEFER which put driver in an infinite probe loop.

Quoted 6 lines

Hmm, this seems solvable? llcc has a node in the dt, so it seems like it should be able to tell the difference between not existing and not being probed yet. Something maybe like, initialize drv_data to NULL instead of -EPROBE_DEFER, and then in the various entry points, if (!drv_data) return not_probed_helper(); which would check if a compatible node exists in dt?

Sounds like that would work. Can we explore that separately?

I am a bit worried about adding another subsystem's patch to this series. That might delay this series by weeks.

-Akhil

Quoted 11 lines

BR,
-R

Quoted 7 lines

Agree about the dt binding suggestion. I will define a new compatible string for rgmu.

-Akhil.

Quoted 1 line

Konrad

#7 lore raw

Re: [PATCH v2 1/2] drm/msm/adreno: Introduce ADRENO_QUIRK_NO_SYSCACHE

Quoted 106 lines · Akhil P Oommen
Quoted 97 lines · Rob Clark
Quoted 86 lines · Akhil P Oommen
Quoted 74 lines · Konrad Dybcio
Quoted 28 lines · Akhil P Oommen

There are a few chipsets which don't have system cache a.k.a LLC. Currently, the assumption in the driver is that the system cache availability correlates with the presence of GMU or RPMH, which is not true. For instance, Snapdragon 6 Gen 1 has RPMH and a GPU with a full blown GMU, but doesnot have a system cache. So, introduce an Adreno Quirk flag to check support for system cache instead of using gmu_wrapper flag.

---
 drivers/gpu/drm/msm/adreno/a6xx_catalog.c | 3 ++-
 drivers/gpu/drm/msm/adreno/a6xx_gpu.c     | 7 +------
 drivers/gpu/drm/msm/adreno/adreno_gpu.h   | 1 +
 3 files changed, 4 insertions(+), 7 deletions(-)
drivers/gpu/drm/msm/adreno/a6xx_catalog.c +1 -0
index 0c560e84ad5a..5e389f6b8b8a 100644
@@ -682,6 +682,7 @@ static const struct adreno_info a6xx_gpus[] = {
             },
             .gmem = (SZ_128K + SZ_4K),
             .inactive_period = DRM_MSM_INACTIVE_PERIOD,
+            .quirks = ADRENO_QUIRK_NO_SYSCACHE,
             .init = a6xx_gpu_init,
             .zapfw = "a610_zap.mdt",
             .a6xx = &(const struct a6xx_info) {

drivers/gpu/drm/msm/adreno/a6xx_catalog.c static const struct adreno_info a7xx_gpus[] = { · line 1338

Quoted 8 lines
drivers/gpu/drm/msm/adreno/a6xx_catalog.c +1 -1
@@ -1331,7 +1332,7 @@ static const struct adreno_info a7xx_gpus[] = {
             },
             .gmem = SZ_128K,
             .inactive_period = DRM_MSM_INACTIVE_PERIOD,
-            .quirks = ADRENO_QUIRK_HAS_HW_APRIV,
+            .quirks = ADRENO_QUIRK_HAS_HW_APRIV | ADRENO_QUIRK_NO_SYSCACHE,
             .init = a6xx_gpu_init,
             .zapfw = "a702_zap.mbn",
             .a6xx = &(const struct a6xx_info) {

+a619_holi

Quoted 16 lines
drivers/gpu/drm/msm/adreno/a6xx_gpu.c +0 -4
index 019610341df1..a8b928d0f320 100644
@@ -1863,10 +1863,6 @@ static void a7xx_llc_activate(struct a6xx_gpu *a6xx_gpu)
 
 static void a6xx_llc_slices_destroy(struct a6xx_gpu *a6xx_gpu)
 {
-    /* No LLCC on non-RPMh (and by extension, non-GMU) SoCs */
-    if (adreno_has_gmu_wrapper(&a6xx_gpu->base))
-            return;
-
     llcc_slice_putd(a6xx_gpu->llc_slice);
     llcc_slice_putd(a6xx_gpu->htw_llc_slice);
 }

drivers/gpu/drm/msm/adreno/a6xx_gpu.c static void a6xx_llc_slices_init(struct platform_device *pdev, · line 1876

Quoted 7 lines
drivers/gpu/drm/msm/adreno/a6xx_gpu.c +1 -2
@@ -1876,8 +1872,7 @@ static void a6xx_llc_slices_init(struct platform_device *pdev,
 {
     struct device_node *phandle;
 
-    /* No LLCC on non-RPMh (and by extension, non-GMU) SoCs */
-    if (adreno_has_gmu_wrapper(&a6xx_gpu->base))
+    if (a6xx_gpu->base.info->quirks & ADRENO_QUIRK_NO_SYSCACHE)
             return;

I think A612 is the "quirky" one here.. it has some sort of a GMU, but we're choosing not to implement it. maybe a check for

if (adreno_has_gmu_wrapper && !adreno_is_a612)

would be clearer here, with a comment that RGMU support is not implemented

Quoted 9 lines

But going further, I'm a bit concerned about dt-bindings.. If we implement RGMU on the driver side in the future, that will require DT changes which will make the currently proposed description invalid.

I think a better angle would be to add a adreno_has_rgmu() func with a qcom,adreno-rgmu compatible and plumb it correctly from the get-go.

This way, we can avoid this syscache quirk as well.

Quoted 8 lines

I am aware of at least Adreno 710 which doesn't have syscache, but has proper GMU. And I don't see any reason why there couldn't be another one in future to save silicon area. So, a quirk flag doesn't seem so bad in this case.

The correct way to avoid this quirk flag is by making LLCC driver return a proper error to detect the absence of syscache. Currently, it just returns EPROBE_DEFER which put driver in an infinite probe loop.

Quoted 6 lines

Hmm, this seems solvable? llcc has a node in the dt, so it seems like it should be able to tell the difference between not existing and not being probed yet. Something maybe like, initialize drv_data to NULL instead of -EPROBE_DEFER, and then in the various entry points, if (!drv_data) return not_probed_helper(); which would check if a compatible node exists in dt?

Quoted 4 lines

Sounds like that would work. Can we explore that separately?

I am a bit worried about adding another subsystem's patch to this series. That might delay this series by weeks.

I don't think there is a dependency between the two, so it shouldn't delay anything. We can just merge the first patch in this series as it is and drop the second. And the llcc change is a legit bug fix, IMO, -EPROBE_DEFER is the incorrect return value when the device is not present.

BR,
-R

Quoted 14 lines

-Akhil

Quoted 11 lines

BR,
-R

Quoted 7 lines

Agree about the dt binding suggestion. I will define a new compatible string for rgmu.

-Akhil.

Quoted 1 line

Konrad

#8 lore raw

Re: [PATCH v2 1/2] drm/msm/adreno: Introduce ADRENO_QUIRK_NO_SYSCACHE

Quoted 110 lines · Rob Clark
Quoted 108 lines · Akhil P Oommen
Quoted 97 lines · Rob Clark
Quoted 86 lines · Akhil P Oommen
Quoted 74 lines · Konrad Dybcio
Quoted 28 lines · Akhil P Oommen

There are a few chipsets which don't have system cache a.k.a LLC. Currently, the assumption in the driver is that the system cache availability correlates with the presence of GMU or RPMH, which is not true. For instance, Snapdragon 6 Gen 1 has RPMH and a GPU with a full blown GMU, but doesnot have a system cache. So, introduce an Adreno Quirk flag to check support for system cache instead of using gmu_wrapper flag.

---
 drivers/gpu/drm/msm/adreno/a6xx_catalog.c | 3 ++-
 drivers/gpu/drm/msm/adreno/a6xx_gpu.c     | 7 +------
 drivers/gpu/drm/msm/adreno/adreno_gpu.h   | 1 +
 3 files changed, 4 insertions(+), 7 deletions(-)
drivers/gpu/drm/msm/adreno/a6xx_catalog.c +1 -0
index 0c560e84ad5a..5e389f6b8b8a 100644
@@ -682,6 +682,7 @@ static const struct adreno_info a6xx_gpus[] = {
             },
             .gmem = (SZ_128K + SZ_4K),
             .inactive_period = DRM_MSM_INACTIVE_PERIOD,
+            .quirks = ADRENO_QUIRK_NO_SYSCACHE,
             .init = a6xx_gpu_init,
             .zapfw = "a610_zap.mdt",
             .a6xx = &(const struct a6xx_info) {

drivers/gpu/drm/msm/adreno/a6xx_catalog.c static const struct adreno_info a7xx_gpus[] = { · line 1338

Quoted 8 lines
drivers/gpu/drm/msm/adreno/a6xx_catalog.c +1 -1
@@ -1331,7 +1332,7 @@ static const struct adreno_info a7xx_gpus[] = {
             },
             .gmem = SZ_128K,
             .inactive_period = DRM_MSM_INACTIVE_PERIOD,
-            .quirks = ADRENO_QUIRK_HAS_HW_APRIV,
+            .quirks = ADRENO_QUIRK_HAS_HW_APRIV | ADRENO_QUIRK_NO_SYSCACHE,
             .init = a6xx_gpu_init,
             .zapfw = "a702_zap.mbn",
             .a6xx = &(const struct a6xx_info) {

+a619_holi

Quoted 16 lines
drivers/gpu/drm/msm/adreno/a6xx_gpu.c +0 -4
index 019610341df1..a8b928d0f320 100644
@@ -1863,10 +1863,6 @@ static void a7xx_llc_activate(struct a6xx_gpu *a6xx_gpu)
 
 static void a6xx_llc_slices_destroy(struct a6xx_gpu *a6xx_gpu)
 {
-    /* No LLCC on non-RPMh (and by extension, non-GMU) SoCs */
-    if (adreno_has_gmu_wrapper(&a6xx_gpu->base))
-            return;
-
     llcc_slice_putd(a6xx_gpu->llc_slice);
     llcc_slice_putd(a6xx_gpu->htw_llc_slice);
 }

drivers/gpu/drm/msm/adreno/a6xx_gpu.c static void a6xx_llc_slices_init(struct platform_device *pdev, · line 1876

Quoted 7 lines
drivers/gpu/drm/msm/adreno/a6xx_gpu.c +1 -2
@@ -1876,8 +1872,7 @@ static void a6xx_llc_slices_init(struct platform_device *pdev,
 {
     struct device_node *phandle;
 
-    /* No LLCC on non-RPMh (and by extension, non-GMU) SoCs */
-    if (adreno_has_gmu_wrapper(&a6xx_gpu->base))
+    if (a6xx_gpu->base.info->quirks & ADRENO_QUIRK_NO_SYSCACHE)
             return;

I think A612 is the "quirky" one here.. it has some sort of a GMU, but we're choosing not to implement it. maybe a check for

if (adreno_has_gmu_wrapper && !adreno_is_a612)

would be clearer here, with a comment that RGMU support is not implemented

Quoted 9 lines

But going further, I'm a bit concerned about dt-bindings.. If we implement RGMU on the driver side in the future, that will require DT changes which will make the currently proposed description invalid.

I think a better angle would be to add a adreno_has_rgmu() func with a qcom,adreno-rgmu compatible and plumb it correctly from the get-go.

This way, we can avoid this syscache quirk as well.

Quoted 8 lines

I am aware of at least Adreno 710 which doesn't have syscache, but has proper GMU. And I don't see any reason why there couldn't be another one in future to save silicon area. So, a quirk flag doesn't seem so bad in this case.

The correct way to avoid this quirk flag is by making LLCC driver return a proper error to detect the absence of syscache. Currently, it just returns EPROBE_DEFER which put driver in an infinite probe loop.

Quoted 6 lines

Hmm, this seems solvable? llcc has a node in the dt, so it seems like it should be able to tell the difference between not existing and not being probed yet. Something maybe like, initialize drv_data to NULL instead of -EPROBE_DEFER, and then in the various entry points, if (!drv_data) return not_probed_helper(); which would check if a compatible node exists in dt?

Sounds like that would work. Can we explore that separately?

Quoted 8 lines
Quoted 2 lines

I am a bit worried about adding another subsystem's patch to this series. That might delay this series by weeks.

I don't think there is a dependency between the two, so it shouldn't delay anything. We can just merge the first patch in this series as it is and drop the second. And the llcc change is a legit bug fix, IMO, -EPROBE_DEFER is the incorrect return value when the device is not present.

Actually, that wasn't _quite_ correct, but the idea still stands. Re-send second patch, but without the ADRENO_QUIRK_NO_SYSCACHE parts, and drop the first.

In parallel send the llcc fix. There is no compile time dependency, so they can go thru different trees.

BR,
-R

Quoted 18 lines

BR,
-R

Quoted 14 lines

-Akhil

Quoted 11 lines

BR,
-R

Quoted 7 lines

Agree about the dt binding suggestion. I will define a new compatible string for rgmu.

-Akhil.

Quoted 1 line

Konrad

#9 lore raw

Re: [PATCH v2 1/2] drm/msm/adreno: Introduce ADRENO_QUIRK_NO_SYSCACHE

Quoted 120 lines · Rob Clark
Quoted 110 lines · Rob Clark
Quoted 108 lines · Akhil P Oommen
Quoted 97 lines · Rob Clark
Quoted 86 lines · Akhil P Oommen
Quoted 74 lines · Konrad Dybcio
Quoted 28 lines · Akhil P Oommen

There are a few chipsets which don't have system cache a.k.a LLC. Currently, the assumption in the driver is that the system cache availability correlates with the presence of GMU or RPMH, which is not true. For instance, Snapdragon 6 Gen 1 has RPMH and a GPU with a full blown GMU, but doesnot have a system cache. So, introduce an Adreno Quirk flag to check support for system cache instead of using gmu_wrapper flag.

---
 drivers/gpu/drm/msm/adreno/a6xx_catalog.c | 3 ++-
 drivers/gpu/drm/msm/adreno/a6xx_gpu.c     | 7 +------
 drivers/gpu/drm/msm/adreno/adreno_gpu.h   | 1 +
 3 files changed, 4 insertions(+), 7 deletions(-)
drivers/gpu/drm/msm/adreno/a6xx_catalog.c +1 -0
index 0c560e84ad5a..5e389f6b8b8a 100644
@@ -682,6 +682,7 @@ static const struct adreno_info a6xx_gpus[] = {
             },
             .gmem = (SZ_128K + SZ_4K),
             .inactive_period = DRM_MSM_INACTIVE_PERIOD,
+            .quirks = ADRENO_QUIRK_NO_SYSCACHE,
             .init = a6xx_gpu_init,
             .zapfw = "a610_zap.mdt",
             .a6xx = &(const struct a6xx_info) {

drivers/gpu/drm/msm/adreno/a6xx_catalog.c static const struct adreno_info a7xx_gpus[] = { · line 1338

Quoted 8 lines
drivers/gpu/drm/msm/adreno/a6xx_catalog.c +1 -1
@@ -1331,7 +1332,7 @@ static const struct adreno_info a7xx_gpus[] = {
             },
             .gmem = SZ_128K,
             .inactive_period = DRM_MSM_INACTIVE_PERIOD,
-            .quirks = ADRENO_QUIRK_HAS_HW_APRIV,
+            .quirks = ADRENO_QUIRK_HAS_HW_APRIV | ADRENO_QUIRK_NO_SYSCACHE,
             .init = a6xx_gpu_init,
             .zapfw = "a702_zap.mbn",
             .a6xx = &(const struct a6xx_info) {

+a619_holi

Quoted 16 lines
drivers/gpu/drm/msm/adreno/a6xx_gpu.c +0 -4
index 019610341df1..a8b928d0f320 100644
@@ -1863,10 +1863,6 @@ static void a7xx_llc_activate(struct a6xx_gpu *a6xx_gpu)
 
 static void a6xx_llc_slices_destroy(struct a6xx_gpu *a6xx_gpu)
 {
-    /* No LLCC on non-RPMh (and by extension, non-GMU) SoCs */
-    if (adreno_has_gmu_wrapper(&a6xx_gpu->base))
-            return;
-
     llcc_slice_putd(a6xx_gpu->llc_slice);
     llcc_slice_putd(a6xx_gpu->htw_llc_slice);
 }

drivers/gpu/drm/msm/adreno/a6xx_gpu.c static void a6xx_llc_slices_init(struct platform_device *pdev, · line 1876

Quoted 7 lines
drivers/gpu/drm/msm/adreno/a6xx_gpu.c +1 -2
@@ -1876,8 +1872,7 @@ static void a6xx_llc_slices_init(struct platform_device *pdev,
 {
     struct device_node *phandle;
 
-    /* No LLCC on non-RPMh (and by extension, non-GMU) SoCs */
-    if (adreno_has_gmu_wrapper(&a6xx_gpu->base))
+    if (a6xx_gpu->base.info->quirks & ADRENO_QUIRK_NO_SYSCACHE)
             return;

I think A612 is the "quirky" one here.. it has some sort of a GMU, but we're choosing not to implement it. maybe a check for

if (adreno_has_gmu_wrapper && !adreno_is_a612)

would be clearer here, with a comment that RGMU support is not implemented

Quoted 9 lines

But going further, I'm a bit concerned about dt-bindings.. If we implement RGMU on the driver side in the future, that will require DT changes which will make the currently proposed description invalid.

I think a better angle would be to add a adreno_has_rgmu() func with a qcom,adreno-rgmu compatible and plumb it correctly from the get-go.

This way, we can avoid this syscache quirk as well.

Quoted 8 lines

I am aware of at least Adreno 710 which doesn't have syscache, but has proper GMU. And I don't see any reason why there couldn't be another one in future to save silicon area. So, a quirk flag doesn't seem so bad in this case.

The correct way to avoid this quirk flag is by making LLCC driver return a proper error to detect the absence of syscache. Currently, it just returns EPROBE_DEFER which put driver in an infinite probe loop.

Quoted 6 lines

Hmm, this seems solvable? llcc has a node in the dt, so it seems like it should be able to tell the difference between not existing and not being probed yet. Something maybe like, initialize drv_data to NULL instead of -EPROBE_DEFER, and then in the various entry points, if (!drv_data) return not_probed_helper(); which would check if a compatible node exists in dt?

Sounds like that would work. Can we explore that separately?

Quoted 8 lines
Quoted 2 lines

I am a bit worried about adding another subsystem's patch to this series. That might delay this series by weeks.

I don't think there is a dependency between the two, so it shouldn't delay anything. We can just merge the first patch in this series as it is and drop the second. And the llcc change is a legit bug fix, IMO, -EPROBE_DEFER is the incorrect return value when the device is not present.

Quoted 7 lines

Actually, that wasn't _quite_ correct, but the idea still stands. Re-send second patch, but without the ADRENO_QUIRK_NO_SYSCACHE parts, and drop the first.

In parallel send the llcc fix. There is no compile time dependency, so they can go thru different trees.

Ack, will send separate patches.

-Akhil.

Quoted 21 lines

BR,
-R

Quoted 18 lines

BR,
-R

Quoted 14 lines

-Akhil

Quoted 11 lines

BR,
-R

Quoted 7 lines

Agree about the dt binding suggestion. I will define a new compatible string for rgmu.

-Akhil.

Quoted 1 line

Konrad

#10 lore raw

PATCH v2 2/2 drm/msm/a6xx: Add support for Adreno 612

In reply to Akhil P Oommen

From: Jie Zhang <[email protected]>

Add support for Adreno 612 GPU found in SM6150/QCS615 chipsets. A612 falls under ADRENO_6XX_GEN1 family and is a cut down version of A615 GPU.

A612 has a new IP called Reduced Graphics Management Unit or RGMU which is a small state machine which helps to toggle GX GDSC (connected to CX rail) to implement IFPC feature. It doesn't support any other features of a full fledged GMU like clock control, resource voting to rpmh etc. So we need linux clock driver support like other gmu-wrapper implementations to control gpu core clock and gpu GX gdsc. Since there is no benefit with enabling RGMU at the moment, RGMU is entirely skipped in this patch.

---
 drivers/gpu/drm/msm/adreno/a6xx_catalog.c | 15 +++++++++++++
 drivers/gpu/drm/msm/adreno/a6xx_gpu.c     | 35 ++++++++++++++++++++++++-------
 drivers/gpu/drm/msm/adreno/adreno_gpu.h   | 11 +++++++---
 3 files changed, 50 insertions(+), 11 deletions(-)
drivers/gpu/drm/msm/adreno/a6xx_catalog.c +15 -0
index 5e389f6b8b8a..633a966a0c39 100644
@@ -705,6 +705,21 @@ static const struct adreno_info a6xx_gpus[] = {
 			{ 157, 3 },
 			{ 127, 4 },
 		),
+	}, {
+		.chip_ids = ADRENO_CHIP_IDS(0x06010200),
+		.family = ADRENO_6XX_GEN1,
+		.fw = {
+			[ADRENO_FW_SQE] = "a630_sqe.fw",
+		},
+		.gmem = (SZ_128K + SZ_4K),
+		.inactive_period = DRM_MSM_INACTIVE_PERIOD,
+		.init = a6xx_gpu_init,
+		.a6xx = &(const struct a6xx_info) {
+			.hwcg = a612_hwcg,
+			.protect = &a630_protect,
+			.gmu_cgc_mode = 0x00000022,
+			.prim_fifo_threshold = 0x00080000,
+		},
 	}, {
 		.chip_ids = ADRENO_CHIP_IDS(0x06010500),
 		.family = ADRENO_6XX_GEN1,
drivers/gpu/drm/msm/adreno/a6xx_gpu.c +27 -8
index a8b928d0f320..1af7bbed457a 100644
@@ -504,15 +504,26 @@ static void a6xx_set_hwcg(struct msm_gpu *gpu, bool state)
 
 	if (adreno_is_a630(adreno_gpu))
 		clock_cntl_on = 0x8aa8aa02;
-	else if (adreno_is_a610(adreno_gpu))
+	else if (adreno_is_a610(adreno_gpu) || adreno_is_a612(adreno_gpu))
 		clock_cntl_on = 0xaaa8aa82;
 	else if (adreno_is_a702(adreno_gpu))
 		clock_cntl_on = 0xaaaaaa82;
 	else
 		clock_cntl_on = 0x8aa8aa82;
 
-	cgc_delay = adreno_is_a615_family(adreno_gpu) ? 0x111 : 0x10111;
-	cgc_hyst = adreno_is_a615_family(adreno_gpu) ? 0x555 : 0x5555;
+	if (adreno_is_a612(adreno_gpu))
+		cgc_delay = 0x11;
+	else if (adreno_is_a615_family(adreno_gpu))
+		cgc_delay = 0x111;
+	else
+		cgc_delay = 0x10111;
+
+	if (adreno_is_a612(adreno_gpu))
+		cgc_hyst = 0x55;
+	else if (adreno_is_a615_family(adreno_gpu))
+		cgc_delay = 0x555;
+	else
+		cgc_delay = 0x5555;
 
 	gmu_write(&a6xx_gpu->gmu, REG_A6XX_GPU_GMU_AO_GMU_CGC_MODE_CNTL,
 			state ? adreno_gpu->info->a6xx->gmu_cgc_mode : 0);
@@ -600,6 +611,9 @@ static void a6xx_calc_ubwc_config(struct adreno_gpu *gpu)
 		gpu->ubwc_config.ubwc_swizzle = 0x7;
 	}
 
+	if (adreno_is_a612(gpu))
+		gpu->ubwc_config.highest_bank_bit = 13;
+
 	if (adreno_is_a618(gpu))
 		gpu->ubwc_config.highest_bank_bit = 14;
 
@@ -1165,7 +1179,7 @@ static int hw_init(struct msm_gpu *gpu)
 		gpu_write(gpu, REG_A6XX_CP_LPAC_PROG_FIFO_SIZE, 0x00000020);
 
 	/* Setting the mem pool size */
-	if (adreno_is_a610(adreno_gpu)) {
+	if (adreno_is_a610(adreno_gpu) || adreno_is_a612(adreno_gpu)) {
 		gpu_write(gpu, REG_A6XX_CP_MEM_POOL_SIZE, 48);
 		gpu_write(gpu, REG_A6XX_CP_MEM_POOL_DBG_ADDR, 47);
 	} else if (adreno_is_a702(adreno_gpu)) {
@@ -1199,7 +1213,7 @@ static int hw_init(struct msm_gpu *gpu)
 
 	/* Enable fault detection */
 	if (adreno_is_a730(adreno_gpu) ||
-	    adreno_is_a740_family(adreno_gpu))
+	    adreno_is_a740_family(adreno_gpu) || adreno_is_a612(adreno_gpu))
 		gpu_write(gpu, REG_A6XX_RBBM_INTERFACE_HANG_INT_CNTL, (1 << 30) | 0xcfffff);
 	else if (adreno_is_a690(adreno_gpu))
 		gpu_write(gpu, REG_A6XX_RBBM_INTERFACE_HANG_INT_CNTL, (1 << 30) | 0x4fffff);
@@ -2076,6 +2090,9 @@ static int a6xx_pm_resume(struct msm_gpu *gpu)
 	if (!ret)
 		msm_devfreq_resume(gpu);
 
+	if (!(a6xx_gpu->base.info->quirks & ADRENO_QUIRK_NO_SYSCACHE))
+		a6xx_llc_activate(a6xx_gpu);
+
 	return ret;
 }
 
@@ -2115,6 +2132,9 @@ static int a6xx_pm_suspend(struct msm_gpu *gpu)
 
 	trace_msm_gpu_suspend(0);
 
+	if (!(a6xx_gpu->base.info->quirks & ADRENO_QUIRK_NO_SYSCACHE))
+		a6xx_llc_deactivate(a6xx_gpu);
+
 	msm_devfreq_suspend(gpu);
 
 	mutex_lock(&a6xx_gpu->gmu.lock);
@@ -2480,11 +2500,8 @@ struct msm_gpu *a6xx_gpu_init(struct drm_device *dev)
 		  config->info->family == ADRENO_7XX_GEN2 ||
 		  config->info->family == ADRENO_7XX_GEN3;
 
-	a6xx_llc_slices_init(pdev, a6xx_gpu, is_a7xx);
-
 	ret = a6xx_set_supported_hw(&pdev->dev, config->info);
 	if (ret) {
-		a6xx_llc_slices_destroy(a6xx_gpu);
 		kfree(a6xx_gpu);
 		return ERR_PTR(ret);
 	}
@@ -2503,6 +2520,8 @@ struct msm_gpu *a6xx_gpu_init(struct drm_device *dev)
 		return ERR_PTR(ret);
 	}
 
+	a6xx_llc_slices_init(pdev, a6xx_gpu, is_a7xx);
+
 	/*
 	 * For now only clamp to idle freq for devices where this is known not
 	 * to cause power supply issues:
drivers/gpu/drm/msm/adreno/adreno_gpu.h +8 -3
index 398be2218110..a6462a255611 100644
@@ -421,6 +421,11 @@ static inline int adreno_is_a610(const struct adreno_gpu *gpu)
 	return adreno_is_revn(gpu, 610);
 }
 
+static inline int adreno_is_a612(const struct adreno_gpu *gpu)
+{
+	return gpu->info->chip_ids[0] == 0x06010200;
+}
+
 static inline int adreno_is_a618(const struct adreno_gpu *gpu)
 {
 	return adreno_is_revn(gpu, 618);
@@ -490,9 +495,9 @@ static inline int adreno_is_a610_family(const struct adreno_gpu *gpu)
 {
 	if (WARN_ON_ONCE(!gpu->info))
 		return false;
-
-	/* TODO: A612 */
-	return adreno_is_a610(gpu) || adreno_is_a702(gpu);
+	return adreno_is_a610(gpu) ||
+	       adreno_is_a612(gpu) ||
+	       adreno_is_a702(gpu);
 }
 
 /* TODO: 615/616 */
Signature · 1 line
2.45.2