aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorHuang Rui <ray.huang@amd.com>2017-12-05 05:48:48 -0500
committerAlex Deucher <alexander.deucher@amd.com>2018-05-15 14:43:35 -0400
commitcf671071334ebbf6c960f88383b35b99d5d53212 (patch)
treee601796fb438d6b9ce87fc313190efde14feac00 /drivers/gpu
parente0e93d03efa1c53012cc609fd48112df3e06da69 (diff)
drm/amdgpu: update psp gfx if header
Signed-off-by: Huang Rui <ray.huang@amd.com> Acked-by: Hawking Zhang <Hawking.Zhang@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Acked-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/psp_gfx_if.h67
1 files changed, 46 insertions, 21 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/psp_gfx_if.h b/drivers/gpu/drm/amd/amdgpu/psp_gfx_if.h
index 8da6da90b1c9..0cf48d26c676 100644
--- a/drivers/gpu/drm/amd/amdgpu/psp_gfx_if.h
+++ b/drivers/gpu/drm/amd/amdgpu/psp_gfx_if.h
@@ -40,11 +40,20 @@ enum psp_gfx_crtl_cmd_id
40 GFX_CTRL_CMD_ID_INIT_GPCOM_RING = 0x00020000, /* initialize GPCOM ring */ 40 GFX_CTRL_CMD_ID_INIT_GPCOM_RING = 0x00020000, /* initialize GPCOM ring */
41 GFX_CTRL_CMD_ID_DESTROY_RINGS = 0x00030000, /* destroy rings */ 41 GFX_CTRL_CMD_ID_DESTROY_RINGS = 0x00030000, /* destroy rings */
42 GFX_CTRL_CMD_ID_CAN_INIT_RINGS = 0x00040000, /* is it allowed to initialized the rings */ 42 GFX_CTRL_CMD_ID_CAN_INIT_RINGS = 0x00040000, /* is it allowed to initialized the rings */
43 GFX_CTRL_CMD_ID_ENABLE_INT = 0x00050000, /* enable PSP-to-Gfx interrupt */
44 GFX_CTRL_CMD_ID_DISABLE_INT = 0x00060000, /* disable PSP-to-Gfx interrupt */
45 GFX_CTRL_CMD_ID_MODE1_RST = 0x00070000, /* trigger the Mode 1 reset */
43 46
44 GFX_CTRL_CMD_ID_MAX = 0x000F0000, /* max command ID */ 47 GFX_CTRL_CMD_ID_MAX = 0x000F0000, /* max command ID */
45}; 48};
46 49
47 50
51/*-----------------------------------------------------------------------------
52 NOTE: All physical addresses used in this interface are actually
53 GPU Virtual Addresses.
54*/
55
56
48/* Control registers of the TEE Gfx interface. These are located in 57/* Control registers of the TEE Gfx interface. These are located in
49* SRBM-to-PSP mailbox registers (total 8 registers). 58* SRBM-to-PSP mailbox registers (total 8 registers).
50*/ 59*/
@@ -55,8 +64,8 @@ struct psp_gfx_ctrl
55 volatile uint32_t rbi_rptr; /* +8 Read pointer (index) of RBI ring */ 64 volatile uint32_t rbi_rptr; /* +8 Read pointer (index) of RBI ring */
56 volatile uint32_t gpcom_wptr; /* +12 Write pointer (index) of GPCOM ring */ 65 volatile uint32_t gpcom_wptr; /* +12 Write pointer (index) of GPCOM ring */
57 volatile uint32_t gpcom_rptr; /* +16 Read pointer (index) of GPCOM ring */ 66 volatile uint32_t gpcom_rptr; /* +16 Read pointer (index) of GPCOM ring */
58 volatile uint32_t ring_addr_lo; /* +20 bits [31:0] of physical address of ring buffer */ 67 volatile uint32_t ring_addr_lo; /* +20 bits [31:0] of GPU Virtual of ring buffer (VMID=0)*/
59 volatile uint32_t ring_addr_hi; /* +24 bits [63:32] of physical address of ring buffer */ 68 volatile uint32_t ring_addr_hi; /* +24 bits [63:32] of GPU Virtual of ring buffer (VMID=0) */
60 volatile uint32_t ring_buf_size; /* +28 Ring buffer size (in bytes) */ 69 volatile uint32_t ring_buf_size; /* +28 Ring buffer size (in bytes) */
61 70
62}; 71};
@@ -78,6 +87,8 @@ enum psp_gfx_cmd_id
78 GFX_CMD_ID_LOAD_ASD = 0x00000004, /* load ASD Driver */ 87 GFX_CMD_ID_LOAD_ASD = 0x00000004, /* load ASD Driver */
79 GFX_CMD_ID_SETUP_TMR = 0x00000005, /* setup TMR region */ 88 GFX_CMD_ID_SETUP_TMR = 0x00000005, /* setup TMR region */
80 GFX_CMD_ID_LOAD_IP_FW = 0x00000006, /* load HW IP FW */ 89 GFX_CMD_ID_LOAD_IP_FW = 0x00000006, /* load HW IP FW */
90 GFX_CMD_ID_DESTROY_TMR = 0x00000007, /* destroy TMR region */
91 GFX_CMD_ID_SAVE_RESTORE = 0x00000008, /* save/restore HW IP FW */
81 92
82}; 93};
83 94
@@ -85,11 +96,11 @@ enum psp_gfx_cmd_id
85/* Command to load Trusted Application binary into PSP OS. */ 96/* Command to load Trusted Application binary into PSP OS. */
86struct psp_gfx_cmd_load_ta 97struct psp_gfx_cmd_load_ta
87{ 98{
88 uint32_t app_phy_addr_lo; /* bits [31:0] of the physical address of the TA binary (must be 4 KB aligned) */ 99 uint32_t app_phy_addr_lo; /* bits [31:0] of the GPU Virtual address of the TA binary (must be 4 KB aligned) */
89 uint32_t app_phy_addr_hi; /* bits [63:32] of the physical address of the TA binary */ 100 uint32_t app_phy_addr_hi; /* bits [63:32] of the GPU Virtual address of the TA binary */
90 uint32_t app_len; /* length of the TA binary in bytes */ 101 uint32_t app_len; /* length of the TA binary in bytes */
91 uint32_t cmd_buf_phy_addr_lo; /* bits [31:0] of the physical address of CMD buffer (must be 4 KB aligned) */ 102 uint32_t cmd_buf_phy_addr_lo; /* bits [31:0] of the GPU Virtual address of CMD buffer (must be 4 KB aligned) */
92 uint32_t cmd_buf_phy_addr_hi; /* bits [63:32] of the physical address of CMD buffer */ 103 uint32_t cmd_buf_phy_addr_hi; /* bits [63:32] of the GPU Virtual address of CMD buffer */
93 uint32_t cmd_buf_len; /* length of the CMD buffer in bytes; must be multiple of 4 KB */ 104 uint32_t cmd_buf_len; /* length of the CMD buffer in bytes; must be multiple of 4 KB */
94 105
95 /* Note: CmdBufLen can be set to 0. In this case no persistent CMD buffer is provided 106 /* Note: CmdBufLen can be set to 0. In this case no persistent CMD buffer is provided
@@ -111,8 +122,8 @@ struct psp_gfx_cmd_unload_ta
111*/ 122*/
112struct psp_gfx_buf_desc 123struct psp_gfx_buf_desc
113{ 124{
114 uint32_t buf_phy_addr_lo; /* bits [31:0] of physical address of the buffer (must be 4 KB aligned) */ 125 uint32_t buf_phy_addr_lo; /* bits [31:0] of GPU Virtual address of the buffer (must be 4 KB aligned) */
115 uint32_t buf_phy_addr_hi; /* bits [63:32] of physical address of the buffer */ 126 uint32_t buf_phy_addr_hi; /* bits [63:32] of GPU Virtual address of the buffer */
116 uint32_t buf_size; /* buffer size in bytes (must be multiple of 4 KB and no bigger than 64 MB) */ 127 uint32_t buf_size; /* buffer size in bytes (must be multiple of 4 KB and no bigger than 64 MB) */
117 128
118}; 129};
@@ -145,8 +156,8 @@ struct psp_gfx_cmd_invoke_cmd
145/* Command to setup TMR region. */ 156/* Command to setup TMR region. */
146struct psp_gfx_cmd_setup_tmr 157struct psp_gfx_cmd_setup_tmr
147{ 158{
148 uint32_t buf_phy_addr_lo; /* bits [31:0] of physical address of TMR buffer (must be 4 KB aligned) */ 159 uint32_t buf_phy_addr_lo; /* bits [31:0] of GPU Virtual address of TMR buffer (must be 4 KB aligned) */
149 uint32_t buf_phy_addr_hi; /* bits [63:32] of physical address of TMR buffer */ 160 uint32_t buf_phy_addr_hi; /* bits [63:32] of GPU Virtual address of TMR buffer */
150 uint32_t buf_size; /* buffer size in bytes (must be multiple of 4 KB) */ 161 uint32_t buf_size; /* buffer size in bytes (must be multiple of 4 KB) */
151 162
152}; 163};
@@ -174,18 +185,32 @@ enum psp_gfx_fw_type
174 GFX_FW_TYPE_ISP = 16, 185 GFX_FW_TYPE_ISP = 16,
175 GFX_FW_TYPE_ACP = 17, 186 GFX_FW_TYPE_ACP = 17,
176 GFX_FW_TYPE_SMU = 18, 187 GFX_FW_TYPE_SMU = 18,
188 GFX_FW_TYPE_MMSCH = 19,
189 GFX_FW_TYPE_RLC_RESTORE_LIST_GPM_MEM = 20,
190 GFX_FW_TYPE_RLC_RESTORE_LIST_SRM_MEM = 21,
191 GFX_FW_TYPE_RLC_RESTORE_LIST_CNTL = 22,
192 GFX_FW_TYPE_MAX = 23
177}; 193};
178 194
179/* Command to load HW IP FW. */ 195/* Command to load HW IP FW. */
180struct psp_gfx_cmd_load_ip_fw 196struct psp_gfx_cmd_load_ip_fw
181{ 197{
182 uint32_t fw_phy_addr_lo; /* bits [31:0] of physical address of FW location (must be 4 KB aligned) */ 198 uint32_t fw_phy_addr_lo; /* bits [31:0] of GPU Virtual address of FW location (must be 4 KB aligned) */
183 uint32_t fw_phy_addr_hi; /* bits [63:32] of physical address of FW location */ 199 uint32_t fw_phy_addr_hi; /* bits [63:32] of GPU Virtual address of FW location */
184 uint32_t fw_size; /* FW buffer size in bytes */ 200 uint32_t fw_size; /* FW buffer size in bytes */
185 enum psp_gfx_fw_type fw_type; /* FW type */ 201 enum psp_gfx_fw_type fw_type; /* FW type */
186 202
187}; 203};
188 204
205/* Command to save/restore HW IP FW. */
206struct psp_gfx_cmd_save_restore_ip_fw
207{
208 uint32_t save_fw; /* if set, command is used for saving fw otherwise for resetoring*/
209 uint32_t save_restore_addr_lo; /* bits [31:0] of FB address of GART memory used as save/restore buffer (must be 4 KB aligned) */
210 uint32_t save_restore_addr_hi; /* bits [63:32] of FB address of GART memory used as save/restore buffer */
211 uint32_t buf_size; /* Size of the save/restore buffer in bytes */
212 enum psp_gfx_fw_type fw_type; /* FW type */
213};
189 214
190/* All GFX ring buffer commands. */ 215/* All GFX ring buffer commands. */
191union psp_gfx_commands 216union psp_gfx_commands
@@ -195,7 +220,7 @@ union psp_gfx_commands
195 struct psp_gfx_cmd_invoke_cmd cmd_invoke_cmd; 220 struct psp_gfx_cmd_invoke_cmd cmd_invoke_cmd;
196 struct psp_gfx_cmd_setup_tmr cmd_setup_tmr; 221 struct psp_gfx_cmd_setup_tmr cmd_setup_tmr;
197 struct psp_gfx_cmd_load_ip_fw cmd_load_ip_fw; 222 struct psp_gfx_cmd_load_ip_fw cmd_load_ip_fw;
198 223 struct psp_gfx_cmd_save_restore_ip_fw cmd_save_restore_ip_fw;
199}; 224};
200 225
201 226
@@ -226,8 +251,8 @@ struct psp_gfx_cmd_resp
226 251
227 /* These fields are used for RBI only. They are all 0 in GPCOM commands 252 /* These fields are used for RBI only. They are all 0 in GPCOM commands
228 */ 253 */
229 uint32_t resp_buf_addr_lo; /* +12 bits [31:0] of physical address of response buffer (must be 4 KB aligned) */ 254 uint32_t resp_buf_addr_lo; /* +12 bits [31:0] of GPU Virtual address of response buffer (must be 4 KB aligned) */
230 uint32_t resp_buf_addr_hi; /* +16 bits [63:32] of physical address of response buffer */ 255 uint32_t resp_buf_addr_hi; /* +16 bits [63:32] of GPU Virtual address of response buffer */
231 uint32_t resp_offset; /* +20 offset within response buffer */ 256 uint32_t resp_offset; /* +20 offset within response buffer */
232 uint32_t resp_buf_size; /* +24 total size of the response buffer in bytes */ 257 uint32_t resp_buf_size; /* +24 total size of the response buffer in bytes */
233 258
@@ -251,19 +276,19 @@ struct psp_gfx_cmd_resp
251/* Structure of the Ring Buffer Frame */ 276/* Structure of the Ring Buffer Frame */
252struct psp_gfx_rb_frame 277struct psp_gfx_rb_frame
253{ 278{
254 uint32_t cmd_buf_addr_lo; /* +0 bits [31:0] of physical address of command buffer (must be 4 KB aligned) */ 279 uint32_t cmd_buf_addr_lo; /* +0 bits [31:0] of GPU Virtual address of command buffer (must be 4 KB aligned) */
255 uint32_t cmd_buf_addr_hi; /* +4 bits [63:32] of physical address of command buffer */ 280 uint32_t cmd_buf_addr_hi; /* +4 bits [63:32] of GPU Virtual address of command buffer */
256 uint32_t cmd_buf_size; /* +8 command buffer size in bytes */ 281 uint32_t cmd_buf_size; /* +8 command buffer size in bytes */
257 uint32_t fence_addr_lo; /* +12 bits [31:0] of physical address of Fence for this frame */ 282 uint32_t fence_addr_lo; /* +12 bits [31:0] of GPU Virtual address of Fence for this frame */
258 uint32_t fence_addr_hi; /* +16 bits [63:32] of physical address of Fence for this frame */ 283 uint32_t fence_addr_hi; /* +16 bits [63:32] of GPU Virtual address of Fence for this frame */
259 uint32_t fence_value; /* +20 Fence value */ 284 uint32_t fence_value; /* +20 Fence value */
260 uint32_t sid_lo; /* +24 bits [31:0] of SID value (used only for RBI frames) */ 285 uint32_t sid_lo; /* +24 bits [31:0] of SID value (used only for RBI frames) */
261 uint32_t sid_hi; /* +28 bits [63:32] of SID value (used only for RBI frames) */ 286 uint32_t sid_hi; /* +28 bits [63:32] of SID value (used only for RBI frames) */
262 uint8_t vmid; /* +32 VMID value used for mapping of all addresses for this frame */ 287 uint8_t vmid; /* +32 VMID value used for mapping of all addresses for this frame */
263 uint8_t frame_type; /* +33 1: destory context frame, 0: all other frames; used only for RBI frames */ 288 uint8_t frame_type; /* +33 1: destory context frame, 0: all other frames; used only for RBI frames */
264 uint8_t reserved1[2]; /* +34 reserved, must be 0 */ 289 uint8_t reserved1[2]; /* +34 reserved, must be 0 */
265 uint32_t reserved2[7]; /* +40 reserved, must be 0 */ 290 uint32_t reserved2[7]; /* +36 reserved, must be 0 */
266 /* total 64 bytes */ 291 /* total 64 bytes */
267}; 292};
268 293
269#endif /* _PSP_TEE_GFX_IF_H_ */ 294#endif /* _PSP_TEE_GFX_IF_H_ */