summaryrefslogtreecommitdiff
path: root/include/asm-x86/gart.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-x86/gart.h')
-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)
#define AMD64_GARTCACHECTL 0x9c
#define AMD64_GARTEN (1<<0)
+static inline void enable_gart_translation(struct pci_dev *dev, u64 addr)
+{
+ u32 tmp, ctl;
+
+ /* address of the mappings table */
+ addr >>= 12;
+ tmp = (u32) addr<<4;
+ tmp &= ~0xf;
+ pci_write_config_dword(dev, AMD64_GARTTABLEBASE, tmp);
+
+ /* Enable GART translation for this hammer. */
+ pci_read_config_dword(dev, AMD64_GARTAPERTURECTL, &ctl);
+ ctl |= GARTEN;
+ ctl &= ~(DISGARTCPU | DISGARTIO);
+ pci_write_config_dword(dev, AMD64_GARTAPERTURECTL, ctl);
+}
+
#endif