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

drm/amdgpu: Get package types for smuio v13.0

Add support to query package types supported in smuio v13.0 ASICs.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@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
b0a45533 4365d2ed

+22
+22
drivers/gpu/drm/amd/amdgpu/smuio_v13_0.c
··· 128 128 return data ? true : false; 129 129 } 130 130 131 + static enum amdgpu_pkg_type smuio_v13_0_get_pkg_type(struct amdgpu_device *adev) 132 + { 133 + enum amdgpu_pkg_type pkg_type; 134 + u32 data; 135 + 136 + data = RREG32_SOC15(SMUIO, 0, regSMUIO_MCM_CONFIG); 137 + data = REG_GET_FIELD(data, SMUIO_MCM_CONFIG, TOPOLOGY_ID); 138 + 139 + switch (data) { 140 + case 0x4: 141 + case 0xC: 142 + pkg_type = AMDGPU_PKG_TYPE_CEM; 143 + break; 144 + default: 145 + pkg_type = AMDGPU_PKG_TYPE_OAM; 146 + break; 147 + } 148 + 149 + return pkg_type; 150 + } 151 + 131 152 const struct amdgpu_smuio_funcs smuio_v13_0_funcs = { 132 153 .get_rom_index_offset = smuio_v13_0_get_rom_index_offset, 133 154 .get_rom_data_offset = smuio_v13_0_get_rom_data_offset, ··· 157 136 .is_host_gpu_xgmi_supported = smuio_v13_0_is_host_gpu_xgmi_supported, 158 137 .update_rom_clock_gating = smuio_v13_0_update_rom_clock_gating, 159 138 .get_clock_gating_state = smuio_v13_0_get_clock_gating_state, 139 + .get_pkg_type = smuio_v13_0_get_pkg_type, 160 140 };