dal_asic_id.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. /*
  2. * Copyright 2012-15 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. * Authors: AMD
  23. *
  24. */
  25. #ifndef __DAL_ASIC_ID_H__
  26. #define __DAL_ASIC_ID_H__
  27. /*
  28. * ASIC internal revision ID
  29. */
  30. /* DCE80 (based on ci_id.h in Perforce) */
  31. #define CI_BONAIRE_M_A0 0x14
  32. #define CI_BONAIRE_M_A1 0x15
  33. #define CI_HAWAII_P_A0 0x28
  34. #define CI_UNKNOWN 0xFF
  35. #define ASIC_REV_IS_BONAIRE_M(rev) \
  36. ((rev >= CI_BONAIRE_M_A0) && (rev < CI_HAWAII_P_A0))
  37. #define ASIC_REV_IS_HAWAII_P(rev) \
  38. (rev >= CI_HAWAII_P_A0)
  39. /* KV1 with Spectre GFX core, 8-8-1-2 (CU-Pix-Primitive-RB) */
  40. #define KV_SPECTRE_A0 0x01
  41. /* KV2 with Spooky GFX core, including downgraded from Spectre core,
  42. * 3-4-1-1 (CU-Pix-Primitive-RB) */
  43. #define KV_SPOOKY_A0 0x41
  44. /* KB with Kalindi GFX core, 2-4-1-1 (CU-Pix-Primitive-RB) */
  45. #define KB_KALINDI_A0 0x81
  46. /* KB with Kalindi GFX core, 2-4-1-1 (CU-Pix-Primitive-RB) */
  47. #define KB_KALINDI_A1 0x82
  48. /* BV with Kalindi GFX core, 2-4-1-1 (CU-Pix-Primitive-RB) */
  49. #define BV_KALINDI_A2 0x85
  50. /* ML with Godavari GFX core, 2-4-1-1 (CU-Pix-Primitive-RB) */
  51. #define ML_GODAVARI_A0 0xA1
  52. /* ML with Godavari GFX core, 2-4-1-1 (CU-Pix-Primitive-RB) */
  53. #define ML_GODAVARI_A1 0xA2
  54. #define KV_UNKNOWN 0xFF
  55. #define ASIC_REV_IS_KALINDI(rev) \
  56. ((rev >= KB_KALINDI_A0) && (rev < KV_UNKNOWN))
  57. #define ASIC_REV_IS_BHAVANI(rev) \
  58. ((rev >= BV_KALINDI_A2) && (rev < ML_GODAVARI_A0))
  59. #define ASIC_REV_IS_GODAVARI(rev) \
  60. ((rev >= ML_GODAVARI_A0) && (rev < KV_UNKNOWN))
  61. /* VI Family */
  62. /* DCE10 */
  63. #define VI_TONGA_P_A0 20
  64. #define VI_TONGA_P_A1 21
  65. #define VI_FIJI_P_A0 60
  66. /* DCE112 */
  67. #define VI_POLARIS10_P_A0 80
  68. #define VI_POLARIS11_M_A0 90
  69. #define VI_POLARIS12_V_A0 100
  70. #define VI_VEGAM_A0 110
  71. #define VI_UNKNOWN 0xFF
  72. #define ASIC_REV_IS_TONGA_P(eChipRev) ((eChipRev >= VI_TONGA_P_A0) && \
  73. (eChipRev < 40))
  74. #define ASIC_REV_IS_FIJI_P(eChipRev) ((eChipRev >= VI_FIJI_P_A0) && \
  75. (eChipRev < 80))
  76. #define ASIC_REV_IS_POLARIS10_P(eChipRev) ((eChipRev >= VI_POLARIS10_P_A0) && \
  77. (eChipRev < VI_POLARIS11_M_A0))
  78. #define ASIC_REV_IS_POLARIS11_M(eChipRev) ((eChipRev >= VI_POLARIS11_M_A0) && \
  79. (eChipRev < VI_POLARIS12_V_A0))
  80. #define ASIC_REV_IS_POLARIS12_V(eChipRev) ((eChipRev >= VI_POLARIS12_V_A0) && \
  81. (eChipRev < VI_VEGAM_A0))
  82. #define ASIC_REV_IS_VEGAM(eChipRev) (eChipRev >= VI_VEGAM_A0)
  83. /* DCE11 */
  84. #define CZ_CARRIZO_A0 0x01
  85. #define STONEY_A0 0x61
  86. #define CZ_UNKNOWN 0xFF
  87. #define ASIC_REV_IS_STONEY(rev) \
  88. ((rev >= STONEY_A0) && (rev < CZ_UNKNOWN))
  89. /* DCE12 */
  90. #define AI_UNKNOWN 0xFF
  91. #define AI_GREENLAND_P_A0 1
  92. #define AI_GREENLAND_P_A1 2
  93. #define AI_UNKNOWN 0xFF
  94. #define AI_VEGA12_P_A0 20
  95. #define AI_VEGA20_P_A0 40
  96. #define ASICREV_IS_GREENLAND_M(eChipRev) (eChipRev < AI_VEGA12_P_A0)
  97. #define ASICREV_IS_GREENLAND_P(eChipRev) (eChipRev < AI_VEGA12_P_A0)
  98. #define ASICREV_IS_VEGA12_P(eChipRev) ((eChipRev >= AI_VEGA12_P_A0) && (eChipRev < AI_VEGA20_P_A0))
  99. #define ASICREV_IS_VEGA20_P(eChipRev) ((eChipRev >= AI_VEGA20_P_A0) && (eChipRev < AI_UNKNOWN))
  100. /* DCN1_0 */
  101. #define INTERNAL_REV_RAVEN_A0 0x00 /* First spin of Raven */
  102. #define RAVEN_A0 0x01
  103. #define RAVEN_B0 0x21
  104. #if defined(CONFIG_DRM_AMD_DC_DCN1_01)
  105. /* DCN1_01 */
  106. #define RAVEN2_A0 0x81
  107. #endif
  108. #define RAVEN_UNKNOWN 0xFF
  109. #if defined(CONFIG_DRM_AMD_DC_DCN1_01)
  110. #define ASICREV_IS_RAVEN2(eChipRev) ((eChipRev >= RAVEN2_A0) && (eChipRev < 0xF0))
  111. #endif /* DCN1_01 */
  112. #define ASIC_REV_IS_RAVEN(eChipRev) ((eChipRev >= RAVEN_A0) && eChipRev < RAVEN_UNKNOWN)
  113. #define RAVEN1_F0 0xF0
  114. #define ASICREV_IS_RV1_F0(eChipRev) ((eChipRev >= RAVEN1_F0) && (eChipRev < RAVEN_UNKNOWN))
  115. #define FAMILY_RV 142 /* DCN 1*/
  116. /*
  117. * ASIC chip ID
  118. */
  119. /* DCE80 */
  120. #define DEVICE_ID_KALINDI_9834 0x9834
  121. #define DEVICE_ID_TEMASH_9839 0x9839
  122. #define DEVICE_ID_TEMASH_983D 0x983D
  123. /* Asic Family IDs for different asic family. */
  124. #define FAMILY_CI 120 /* Sea Islands: Hawaii (P), Bonaire (M) */
  125. #define FAMILY_KV 125 /* Fusion => Kaveri: Spectre, Spooky; Kabini: Kalindi */
  126. #define FAMILY_VI 130 /* Volcanic Islands: Iceland (V), Tonga (M) */
  127. #define FAMILY_CZ 135 /* Carrizo */
  128. #define FAMILY_AI 141
  129. #define FAMILY_UNKNOWN 0xFF
  130. #endif /* __DAL_ASIC_ID_H__ */