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

drm/amdgpu: implement smuio callback to query socket id

get_socket_id is used to query socket id

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: John Clements <John.Clements@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Hawking Zhang and committed by
Alex Deucher
dfdd4b8a ec0f72cb

+19
+1
drivers/gpu/drm/amd/amdgpu/amdgpu_smuio.h
··· 29 29 void (*update_rom_clock_gating)(struct amdgpu_device *adev, bool enable); 30 30 void (*get_clock_gating_state)(struct amdgpu_device *adev, u32 *flags); 31 31 u32 (*get_die_id)(struct amdgpu_device *adev); 32 + u32 (*get_socket_id)(struct amdgpu_device *adev); 32 33 bool (*is_host_gpu_xgmi_supported)(struct amdgpu_device *adev); 33 34 }; 34 35
+18
drivers/gpu/drm/amd/amdgpu/smuio_v13_0.c
··· 89 89 } 90 90 91 91 /** 92 + * smuio_v13_0_get_socket_id - query socket id from FCH 93 + * 94 + * @adev: amdgpu device pointer 95 + * 96 + * Returns socket id 97 + */ 98 + static u32 smuio_v13_0_get_socket_id(struct amdgpu_device *adev) 99 + { 100 + u32 data, socket_id; 101 + 102 + data = RREG32_SOC15(SMUIO, 0, regSMUIO_MCM_CONFIG); 103 + socket_id = REG_GET_FIELD(data, SMUIO_MCM_CONFIG, SOCKET_ID); 104 + 105 + return socket_id; 106 + } 107 + 108 + /** 92 109 * smuio_v13_0_supports_host_gpu_xgmi - detect xgmi interface between cpu and gpu/s. 93 110 * 94 111 * @adev: amdgpu device pointer ··· 132 115 .get_rom_index_offset = smuio_v13_0_get_rom_index_offset, 133 116 .get_rom_data_offset = smuio_v13_0_get_rom_data_offset, 134 117 .get_die_id = smuio_v13_0_get_die_id, 118 + .get_socket_id = smuio_v13_0_get_socket_id, 135 119 .is_host_gpu_xgmi_supported = smuio_v13_0_is_host_gpu_xgmi_supported, 136 120 .update_rom_clock_gating = smuio_v13_0_update_rom_clock_gating, 137 121 .get_clock_gating_state = smuio_v13_0_get_clock_gating_state,