Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdgpu: Add some XCC programming

Add additional XCC programming sequences.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Lijo Lazar and committed by
Alex Deucher
e6a02e2c 15091a6f

+26
+26
drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
··· 1150 1150 WREG32_SOC15(GC, xcc_id, regCPC_PSP_DEBUG, data); 1151 1151 } 1152 1152 1153 + static void gfx_v9_4_3_program_xcc_id(struct amdgpu_device *adev, int xcc_id) 1154 + { 1155 + uint32_t tmp = 0; 1156 + 1157 + switch (adev->gfx.num_xcd) { 1158 + /* directly config VIRTUAL_XCC_ID to 0 for 1-XCC */ 1159 + case 1: 1160 + WREG32_SOC15(GC, xcc_id, regCP_HYP_XCP_CTL, 0x8); 1161 + break; 1162 + case 2: 1163 + tmp = (xcc_id % adev->gfx.num_xcc_per_xcp) << REG_FIELD_SHIFT(CP_HYP_XCP_CTL, VIRTUAL_XCC_ID); 1164 + tmp = tmp | (adev->gfx.num_xcd << REG_FIELD_SHIFT(CP_HYP_XCP_CTL, NUM_XCC_IN_XCP)); 1165 + WREG32_SOC15(GC, xcc_id, regCP_HYP_XCP_CTL, tmp); 1166 + 1167 + tmp = xcc_id << REG_FIELD_SHIFT(CP_PSP_XCP_CTL, PHYSICAL_XCC_ID); 1168 + tmp = tmp | (xcc_id << REG_FIELD_SHIFT(CP_PSP_XCP_CTL, XCC_DIE_ID)); 1169 + WREG32_SOC15(GC, xcc_id, regCP_PSP_XCP_CTL, tmp); 1170 + break; 1171 + default: 1172 + break; 1173 + } 1174 + } 1175 + 1153 1176 static bool gfx_v9_4_3_is_rlc_enabled(struct amdgpu_device *adev) 1154 1177 { 1155 1178 uint32_t rlc_setting; ··· 1970 1947 if (r) 1971 1948 return r; 1972 1949 } 1950 + 1951 + /* set the virtual and physical id based on partition_mode */ 1952 + gfx_v9_4_3_program_xcc_id(adev, i); 1973 1953 1974 1954 r = gfx_v9_4_3_kiq_resume(adev, i); 1975 1955 if (r)