1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */ 2ff7cdd69SDaniel Vetter /* 3ff7cdd69SDaniel Vetter * Common Intel AGPGART and GTT definitions. 4ff7cdd69SDaniel Vetter */ 593f5f7f1SZhenyu Wang #ifndef _INTEL_AGP_H 693f5f7f1SZhenyu Wang #define _INTEL_AGP_H 7ff7cdd69SDaniel Vetter 8ff7cdd69SDaniel Vetter /* Intel registers */ 9ff7cdd69SDaniel Vetter #define INTEL_APSIZE 0xb4 10ff7cdd69SDaniel Vetter #define INTEL_ATTBASE 0xb8 11ff7cdd69SDaniel Vetter #define INTEL_AGPCTRL 0xb0 12ff7cdd69SDaniel Vetter #define INTEL_NBXCFG 0x50 13ff7cdd69SDaniel Vetter #define INTEL_ERRSTS 0x91 14ff7cdd69SDaniel Vetter 15ff7cdd69SDaniel Vetter /* Intel i830 registers */ 16ff7cdd69SDaniel Vetter #define I830_GMCH_CTRL 0x52 17ff7cdd69SDaniel Vetter #define I830_GMCH_ENABLED 0x4 18ff7cdd69SDaniel Vetter #define I830_GMCH_MEM_MASK 0x1 19ff7cdd69SDaniel Vetter #define I830_GMCH_MEM_64M 0x1 20ff7cdd69SDaniel Vetter #define I830_GMCH_MEM_128M 0 21ff7cdd69SDaniel Vetter #define I830_GMCH_GMS_MASK 0x70 22ff7cdd69SDaniel Vetter #define I830_GMCH_GMS_DISABLED 0x00 23ff7cdd69SDaniel Vetter #define I830_GMCH_GMS_LOCAL 0x10 24ff7cdd69SDaniel Vetter #define I830_GMCH_GMS_STOLEN_512 0x20 25ff7cdd69SDaniel Vetter #define I830_GMCH_GMS_STOLEN_1024 0x30 26ff7cdd69SDaniel Vetter #define I830_GMCH_GMS_STOLEN_8192 0x40 27ff7cdd69SDaniel Vetter #define I830_RDRAM_CHANNEL_TYPE 0x03010 28ff7cdd69SDaniel Vetter #define I830_RDRAM_ND(x) (((x) & 0x20) >> 5) 29ff7cdd69SDaniel Vetter #define I830_RDRAM_DDT(x) (((x) & 0x18) >> 3) 30ff7cdd69SDaniel Vetter 31ff7cdd69SDaniel Vetter /* This one is for I830MP w. an external graphic card */ 32ff7cdd69SDaniel Vetter #define INTEL_I830_ERRSTS 0x92 33ff7cdd69SDaniel Vetter 34ff7cdd69SDaniel Vetter /* Intel 855GM/852GM registers */ 35ff7cdd69SDaniel Vetter #define I855_GMCH_GMS_MASK 0xF0 36ff7cdd69SDaniel Vetter #define I855_GMCH_GMS_STOLEN_0M 0x0 37ff7cdd69SDaniel Vetter #define I855_GMCH_GMS_STOLEN_1M (0x1 << 4) 38ff7cdd69SDaniel Vetter #define I855_GMCH_GMS_STOLEN_4M (0x2 << 4) 39ff7cdd69SDaniel Vetter #define I855_GMCH_GMS_STOLEN_8M (0x3 << 4) 40ff7cdd69SDaniel Vetter #define I855_GMCH_GMS_STOLEN_16M (0x4 << 4) 41ff7cdd69SDaniel Vetter #define I855_GMCH_GMS_STOLEN_32M (0x5 << 4) 42ff7cdd69SDaniel Vetter #define I85X_CAPID 0x44 43ff7cdd69SDaniel Vetter #define I85X_VARIANT_MASK 0x7 44ff7cdd69SDaniel Vetter #define I85X_VARIANT_SHIFT 5 45ff7cdd69SDaniel Vetter #define I855_GME 0x0 46ff7cdd69SDaniel Vetter #define I855_GM 0x4 47ff7cdd69SDaniel Vetter #define I852_GME 0x2 48ff7cdd69SDaniel Vetter #define I852_GM 0x5 49ff7cdd69SDaniel Vetter 50ff7cdd69SDaniel Vetter /* Intel i845 registers */ 51ff7cdd69SDaniel Vetter #define INTEL_I845_AGPM 0x51 52ff7cdd69SDaniel Vetter #define INTEL_I845_ERRSTS 0xc8 53ff7cdd69SDaniel Vetter 54ff7cdd69SDaniel Vetter /* Intel i860 registers */ 55ff7cdd69SDaniel Vetter #define INTEL_I860_MCHCFG 0x50 56ff7cdd69SDaniel Vetter #define INTEL_I860_ERRSTS 0xc8 57ff7cdd69SDaniel Vetter 58ff7cdd69SDaniel Vetter /* Intel i810 registers */ 59545b0a74SYinghai Lu #define I810_GMADR_BAR 0 605ef6d8f4SBjorn Helgaas #define I810_MMADR_BAR 1 61ff7cdd69SDaniel Vetter #define I810_PTE_BASE 0x10000 62ff7cdd69SDaniel Vetter #define I810_PTE_MAIN_UNCACHED 0x00000000 63ff7cdd69SDaniel Vetter #define I810_PTE_LOCAL 0x00000002 64ff7cdd69SDaniel Vetter #define I810_PTE_VALID 0x00000001 65ff7cdd69SDaniel Vetter #define I830_PTE_SYSTEM_CACHED 0x00000006 66a2757b6fSZhenyu Wang 67ff7cdd69SDaniel Vetter #define I810_SMRAM_MISCC 0x70 68ff7cdd69SDaniel Vetter #define I810_GFX_MEM_WIN_SIZE 0x00010000 69ff7cdd69SDaniel Vetter #define I810_GFX_MEM_WIN_32M 0x00010000 70ff7cdd69SDaniel Vetter #define I810_GMS 0x000000c0 71ff7cdd69SDaniel Vetter #define I810_GMS_DISABLE 0x00000000 72ff7cdd69SDaniel Vetter #define I810_PGETBL_CTL 0x2020 73ff7cdd69SDaniel Vetter #define I810_PGETBL_ENABLED 0x00000001 7420172842SDaniel Vetter /* Note: PGETBL_CTL2 has a different offset on G33. */ 7520172842SDaniel Vetter #define I965_PGETBL_CTL2 0x20c4 76ff7cdd69SDaniel Vetter #define I965_PGETBL_SIZE_MASK 0x0000000e 77ff7cdd69SDaniel Vetter #define I965_PGETBL_SIZE_512KB (0 << 1) 78ff7cdd69SDaniel Vetter #define I965_PGETBL_SIZE_256KB (1 << 1) 79ff7cdd69SDaniel Vetter #define I965_PGETBL_SIZE_128KB (2 << 1) 80ff7cdd69SDaniel Vetter #define I965_PGETBL_SIZE_1MB (3 << 1) 81ff7cdd69SDaniel Vetter #define I965_PGETBL_SIZE_2MB (4 << 1) 82ff7cdd69SDaniel Vetter #define I965_PGETBL_SIZE_1_5MB (5 << 1) 8320172842SDaniel Vetter #define G33_GMCH_SIZE_MASK (3 << 8) 8420172842SDaniel Vetter #define G33_GMCH_SIZE_1M (1 << 8) 8520172842SDaniel Vetter #define G33_GMCH_SIZE_2M (2 << 8) 8620172842SDaniel Vetter #define G4x_GMCH_SIZE_MASK (0xf << 8) 8720172842SDaniel Vetter #define G4x_GMCH_SIZE_1M (0x1 << 8) 8820172842SDaniel Vetter #define G4x_GMCH_SIZE_2M (0x3 << 8) 89780d7cc4SChris Wilson #define G4x_GMCH_SIZE_VT_EN (0x8 << 8) 90780d7cc4SChris Wilson #define G4x_GMCH_SIZE_VT_1M (G4x_GMCH_SIZE_1M | G4x_GMCH_SIZE_VT_EN) 91780d7cc4SChris Wilson #define G4x_GMCH_SIZE_VT_1_5M ((0x2 << 8) | G4x_GMCH_SIZE_VT_EN) 92780d7cc4SChris Wilson #define G4x_GMCH_SIZE_VT_2M (G4x_GMCH_SIZE_2M | G4x_GMCH_SIZE_VT_EN) 93ff7cdd69SDaniel Vetter 94c97689d8SChris Wilson #define GFX_FLSH_CNTL 0x2170 /* 915+ */ 95c97689d8SChris Wilson 96ff7cdd69SDaniel Vetter #define I810_DRAM_CTL 0x3000 97ff7cdd69SDaniel Vetter #define I810_DRAM_ROW_0 0x00000001 98ff7cdd69SDaniel Vetter #define I810_DRAM_ROW_0_SDRAM 0x00000001 99ff7cdd69SDaniel Vetter 100ff7cdd69SDaniel Vetter /* Intel 815 register */ 101ff7cdd69SDaniel Vetter #define INTEL_815_APCONT 0x51 102ff7cdd69SDaniel Vetter #define INTEL_815_ATTBASE_MASK ~0x1FFFFFFF 103ff7cdd69SDaniel Vetter 104ff7cdd69SDaniel Vetter /* Intel i820 registers */ 105ff7cdd69SDaniel Vetter #define INTEL_I820_RDCR 0x51 106ff7cdd69SDaniel Vetter #define INTEL_I820_ERRSTS 0xc8 107ff7cdd69SDaniel Vetter 108ff7cdd69SDaniel Vetter /* Intel i840 registers */ 109ff7cdd69SDaniel Vetter #define INTEL_I840_MCHCFG 0x50 110ff7cdd69SDaniel Vetter #define INTEL_I840_ERRSTS 0xc8 111ff7cdd69SDaniel Vetter 112ff7cdd69SDaniel Vetter /* Intel i850 registers */ 113ff7cdd69SDaniel Vetter #define INTEL_I850_MCHCFG 0x50 114ff7cdd69SDaniel Vetter #define INTEL_I850_ERRSTS 0xc8 115ff7cdd69SDaniel Vetter 116ff7cdd69SDaniel Vetter /* intel 915G registers */ 117545b0a74SYinghai Lu #define I915_GMADR_BAR 2 1185ef6d8f4SBjorn Helgaas #define I915_MMADR_BAR 0 119b5e350f9SBjorn Helgaas #define I915_PTE_BAR 3 120ff7cdd69SDaniel Vetter #define I915_GMCH_GMS_STOLEN_48M (0x6 << 4) 121ff7cdd69SDaniel Vetter #define I915_GMCH_GMS_STOLEN_64M (0x7 << 4) 122ff7cdd69SDaniel Vetter #define G33_GMCH_GMS_STOLEN_128M (0x8 << 4) 123ff7cdd69SDaniel Vetter #define G33_GMCH_GMS_STOLEN_256M (0x9 << 4) 124ff7cdd69SDaniel Vetter #define INTEL_GMCH_GMS_STOLEN_96M (0xa << 4) 125ff7cdd69SDaniel Vetter #define INTEL_GMCH_GMS_STOLEN_160M (0xb << 4) 126ff7cdd69SDaniel Vetter #define INTEL_GMCH_GMS_STOLEN_224M (0xc << 4) 127ff7cdd69SDaniel Vetter #define INTEL_GMCH_GMS_STOLEN_352M (0xd << 4) 128ff7cdd69SDaniel Vetter 129ff7cdd69SDaniel Vetter #define I915_IFPADDR 0x60 130bdb8b975SChris Wilson #define I830_HIC 0x70 131ff7cdd69SDaniel Vetter 132ff7cdd69SDaniel Vetter /* Intel 965G registers */ 133ff7cdd69SDaniel Vetter #define I965_MSAC 0x62 134ff7cdd69SDaniel Vetter #define I965_IFPADDR 0x70 135ff7cdd69SDaniel Vetter 136ff7cdd69SDaniel Vetter /* Intel 7505 registers */ 137ff7cdd69SDaniel Vetter #define INTEL_I7505_APSIZE 0x74 138ff7cdd69SDaniel Vetter #define INTEL_I7505_NCAPID 0x60 139ff7cdd69SDaniel Vetter #define INTEL_I7505_NISTAT 0x6c 140ff7cdd69SDaniel Vetter #define INTEL_I7505_ATTBASE 0x78 141ff7cdd69SDaniel Vetter #define INTEL_I7505_ERRSTS 0x42 142ff7cdd69SDaniel Vetter #define INTEL_I7505_AGPCTRL 0x70 143ff7cdd69SDaniel Vetter #define INTEL_I7505_MCHCFG 0x50 144ff7cdd69SDaniel Vetter 145ff7cdd69SDaniel Vetter /* pci devices ids */ 146ff7cdd69SDaniel Vetter #define PCI_DEVICE_ID_INTEL_E7221_HB 0x2588 147ff7cdd69SDaniel Vetter #define PCI_DEVICE_ID_INTEL_E7221_IG 0x258a 148ff7cdd69SDaniel Vetter #define PCI_DEVICE_ID_INTEL_82946GZ_HB 0x2970 149ff7cdd69SDaniel Vetter #define PCI_DEVICE_ID_INTEL_82946GZ_IG 0x2972 150ff7cdd69SDaniel Vetter #define PCI_DEVICE_ID_INTEL_82G35_HB 0x2980 151ff7cdd69SDaniel Vetter #define PCI_DEVICE_ID_INTEL_82G35_IG 0x2982 152ff7cdd69SDaniel Vetter #define PCI_DEVICE_ID_INTEL_82965Q_HB 0x2990 153ff7cdd69SDaniel Vetter #define PCI_DEVICE_ID_INTEL_82965Q_IG 0x2992 154ff7cdd69SDaniel Vetter #define PCI_DEVICE_ID_INTEL_82965G_HB 0x29A0 155ff7cdd69SDaniel Vetter #define PCI_DEVICE_ID_INTEL_82965G_IG 0x29A2 156ff7cdd69SDaniel Vetter #define PCI_DEVICE_ID_INTEL_82965GM_HB 0x2A00 157ff7cdd69SDaniel Vetter #define PCI_DEVICE_ID_INTEL_82965GM_IG 0x2A02 158ff7cdd69SDaniel Vetter #define PCI_DEVICE_ID_INTEL_82965GME_HB 0x2A10 159ff7cdd69SDaniel Vetter #define PCI_DEVICE_ID_INTEL_82965GME_IG 0x2A12 160ff7cdd69SDaniel Vetter #define PCI_DEVICE_ID_INTEL_82945GME_HB 0x27AC 161ff7cdd69SDaniel Vetter #define PCI_DEVICE_ID_INTEL_82945GME_IG 0x27AE 162ff7cdd69SDaniel Vetter #define PCI_DEVICE_ID_INTEL_PINEVIEW_M_HB 0xA010 163ff7cdd69SDaniel Vetter #define PCI_DEVICE_ID_INTEL_PINEVIEW_M_IG 0xA011 164ff7cdd69SDaniel Vetter #define PCI_DEVICE_ID_INTEL_PINEVIEW_HB 0xA000 165ff7cdd69SDaniel Vetter #define PCI_DEVICE_ID_INTEL_PINEVIEW_IG 0xA001 166ff7cdd69SDaniel Vetter #define PCI_DEVICE_ID_INTEL_G33_HB 0x29C0 167ff7cdd69SDaniel Vetter #define PCI_DEVICE_ID_INTEL_G33_IG 0x29C2 168ff7cdd69SDaniel Vetter #define PCI_DEVICE_ID_INTEL_Q35_HB 0x29B0 169ff7cdd69SDaniel Vetter #define PCI_DEVICE_ID_INTEL_Q35_IG 0x29B2 170ff7cdd69SDaniel Vetter #define PCI_DEVICE_ID_INTEL_Q33_HB 0x29D0 171ff7cdd69SDaniel Vetter #define PCI_DEVICE_ID_INTEL_Q33_IG 0x29D2 172ff7cdd69SDaniel Vetter #define PCI_DEVICE_ID_INTEL_B43_HB 0x2E40 173ff7cdd69SDaniel Vetter #define PCI_DEVICE_ID_INTEL_B43_IG 0x2E42 17441a51428SChris Wilson #define PCI_DEVICE_ID_INTEL_B43_1_HB 0x2E90 17541a51428SChris Wilson #define PCI_DEVICE_ID_INTEL_B43_1_IG 0x2E92 176ff7cdd69SDaniel Vetter #define PCI_DEVICE_ID_INTEL_GM45_HB 0x2A40 177ff7cdd69SDaniel Vetter #define PCI_DEVICE_ID_INTEL_GM45_IG 0x2A42 178ff7cdd69SDaniel Vetter #define PCI_DEVICE_ID_INTEL_EAGLELAKE_HB 0x2E00 179ff7cdd69SDaniel Vetter #define PCI_DEVICE_ID_INTEL_EAGLELAKE_IG 0x2E02 180ff7cdd69SDaniel Vetter #define PCI_DEVICE_ID_INTEL_Q45_HB 0x2E10 181ff7cdd69SDaniel Vetter #define PCI_DEVICE_ID_INTEL_Q45_IG 0x2E12 182ff7cdd69SDaniel Vetter #define PCI_DEVICE_ID_INTEL_G45_HB 0x2E20 183ff7cdd69SDaniel Vetter #define PCI_DEVICE_ID_INTEL_G45_IG 0x2E22 184ff7cdd69SDaniel Vetter #define PCI_DEVICE_ID_INTEL_G41_HB 0x2E30 185ff7cdd69SDaniel Vetter #define PCI_DEVICE_ID_INTEL_G41_IG 0x2E32 186ff7cdd69SDaniel Vetter #define PCI_DEVICE_ID_INTEL_IRONLAKE_D_HB 0x0040 18767384fe3SEugeni Dodonov #define PCI_DEVICE_ID_INTEL_IRONLAKE_D2_HB 0x0069 188ff7cdd69SDaniel Vetter #define PCI_DEVICE_ID_INTEL_IRONLAKE_D_IG 0x0042 189ff7cdd69SDaniel Vetter #define PCI_DEVICE_ID_INTEL_IRONLAKE_M_HB 0x0044 190ff7cdd69SDaniel Vetter #define PCI_DEVICE_ID_INTEL_IRONLAKE_MA_HB 0x0062 191ff7cdd69SDaniel Vetter #define PCI_DEVICE_ID_INTEL_IRONLAKE_MC2_HB 0x006a 192ff7cdd69SDaniel Vetter #define PCI_DEVICE_ID_INTEL_IRONLAKE_M_IG 0x0046 193ff7cdd69SDaniel Vetter 19493f5f7f1SZhenyu Wang #endif 195