Skip to content

Commit d2bcca0

Browse files
superna9999robclark
authored andcommitted
drm/msm: add support for A750 GPU
Add support for the A750 GPU found on the SM8650 platform Unlike the the very close A740 GPU on the SM8550 SoC, the A750 GPU doesn't have an HWCFG block but a separate register set. The A750 GPU info are added under the adreno_is_a750() macro and the ADRENO_7XX_GEN3 family id. Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org> Patchwork: https://patchwork.freedesktop.org/patch/578693/ Signed-off-by: Rob Clark <robdclark@chromium.org>
1 parent 1fdd35d commit d2bcca0

File tree

4 files changed

+49
-5
lines changed

4 files changed

+49
-5
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -842,6 +842,8 @@ static int a6xx_gmu_fw_start(struct a6xx_gmu *gmu, unsigned int state)
842842
*/
843843
if (adreno_is_a740(adreno_gpu))
844844
chipid_min = 2;
845+
else if (adreno_is_a750(adreno_gpu))
846+
chipid_min = 9;
845847
else
846848
return -EINVAL;
847849

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

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -961,7 +961,7 @@ static void a6xx_set_hwcg(struct msm_gpu *gpu, bool state)
961961
unsigned int i;
962962
u32 val, clock_cntl_on, cgc_mode;
963963

964-
if (!adreno_gpu->info->hwcg)
964+
if (!(adreno_gpu->info->hwcg || adreno_is_a7xx(adreno_gpu)))
965965
return;
966966

967967
if (adreno_is_a630(adreno_gpu))
@@ -982,6 +982,25 @@ static void a6xx_set_hwcg(struct msm_gpu *gpu, bool state)
982982
state ? 0x5555 : 0);
983983
}
984984

985+
if (!adreno_gpu->info->hwcg) {
986+
gpu_write(gpu, REG_A7XX_RBBM_CLOCK_CNTL_GLOBAL, 1);
987+
gpu_write(gpu, REG_A7XX_RBBM_CGC_GLOBAL_LOAD_CMD, state ? 1 : 0);
988+
989+
if (state) {
990+
gpu_write(gpu, REG_A7XX_RBBM_CGC_P2S_TRIG_CMD, 1);
991+
992+
if (gpu_poll_timeout(gpu, REG_A7XX_RBBM_CGC_P2S_STATUS, val,
993+
val & A7XX_RBBM_CGC_P2S_STATUS_TXDONE, 1, 10)) {
994+
dev_err(&gpu->pdev->dev, "RBBM_CGC_P2S_STATUS TXDONE Poll failed\n");
995+
return;
996+
}
997+
998+
gpu_write(gpu, REG_A7XX_RBBM_CLOCK_CNTL_GLOBAL, 0);
999+
}
1000+
1001+
return;
1002+
}
1003+
9851004
val = gpu_read(gpu, REG_A6XX_RBBM_CLOCK_CNTL);
9861005

9871006
/* Don't re-program the registers if they are already correct */
@@ -1239,7 +1258,9 @@ static void a6xx_set_cp_protect(struct msm_gpu *gpu)
12391258
count = ARRAY_SIZE(a660_protect);
12401259
count_max = 48;
12411260
BUILD_BUG_ON(ARRAY_SIZE(a660_protect) > 48);
1242-
} else if (adreno_is_a730(adreno_gpu) || adreno_is_a740(adreno_gpu)) {
1261+
} else if (adreno_is_a730(adreno_gpu) ||
1262+
adreno_is_a740(adreno_gpu) ||
1263+
adreno_is_a750(adreno_gpu)) {
12431264
regs = a730_protect;
12441265
count = ARRAY_SIZE(a730_protect);
12451266
count_max = 48;
@@ -2879,7 +2900,8 @@ struct msm_gpu *a6xx_gpu_init(struct drm_device *dev)
28792900

28802901
/* gpu->info only gets assigned in adreno_gpu_init() */
28812902
is_a7xx = config->info->family == ADRENO_7XX_GEN1 ||
2882-
config->info->family == ADRENO_7XX_GEN2;
2903+
config->info->family == ADRENO_7XX_GEN2 ||
2904+
config->info->family == ADRENO_7XX_GEN3;
28832905

28842906
a6xx_llc_slices_init(pdev, a6xx_gpu, is_a7xx);
28852907

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,20 @@ static const struct adreno_info gpulist[] = {
550550
.zapfw = "a740_zap.mdt",
551551
.hwcg = a740_hwcg,
552552
.address_space_size = SZ_16G,
553+
}, {
554+
.chip_ids = ADRENO_CHIP_IDS(0x43051401), /* "C520v2" */
555+
.family = ADRENO_7XX_GEN3,
556+
.fw = {
557+
[ADRENO_FW_SQE] = "gen70900_sqe.fw",
558+
[ADRENO_FW_GMU] = "gmu_gen70900.bin",
559+
},
560+
.gmem = 3 * SZ_1M,
561+
.inactive_period = DRM_MSM_INACTIVE_PERIOD,
562+
.quirks = ADRENO_QUIRK_HAS_CACHED_COHERENT |
563+
ADRENO_QUIRK_HAS_HW_APRIV,
564+
.init = a6xx_gpu_init,
565+
.zapfw = "gen70900_zap.mbn",
566+
.address_space_size = SZ_16G,
553567
},
554568
};
555569

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ enum adreno_family {
4848
ADRENO_6XX_GEN4, /* a660 family */
4949
ADRENO_7XX_GEN1, /* a730 family */
5050
ADRENO_7XX_GEN2, /* a740 family */
51+
ADRENO_7XX_GEN3, /* a750 family */
5152
};
5253

5354
#define ADRENO_QUIRK_TWO_PASS_USE_WFI BIT(0)
@@ -428,12 +429,17 @@ static inline int adreno_is_a740(struct adreno_gpu *gpu)
428429
return gpu->info->chip_ids[0] == 0x43050a01;
429430
}
430431

431-
/* Placeholder to make future diffs smaller */
432+
static inline int adreno_is_a750(struct adreno_gpu *gpu)
433+
{
434+
return gpu->info->chip_ids[0] == 0x43051401;
435+
}
436+
432437
static inline int adreno_is_a740_family(struct adreno_gpu *gpu)
433438
{
434439
if (WARN_ON_ONCE(!gpu->info))
435440
return false;
436-
return gpu->info->family == ADRENO_7XX_GEN2;
441+
return gpu->info->family == ADRENO_7XX_GEN2 ||
442+
gpu->info->family == ADRENO_7XX_GEN3;
437443
}
438444

439445
static inline int adreno_is_a7xx(struct adreno_gpu *gpu)

0 commit comments

Comments
 (0)