Adreno A540 support
Subsystems (4)
v2 cover Adreno A540 support
Adreno driver support for the A540 found in the MSM8998 SoC
v2:
-Removed extra RBBM write
-Corrected added RBBM writes to allow for hwcg disable -Patch to add REG_A5XX_HLSQ_DBG_ECO_CNTL to envytools -Regenerated a5xx header file with updated envytools -Used REG_A5XX_HLSQ_DBG_ECO_CNTL in code -Stripped extranious magic number comment
Jeffrey Hugo (1):
drm/msm/adreno: Add A540 support
drivers/gpu/drm/msm/adreno/a5xx.xml.h | 28 ++++---- drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 21 ++++++ drivers/gpu/drm/msm/adreno/a5xx_power.c | 76 +++++++++++++++++++++- drivers/gpu/drm/msm/adreno/adreno_device.c | 18 +++++ drivers/gpu/drm/msm/adreno/adreno_gpu.h | 6 ++ 5 files changed, 133 insertions(+), 16 deletions(-)
Signature · 1 line
2.17.1
PATCH v2 1/2 a5xx: Define HLSQ_DBG_ECO_CNTL
--- rnndb/adreno/a5xx.xml | 1 + 1 file changed, 1 insertion(+)
rnndb/adreno/a5xx.xml +1 -0
@@ -1523,6 +1523,7 @@ xsi:schemaLocation="http://nouveau.freedesktop.org/ rules-ng.xsd"> <reg32 offset="0x0e00" name="HLSQ_TIMEOUT_THRESHOLD_0"/> <reg32 offset="0x0e01" name="HLSQ_TIMEOUT_THRESHOLD_1"/> + <reg32 offset="0x0e04" name="HLSQ_DBG_ECO_CNTL"/> <reg32 offset="0x0e05" name="HLSQ_ADDR_MODE_CNTL"/> <reg32 offset="0x0e06" name="HLSQ_MODE_CNTL"/> <!-- always 00000001? --> <reg32 offset="0x0e10" name="HLSQ_PERFCTR_HLSQ_SEL_0" type="a5xx_hlsq_perfcounter_select"/>
Signature · 1 line
2.17.1
Re: [PATCH v2 1/2] a5xx: Define HLSQ_DBG_ECO_CNTL
thanks, I've pushed this one to envytools tree
BR,
-R
Quoted 20 lines · Jeffrey Hugo
--- rnndb/adreno/a5xx.xml | 1 + 1 file changed, 1 insertion(+)rnndb/adreno/a5xx.xml +1
-1@@ -1523,6 +1523,7 @@ xsi:schemaLocation="http://nouveau.freedesktop.org/ rules-ng.xsd"> <reg32 offset="0x0e00" name="HLSQ_TIMEOUT_THRESHOLD_0"/> <reg32 offset="0x0e01" name="HLSQ_TIMEOUT_THRESHOLD_1"/> + <reg32 offset="0x0e04" name="HLSQ_DBG_ECO_CNTL"/> <reg32 offset="0x0e05" name="HLSQ_ADDR_MODE_CNTL"/> <reg32 offset="0x0e06" name="HLSQ_MODE_CNTL"/> <!-- always 00000001? --> <reg32 offset="0x0e10" name="HLSQ_PERFCTR_HLSQ_SEL_0" type="a5xx_hlsq_perfcounter_select"/> --2.17.1
PATCH v2 2/2 drm/msm/adreno: Add A540 support
In reply to Jeffrey HugoThe A540 is a derivative of the A530, and is found in the MSM8998 SoC.
Signed-off-by Jeffrey Hugo <[email protected]>
--- drivers/gpu/drm/msm/adreno/a5xx.xml.h | 28 ++++---- drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 21 ++++++ drivers/gpu/drm/msm/adreno/a5xx_power.c | 76 +++++++++++++++++++++- drivers/gpu/drm/msm/adreno/adreno_device.c | 18 +++++ drivers/gpu/drm/msm/adreno/adreno_gpu.h | 6 ++ 5 files changed, 133 insertions(+), 16 deletions(-)
drivers/gpu/drm/msm/adreno/a5xx.xml.h +15 -13
@@ -8,19 +8,19 @@ This file was generated by the rules-ng-ng headergen tool in this git repository git clone https://github.com/freedreno/envytools.git The rules-ng-ng source files this header was generated from are: -- /home/robclark/src/envytools/rnndb/adreno.xml ( 501 bytes, from 2018-07-03 19:37:13) -- /home/robclark/src/envytools/rnndb/freedreno_copyright.xml ( 1572 bytes, from 2018-07-03 19:37:13) -- /home/robclark/src/envytools/rnndb/adreno/a2xx.xml ( 42463 bytes, from 2018-11-19 13:44:03) -- /home/robclark/src/envytools/rnndb/adreno/adreno_common.xml ( 14201 bytes, from 2018-12-02 17:29:54) -- /home/robclark/src/envytools/rnndb/adreno/adreno_pm4.xml ( 43052 bytes, from 2018-12-02 17:29:54) -- /home/robclark/src/envytools/rnndb/adreno/a3xx.xml ( 83840 bytes, from 2018-07-03 19:37:13) -- /home/robclark/src/envytools/rnndb/adreno/a4xx.xml ( 112086 bytes, from 2018-07-03 19:37:13) -- /home/robclark/src/envytools/rnndb/adreno/a5xx.xml ( 147240 bytes, from 2018-12-02 17:29:54) -- /home/robclark/src/envytools/rnndb/adreno/a6xx.xml ( 140790 bytes, from 2018-12-02 17:29:54) -- /home/robclark/src/envytools/rnndb/adreno/a6xx_gmu.xml ( 10431 bytes, from 2018-09-14 13:03:07) -- /home/robclark/src/envytools/rnndb/adreno/ocmem.xml ( 1773 bytes, from 2018-07-03 19:37:13) - -Copyright (C) 2013-2018 by the following authors: +- /home/ubuntu/envytools/envytools/rnndb/./adreno.xml ( 501 bytes, from 2019-05-29 01:28:15) +- /home/ubuntu/envytools/envytools/rnndb/freedreno_copyright.xml ( 1572 bytes, from 2019-05-29 01:28:15) +- /home/ubuntu/envytools/envytools/rnndb/adreno/a2xx.xml ( 79608 bytes, from 2019-05-29 01:28:15) +- /home/ubuntu/envytools/envytools/rnndb/adreno/adreno_common.xml ( 14239 bytes, from 2019-05-29 01:28:15) +- /home/ubuntu/envytools/envytools/rnndb/adreno/adreno_pm4.xml ( 43155 bytes, from 2019-05-29 01:28:15) +- /home/ubuntu/envytools/envytools/rnndb/adreno/a3xx.xml ( 83840 bytes, from 2019-05-29 01:28:15) +- /home/ubuntu/envytools/envytools/rnndb/adreno/a4xx.xml ( 112086 bytes, from 2019-05-29 01:28:15) +- /home/ubuntu/envytools/envytools/rnndb/adreno/a5xx.xml ( 147291 bytes, from 2019-05-29 14:51:41) +- /home/ubuntu/envytools/envytools/rnndb/adreno/a6xx.xml ( 148461 bytes, from 2019-05-29 01:28:15) +- /home/ubuntu/envytools/envytools/rnndb/adreno/a6xx_gmu.xml ( 10431 bytes, from 2019-05-29 01:28:15) +- /home/ubuntu/envytools/envytools/rnndb/adreno/ocmem.xml ( 1773 bytes, from 2019-05-29 01:28:15) + +Copyright (C) 2013-2019 by the following authors: - Rob Clark <[email protected]> (robclark) - Ilia Mirkin <[email protected]> (imirkin)
@@ -2148,6 +2148,8 @@ static inline uint32_t A5XX_VSC_RESOLVE_CNTL_Y(uint32_t val)#define REG_A5XX_HLSQ_TIMEOUT_THRESHOLD_1 0x00000e01 +#define REG_A5XX_HLSQ_DBG_ECO_CNTL 0x00000e04 +#define REG_A5XX_HLSQ_ADDR_MODE_CNTL 0x00000e05#define REG_A5XX_HLSQ_MODE_CNTL 0x00000e06
drivers/gpu/drm/msm/adreno/a5xx_gpu.c +21 -0
@@ -318,12 +318,18 @@ static const struct {void a5xx_set_hwcg (struct msm_gpu *gpu,bool state) { +struct adreno_gpu *adreno_gpu =to_adreno_gpu (gpu);unsigned int i;for (i =0 ; i <ARRAY_SIZE (a5xx_hwcg); i++)gpu_write (gpu, a5xx_hwcg[i].offset, state ? a5xx_hwcg[i].value :0 ); +if (adreno_is_a540 (adreno_gpu)) { +gpu_write (gpu,REG_A5XX_RBBM_CLOCK_DELAY_GPMU , state ?0x00000770 :0 ); +gpu_write (gpu,REG_A5XX_RBBM_CLOCK_HYST_GPMU , state ?0x00000004 :0 ); + } +gpu_write (gpu,REG_A5XX_RBBM_CLOCK_CNTL , state ?0xAAA8AA00 :0 );gpu_write (gpu,REG_A5XX_RBBM_ISDB_CNT , state ?0x182 :0x180 ); }
@@ -507,6 +513,9 @@ static int a5xx_hw_init(struct msm_gpu *gpu)gpu_write (gpu,REG_A5XX_VBIF_ROUND_ROBIN_QOS_ARB ,0x00000003 ); +if (adreno_is_a540 (adreno_gpu)) +gpu_write (gpu,REG_A5XX_VBIF_GATE_OFF_WRREQ_EN ,0x00000009 ); +/* Make all blocks contribute to the GPU BUSY perf counter */ gpu_write (gpu,REG_A5XX_RBBM_PERFCTR_GPU_BUSY_MASKED ,0xFFFFFFFF );
@@ -592,6 +601,8 @@ static int a5xx_hw_init(struct msm_gpu *gpu)/* Set the highest bank bit */ gpu_write (gpu,REG_A5XX_TPL1_MODE_CNTL ,2 <<7 );gpu_write (gpu,REG_A5XX_RB_MODE_CNTL ,2 <<1 ); +if (adreno_is_a540 (adreno_gpu)) +gpu_write (gpu,REG_A5XX_UCHE_DBG_ECO_CNTL_2 ,2 );/* Protect registers from the CP */ gpu_write (gpu,REG_A5XX_CP_PROTECT_CNTL ,0x00000007 );
@@ -642,6 +653,16 @@ static int a5xx_hw_init(struct msm_gpu *gpu) REG_A5XX_RBBM_SECVID_TSB_TRUSTED_BASE_HI, 0x00000000);gpu_write (gpu,REG_A5XX_RBBM_SECVID_TSB_TRUSTED_SIZE ,0x00000000 ); +/* +* VPC corner case with local memory load kill leads to corrupt +* internal state. Normal Disable does not work for all a5x chips. +* So do the following setting to disable it. +*/ +if (adreno_gpu->info->quirks &ADRENO_QUIRK_LMLOADKILL_DISABLE ) { +gpu_rmw (gpu,REG_A5XX_VPC_DBG_ECO_CNTL ,0 ,BIT (23 )); +gpu_rmw (gpu,REG_A5XX_HLSQ_DBG_ECO_CNTL ,BIT (18 ),0 ); + } + ret =adreno_hw_init (gpu);if (ret)return ret;
drivers/gpu/drm/msm/adreno/a5xx_power.c +73 -3
121 lines not on this page · raw message
drivers/gpu/drm/msm/adreno/adreno_device.c +18 -0
@@ -144,6 +144,24 @@ static const struct adreno_info gpulist[] = { ADRENO_QUIRK_FAULT_DETECT_MASK, .init = a5xx_gpu_init, .zapfw = "a530_zap.mdt", + }, { + .rev = ADRENO_REV(5, 4, 0, 2), + .revn = 540, + .name = "A540", + .fw = { + [ADRENO_FW_PM4] = "a530_pm4.fw", + [ADRENO_FW_PFP] = "a530_pfp.fw", + [ADRENO_FW_GPMU] = "a540_gpmu.fw2", + }, + .gmem = SZ_1M, +/* +* Increase inactive period to 250 to avoid bouncing +* the GDSC which appears to make it grumpy +*/ + .inactive_period = 250, + .quirks = ADRENO_QUIRK_LMLOADKILL_DISABLE, + .init = a5xx_gpu_init, + .zapfw = "a540_zap.mdt", }, { .rev = ADRENO_REV(6, 3, 0, ANY_ID), .revn = 630,
drivers/gpu/drm/msm/adreno/adreno_gpu.h +6 -0
@@ -61,6 +61,7 @@ enum {enum adreno_quirks {ADRENO_QUIRK_TWO_PASS_USE_WFI =1 ,ADRENO_QUIRK_FAULT_DETECT_MASK =2 , +ADRENO_QUIRK_LMLOADKILL_DISABLE =3 , };struct adreno_rev {
@@ -221,6 +222,11 @@ static inline int adreno_is_a530(struct adreno_gpu *gpu)return gpu->revn ==530 ; } +static inline int adreno_is_a540 (struct adreno_gpu *gpu) +{ +return gpu->revn ==540 ; +} +int adreno_get_param (struct msm_gpu *gpu,uint32_t param,uint64_t *value);const struct firmware *adreno_request_fw (struct adreno_gpu *adreno_gpu,const char *fwname);
Signature · 6 lines
2.17.1 _______________________________________________ Freedreno mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/freedreno