1ab71ac56SXiangliang Yu /* 2ab71ac56SXiangliang Yu * Copyright 2017 Advanced Micro Devices, Inc. 3ab71ac56SXiangliang Yu * 4ab71ac56SXiangliang Yu * Permission is hereby granted, free of charge, to any person obtaining a 5ab71ac56SXiangliang Yu * copy of this software and associated documentation files (the "Software"), 6ab71ac56SXiangliang Yu * to deal in the Software without restriction, including without limitation 7ab71ac56SXiangliang Yu * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8ab71ac56SXiangliang Yu * and/or sell copies of the Software, and to permit persons to whom the 9ab71ac56SXiangliang Yu * Software is furnished to do so, subject to the following conditions: 10ab71ac56SXiangliang Yu * 11ab71ac56SXiangliang Yu * The above copyright notice and this permission notice shall be included in 12ab71ac56SXiangliang Yu * all copies or substantial portions of the Software. 13ab71ac56SXiangliang Yu * 14ab71ac56SXiangliang Yu * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15ab71ac56SXiangliang Yu * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16ab71ac56SXiangliang Yu * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17ab71ac56SXiangliang Yu * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR 18ab71ac56SXiangliang Yu * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 19ab71ac56SXiangliang Yu * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 20ab71ac56SXiangliang Yu * OTHER DEALINGS IN THE SOFTWARE. 21ab71ac56SXiangliang Yu */ 22ab71ac56SXiangliang Yu 23ab71ac56SXiangliang Yu #ifndef __MXGPU_VI_H__ 24ab71ac56SXiangliang Yu #define __MXGPU_VI_H__ 25ab71ac56SXiangliang Yu 266e132ca0SHorace Chen #define VI_MAILBOX_TIMEDOUT 12000 27ab71ac56SXiangliang Yu #define VI_MAILBOX_RESET_TIME 12 28ab71ac56SXiangliang Yu 29ab71ac56SXiangliang Yu /* VI mailbox messages request */ 30ab71ac56SXiangliang Yu enum idh_request { 31ab71ac56SXiangliang Yu IDH_REQ_GPU_INIT_ACCESS = 1, 32ab71ac56SXiangliang Yu IDH_REL_GPU_INIT_ACCESS, 33ab71ac56SXiangliang Yu IDH_REQ_GPU_FINI_ACCESS, 34ab71ac56SXiangliang Yu IDH_REL_GPU_FINI_ACCESS, 3589041940SGavin Wan IDH_REQ_GPU_RESET_ACCESS, 3689041940SGavin Wan 3789041940SGavin Wan IDH_LOG_VF_ERROR = 200, 38ab71ac56SXiangliang Yu }; 39ab71ac56SXiangliang Yu 40ab71ac56SXiangliang Yu /* VI mailbox messages data */ 41ab71ac56SXiangliang Yu enum idh_event { 42ab71ac56SXiangliang Yu IDH_CLR_MSG_BUF = 0, 43ab71ac56SXiangliang Yu IDH_READY_TO_ACCESS_GPU, 44ab71ac56SXiangliang Yu IDH_FLR_NOTIFICATION, 45ab71ac56SXiangliang Yu IDH_FLR_NOTIFICATION_CMPL, 46*4d130238SMonk Liu 47*4d130238SMonk Liu IDH_TEXT_MESSAGE = 255 48ab71ac56SXiangliang Yu }; 49ab71ac56SXiangliang Yu 50ab71ac56SXiangliang Yu extern const struct amdgpu_virt_ops xgpu_vi_virt_ops; 51ab71ac56SXiangliang Yu 52ab71ac56SXiangliang Yu void xgpu_vi_init_golden_registers(struct amdgpu_device *adev); 53ab71ac56SXiangliang Yu void xgpu_vi_mailbox_set_irq_funcs(struct amdgpu_device *adev); 54ab71ac56SXiangliang Yu int xgpu_vi_mailbox_add_irq_id(struct amdgpu_device *adev); 55ab71ac56SXiangliang Yu int xgpu_vi_mailbox_get_irq(struct amdgpu_device *adev); 56ab71ac56SXiangliang Yu void xgpu_vi_mailbox_put_irq(struct amdgpu_device *adev); 57ab71ac56SXiangliang Yu 58ab71ac56SXiangliang Yu #endif 59