0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024 #ifndef __MXGPU_AI_H__
0025 #define __MXGPU_AI_H__
0026
0027 #define AI_MAILBOX_POLL_ACK_TIMEDOUT 500
0028 #define AI_MAILBOX_POLL_MSG_TIMEDOUT 6000
0029 #define AI_MAILBOX_POLL_FLR_TIMEDOUT 10000
0030 #define AI_MAILBOX_POLL_MSG_REP_MAX 11
0031
0032 enum idh_request {
0033 IDH_REQ_GPU_INIT_ACCESS = 1,
0034 IDH_REL_GPU_INIT_ACCESS,
0035 IDH_REQ_GPU_FINI_ACCESS,
0036 IDH_REL_GPU_FINI_ACCESS,
0037 IDH_REQ_GPU_RESET_ACCESS,
0038 IDH_REQ_GPU_INIT_DATA,
0039
0040 IDH_LOG_VF_ERROR = 200,
0041 IDH_READY_TO_RESET = 201,
0042 };
0043
0044 enum idh_event {
0045 IDH_CLR_MSG_BUF = 0,
0046 IDH_READY_TO_ACCESS_GPU,
0047 IDH_FLR_NOTIFICATION,
0048 IDH_FLR_NOTIFICATION_CMPL,
0049 IDH_SUCCESS,
0050 IDH_FAIL,
0051 IDH_QUERY_ALIVE,
0052 IDH_REQ_GPU_INIT_DATA_READY,
0053
0054 IDH_TEXT_MESSAGE = 255,
0055 };
0056
0057 extern const struct amdgpu_virt_ops xgpu_ai_virt_ops;
0058
0059 void xgpu_ai_mailbox_set_irq_funcs(struct amdgpu_device *adev);
0060 int xgpu_ai_mailbox_add_irq_id(struct amdgpu_device *adev);
0061 int xgpu_ai_mailbox_get_irq(struct amdgpu_device *adev);
0062 void xgpu_ai_mailbox_put_irq(struct amdgpu_device *adev);
0063
0064 #define AI_MAIBOX_CONTROL_TRN_OFFSET_BYTE SOC15_REG_OFFSET(NBIO, 0, mmBIF_BX_PF0_MAILBOX_CONTROL) * 4
0065 #define AI_MAIBOX_CONTROL_RCV_OFFSET_BYTE SOC15_REG_OFFSET(NBIO, 0, mmBIF_BX_PF0_MAILBOX_CONTROL) * 4 + 1
0066
0067 #endif