Skip to content

Commit dbfbb37

Browse files
konradybciorobclark
authored andcommitted
drm/msm/a6xx: Add A621 support
A621 is a clear A662 derivative (same lineage as A650), no explosions or sick features, other than a NoC bug which can stall the GPU.. Add support for it. Signed-off-by: Konrad Dybcio <[email protected]> Patchwork: https://patchwork.freedesktop.org/patch/611100/ Signed-off-by: Rob Clark <[email protected]>
1 parent 40c297e commit dbfbb37

File tree

4 files changed

+106
-1
lines changed

4 files changed

+106
-1
lines changed

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

Lines changed: 77 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,59 @@ static const struct adreno_reglist a615_hwcg[] = {
129129
{},
130130
};
131131

132+
static const struct adreno_reglist a620_hwcg[] = {
133+
{REG_A6XX_RBBM_CLOCK_CNTL_SP0, 0x02222222},
134+
{REG_A6XX_RBBM_CLOCK_CNTL2_SP0, 0x02222220},
135+
{REG_A6XX_RBBM_CLOCK_DELAY_SP0, 0x00000080},
136+
{REG_A6XX_RBBM_CLOCK_HYST_SP0, 0x0000f3cf},
137+
{REG_A6XX_RBBM_CLOCK_CNTL_TP0, 0x02222222},
138+
{REG_A6XX_RBBM_CLOCK_CNTL2_TP0, 0x22222222},
139+
{REG_A6XX_RBBM_CLOCK_CNTL3_TP0, 0x22222222},
140+
{REG_A6XX_RBBM_CLOCK_CNTL4_TP0, 0x00022222},
141+
{REG_A6XX_RBBM_CLOCK_DELAY_TP0, 0x11111111},
142+
{REG_A6XX_RBBM_CLOCK_DELAY2_TP0, 0x11111111},
143+
{REG_A6XX_RBBM_CLOCK_DELAY3_TP0, 0x11111111},
144+
{REG_A6XX_RBBM_CLOCK_DELAY4_TP0, 0x00011111},
145+
{REG_A6XX_RBBM_CLOCK_HYST_TP0, 0x77777777},
146+
{REG_A6XX_RBBM_CLOCK_HYST2_TP0, 0x77777777},
147+
{REG_A6XX_RBBM_CLOCK_HYST3_TP0, 0x77777777},
148+
{REG_A6XX_RBBM_CLOCK_HYST4_TP0, 0x00077777},
149+
{REG_A6XX_RBBM_CLOCK_CNTL_RB0, 0x22222222},
150+
{REG_A6XX_RBBM_CLOCK_CNTL2_RB0, 0x01002222},
151+
{REG_A6XX_RBBM_CLOCK_CNTL_CCU0, 0x00002220},
152+
{REG_A6XX_RBBM_CLOCK_HYST_RB_CCU0, 0x00040f00},
153+
{REG_A6XX_RBBM_CLOCK_CNTL_RAC, 0x25222022},
154+
{REG_A6XX_RBBM_CLOCK_CNTL2_RAC, 0x00005555},
155+
{REG_A6XX_RBBM_CLOCK_DELAY_RAC, 0x00000011},
156+
{REG_A6XX_RBBM_CLOCK_HYST_RAC, 0x00445044},
157+
{REG_A6XX_RBBM_CLOCK_CNTL_TSE_RAS_RBBM, 0x04222222},
158+
{REG_A6XX_RBBM_CLOCK_MODE_VFD, 0x00002222},
159+
{REG_A6XX_RBBM_CLOCK_MODE_GPC, 0x00222222},
160+
{REG_A6XX_RBBM_CLOCK_DELAY_HLSQ_2, 0x00000002},
161+
{REG_A6XX_RBBM_CLOCK_MODE_HLSQ, 0x00002222},
162+
{REG_A6XX_RBBM_CLOCK_DELAY_TSE_RAS_RBBM, 0x00004000},
163+
{REG_A6XX_RBBM_CLOCK_DELAY_VFD, 0x00002222},
164+
{REG_A6XX_RBBM_CLOCK_DELAY_GPC, 0x00000200},
165+
{REG_A6XX_RBBM_CLOCK_DELAY_HLSQ, 0x00000000},
166+
{REG_A6XX_RBBM_CLOCK_HYST_TSE_RAS_RBBM, 0x00000000},
167+
{REG_A6XX_RBBM_CLOCK_HYST_VFD, 0x00000000},
168+
{REG_A6XX_RBBM_CLOCK_HYST_GPC, 0x04104004},
169+
{REG_A6XX_RBBM_CLOCK_HYST_HLSQ, 0x00000000},
170+
{REG_A6XX_RBBM_CLOCK_CNTL_TEX_FCHE, 0x00000222},
171+
{REG_A6XX_RBBM_CLOCK_DELAY_TEX_FCHE, 0x00000111},
172+
{REG_A6XX_RBBM_CLOCK_HYST_TEX_FCHE, 0x00000777},
173+
{REG_A6XX_RBBM_CLOCK_CNTL_UCHE, 0x22222222},
174+
{REG_A6XX_RBBM_CLOCK_HYST_UCHE, 0x00000004},
175+
{REG_A6XX_RBBM_CLOCK_DELAY_UCHE, 0x00000002},
176+
{REG_A6XX_RBBM_ISDB_CNT, 0x00000182},
177+
{REG_A6XX_RBBM_RAC_THRESHOLD_CNT, 0x00000000},
178+
{REG_A6XX_RBBM_SP_HYST_CNT, 0x00000000},
179+
{REG_A6XX_RBBM_CLOCK_CNTL_GMU_GX, 0x00000222},
180+
{REG_A6XX_RBBM_CLOCK_DELAY_GMU_GX, 0x00000111},
181+
{REG_A6XX_RBBM_CLOCK_HYST_GMU_GX, 0x00000555},
182+
{},
183+
};
184+
132185
static const struct adreno_reglist a630_hwcg[] = {
133186
{REG_A6XX_RBBM_CLOCK_CNTL_SP0, 0x22222222},
134187
{REG_A6XX_RBBM_CLOCK_CNTL_SP1, 0x22222222},
@@ -490,7 +543,6 @@ static const u32 a630_protect_regs[] = {
490543
};
491544
DECLARE_ADRENO_PROTECT(a630_protect, 32);
492545

493-
/* These are for a620 and a650 */
494546
static const u32 a650_protect_regs[] = {
495547
A6XX_PROTECT_RDONLY(0x00000, 0x04ff),
496548
A6XX_PROTECT_RDONLY(0x00501, 0x0005),
@@ -803,6 +855,30 @@ static const struct adreno_info a6xx_gpus[] = {
803855
{ 169, 2 },
804856
{ 180, 1 },
805857
),
858+
}, {
859+
.chip_ids = ADRENO_CHIP_IDS(0x06020100),
860+
.family = ADRENO_6XX_GEN3,
861+
.fw = {
862+
[ADRENO_FW_SQE] = "a650_sqe.fw",
863+
[ADRENO_FW_GMU] = "a621_gmu.bin",
864+
},
865+
.gmem = SZ_512K,
866+
.inactive_period = DRM_MSM_INACTIVE_PERIOD,
867+
.quirks = ADRENO_QUIRK_HAS_CACHED_COHERENT |
868+
ADRENO_QUIRK_HAS_HW_APRIV,
869+
.init = a6xx_gpu_init,
870+
.zapfw = "a620_zap.mbn",
871+
.a6xx = &(const struct a6xx_info) {
872+
.hwcg = a620_hwcg,
873+
.protect = &a650_protect,
874+
.gmu_cgc_mode = 0x00020200,
875+
.prim_fifo_threshold = 0x00010000,
876+
},
877+
.address_space_size = SZ_16G,
878+
.speedbins = ADRENO_SPEEDBINS(
879+
{ 0, 0 },
880+
{ 137, 1 },
881+
),
806882
}, {
807883
.chip_ids = ADRENO_CHIP_IDS(
808884
0x06030001,

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,20 @@ static int a6xx_gmu_gfx_rail_on(struct a6xx_gmu *gmu)
423423
return a6xx_gmu_set_oob(gmu, GMU_OOB_BOOT_SLUMBER);
424424
}
425425

426+
static void a6xx_gemnoc_workaround(struct a6xx_gmu *gmu)
427+
{
428+
struct a6xx_gpu *a6xx_gpu = container_of(gmu, struct a6xx_gpu, gmu);
429+
struct adreno_gpu *adreno_gpu = &a6xx_gpu->base;
430+
431+
/*
432+
* GEMNoC can power collapse whilst the GPU is being powered down, resulting
433+
* in the power down sequence not being fully executed. That in turn can
434+
* prevent CX_GDSC from collapsing. Assert Qactive to avoid this.
435+
*/
436+
if (adreno_is_a621(adreno_gpu) || adreno_is_7c3(adreno_gpu))
437+
gmu_write(gmu, REG_A6XX_GMU_AO_AHB_FENCE_CTRL, BIT(0));
438+
}
439+
426440
/* Let the GMU know that we are about to go into slumber */
427441
static int a6xx_gmu_notify_slumber(struct a6xx_gmu *gmu)
428442
{
@@ -456,6 +470,8 @@ static int a6xx_gmu_notify_slumber(struct a6xx_gmu *gmu)
456470
}
457471

458472
out:
473+
a6xx_gemnoc_workaround(gmu);
474+
459475
/* Put fence into allow mode */
460476
gmu_write(gmu, REG_A6XX_GMU_AO_AHB_FENCE_CTRL, 0);
461477
return ret;
@@ -945,6 +961,8 @@ static void a6xx_gmu_force_off(struct a6xx_gmu *gmu)
945961
/* Force off SPTP in case the GMU is managing it */
946962
a6xx_sptprac_disable(gmu);
947963

964+
a6xx_gemnoc_workaround(gmu);
965+
948966
/* Make sure there are no outstanding RPMh votes */
949967
a6xx_gmu_rpmh_off(gmu);
950968

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,12 @@ static void a6xx_calc_ubwc_config(struct adreno_gpu *gpu)
516516
if (adreno_is_a619_holi(gpu))
517517
gpu->ubwc_config.highest_bank_bit = 13;
518518

519+
if (adreno_is_a621(gpu)) {
520+
gpu->ubwc_config.highest_bank_bit = 13;
521+
gpu->ubwc_config.amsbc = 1;
522+
gpu->ubwc_config.uavflagprd_inv = 2;
523+
}
524+
519525
if (adreno_is_a640_family(gpu))
520526
gpu->ubwc_config.amsbc = 1;
521527

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,11 @@ static inline int adreno_is_a619_holi(const struct adreno_gpu *gpu)
414414
return adreno_is_a619(gpu) && adreno_has_gmu_wrapper(gpu);
415415
}
416416

417+
static inline int adreno_is_a621(const struct adreno_gpu *gpu)
418+
{
419+
return gpu->info->chip_ids[0] == 0x06020100;
420+
}
421+
417422
static inline int adreno_is_a630(const struct adreno_gpu *gpu)
418423
{
419424
return adreno_is_revn(gpu, 630);

0 commit comments

Comments
 (0)