Joerg Roedel | 395624f | 2007-10-24 12:49:47 +0200 | [diff] [blame] | 1 | #ifndef _ASM_X8664_IOMMU_H |
| 2 | #define _ASM_X8664_IOMMU_H 1 |
| 3 | |
| 4 | extern void pci_iommu_shutdown(void); |
| 5 | extern void no_iommu_init(void); |
| 6 | extern int force_iommu, no_iommu; |
| 7 | extern int iommu_detected; |
Pavel Machek | aa134f1 | 2008-04-08 10:49:03 +0200 | [diff] [blame^] | 8 | extern int agp_amd64_init(void); |
Joerg Roedel | 966396d | 2007-10-24 12:49:48 +0200 | [diff] [blame] | 9 | #ifdef CONFIG_GART_IOMMU |
Joerg Roedel | 395624f | 2007-10-24 12:49:47 +0200 | [diff] [blame] | 10 | extern void gart_iommu_init(void); |
| 11 | extern void gart_iommu_shutdown(void); |
| 12 | extern void __init gart_parse_options(char *); |
Yinghai Lu | aaf2304 | 2008-01-30 13:33:09 +0100 | [diff] [blame] | 13 | extern void early_gart_iommu_check(void); |
Joerg Roedel | 0440d4c | 2007-10-24 12:49:50 +0200 | [diff] [blame] | 14 | extern void gart_iommu_hole_init(void); |
Joerg Roedel | 395624f | 2007-10-24 12:49:47 +0200 | [diff] [blame] | 15 | extern int fallback_aper_order; |
| 16 | extern int fallback_aper_force; |
Joerg Roedel | 0440d4c | 2007-10-24 12:49:50 +0200 | [diff] [blame] | 17 | extern int gart_iommu_aperture; |
| 18 | extern int gart_iommu_aperture_allowed; |
| 19 | extern int gart_iommu_aperture_disabled; |
Joerg Roedel | 395624f | 2007-10-24 12:49:47 +0200 | [diff] [blame] | 20 | extern int fix_aperture; |
| 21 | #else |
Joerg Roedel | 0440d4c | 2007-10-24 12:49:50 +0200 | [diff] [blame] | 22 | #define gart_iommu_aperture 0 |
| 23 | #define gart_iommu_aperture_allowed 0 |
Joerg Roedel | 395624f | 2007-10-24 12:49:47 +0200 | [diff] [blame] | 24 | |
Yinghai Lu | aaf2304 | 2008-01-30 13:33:09 +0100 | [diff] [blame] | 25 | static inline void early_gart_iommu_check(void) |
| 26 | { |
| 27 | } |
| 28 | |
Joerg Roedel | 395624f | 2007-10-24 12:49:47 +0200 | [diff] [blame] | 29 | static inline void gart_iommu_shutdown(void) |
| 30 | { |
| 31 | } |
| 32 | |
| 33 | #endif |
| 34 | |
Pavel Machek | aa134f1 | 2008-04-08 10:49:03 +0200 | [diff] [blame^] | 35 | /* PTE bits. */ |
| 36 | #define GPTE_VALID 1 |
| 37 | #define GPTE_COHERENT 2 |
| 38 | |
| 39 | /* Aperture control register bits. */ |
| 40 | #define GARTEN (1<<0) |
| 41 | #define DISGARTCPU (1<<4) |
| 42 | #define DISGARTIO (1<<5) |
| 43 | |
| 44 | /* GART cache control register bits. */ |
| 45 | #define INVGART (1<<0) |
| 46 | #define GARTPTEERR (1<<1) |
| 47 | |
| 48 | /* K8 On-cpu GART registers */ |
| 49 | #define AMD64_GARTAPERTURECTL 0x90 |
| 50 | #define AMD64_GARTAPERTUREBASE 0x94 |
| 51 | #define AMD64_GARTTABLEBASE 0x98 |
| 52 | #define AMD64_GARTCACHECTL 0x9c |
| 53 | #define AMD64_GARTEN (1<<0) |
| 54 | |
Joerg Roedel | 395624f | 2007-10-24 12:49:47 +0200 | [diff] [blame] | 55 | #endif |