intel_pci_config.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. /* SPDX-License-Identifier: MIT */
  2. /*
  3. * Copyright © 2022 Intel Corporation
  4. */
  5. #ifndef __INTEL_PCI_CONFIG_H__
  6. #define __INTEL_PCI_CONFIG_H__
  7. /* PCI BARs */
  8. #define GEN2_GMADR_BAR 0
  9. #define GEN2_MMADR_BAR 1 /* MMIO+GTT, despite the name */
  10. #define GEN2_IO_BAR 2 /* 85x/865 */
  11. #define GEN3_MMADR_BAR 0 /* MMIO only */
  12. #define GEN3_IO_BAR 1
  13. #define GEN3_GMADR_BAR 2
  14. #define GEN3_GTTADR_BAR 3 /* GTT only */
  15. #define GEN4_GTTMMADR_BAR 0 /* MMIO+GTT */
  16. #define GEN4_GMADR_BAR 2
  17. #define GEN4_IO_BAR 4
  18. #define GEN12_LMEM_BAR 2
  19. static inline int intel_mmio_bar(int graphics_ver)
  20. {
  21. switch (graphics_ver) {
  22. case 2: return GEN2_MMADR_BAR;
  23. case 3: return GEN3_MMADR_BAR;
  24. default: return GEN4_GTTMMADR_BAR;
  25. }
  26. }
  27. /* BSM in include/drm/intel/i915_drm.h */
  28. #define MCHBAR_I915 0x44
  29. #define MCHBAR_I965 0x48
  30. #define MCHBAR_SIZE (4 * 4096)
  31. #define DEVEN 0x54
  32. #define DEVEN_MCHBAR_EN (1 << 28)
  33. #define HPLLCC 0xc0 /* 85x only */
  34. #define GC_CLOCK_CONTROL_MASK (0x7 << 0)
  35. #define GC_CLOCK_133_200 (0 << 0)
  36. #define GC_CLOCK_100_200 (1 << 0)
  37. #define GC_CLOCK_100_133 (2 << 0)
  38. #define GC_CLOCK_133_266 (3 << 0)
  39. #define GC_CLOCK_133_200_2 (4 << 0)
  40. #define GC_CLOCK_133_266_2 (5 << 0)
  41. #define GC_CLOCK_166_266 (6 << 0)
  42. #define GC_CLOCK_166_250 (7 << 0)
  43. #define I915_GDRST 0xc0
  44. #define GRDOM_FULL (0 << 2)
  45. #define GRDOM_RENDER (1 << 2)
  46. #define GRDOM_MEDIA (3 << 2)
  47. #define GRDOM_MASK (3 << 2)
  48. #define GRDOM_RESET_STATUS (1 << 1)
  49. #define GRDOM_RESET_ENABLE (1 << 0)
  50. /* BSpec only has register offset, PCI device and bit found empirically */
  51. #define I830_CLOCK_GATE 0xc8 /* device 0 */
  52. #define I830_L2_CACHE_CLOCK_GATE_DISABLE (1 << 2)
  53. #define GCDGMBUS 0xcc
  54. #define GCFGC2 0xda
  55. #define GCFGC 0xf0 /* 915+ only */
  56. #define GC_LOW_FREQUENCY_ENABLE (1 << 7)
  57. #define GC_DISPLAY_CLOCK_190_200_MHZ (0 << 4)
  58. #define GC_DISPLAY_CLOCK_333_320_MHZ (4 << 4)
  59. #define GC_DISPLAY_CLOCK_267_MHZ_PNV (0 << 4)
  60. #define GC_DISPLAY_CLOCK_333_MHZ_PNV (1 << 4)
  61. #define GC_DISPLAY_CLOCK_444_MHZ_PNV (2 << 4)
  62. #define GC_DISPLAY_CLOCK_200_MHZ_PNV (5 << 4)
  63. #define GC_DISPLAY_CLOCK_133_MHZ_PNV (6 << 4)
  64. #define GC_DISPLAY_CLOCK_167_MHZ_PNV (7 << 4)
  65. #define GC_DISPLAY_CLOCK_MASK (7 << 4)
  66. #define GM45_GC_RENDER_CLOCK_MASK (0xf << 0)
  67. #define GM45_GC_RENDER_CLOCK_266_MHZ (8 << 0)
  68. #define GM45_GC_RENDER_CLOCK_320_MHZ (9 << 0)
  69. #define GM45_GC_RENDER_CLOCK_400_MHZ (0xb << 0)
  70. #define GM45_GC_RENDER_CLOCK_533_MHZ (0xc << 0)
  71. #define I965_GC_RENDER_CLOCK_MASK (0xf << 0)
  72. #define I965_GC_RENDER_CLOCK_267_MHZ (2 << 0)
  73. #define I965_GC_RENDER_CLOCK_333_MHZ (3 << 0)
  74. #define I965_GC_RENDER_CLOCK_444_MHZ (4 << 0)
  75. #define I965_GC_RENDER_CLOCK_533_MHZ (5 << 0)
  76. #define I945_GC_RENDER_CLOCK_MASK (7 << 0)
  77. #define I945_GC_RENDER_CLOCK_166_MHZ (0 << 0)
  78. #define I945_GC_RENDER_CLOCK_200_MHZ (1 << 0)
  79. #define I945_GC_RENDER_CLOCK_250_MHZ (3 << 0)
  80. #define I945_GC_RENDER_CLOCK_400_MHZ (5 << 0)
  81. #define I915_GC_RENDER_CLOCK_MASK (7 << 0)
  82. #define I915_GC_RENDER_CLOCK_166_MHZ (0 << 0)
  83. #define I915_GC_RENDER_CLOCK_200_MHZ (1 << 0)
  84. #define I915_GC_RENDER_CLOCK_333_MHZ (4 << 0)
  85. #define ASLE 0xe4
  86. #define ASLS 0xfc
  87. #define SWSCI 0xe8
  88. #define SWSCI_SCISEL (1 << 15)
  89. #define SWSCI_GSSCIE (1 << 0)
  90. /* legacy/combination backlight modes, also called LBB */
  91. #define LBPC 0xf4
  92. #endif /* __INTEL_PCI_CONFIG_H__ */