aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/agp
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/agp')
-rw-r--r--drivers/char/agp/intel-agp.c1
-rw-r--r--drivers/char/agp/intel-agp.h14
-rw-r--r--drivers/char/agp/intel-gtt.c45
3 files changed, 59 insertions, 1 deletions
diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c
index 962e75dc4781..74c2d9274c53 100644
--- a/drivers/char/agp/intel-agp.c
+++ b/drivers/char/agp/intel-agp.c
@@ -907,6 +907,7 @@ static struct pci_device_id agp_intel_pci_table[] = {
907 ID(PCI_DEVICE_ID_INTEL_IVYBRIDGE_HB), 907 ID(PCI_DEVICE_ID_INTEL_IVYBRIDGE_HB),
908 ID(PCI_DEVICE_ID_INTEL_IVYBRIDGE_M_HB), 908 ID(PCI_DEVICE_ID_INTEL_IVYBRIDGE_M_HB),
909 ID(PCI_DEVICE_ID_INTEL_IVYBRIDGE_S_HB), 909 ID(PCI_DEVICE_ID_INTEL_IVYBRIDGE_S_HB),
910 ID(PCI_DEVICE_ID_INTEL_VALLEYVIEW_HB),
910 { } 911 { }
911}; 912};
912 913
diff --git a/drivers/char/agp/intel-agp.h b/drivers/char/agp/intel-agp.h
index 7ea18a5fe71c..c0091753a0d1 100644
--- a/drivers/char/agp/intel-agp.h
+++ b/drivers/char/agp/intel-agp.h
@@ -96,6 +96,7 @@
96#define G4x_GMCH_SIZE_VT_2M (G4x_GMCH_SIZE_2M | G4x_GMCH_SIZE_VT_EN) 96#define G4x_GMCH_SIZE_VT_2M (G4x_GMCH_SIZE_2M | G4x_GMCH_SIZE_VT_EN)
97 97
98#define GFX_FLSH_CNTL 0x2170 /* 915+ */ 98#define GFX_FLSH_CNTL 0x2170 /* 915+ */
99#define GFX_FLSH_CNTL_VLV 0x101008
99 100
100#define I810_DRAM_CTL 0x3000 101#define I810_DRAM_CTL 0x3000
101#define I810_DRAM_ROW_0 0x00000001 102#define I810_DRAM_ROW_0 0x00000001
@@ -235,6 +236,19 @@
235#define PCI_DEVICE_ID_INTEL_IVYBRIDGE_S_HB 0x0158 /* Server */ 236#define PCI_DEVICE_ID_INTEL_IVYBRIDGE_S_HB 0x0158 /* Server */
236#define PCI_DEVICE_ID_INTEL_IVYBRIDGE_S_GT1_IG 0x015A 237#define PCI_DEVICE_ID_INTEL_IVYBRIDGE_S_GT1_IG 0x015A
237#define PCI_DEVICE_ID_INTEL_IVYBRIDGE_S_GT2_IG 0x016A 238#define PCI_DEVICE_ID_INTEL_IVYBRIDGE_S_GT2_IG 0x016A
239#define PCI_DEVICE_ID_INTEL_VALLEYVIEW_HB 0x0F00 /* VLV1 */
240#define PCI_DEVICE_ID_INTEL_VALLEYVIEW_IG 0x0F30
241#define PCI_DEVICE_ID_INTEL_HASWELL_HB 0x0400 /* Desktop */
242#define PCI_DEVICE_ID_INTEL_HASWELL_D_GT1_IG 0x0402
243#define PCI_DEVICE_ID_INTEL_HASWELL_D_GT2_IG 0x0412
244#define PCI_DEVICE_ID_INTEL_HASWELL_M_HB 0x0404 /* Mobile */
245#define PCI_DEVICE_ID_INTEL_HASWELL_M_GT1_IG 0x0406
246#define PCI_DEVICE_ID_INTEL_HASWELL_M_GT2_IG 0x0416
247#define PCI_DEVICE_ID_INTEL_HASWELL_S_HB 0x0408 /* Server */
248#define PCI_DEVICE_ID_INTEL_HASWELL_S_GT1_IG 0x040a
249#define PCI_DEVICE_ID_INTEL_HASWELL_S_GT2_IG 0x041a
250#define PCI_DEVICE_ID_INTEL_HASWELL_SDV 0x0c16 /* SDV */
251#define PCI_DEVICE_ID_INTEL_HASWELL_E_HB 0x0c04
238 252
239int intel_gmch_probe(struct pci_dev *pdev, 253int intel_gmch_probe(struct pci_dev *pdev,
240 struct agp_bridge_data *bridge); 254 struct agp_bridge_data *bridge);
diff --git a/drivers/char/agp/intel-gtt.c b/drivers/char/agp/intel-gtt.c
index 7f025fb620de..1237e7575c3f 100644
--- a/drivers/char/agp/intel-gtt.c
+++ b/drivers/char/agp/intel-gtt.c
@@ -1179,6 +1179,20 @@ static void gen6_write_entry(dma_addr_t addr, unsigned int entry,
1179 writel(addr | pte_flags, intel_private.gtt + entry); 1179 writel(addr | pte_flags, intel_private.gtt + entry);
1180} 1180}
1181 1181
1182static void valleyview_write_entry(dma_addr_t addr, unsigned int entry,
1183 unsigned int flags)
1184{
1185 u32 pte_flags;
1186
1187 pte_flags = GEN6_PTE_UNCACHED | I810_PTE_VALID;
1188
1189 /* gen6 has bit11-4 for physical addr bit39-32 */
1190 addr |= (addr >> 28) & 0xff0;
1191 writel(addr | pte_flags, intel_private.gtt + entry);
1192
1193 writel(1, intel_private.registers + GFX_FLSH_CNTL_VLV);
1194}
1195
1182static void gen6_cleanup(void) 1196static void gen6_cleanup(void)
1183{ 1197{
1184} 1198}
@@ -1205,12 +1219,16 @@ static inline int needs_idle_maps(void)
1205static int i9xx_setup(void) 1219static int i9xx_setup(void)
1206{ 1220{
1207 u32 reg_addr; 1221 u32 reg_addr;
1222 int size = KB(512);
1208 1223
1209 pci_read_config_dword(intel_private.pcidev, I915_MMADDR, &reg_addr); 1224 pci_read_config_dword(intel_private.pcidev, I915_MMADDR, &reg_addr);
1210 1225
1211 reg_addr &= 0xfff80000; 1226 reg_addr &= 0xfff80000;
1212 1227
1213 intel_private.registers = ioremap(reg_addr, 128 * 4096); 1228 if (INTEL_GTT_GEN >= 7)
1229 size = MB(2);
1230
1231 intel_private.registers = ioremap(reg_addr, size);
1214 if (!intel_private.registers) 1232 if (!intel_private.registers)
1215 return -ENOMEM; 1233 return -ENOMEM;
1216 1234
@@ -1354,6 +1372,15 @@ static const struct intel_gtt_driver sandybridge_gtt_driver = {
1354 .check_flags = gen6_check_flags, 1372 .check_flags = gen6_check_flags,
1355 .chipset_flush = i9xx_chipset_flush, 1373 .chipset_flush = i9xx_chipset_flush,
1356}; 1374};
1375static const struct intel_gtt_driver valleyview_gtt_driver = {
1376 .gen = 7,
1377 .setup = i9xx_setup,
1378 .cleanup = gen6_cleanup,
1379 .write_entry = valleyview_write_entry,
1380 .dma_mask_size = 40,
1381 .check_flags = gen6_check_flags,
1382 .chipset_flush = i9xx_chipset_flush,
1383};
1357 1384
1358/* Table to describe Intel GMCH and AGP/PCIE GART drivers. At least one of 1385/* Table to describe Intel GMCH and AGP/PCIE GART drivers. At least one of
1359 * driver and gmch_driver must be non-null, and find_gmch will determine 1386 * driver and gmch_driver must be non-null, and find_gmch will determine
@@ -1460,6 +1487,22 @@ static const struct intel_gtt_driver_description {
1460 "Ivybridge", &sandybridge_gtt_driver }, 1487 "Ivybridge", &sandybridge_gtt_driver },
1461 { PCI_DEVICE_ID_INTEL_IVYBRIDGE_S_GT2_IG, 1488 { PCI_DEVICE_ID_INTEL_IVYBRIDGE_S_GT2_IG,
1462 "Ivybridge", &sandybridge_gtt_driver }, 1489 "Ivybridge", &sandybridge_gtt_driver },
1490 { PCI_DEVICE_ID_INTEL_VALLEYVIEW_IG,
1491 "ValleyView", &valleyview_gtt_driver },
1492 { PCI_DEVICE_ID_INTEL_HASWELL_D_GT1_IG,
1493 "Haswell", &sandybridge_gtt_driver },
1494 { PCI_DEVICE_ID_INTEL_HASWELL_D_GT2_IG,
1495 "Haswell", &sandybridge_gtt_driver },
1496 { PCI_DEVICE_ID_INTEL_HASWELL_M_GT1_IG,
1497 "Haswell", &sandybridge_gtt_driver },
1498 { PCI_DEVICE_ID_INTEL_HASWELL_M_GT2_IG,
1499 "Haswell", &sandybridge_gtt_driver },
1500 { PCI_DEVICE_ID_INTEL_HASWELL_S_GT1_IG,
1501 "Haswell", &sandybridge_gtt_driver },
1502 { PCI_DEVICE_ID_INTEL_HASWELL_S_GT2_IG,
1503 "Haswell", &sandybridge_gtt_driver },
1504 { PCI_DEVICE_ID_INTEL_HASWELL_SDV,
1505 "Haswell", &sandybridge_gtt_driver },
1463 { 0, NULL, NULL } 1506 { 0, NULL, NULL }
1464}; 1507};
1465 1508