Skip to content

Commit fa17fbb

Browse files
Lanik123robclark
authored andcommitted
drm/msm/adreno: Add support for Adreno 505 GPU
This GPU is found on SoCs such as MSM8937 (450 MHz), MSM8940 (475 MHz), SDM439 (650 MHz). Signed-off-by: Daniil Titov <[email protected]> Reviewed-by: Konrad Dybcio <[email protected]> Signed-off-by: Barnabás Czémán <[email protected]> Patchwork: https://patchwork.freedesktop.org/patch/601411/ Signed-off-by: Rob Clark <[email protected]>
1 parent 71c5c23 commit fa17fbb

File tree

3 files changed

+35
-12
lines changed

3 files changed

+35
-12
lines changed

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,19 @@
1010

1111
static const struct adreno_info a5xx_gpus[] = {
1212
{
13+
.chip_ids = ADRENO_CHIP_IDS(0x05000500),
14+
.family = ADRENO_5XX,
15+
.revn = 505,
16+
.fw = {
17+
[ADRENO_FW_PM4] = "a530_pm4.fw",
18+
[ADRENO_FW_PFP] = "a530_pfp.fw",
19+
},
20+
.gmem = (SZ_128K + SZ_8K),
21+
.inactive_period = DRM_MSM_INACTIVE_PERIOD,
22+
.quirks = ADRENO_QUIRK_TWO_PASS_USE_WFI |
23+
ADRENO_QUIRK_LMLOADKILL_DISABLE,
24+
.init = a5xx_gpu_init,
25+
}, {
1326
.chip_ids = ADRENO_CHIP_IDS(0x05000600),
1427
.family = ADRENO_5XX,
1528
.revn = 506,

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

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,8 @@ void a5xx_set_hwcg(struct msm_gpu *gpu, bool state)
439439
const struct adreno_five_hwcg_regs *regs;
440440
unsigned int i, sz;
441441

442-
if (adreno_is_a506(adreno_gpu) || adreno_is_a508(adreno_gpu)) {
442+
if (adreno_is_a505(adreno_gpu) || adreno_is_a506(adreno_gpu) ||
443+
adreno_is_a508(adreno_gpu)) {
443444
regs = a50x_hwcg;
444445
sz = ARRAY_SIZE(a50x_hwcg);
445446
} else if (adreno_is_a509(adreno_gpu) || adreno_is_a512(adreno_gpu)) {
@@ -483,7 +484,8 @@ static int a5xx_me_init(struct msm_gpu *gpu)
483484
OUT_RING(ring, 0x00000000);
484485

485486
/* Specify workarounds for various microcode issues */
486-
if (adreno_is_a506(adreno_gpu) || adreno_is_a530(adreno_gpu)) {
487+
if (adreno_is_a505(adreno_gpu) || adreno_is_a506(adreno_gpu) ||
488+
adreno_is_a530(adreno_gpu)) {
487489
/* Workaround for token end syncs
488490
* Force a WFI after every direct-render 3D mode draw and every
489491
* 2D mode 3 draw
@@ -752,10 +754,11 @@ static int a5xx_hw_init(struct msm_gpu *gpu)
752754
0x00100000 + adreno_gpu->info->gmem - 1);
753755
gpu_write(gpu, REG_A5XX_UCHE_GMEM_RANGE_MAX_HI, 0x00000000);
754756

755-
if (adreno_is_a506(adreno_gpu) || adreno_is_a508(adreno_gpu) ||
756-
adreno_is_a510(adreno_gpu)) {
757+
if (adreno_is_a505(adreno_gpu) || adreno_is_a506(adreno_gpu) ||
758+
adreno_is_a508(adreno_gpu) || adreno_is_a510(adreno_gpu)) {
757759
gpu_write(gpu, REG_A5XX_CP_MEQ_THRESHOLDS, 0x20);
758-
if (adreno_is_a506(adreno_gpu) || adreno_is_a508(adreno_gpu))
760+
if (adreno_is_a505(adreno_gpu) || adreno_is_a506(adreno_gpu) ||
761+
adreno_is_a508(adreno_gpu))
759762
gpu_write(gpu, REG_A5XX_CP_MERCIU_SIZE, 0x400);
760763
else
761764
gpu_write(gpu, REG_A5XX_CP_MERCIU_SIZE, 0x20);
@@ -771,7 +774,8 @@ static int a5xx_hw_init(struct msm_gpu *gpu)
771774
gpu_write(gpu, REG_A5XX_CP_ROQ_THRESHOLDS_1, 0x40201B16);
772775
}
773776

774-
if (adreno_is_a506(adreno_gpu) || adreno_is_a508(adreno_gpu))
777+
if (adreno_is_a505(adreno_gpu) || adreno_is_a506(adreno_gpu) ||
778+
adreno_is_a508(adreno_gpu))
775779
gpu_write(gpu, REG_A5XX_PC_DBG_ECO_CNTL,
776780
(0x100 << 11 | 0x100 << 22));
777781
else if (adreno_is_a509(adreno_gpu) || adreno_is_a510(adreno_gpu) ||
@@ -789,8 +793,9 @@ static int a5xx_hw_init(struct msm_gpu *gpu)
789793
* Disable the RB sampler datapath DP2 clock gating optimization
790794
* for 1-SP GPUs, as it is enabled by default.
791795
*/
792-
if (adreno_is_a506(adreno_gpu) || adreno_is_a508(adreno_gpu) ||
793-
adreno_is_a509(adreno_gpu) || adreno_is_a512(adreno_gpu))
796+
if (adreno_is_a505(adreno_gpu) || adreno_is_a506(adreno_gpu) ||
797+
adreno_is_a508(adreno_gpu) || adreno_is_a509(adreno_gpu) ||
798+
adreno_is_a512(adreno_gpu))
794799
gpu_rmw(gpu, REG_A5XX_RB_DBG_ECO_CNTL, 0, (1 << 9));
795800

796801
/* Disable UCHE global filter as SP can invalidate/flush independently */
@@ -1345,7 +1350,7 @@ static int a5xx_pm_resume(struct msm_gpu *gpu)
13451350
if (ret)
13461351
return ret;
13471352

1348-
/* Adreno 506, 508, 509, 510, 512 needs manual RBBM sus/res control */
1353+
/* Adreno 505, 506, 508, 509, 510, 512 needs manual RBBM sus/res control */
13491354
if (!(adreno_is_a530(adreno_gpu) || adreno_is_a540(adreno_gpu))) {
13501355
/* Halt the sp_input_clk at HM level */
13511356
gpu_write(gpu, REG_A5XX_RBBM_CLOCK_CNTL, 0x00000055);
@@ -1388,9 +1393,9 @@ static int a5xx_pm_suspend(struct msm_gpu *gpu)
13881393
u32 mask = 0xf;
13891394
int i, ret;
13901395

1391-
/* A506, A508, A510 have 3 XIN ports in VBIF */
1392-
if (adreno_is_a506(adreno_gpu) || adreno_is_a508(adreno_gpu) ||
1393-
adreno_is_a510(adreno_gpu))
1396+
/* A505, A506, A508, A510 have 3 XIN ports in VBIF */
1397+
if (adreno_is_a505(adreno_gpu) || adreno_is_a506(adreno_gpu) ||
1398+
adreno_is_a508(adreno_gpu) || adreno_is_a510(adreno_gpu))
13941399
mask = 0x7;
13951400

13961401
/* Clear the VBIF pipe before shutting down */

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,11 @@ static inline int adreno_is_a430(const struct adreno_gpu *gpu)
324324
return adreno_is_revn(gpu, 430);
325325
}
326326

327+
static inline int adreno_is_a505(const struct adreno_gpu *gpu)
328+
{
329+
return adreno_is_revn(gpu, 505);
330+
}
331+
327332
static inline int adreno_is_a506(const struct adreno_gpu *gpu)
328333
{
329334
return adreno_is_revn(gpu, 506);

0 commit comments

Comments
 (0)