Skip to content

Commit d6225e0

Browse files
Akhil P Oommenrobclark
authored andcommitted
drm/msm/adreno: Add support for X185 GPU
Add support in drm/msm driver for the Adreno X185 gpu found in Snapdragon X1 Elite chipset. Signed-off-by: Akhil P Oommen <[email protected]> Reviewed-by: Konrad Dybcio <[email protected]> Patchwork: https://patchwork.freedesktop.org/patch/601399/ Signed-off-by: Rob Clark <[email protected]>
1 parent e5598ff commit d6225e0

File tree

5 files changed

+36
-3
lines changed

5 files changed

+36
-3
lines changed

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,6 +1208,24 @@ static const struct adreno_info a7xx_gpus[] = {
12081208
.protect = &a730_protect,
12091209
},
12101210
.address_space_size = SZ_16G,
1211+
}, {
1212+
.chip_ids = ADRENO_CHIP_IDS(0x43050c01), /* "C512v2" */
1213+
.family = ADRENO_7XX_GEN2,
1214+
.fw = {
1215+
[ADRENO_FW_SQE] = "gen70500_sqe.fw",
1216+
[ADRENO_FW_GMU] = "gen70500_gmu.bin",
1217+
},
1218+
.gmem = 3 * SZ_1M,
1219+
.inactive_period = DRM_MSM_INACTIVE_PERIOD,
1220+
.quirks = ADRENO_QUIRK_HAS_CACHED_COHERENT |
1221+
ADRENO_QUIRK_HAS_HW_APRIV,
1222+
.init = a6xx_gpu_init,
1223+
.a6xx = &(const struct a6xx_info) {
1224+
.hwcg = a740_hwcg,
1225+
.protect = &a730_protect,
1226+
.gmu_chipid = 0x7050001,
1227+
},
1228+
.address_space_size = SZ_256G,
12111229
}, {
12121230
.chip_ids = ADRENO_CHIP_IDS(0x43051401), /* "C520v2" */
12131231
.family = ADRENO_7XX_GEN3,

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,7 @@ static int a6xx_gmu_fw_start(struct a6xx_gmu *gmu, unsigned int state)
767767
{
768768
struct a6xx_gpu *a6xx_gpu = container_of(gmu, struct a6xx_gpu, gmu);
769769
struct adreno_gpu *adreno_gpu = &a6xx_gpu->base;
770+
const struct a6xx_info *a6xx_info = adreno_gpu->info->a6xx;
770771
u32 fence_range_lower, fence_range_upper;
771772
u32 chipid, chipid_min = 0;
772773
int ret;
@@ -828,8 +829,10 @@ static int a6xx_gmu_fw_start(struct a6xx_gmu *gmu, unsigned int state)
828829
*/
829830
gmu_write(gmu, REG_A6XX_GMU_CM3_CFG, 0x4052);
830831

832+
if (a6xx_info->gmu_chipid) {
833+
chipid = a6xx_info->gmu_chipid;
831834
/* NOTE: A730 may also fall in this if-condition with a future GMU fw update. */
832-
if (adreno_is_a7xx(adreno_gpu) && !adreno_is_a730(adreno_gpu)) {
835+
} else if (adreno_is_a7xx(adreno_gpu) && !adreno_is_a730(adreno_gpu)) {
833836
/* A7xx GPUs have obfuscated chip IDs. Use constant maj = 7 */
834837
chipid = FIELD_PREP(GENMASK(31, 24), 0x7);
835838

@@ -1327,7 +1330,13 @@ static int a6xx_gmu_rpmh_arc_votes_init(struct device *dev, u32 *votes,
13271330
if (!pri_count)
13281331
return -EINVAL;
13291332

1330-
sec = cmd_db_read_aux_data("mx.lvl", &sec_count);
1333+
/*
1334+
* Some targets have a separate gfx mxc rail. So try to read that first and then fall back
1335+
* to regular mx rail if it is missing
1336+
*/
1337+
sec = cmd_db_read_aux_data("gmxc.lvl", &sec_count);
1338+
if (IS_ERR(sec) && sec != ERR_PTR(-EPROBE_DEFER))
1339+
sec = cmd_db_read_aux_data("mx.lvl", &sec_count);
13311340
if (IS_ERR(sec))
13321341
return PTR_ERR(sec);
13331342

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1029,7 +1029,7 @@ static int hw_init(struct msm_gpu *gpu)
10291029
gpu_write(gpu, REG_A6XX_UCHE_CLIENT_PF, BIT(7) | 0x1);
10301030

10311031
/* Set weights for bicubic filtering */
1032-
if (adreno_is_a650_family(adreno_gpu)) {
1032+
if (adreno_is_a650_family(adreno_gpu) || adreno_is_x185(adreno_gpu)) {
10331033
gpu_write(gpu, REG_A6XX_TPL1_BICUBIC_WEIGHTS_TABLE_0, 0);
10341034
gpu_write(gpu, REG_A6XX_TPL1_BICUBIC_WEIGHTS_TABLE_1,
10351035
0x3fe05ff4);

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ extern bool hang_debug;
2121
struct a6xx_info {
2222
const struct adreno_reglist *hwcg;
2323
const struct adreno_protect *protect;
24+
u32 gmu_chipid;
2425
};
2526

2627
struct a6xx_gpu {

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,11 @@ static inline int adreno_is_a750(struct adreno_gpu *gpu)
474474
return gpu->info->chip_ids[0] == 0x43051401;
475475
}
476476

477+
static inline int adreno_is_x185(struct adreno_gpu *gpu)
478+
{
479+
return gpu->info->chip_ids[0] == 0x43050c01;
480+
}
481+
477482
static inline int adreno_is_a740_family(struct adreno_gpu *gpu)
478483
{
479484
if (WARN_ON_ONCE(!gpu->info))

0 commit comments

Comments
 (0)