Skip to content

Commit dc0fa5e

Browse files
shawnguo2robclark
authored andcommitted
drm/msm/a4xx: add adreno a405 support
It adds support for adreno a405 found on MSM8939. The adreno_is_a430() check in adreno_submit() needs an extension to cover a405. The downstream driver suggests it should cover the whole a4xx generation. That's why it gets changed to adreno_is_a4xx(), while a420 is not tested though. Signed-off-by: Shawn Guo <[email protected]> Reviewed-by: Jordan Crouse <[email protected]> Signed-off-by: Rob Clark <[email protected]>
1 parent 24e6938 commit dc0fa5e

File tree

4 files changed

+34
-13
lines changed

4 files changed

+34
-13
lines changed

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

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -66,19 +66,22 @@ static void a4xx_enable_hwcg(struct msm_gpu *gpu)
6666
}
6767
}
6868

69-
for (i = 0; i < 4; i++) {
70-
gpu_write(gpu, REG_A4XX_RBBM_CLOCK_CTL_MARB_CCU(i),
71-
0x00000922);
72-
}
69+
/* No CCU for A405 */
70+
if (!adreno_is_a405(adreno_gpu)) {
71+
for (i = 0; i < 4; i++) {
72+
gpu_write(gpu, REG_A4XX_RBBM_CLOCK_CTL_MARB_CCU(i),
73+
0x00000922);
74+
}
7375

74-
for (i = 0; i < 4; i++) {
75-
gpu_write(gpu, REG_A4XX_RBBM_CLOCK_HYST_RB_MARB_CCU(i),
76-
0x00000000);
77-
}
76+
for (i = 0; i < 4; i++) {
77+
gpu_write(gpu, REG_A4XX_RBBM_CLOCK_HYST_RB_MARB_CCU(i),
78+
0x00000000);
79+
}
7880

79-
for (i = 0; i < 4; i++) {
80-
gpu_write(gpu, REG_A4XX_RBBM_CLOCK_DELAY_RB_MARB_CCU_L1(i),
81-
0x00000001);
81+
for (i = 0; i < 4; i++) {
82+
gpu_write(gpu, REG_A4XX_RBBM_CLOCK_DELAY_RB_MARB_CCU_L1(i),
83+
0x00000001);
84+
}
8285
}
8386

8487
gpu_write(gpu, REG_A4XX_RBBM_CLOCK_MODE_GPC, 0x02222222);
@@ -137,7 +140,9 @@ static int a4xx_hw_init(struct msm_gpu *gpu)
137140
uint32_t *ptr, len;
138141
int i, ret;
139142

140-
if (adreno_is_a420(adreno_gpu)) {
143+
if (adreno_is_a405(adreno_gpu)) {
144+
gpu_write(gpu, REG_A4XX_VBIF_ROUND_ROBIN_QOS_ARB, 0x00000003);
145+
} else if (adreno_is_a420(adreno_gpu)) {
141146
gpu_write(gpu, REG_A4XX_VBIF_ABIT_SORT, 0x0001001F);
142147
gpu_write(gpu, REG_A4XX_VBIF_ABIT_SORT_CONF, 0x000000A4);
143148
gpu_write(gpu, REG_A4XX_VBIF_GATE_OFF_WRREQ_EN, 0x00000001);

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,17 @@ static const struct adreno_info gpulist[] = {
9292
.gmem = SZ_1M,
9393
.inactive_period = DRM_MSM_INACTIVE_PERIOD,
9494
.init = a3xx_gpu_init,
95+
}, {
96+
.rev = ADRENO_REV(4, 0, 5, ANY_ID),
97+
.revn = 405,
98+
.name = "A405",
99+
.fw = {
100+
[ADRENO_FW_PM4] = "a420_pm4.fw",
101+
[ADRENO_FW_PFP] = "a420_pfp.fw",
102+
},
103+
.gmem = SZ_256K,
104+
.inactive_period = DRM_MSM_INACTIVE_PERIOD,
105+
.init = a4xx_gpu_init,
95106
}, {
96107
.rev = ADRENO_REV(4, 2, 0, ANY_ID),
97108
.revn = 420,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ void adreno_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit,
459459
break;
460460
/* fall-thru */
461461
case MSM_SUBMIT_CMD_BUF:
462-
OUT_PKT3(ring, adreno_is_a430(adreno_gpu) ?
462+
OUT_PKT3(ring, adreno_is_a4xx(adreno_gpu) ?
463463
CP_INDIRECT_BUFFER_PFE : CP_INDIRECT_BUFFER_PFD, 2);
464464
OUT_RING(ring, lower_32_bits(submit->cmd[i].iova));
465465
OUT_RING(ring, submit->cmd[i].size);

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,11 @@ static inline bool adreno_is_a4xx(struct adreno_gpu *gpu)
202202
return (gpu->revn >= 400) && (gpu->revn < 500);
203203
}
204204

205+
static inline int adreno_is_a405(struct adreno_gpu *gpu)
206+
{
207+
return gpu->revn == 405;
208+
}
209+
205210
static inline int adreno_is_a420(struct adreno_gpu *gpu)
206211
{
207212
return gpu->revn == 420;

0 commit comments

Comments
 (0)