diff options
author | Pavel Machek <pavel@ucw.cz> | 2008-04-15 06:43:57 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-05-12 15:28:10 -0400 |
commit | 3bb6fbf9969a8bbe4892968659239273d092e78a (patch) | |
tree | 26ede22e0622abfbb585cd83199b2615b4b4542d /include/asm-x86/gart.h | |
parent | 330fce23dab6e6a3d1979e55f27aba4c0c301331 (diff) |
x86 gart: factor out common code
Cleanup gart handling on amd64 a bit: move common code into
enable_gart_translation , and use symbolic register names where
appropriate.
Signed-off-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/asm-x86/gart.h')
-rw-r--r-- | include/asm-x86/gart.h | 17 |
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 | ||
55 | static 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 |