0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026 #ifndef _I915_DRM_H_
0027 #define _I915_DRM_H_
0028
0029 #include <linux/types.h>
0030
0031
0032 unsigned long i915_read_mch_val(void);
0033 bool i915_gpu_raise(void);
0034 bool i915_gpu_lower(void);
0035 bool i915_gpu_busy(void);
0036 bool i915_gpu_turbo_disable(void);
0037
0038
0039 extern struct resource intel_graphics_stolen_res;
0040
0041
0042
0043
0044
0045
0046
0047 #define INTEL_GMCH_CTRL 0x52
0048 #define INTEL_GMCH_VGA_DISABLE (1 << 1)
0049 #define SNB_GMCH_CTRL 0x50
0050 #define SNB_GMCH_GGMS_SHIFT 8
0051 #define SNB_GMCH_GGMS_MASK 0x3
0052 #define SNB_GMCH_GMS_SHIFT 3
0053 #define SNB_GMCH_GMS_MASK 0x1f
0054 #define BDW_GMCH_GGMS_SHIFT 6
0055 #define BDW_GMCH_GGMS_MASK 0x3
0056 #define BDW_GMCH_GMS_SHIFT 8
0057 #define BDW_GMCH_GMS_MASK 0xff
0058
0059 #define I830_GMCH_CTRL 0x52
0060
0061 #define I830_GMCH_GMS_MASK 0x70
0062 #define I830_GMCH_GMS_LOCAL 0x10
0063 #define I830_GMCH_GMS_STOLEN_512 0x20
0064 #define I830_GMCH_GMS_STOLEN_1024 0x30
0065 #define I830_GMCH_GMS_STOLEN_8192 0x40
0066
0067 #define I855_GMCH_GMS_MASK 0xF0
0068 #define I855_GMCH_GMS_STOLEN_0M 0x0
0069 #define I855_GMCH_GMS_STOLEN_1M (0x1 << 4)
0070 #define I855_GMCH_GMS_STOLEN_4M (0x2 << 4)
0071 #define I855_GMCH_GMS_STOLEN_8M (0x3 << 4)
0072 #define I855_GMCH_GMS_STOLEN_16M (0x4 << 4)
0073 #define I855_GMCH_GMS_STOLEN_32M (0x5 << 4)
0074 #define I915_GMCH_GMS_STOLEN_48M (0x6 << 4)
0075 #define I915_GMCH_GMS_STOLEN_64M (0x7 << 4)
0076 #define G33_GMCH_GMS_STOLEN_128M (0x8 << 4)
0077 #define G33_GMCH_GMS_STOLEN_256M (0x9 << 4)
0078 #define INTEL_GMCH_GMS_STOLEN_96M (0xa << 4)
0079 #define INTEL_GMCH_GMS_STOLEN_160M (0xb << 4)
0080 #define INTEL_GMCH_GMS_STOLEN_224M (0xc << 4)
0081 #define INTEL_GMCH_GMS_STOLEN_352M (0xd << 4)
0082
0083 #define I830_DRB3 0x63
0084 #define I85X_DRB3 0x43
0085 #define I865_TOUD 0xc4
0086
0087 #define I830_ESMRAMC 0x91
0088 #define I845_ESMRAMC 0x9e
0089 #define I85X_ESMRAMC 0x61
0090 #define TSEG_ENABLE (1 << 0)
0091 #define I830_TSEG_SIZE_512K (0 << 1)
0092 #define I830_TSEG_SIZE_1M (1 << 1)
0093 #define I845_TSEG_SIZE_MASK (3 << 1)
0094 #define I845_TSEG_SIZE_512K (2 << 1)
0095 #define I845_TSEG_SIZE_1M (3 << 1)
0096
0097 #define INTEL_BSM 0x5c
0098 #define INTEL_GEN11_BSM_DW0 0xc0
0099 #define INTEL_GEN11_BSM_DW1 0xc4
0100 #define INTEL_BSM_MASK (-(1u << 20))
0101
0102 #endif