amdgpu_vf_error.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * Copyright 2017 Advanced Micro Devices, Inc.
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a
  5. * copy of this software and associated documentation files (the "Software"),
  6. * to deal in the Software without restriction, including without limitation
  7. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8. * and/or sell copies of the Software, and to permit persons to whom the
  9. * Software is furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be included in
  12. * all copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  17. * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
  18. * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  19. * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  20. * OTHER DEALINGS IN THE SOFTWARE.
  21. *
  22. */
  23. #ifndef __VF_ERROR_H__
  24. #define __VF_ERROR_H__
  25. #define AMDGIM_ERROR_CODE_FLAGS_TO_MAILBOX(c,f) (((c & 0xFFFF) << 16) | (f & 0xFFFF))
  26. #define AMDGIM_ERROR_CODE(t,c) (((t&0xF)<<12)|(c&0xFFF))
  27. /* Please keep enum same as AMD GIM driver */
  28. enum AMDGIM_ERROR_VF {
  29. AMDGIM_ERROR_VF_ATOMBIOS_INIT_FAIL = 0,
  30. AMDGIM_ERROR_VF_NO_VBIOS,
  31. AMDGIM_ERROR_VF_GPU_POST_ERROR,
  32. AMDGIM_ERROR_VF_ATOMBIOS_GET_CLOCK_FAIL,
  33. AMDGIM_ERROR_VF_FENCE_INIT_FAIL,
  34. AMDGIM_ERROR_VF_AMDGPU_INIT_FAIL,
  35. AMDGIM_ERROR_VF_IB_INIT_FAIL,
  36. AMDGIM_ERROR_VF_AMDGPU_LATE_INIT_FAIL,
  37. AMDGIM_ERROR_VF_ASIC_RESUME_FAIL,
  38. AMDGIM_ERROR_VF_GPU_RESET_FAIL,
  39. AMDGIM_ERROR_VF_TEST,
  40. AMDGIM_ERROR_VF_MAX
  41. };
  42. enum AMDGIM_ERROR_CATEGORY {
  43. AMDGIM_ERROR_CATEGORY_NON_USED = 0,
  44. AMDGIM_ERROR_CATEGORY_GIM,
  45. AMDGIM_ERROR_CATEGORY_PF,
  46. AMDGIM_ERROR_CATEGORY_VF,
  47. AMDGIM_ERROR_CATEGORY_VBIOS,
  48. AMDGIM_ERROR_CATEGORY_MONITOR,
  49. AMDGIM_ERROR_CATEGORY_MAX
  50. };
  51. void amdgpu_vf_error_put(struct amdgpu_device *adev,
  52. uint16_t sub_error_code,
  53. uint16_t error_flags,
  54. uint64_t error_data);
  55. void amdgpu_vf_error_trans_all (struct amdgpu_device *adev);
  56. #endif /* __VF_ERROR_H__ */