From 52c58461b7dd43a874f77344791be9c4e2a927f6 Mon Sep 17 00:00:00 2001 From: Deepak Kumar Date: Sun, 5 Jul 2020 12:08:08 +0530 Subject: [PATCH] msm: kgsl: Add support for A660 GPU variant Add A660 GPU variant support to deal with different settings of A660 GPU. Change-Id: I8dc4a5918777ca5ec2c6d14e5e26c603cd5e7390 Signed-off-by: Deepak Kumar --- drivers/gpu/msm/adreno-gpulist.h | 30 ++++++++++++++++++++++++++++++ drivers/gpu/msm/adreno.h | 8 ++++++++ drivers/gpu/msm/adreno_a6xx.c | 10 +++++++--- drivers/gpu/msm/kgsl_iommu.c | 1 + 4 files changed, 46 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/msm/adreno-gpulist.h b/drivers/gpu/msm/adreno-gpulist.h index fd58a9316bcb..6ee4b4c6fa95 100644 --- a/drivers/gpu/msm/adreno-gpulist.h +++ b/drivers/gpu/msm/adreno-gpulist.h @@ -1573,6 +1573,35 @@ static const struct adreno_a6xx_core adreno_gpu_core_a660 = { .pdc_in_aop = true, }; +static const struct adreno_a6xx_core adreno_gpu_core_a660_shima = { + .base = { + DEFINE_ADRENO_REV(ADRENO_REV_A660, 6, 6, 0, ANY_ID), + .compatible = "qcom,adreno-gpu-a660-shima", + .features = ADRENO_RPMH | ADRENO_GPMU | ADRENO_APRIV | + ADRENO_IOCOHERENT | ADRENO_CONTENT_PROTECTION, + .gpudev = &adreno_a6xx_gpudev, + .gmem_base = 0, + .gmem_size = SZ_1M + SZ_512K, + .bus_width = 32, + .snapshot_size = SZ_2M, + }, + .prim_fifo_threshold = 0x00300000, + .gmu_major = 2, + .gmu_minor = 0, + .sqefw_name = "a660_sqe.fw", + .gmufw_name = "a660_gmu.bin", + .zap_name = "a660_zap", + .hwcg = a660_hwcg_regs, + .hwcg_count = ARRAY_SIZE(a660_hwcg_regs), + .vbif = a650_gbif_regs, + .vbif_count = ARRAY_SIZE(a650_gbif_regs), + .hang_detect_cycles = 0x3ffff, + .protected_regs = a660_protected_regs, + .disable_tseskip = true, + .highest_bank_bit = 15, + .pdc_in_aop = true, +}; + static const struct adreno_gpu_core *adreno_gpulist[] = { &adreno_gpu_core_a306.base, &adreno_gpu_core_a306a.base, @@ -1606,4 +1635,5 @@ static const struct adreno_gpu_core *adreno_gpulist[] = { &adreno_gpu_core_a612.base, &adreno_gpu_core_a616.base, &adreno_gpu_core_a610.base, + &adreno_gpu_core_a660_shima.base, }; diff --git a/drivers/gpu/msm/adreno.h b/drivers/gpu/msm/adreno.h index 8e5229d7df51..7ee2dbc8e4d0 100644 --- a/drivers/gpu/msm/adreno.h +++ b/drivers/gpu/msm/adreno.h @@ -1067,6 +1067,14 @@ static inline int adreno_is_a660v1(struct adreno_device *adreno_dev) (ADRENO_CHIPID_PATCH(adreno_dev->chipid) == 0); } +static inline int adreno_is_a660_shima(struct adreno_device *adreno_dev) +{ + return (ADRENO_GPUREV(adreno_dev) == ADRENO_REV_A660) && + (adreno_dev->gpucore->compatible && + !strcmp(adreno_dev->gpucore->compatible, + "qcom,adreno-gpu-a660-shima")); +} + ADRENO_TARGET(a610, ADRENO_REV_A610) ADRENO_TARGET(a612, ADRENO_REV_A612) ADRENO_TARGET(a618, ADRENO_REV_A618) diff --git a/drivers/gpu/msm/adreno_a6xx.c b/drivers/gpu/msm/adreno_a6xx.c index 37ea5549fa32..499e5550c0ab 100644 --- a/drivers/gpu/msm/adreno_a6xx.c +++ b/drivers/gpu/msm/adreno_a6xx.c @@ -127,9 +127,13 @@ int a6xx_init(struct adreno_device *adreno_dev) adreno_dev->highest_bank_bit = a6xx_core->highest_bank_bit; /* If the memory type is DDR 4, override the existing configuration */ - if ((adreno_is_a650(adreno_dev) || adreno_is_a660(adreno_dev)) && - of_fdt_get_ddrtype() == 0x7) - adreno_dev->highest_bank_bit = 15; + if (of_fdt_get_ddrtype() == 0x7) { + if (adreno_is_a660_shima(adreno_dev)) + adreno_dev->highest_bank_bit = 14; + else if ((adreno_is_a650(adreno_dev) || + adreno_is_a660(adreno_dev))) + adreno_dev->highest_bank_bit = 15; + } a6xx_crashdump_init(adreno_dev); diff --git a/drivers/gpu/msm/kgsl_iommu.c b/drivers/gpu/msm/kgsl_iommu.c index e2f0855b8a2a..74486c07a22a 100644 --- a/drivers/gpu/msm/kgsl_iommu.c +++ b/drivers/gpu/msm/kgsl_iommu.c @@ -2505,6 +2505,7 @@ static const char * const kgsl_iommu_clocks[] = { "gcc_gpu_memnoc_gfx", "gcc_gpu_snoc_dvm_gfx", "gpu_cc_ahb", + "gpu_cc_hlos1_vote_gpu_smmu_clk", }; static struct kgsl_mmu_ops kgsl_iommu_ops;