Skip to content

Commit 3d6ab12

Browse files
z3nturobclark
authored andcommitted
drm/msm/adreno: Add A305B support
Add support for the Adreno 305B GPU that is found in MSM8226(v2) SoC. Previously this was mistakenly claimed to be supported but using wrong a configuration. In MSM8226v1 there's also a A305B but with chipid 0x03000510 which should work with the same configuration but due to lack of hardware for testing this is not added. Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Luca Weiss <luca@z3ntu.xyz> Reviewed-by: David Heidelberg <david@ixit.cz> Patchwork: https://patchwork.freedesktop.org/patch/575274/ Signed-off-by: Rob Clark <robdclark@chromium.org>
1 parent 0be7a75 commit 3d6ab12

File tree

3 files changed

+26
-7
lines changed

3 files changed

+26
-7
lines changed

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

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,13 @@ static int a3xx_hw_init(struct msm_gpu *gpu)
134134
/* Set up AOOO: */
135135
gpu_write(gpu, REG_A3XX_VBIF_OUT_AXI_AOOO_EN, 0x0000003c);
136136
gpu_write(gpu, REG_A3XX_VBIF_OUT_AXI_AOOO, 0x003c003c);
137+
} else if (adreno_is_a305b(adreno_gpu)) {
138+
gpu_write(gpu, REG_A3XX_VBIF_IN_RD_LIM_CONF0, 0x00181818);
139+
gpu_write(gpu, REG_A3XX_VBIF_IN_WR_LIM_CONF0, 0x00181818);
140+
gpu_write(gpu, REG_A3XX_VBIF_OUT_RD_LIM_CONF0, 0x00000018);
141+
gpu_write(gpu, REG_A3XX_VBIF_OUT_WR_LIM_CONF0, 0x00000018);
142+
gpu_write(gpu, REG_A3XX_VBIF_DDR_OUT_MAX_BURST, 0x00000303);
143+
gpu_write(gpu, REG_A3XX_VBIF_ROUND_ROBIN_QOS_ARB, 0x0003);
137144
} else if (adreno_is_a306(adreno_gpu)) {
138145
gpu_write(gpu, REG_A3XX_VBIF_ROUND_ROBIN_QOS_ARB, 0x0003);
139146
gpu_write(gpu, REG_A3XX_VBIF_OUT_RD_LIM_CONF0, 0x0000000a);
@@ -230,7 +237,7 @@ static int a3xx_hw_init(struct msm_gpu *gpu)
230237
gpu_write(gpu, REG_A3XX_UCHE_CACHE_MODE_CONTROL_REG, 0x00000001);
231238

232239
/* Enable Clock gating: */
233-
if (adreno_is_a306(adreno_gpu))
240+
if (adreno_is_a305b(adreno_gpu) || adreno_is_a306(adreno_gpu))
234241
gpu_write(gpu, REG_A3XX_RBBM_CLOCK_CTL, 0xaaaaaaaa);
235242
else if (adreno_is_a320(adreno_gpu))
236243
gpu_write(gpu, REG_A3XX_RBBM_CLOCK_CTL, 0xbfffffff);
@@ -333,7 +340,7 @@ static int a3xx_hw_init(struct msm_gpu *gpu)
333340
AXXX_CP_QUEUE_THRESHOLDS_CSQ_IB1_START(2) |
334341
AXXX_CP_QUEUE_THRESHOLDS_CSQ_IB2_START(6) |
335342
AXXX_CP_QUEUE_THRESHOLDS_CSQ_ST_START(14));
336-
} else if (adreno_is_a330(adreno_gpu)) {
343+
} else if (adreno_is_a330(adreno_gpu) || adreno_is_a305b(adreno_gpu)) {
337344
/* NOTE: this (value take from downstream android driver)
338345
* includes some bits outside of the known bitfields. But
339346
* A330 has this "MERCIU queue" thing too, which might
@@ -559,7 +566,7 @@ struct msm_gpu *a3xx_gpu_init(struct drm_device *dev)
559566
goto fail;
560567

561568
/* if needed, allocate gmem: */
562-
if (adreno_is_a330(adreno_gpu)) {
569+
if (adreno_is_a330(adreno_gpu) || adreno_is_a305b(adreno_gpu)) {
563570
ret = adreno_gpu_ocmem_init(&adreno_gpu->base.pdev->dev,
564571
adreno_gpu, &a3xx_gpu->ocmem);
565572
if (ret)

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

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,17 @@ static const struct adreno_info gpulist[] = {
5555
.inactive_period = DRM_MSM_INACTIVE_PERIOD,
5656
.init = a2xx_gpu_init,
5757
}, {
58-
.chip_ids = ADRENO_CHIP_IDS(
59-
0x03000512,
60-
0x03000520
61-
),
58+
.chip_ids = ADRENO_CHIP_IDS(0x03000512),
59+
.family = ADRENO_3XX,
60+
.fw = {
61+
[ADRENO_FW_PM4] = "a330_pm4.fw",
62+
[ADRENO_FW_PFP] = "a330_pfp.fw",
63+
},
64+
.gmem = SZ_128K,
65+
.inactive_period = DRM_MSM_INACTIVE_PERIOD,
66+
.init = a3xx_gpu_init,
67+
}, {
68+
.chip_ids = ADRENO_CHIP_IDS(0x03000520),
6269
.family = ADRENO_3XX,
6370
.revn = 305,
6471
.fw = {

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,11 @@ static inline bool adreno_is_a305(const struct adreno_gpu *gpu)
256256
return adreno_is_revn(gpu, 305);
257257
}
258258

259+
static inline bool adreno_is_a305b(const struct adreno_gpu *gpu)
260+
{
261+
return gpu->info->chip_ids[0] == 0x03000512;
262+
}
263+
259264
static inline bool adreno_is_a306(const struct adreno_gpu *gpu)
260265
{
261266
/* yes, 307, because a305c is 306 */

0 commit comments

Comments
 (0)