Skip to content

Commit 5773cce

Browse files
pvgtejas-quicrobclark
authored andcommitted
drm/msm/a6xx: Add support for A663
Add support for Adreno 663 found on sa8775p based platforms. Signed-off-by: Puranam V G Tejaswi <quic_pvgtejas@quicinc.com> Signed-off-by: Akhil P Oommen <quic_akhilpo@quicinc.com> Patchwork: https://patchwork.freedesktop.org/patch/620768/ Signed-off-by: Rob Clark <robdclark@chromium.org>
1 parent 45a4f88 commit 5773cce

File tree

4 files changed

+67
-1
lines changed

4 files changed

+67
-1
lines changed

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -972,6 +972,25 @@ static const struct adreno_info a6xx_gpus[] = {
972972
.prim_fifo_threshold = 0x00300200,
973973
},
974974
.address_space_size = SZ_16G,
975+
}, {
976+
.chip_ids = ADRENO_CHIP_IDS(0x06060300),
977+
.family = ADRENO_6XX_GEN4,
978+
.fw = {
979+
[ADRENO_FW_SQE] = "a660_sqe.fw",
980+
[ADRENO_FW_GMU] = "a663_gmu.bin",
981+
},
982+
.gmem = SZ_1M + SZ_512K,
983+
.inactive_period = DRM_MSM_INACTIVE_PERIOD,
984+
.quirks = ADRENO_QUIRK_HAS_CACHED_COHERENT |
985+
ADRENO_QUIRK_HAS_HW_APRIV,
986+
.init = a6xx_gpu_init,
987+
.a6xx = &(const struct a6xx_info) {
988+
.hwcg = a690_hwcg,
989+
.protect = &a660_protect,
990+
.gmu_cgc_mode = 0x00020200,
991+
.prim_fifo_threshold = 0x00300200,
992+
},
993+
.address_space_size = SZ_16G,
975994
}, {
976995
.chip_ids = ADRENO_CHIP_IDS(0x06030500),
977996
.family = ADRENO_6XX_GEN4,

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,15 @@ static void a6xx_calc_ubwc_config(struct adreno_gpu *gpu)
635635
gpu->ubwc_config.macrotile_mode = 1;
636636
}
637637

638+
if (adreno_is_a663(gpu)) {
639+
gpu->ubwc_config.highest_bank_bit = 13;
640+
gpu->ubwc_config.amsbc = 1;
641+
gpu->ubwc_config.rgb565_predicator = 1;
642+
gpu->ubwc_config.uavflagprd_inv = 2;
643+
gpu->ubwc_config.macrotile_mode = 1;
644+
gpu->ubwc_config.ubwc_swizzle = 0x4;
645+
}
646+
638647
if (adreno_is_7c3(gpu)) {
639648
gpu->ubwc_config.highest_bank_bit = 14;
640649
gpu->ubwc_config.amsbc = 1;
@@ -1240,7 +1249,7 @@ static int hw_init(struct msm_gpu *gpu)
12401249
if (adreno_is_a690(adreno_gpu))
12411250
gpu_write(gpu, REG_A6XX_UCHE_CMDQ_CONFIG, 0x90);
12421251
/* Set dualQ + disable afull for A660 GPU */
1243-
else if (adreno_is_a660(adreno_gpu))
1252+
else if (adreno_is_a660(adreno_gpu) || adreno_is_a663(adreno_gpu))
12441253
gpu_write(gpu, REG_A6XX_UCHE_CMDQ_CONFIG, 0x66906);
12451254
else if (adreno_is_a7xx(adreno_gpu))
12461255
gpu_write(gpu, REG_A6XX_UCHE_CMDQ_CONFIG,

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

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,37 @@ static void a660_build_bw_table(struct a6xx_hfi_msg_bw_table *msg)
478478
msg->cnoc_cmds_data[1][0] = 0x60000001;
479479
}
480480

481+
static void a663_build_bw_table(struct a6xx_hfi_msg_bw_table *msg)
482+
{
483+
/*
484+
* Send a single "off" entry just to get things running
485+
* TODO: bus scaling
486+
*/
487+
msg->bw_level_num = 1;
488+
489+
msg->ddr_cmds_num = 3;
490+
msg->ddr_wait_bitmask = 0x07;
491+
492+
msg->ddr_cmds_addrs[0] = 0x50004;
493+
msg->ddr_cmds_addrs[1] = 0x50000;
494+
msg->ddr_cmds_addrs[2] = 0x500b4;
495+
496+
msg->ddr_cmds_data[0][0] = 0x40000000;
497+
msg->ddr_cmds_data[0][1] = 0x40000000;
498+
msg->ddr_cmds_data[0][2] = 0x40000000;
499+
500+
/*
501+
* These are the CX (CNOC) votes - these are used by the GMU but the
502+
* votes are known and fixed for the target
503+
*/
504+
msg->cnoc_cmds_num = 1;
505+
msg->cnoc_wait_bitmask = 0x01;
506+
507+
msg->cnoc_cmds_addrs[0] = 0x50058;
508+
msg->cnoc_cmds_data[0][0] = 0x40000000;
509+
msg->cnoc_cmds_data[1][0] = 0x60000001;
510+
}
511+
481512
static void adreno_7c3_build_bw_table(struct a6xx_hfi_msg_bw_table *msg)
482513
{
483514
/*
@@ -646,6 +677,8 @@ static int a6xx_hfi_send_bw_table(struct a6xx_gmu *gmu)
646677
adreno_7c3_build_bw_table(&msg);
647678
else if (adreno_is_a660(adreno_gpu))
648679
a660_build_bw_table(&msg);
680+
else if (adreno_is_a663(adreno_gpu))
681+
a663_build_bw_table(&msg);
649682
else if (adreno_is_a690(adreno_gpu))
650683
a690_build_bw_table(&msg);
651684
else if (adreno_is_a730(adreno_gpu))

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,11 @@ static inline int adreno_is_a680(const struct adreno_gpu *gpu)
470470
return adreno_is_revn(gpu, 680);
471471
}
472472

473+
static inline int adreno_is_a663(const struct adreno_gpu *gpu)
474+
{
475+
return gpu->info->chip_ids[0] == 0x06060300;
476+
}
477+
473478
static inline int adreno_is_a690(const struct adreno_gpu *gpu)
474479
{
475480
return gpu->info->chip_ids[0] == 0x06090000;

0 commit comments

Comments
 (0)