Skip to content

Commit 24e6938

Browse files
fltorobclark
authored andcommitted
drm/msm/a6xx: update a6xx_hw_init for A640 and A650
Adreno 640 and 650 GPUs need some registers set differently. Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Jordan Crouse <[email protected]> Signed-off-by: Rob Clark <[email protected]>
1 parent ad4968d commit 24e6938

File tree

2 files changed

+61
-9
lines changed

2 files changed

+61
-9
lines changed

drivers/gpu/drm/msm/adreno/a6xx.xml.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,6 +1047,8 @@ enum a6xx_tex_type {
10471047

10481048
#define REG_A6XX_CP_MISC_CNTL 0x00000840
10491049

1050+
#define REG_A6XX_CP_APRIV_CNTL 0x00000844
1051+
10501052
#define REG_A6XX_CP_ROQ_THRESHOLDS_1 0x000008c1
10511053

10521054
#define REG_A6XX_CP_ROQ_THRESHOLDS_2 0x000008c2
@@ -1764,6 +1766,8 @@ static inline uint32_t A6XX_CP_PROTECT_REG_MASK_LEN(uint32_t val)
17641766

17651767
#define REG_A6XX_RBBM_VBIF_CLIENT_QOS_CNTL 0x00000010
17661768

1769+
#define REG_A6XX_RBBM_GBIF_CLIENT_QOS_CNTL 0x00000011
1770+
17671771
#define REG_A6XX_RBBM_INTERFACE_HANG_INT_CNTL 0x0000001f
17681772

17691773
#define REG_A6XX_RBBM_INT_CLEAR_CMD 0x00000037
@@ -2418,6 +2422,16 @@ static inline uint32_t A6XX_UCHE_CLIENT_PF_PERFSEL(uint32_t val)
24182422

24192423
#define REG_A6XX_TPL1_NC_MODE_CNTL 0x0000b604
24202424

2425+
#define REG_A6XX_TPL1_BICUBIC_WEIGHTS_TABLE_0 0x0000b608
2426+
2427+
#define REG_A6XX_TPL1_BICUBIC_WEIGHTS_TABLE_1 0x0000b609
2428+
2429+
#define REG_A6XX_TPL1_BICUBIC_WEIGHTS_TABLE_2 0x0000b60a
2430+
2431+
#define REG_A6XX_TPL1_BICUBIC_WEIGHTS_TABLE_3 0x0000b60b
2432+
2433+
#define REG_A6XX_TPL1_BICUBIC_WEIGHTS_TABLE_4 0x0000b60c
2434+
24212435
#define REG_A6XX_TPL1_PERFCTR_TP_SEL_0 0x0000b610
24222436

24232437
#define REG_A6XX_TPL1_PERFCTR_TP_SEL_1 0x0000b611

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

Lines changed: 47 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,17 @@ static int a6xx_hw_init(struct msm_gpu *gpu)
414414
a6xx_set_hwcg(gpu, true);
415415

416416
/* VBIF/GBIF start*/
417-
gpu_write(gpu, REG_A6XX_RBBM_VBIF_CLIENT_QOS_CNTL, 0x3);
417+
if (adreno_is_a640(adreno_gpu) || adreno_is_a650(adreno_gpu)) {
418+
gpu_write(gpu, REG_A6XX_GBIF_QSB_SIDE0, 0x00071620);
419+
gpu_write(gpu, REG_A6XX_GBIF_QSB_SIDE1, 0x00071620);
420+
gpu_write(gpu, REG_A6XX_GBIF_QSB_SIDE2, 0x00071620);
421+
gpu_write(gpu, REG_A6XX_GBIF_QSB_SIDE3, 0x00071620);
422+
gpu_write(gpu, REG_A6XX_GBIF_QSB_SIDE3, 0x00071620);
423+
gpu_write(gpu, REG_A6XX_RBBM_GBIF_CLIENT_QOS_CNTL, 0x3);
424+
} else {
425+
gpu_write(gpu, REG_A6XX_RBBM_VBIF_CLIENT_QOS_CNTL, 0x3);
426+
}
427+
418428
if (adreno_is_a630(adreno_gpu))
419429
gpu_write(gpu, REG_A6XX_VBIF_GATE_OFF_WRREQ_EN, 0x00000009);
420430

@@ -429,25 +439,35 @@ static int a6xx_hw_init(struct msm_gpu *gpu)
429439
gpu_write(gpu, REG_A6XX_UCHE_WRITE_THRU_BASE_LO, 0xfffff000);
430440
gpu_write(gpu, REG_A6XX_UCHE_WRITE_THRU_BASE_HI, 0x0001ffff);
431441

432-
/* Set the GMEM VA range [0x100000:0x100000 + gpu->gmem - 1] */
433-
gpu_write64(gpu, REG_A6XX_UCHE_GMEM_RANGE_MIN_LO,
434-
REG_A6XX_UCHE_GMEM_RANGE_MIN_HI, 0x00100000);
442+
if (!adreno_is_a650(adreno_gpu)) {
443+
/* Set the GMEM VA range [0x100000:0x100000 + gpu->gmem - 1] */
444+
gpu_write64(gpu, REG_A6XX_UCHE_GMEM_RANGE_MIN_LO,
445+
REG_A6XX_UCHE_GMEM_RANGE_MIN_HI, 0x00100000);
435446

436-
gpu_write64(gpu, REG_A6XX_UCHE_GMEM_RANGE_MAX_LO,
437-
REG_A6XX_UCHE_GMEM_RANGE_MAX_HI,
438-
0x00100000 + adreno_gpu->gmem - 1);
447+
gpu_write64(gpu, REG_A6XX_UCHE_GMEM_RANGE_MAX_LO,
448+
REG_A6XX_UCHE_GMEM_RANGE_MAX_HI,
449+
0x00100000 + adreno_gpu->gmem - 1);
450+
}
439451

440452
gpu_write(gpu, REG_A6XX_UCHE_FILTER_CNTL, 0x804);
441453
gpu_write(gpu, REG_A6XX_UCHE_CACHE_WAYS, 0x4);
442454

443-
gpu_write(gpu, REG_A6XX_CP_ROQ_THRESHOLDS_2, 0x010000c0);
455+
if (adreno_is_a640(adreno_gpu) || adreno_is_a650(adreno_gpu))
456+
gpu_write(gpu, REG_A6XX_CP_ROQ_THRESHOLDS_2, 0x02000140);
457+
else
458+
gpu_write(gpu, REG_A6XX_CP_ROQ_THRESHOLDS_2, 0x010000c0);
444459
gpu_write(gpu, REG_A6XX_CP_ROQ_THRESHOLDS_1, 0x8040362c);
445460

446461
/* Setting the mem pool size */
447462
gpu_write(gpu, REG_A6XX_CP_MEM_POOL_SIZE, 128);
448463

449464
/* Setting the primFifo thresholds default values */
450-
gpu_write(gpu, REG_A6XX_PC_DBG_ECO_CNTL, (0x300 << 11));
465+
if (adreno_is_a650(adreno_gpu))
466+
gpu_write(gpu, REG_A6XX_PC_DBG_ECO_CNTL, 0x00300000);
467+
else if (adreno_is_a640(adreno_gpu))
468+
gpu_write(gpu, REG_A6XX_PC_DBG_ECO_CNTL, 0x00200000);
469+
else
470+
gpu_write(gpu, REG_A6XX_PC_DBG_ECO_CNTL, (0x300 << 11));
451471

452472
/* Set the AHB default slave response to "ERROR" */
453473
gpu_write(gpu, REG_A6XX_CP_AHB_CNTL, 0x1);
@@ -471,6 +491,19 @@ static int a6xx_hw_init(struct msm_gpu *gpu)
471491

472492
gpu_write(gpu, REG_A6XX_UCHE_CLIENT_PF, 1);
473493

494+
/* Set weights for bicubic filtering */
495+
if (adreno_is_a650(adreno_gpu)) {
496+
gpu_write(gpu, REG_A6XX_TPL1_BICUBIC_WEIGHTS_TABLE_0, 0);
497+
gpu_write(gpu, REG_A6XX_TPL1_BICUBIC_WEIGHTS_TABLE_1,
498+
0x3fe05ff4);
499+
gpu_write(gpu, REG_A6XX_TPL1_BICUBIC_WEIGHTS_TABLE_2,
500+
0x3fa0ebee);
501+
gpu_write(gpu, REG_A6XX_TPL1_BICUBIC_WEIGHTS_TABLE_3,
502+
0x3f5193ed);
503+
gpu_write(gpu, REG_A6XX_TPL1_BICUBIC_WEIGHTS_TABLE_4,
504+
0x3f0243f0);
505+
}
506+
474507
/* Protect registers from the CP */
475508
gpu_write(gpu, REG_A6XX_CP_PROTECT_CNTL, 0x00000003);
476509

@@ -508,6 +541,11 @@ static int a6xx_hw_init(struct msm_gpu *gpu)
508541
A6XX_PROTECT_RDONLY(0x980, 0x4));
509542
gpu_write(gpu, REG_A6XX_CP_PROTECT(25), A6XX_PROTECT_RW(0xa630, 0x0));
510543

544+
if (adreno_is_a650(adreno_gpu)) {
545+
gpu_write(gpu, REG_A6XX_CP_APRIV_CNTL,
546+
(1 << 6) | (1 << 5) | (1 << 3) | (1 << 2) | (1 << 1));
547+
}
548+
511549
/* Enable interrupts */
512550
gpu_write(gpu, REG_A6XX_RBBM_INT_0_MASK, A6XX_INT_MASK);
513551

0 commit comments

Comments
 (0)