aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-x86')
-rw-r--r--include/asm-x86/gart.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/asm-x86/gart.h b/include/asm-x86/gart.h
index 248e5778e928..6f22786d2f0c 100644
--- a/include/asm-x86/gart.h
+++ b/include/asm-x86/gart.h
@@ -52,4 +52,21 @@ static inline void gart_iommu_shutdown(void)
52#define AMD64_GARTCACHECTL 0x9c 52#define AMD64_GARTCACHECTL 0x9c
53#define AMD64_GARTEN (1<<0) 53#define AMD64_GARTEN (1<<0)
54 54
55static inline void enable_gart_translation(struct pci_dev *dev, u64 addr)
56{
57 u32 tmp, ctl;
58
59 /* address of the mappings table */
60 addr >>= 12;
61 tmp = (u32) addr<<4;
62 tmp &= ~0xf;
63 pci_write_config_dword(dev, AMD64_GARTTABLEBASE, tmp);
64
65 /* Enable GART translation for this hammer. */
66 pci_read_config_dword(dev, AMD64_GARTAPERTURECTL, &ctl);
67 ctl |= GARTEN;
68 ctl &= ~(DISGARTCPU | DISGARTIO);
69 pci_write_config_dword(dev, AMD64_GARTAPERTURECTL, ctl);
70}
71
55#endif 72#endif