Skip to content

Commit aa6256e

Browse files
committed
msm8909gfx
1 parent 7b5aa98 commit aa6256e

File tree

5 files changed

+113
-2
lines changed

5 files changed

+113
-2
lines changed

arch/arm/boot/dts/qcom/qcom-msm8909.dtsi

Lines changed: 68 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,6 @@
195195
compatible = "arm,cortex-a7-pmu";
196196
interrupts = <GIC_PPI 7 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
197197
};
198-
199198
reserved-memory {
200199
#address-cells = <1>;
201200
#size-cells = <1>;
@@ -382,7 +381,74 @@
382381
#size-cells = <1>;
383382
ranges;
384383

385-
rng@22000 {
384+
385+
gpu_iommu: iommu@1f08000 {
386+
#address-cells = <1>;
387+
#size-cells = <1>;
388+
#iommu-cells = <1>;
389+
compatible = "qcom,msm8916-iommu", "qcom,msm-iommu-v1";
390+
ranges = <0 0x01f08000 0x10000>;
391+
clocks = <&gcc GCC_SMMU_CFG_CLK>,
392+
<&gcc GCC_GFX_TCU_CLK>;
393+
clock-names = "iface", "bus";
394+
qcom,iommu-secure-id = <18>;
395+
396+
/* GFX3D_USER */
397+
iommu-ctx@1000 {
398+
compatible = "qcom,msm-iommu-v1-ns";
399+
reg = <0x1000 0x1000>;
400+
interrupts = <GIC_SPI 241 IRQ_TYPE_LEVEL_HIGH>;
401+
};
402+
403+
/* GFX3D_PRIV */
404+
iommu-ctx@2000 {
405+
compatible = "qcom,msm-iommu-v1-ns";
406+
reg = <0x2000 0x1000>;
407+
interrupts = <GIC_SPI 242 IRQ_TYPE_LEVEL_HIGH>;
408+
};
409+
};
410+
411+
gpu: gpu@1c00000 {
412+
compatible = "amd,imageon-304.0", "amd,imageon";
413+
reg = <0x01c00000 0x10000
414+
0x01c10000 0x10000
415+
0x0005c00c 0x8>;
416+
reg-names = "kgsl_3d0_reg_memory";
417+
interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>;
418+
interrupt-names = "kgsl_3d0_irq";
419+
clock-names =
420+
"core",
421+
"iface",
422+
"mem_iface",
423+
"alt_mem_iface",
424+
"gfx3d";
425+
clocks =
426+
<&gcc GCC_OXILI_GFX3D_CLK>,
427+
<&gcc GCC_OXILI_AHB_CLK>,
428+
<&gcc GCC_BIMC_GFX_CLK>,
429+
<&gcc GCC_BIMC_GPU_CLK>,
430+
<&gcc GFX3D_CLK_SRC>;
431+
power-domains = <&gcc OXILI_GDSC>;
432+
operating-points-v2 = <&gpu_opp_table>;
433+
iommus = <&gpu_iommu 1>, <&gpu_iommu 2>;
434+
#cooling-cells = <2>;
435+
qcom,force-iommu;
436+
437+
status = "okay";
438+
439+
gpu_opp_table: opp-table {
440+
compatible = "operating-points-v2";
441+
442+
opp-456000000 {
443+
opp-hz = /bits/ 64 <456000000>;
444+
};
445+
opp-19200000 {
446+
opp-hz = /bits/ 64 <19200000>;
447+
};
448+
};
449+
};
450+
451+
rng@22000 {
386452
compatible = "qcom,prng";
387453
reg = <0x00022000 0x200>;
388454
clocks = <&gcc GCC_PRNG_AHB_CLK>;

drivers/gpu/drm/msm/adreno/a3xx_catalog.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,17 @@ static const struct adreno_info a3xx_gpus[] = {
1919
.gmem = SZ_128K,
2020
.inactive_period = DRM_MSM_INACTIVE_PERIOD,
2121
.init = a3xx_gpu_init,
22+
}, {
23+
.chip_ids = ADRENO_CHIP_IDS(0x03000400),
24+
.family = ADRENO_3XX,
25+
.revn = 304,
26+
.fw = {
27+
[ADRENO_FW_PM4] = "a300_pm4.fw",
28+
[ADRENO_FW_PFP] = "a300_pfp.fw",
29+
},
30+
.gmem = (SZ_64K + SZ_32K),
31+
.inactive_period = DRM_MSM_INACTIVE_PERIOD,
32+
.init = a3xx_gpu_init,
2233
}, {
2334
.chip_ids = ADRENO_CHIP_IDS(0x03000520),
2435
.family = ADRENO_3XX,

drivers/gpu/drm/msm/adreno/a3xx_gpu.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,8 @@ static int a3xx_hw_init(struct msm_gpu *gpu)
210210
*/
211211
gpu_write(gpu, REG_A3XX_VBIF_CLKON, 0x00000001);
212212

213+
} else if (adreno_is_a304(adreno_gpu)) {
214+
gpu_write(gpu, REG_A3XX_VBIF_ROUND_ROBIN_QOS_ARB, 0x0003);
213215
} else {
214216
BUG();
215217
}
@@ -242,6 +244,7 @@ static int a3xx_hw_init(struct msm_gpu *gpu)
242244

243245
/* Enable Clock gating: */
244246
if (adreno_is_a305b(adreno_gpu) ||
247+
adreno_is_a304(adreno_gpu) ||
245248
adreno_is_a306(adreno_gpu) ||
246249
adreno_is_a306a(adreno_gpu))
247250
gpu_write(gpu, REG_A3XX_RBBM_CLOCK_CTL, 0xaaaaaaaa);
@@ -341,6 +344,7 @@ static int a3xx_hw_init(struct msm_gpu *gpu)
341344

342345
/* CP ROQ queue sizes (bytes) - RB:16, ST:16, IB1:32, IB2:64 */
343346
if (adreno_is_a305(adreno_gpu) ||
347+
adreno_is_a304(adreno_gpu) ||
344348
adreno_is_a306(adreno_gpu) ||
345349
adreno_is_a306a(adreno_gpu) ||
346350
adreno_is_a320(adreno_gpu)) {

drivers/gpu/drm/msm/adreno/adreno_gpu.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,11 @@ static inline bool adreno_is_a225(const struct adreno_gpu *gpu)
294294
return adreno_is_revn(gpu, 225);
295295
}
296296

297+
static inline bool adreno_is_a304(const struct adreno_gpu *gpu)
298+
{
299+
return adreno_is_revn(gpu, 304);
300+
}
301+
297302
static inline bool adreno_is_a305(const struct adreno_gpu *gpu)
298303
{
299304
return adreno_is_revn(gpu, 305);

mesapatch

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
From dc6e6d7a2bedcc34d59e76f08ca4362369438f32 Mon Sep 17 00:00:00 2028
2+
From: exkc <exkc@exkc.moe>
3+
Date: Tue, 28 May 2024 14:15:09 -0700
4+
Subject: [PATCH] freedreno: Enable Adreno 304
5+
6+
---
7+
src/freedreno/common/freedreno_devices.py | 1 +
8+
1 file changed, 1 insertion(+)
9+
10+
diff --git a/src/freedreno/common/freedreno_devices.py b/src/freedreno/common/freedreno_devices.py
11+
index 2d38d01862b7f..b3ad9fbc4b9f0 100644
12+
--- a/src/freedreno/common/freedreno_devices.py
13+
+++ b/src/freedreno/common/freedreno_devices.py
14+
@@ -217,6 +217,7 @@ add_gpus([
15+
GPUId(320),
16+
GPUId(330),
17+
GPUId(chip_id=0x03000512, name="FD305B"),
18+
GPUId(chip_id=0x03000620, name="FD306A"),
19+
+ GPUId(chip_id=0x03000400, name="QwQ_GPU"),
20+
], GPUInfo(
21+
CHIP.A3XX,
22+
gmem_align_w = 32, gmem_align_h = 32,
23+
--
24+
GitLab
25+

0 commit comments

Comments
 (0)