diff options
author | Shaoyun Liu <Shaoyun.Liu@amd.com> | 2018-06-27 17:24:46 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-09-10 23:47:35 -0400 |
commit | 6449724058c66408df599cd0b97d9df531137a08 (patch) | |
tree | 089aaea90ab89b95ed12602c5c98ea4822ad1ca4 | |
parent | 6fdd68b14a943ead1d0ce1c0c7023cd2dbfde4c2 (diff) |
drm/amdgpu : Add psp function interfaces for XGMI support
Place holder for XGMI support
Signed-off-by: Shaoyun Liu <Shaoyun.Liu@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h index 981887c928b7..8b8720e9c3f0 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h | |||
@@ -35,6 +35,7 @@ | |||
35 | #define PSP_TMR_SIZE 0x400000 | 35 | #define PSP_TMR_SIZE 0x400000 |
36 | 36 | ||
37 | struct psp_context; | 37 | struct psp_context; |
38 | struct psp_xgmi_topology_info; | ||
38 | 39 | ||
39 | enum psp_ring_type | 40 | enum psp_ring_type |
40 | { | 41 | { |
@@ -79,6 +80,12 @@ struct psp_funcs | |||
79 | enum AMDGPU_UCODE_ID ucode_type); | 80 | enum AMDGPU_UCODE_ID ucode_type); |
80 | bool (*smu_reload_quirk)(struct psp_context *psp); | 81 | bool (*smu_reload_quirk)(struct psp_context *psp); |
81 | int (*mode1_reset)(struct psp_context *psp); | 82 | int (*mode1_reset)(struct psp_context *psp); |
83 | uint64_t (*xgmi_get_device_id)(struct psp_context *psp); | ||
84 | uint64_t (*xgmi_get_hive_id)(struct psp_context *psp); | ||
85 | int (*xgmi_get_topology_info)(struct psp_context *psp, int number_devices, | ||
86 | struct psp_xgmi_topology_info *topology); | ||
87 | int (*xgmi_set_topology_info)(struct psp_context *psp, int number_devices, | ||
88 | struct psp_xgmi_topology_info *topology); | ||
82 | }; | 89 | }; |
83 | 90 | ||
84 | struct psp_context | 91 | struct psp_context |
@@ -134,6 +141,23 @@ struct amdgpu_psp_funcs { | |||
134 | enum AMDGPU_UCODE_ID); | 141 | enum AMDGPU_UCODE_ID); |
135 | }; | 142 | }; |
136 | 143 | ||
144 | struct psp_xgmi_topology_info { | ||
145 | /* Generated by PSP to identify the GPU instance within xgmi connection */ | ||
146 | uint64_t device_id; | ||
147 | /* | ||
148 | * If all bits set to 0 , driver indicates it wants to retrieve the xgmi | ||
149 | * connection vector topology, but not access enable the connections | ||
150 | * if some or all bits are set to 1, driver indicates it want to retrieve the | ||
151 | * current xgmi topology and access enable the link to GPU[i] associated | ||
152 | * with the bit position in the vector. | ||
153 | * On return,: bits indicated which xgmi links are present/active depending | ||
154 | * on the value passed in. The relative bit offset for the relative GPU index | ||
155 | * within the hive is always marked active. | ||
156 | */ | ||
157 | uint32_t connection_mask; | ||
158 | uint32_t reserved; /* must be 0 */ | ||
159 | }; | ||
160 | |||
137 | #define psp_prep_cmd_buf(ucode, type) (psp)->funcs->prep_cmd_buf((ucode), (type)) | 161 | #define psp_prep_cmd_buf(ucode, type) (psp)->funcs->prep_cmd_buf((ucode), (type)) |
138 | #define psp_ring_init(psp, type) (psp)->funcs->ring_init((psp), (type)) | 162 | #define psp_ring_init(psp, type) (psp)->funcs->ring_init((psp), (type)) |
139 | #define psp_ring_create(psp, type) (psp)->funcs->ring_create((psp), (type)) | 163 | #define psp_ring_create(psp, type) (psp)->funcs->ring_create((psp), (type)) |
@@ -153,6 +177,16 @@ struct amdgpu_psp_funcs { | |||
153 | ((psp)->funcs->smu_reload_quirk ? (psp)->funcs->smu_reload_quirk((psp)) : false) | 177 | ((psp)->funcs->smu_reload_quirk ? (psp)->funcs->smu_reload_quirk((psp)) : false) |
154 | #define psp_mode1_reset(psp) \ | 178 | #define psp_mode1_reset(psp) \ |
155 | ((psp)->funcs->mode1_reset ? (psp)->funcs->mode1_reset((psp)) : false) | 179 | ((psp)->funcs->mode1_reset ? (psp)->funcs->mode1_reset((psp)) : false) |
180 | #define psp_xgmi_get_device_id(psp) \ | ||
181 | ((psp)->funcs->xgmi_get_device_id ? (psp)->funcs->xgmi_get_device_id((psp)) : 0) | ||
182 | #define psp_xgmi_get_hive_id(psp) \ | ||
183 | ((psp)->funcs->xgmi_get_hive_id ? (psp)->funcs->xgmi_get_hive_id((psp)) : 0) | ||
184 | #define psp_xgmi_get_topology_info(psp, num_device, topology) \ | ||
185 | ((psp)->funcs->xgmi_get_topology_info ? \ | ||
186 | (psp)->funcs->xgmi_get_topology_info((psp), (num_device), (topology)) : -EINVAL) | ||
187 | #define psp_xgmi_set_topology_info(psp, num_device, topology) \ | ||
188 | ((psp)->funcs->xgmi_set_topology_info ? \ | ||
189 | (psp)->funcs->xgmi_set_topology_info((psp), (num_device), (topology)) : -EINVAL) | ||
156 | 190 | ||
157 | #define amdgpu_psp_check_fw_loading_status(adev, i) (adev)->firmware.funcs->check_fw_loading_status((adev), (i)) | 191 | #define amdgpu_psp_check_fw_loading_status(adev, i) (adev)->firmware.funcs->check_fw_loading_status((adev), (i)) |
158 | 192 | ||