blob: 248e5778e928a7a475725bad9a0a9e8bd86ef4fb [file] [log] [blame]
Joerg Roedel395624f2007-10-24 12:49:47 +02001#ifndef _ASM_X8664_IOMMU_H
2#define _ASM_X8664_IOMMU_H 1
3
4extern void pci_iommu_shutdown(void);
5extern void no_iommu_init(void);
6extern int force_iommu, no_iommu;
7extern int iommu_detected;
Pavel Machekaa134f12008-04-08 10:49:03 +02008extern int agp_amd64_init(void);
Joerg Roedel966396d2007-10-24 12:49:48 +02009#ifdef CONFIG_GART_IOMMU
Joerg Roedel395624f2007-10-24 12:49:47 +020010extern void gart_iommu_init(void);
11extern void gart_iommu_shutdown(void);
12extern void __init gart_parse_options(char *);
Yinghai Luaaf23042008-01-30 13:33:09 +010013extern void early_gart_iommu_check(void);
Joerg Roedel0440d4c2007-10-24 12:49:50 +020014extern void gart_iommu_hole_init(void);
Joerg Roedel395624f2007-10-24 12:49:47 +020015extern int fallback_aper_order;
16extern int fallback_aper_force;
Joerg Roedel0440d4c2007-10-24 12:49:50 +020017extern int gart_iommu_aperture;
18extern int gart_iommu_aperture_allowed;
19extern int gart_iommu_aperture_disabled;
Joerg Roedel395624f2007-10-24 12:49:47 +020020extern int fix_aperture;
21#else
Joerg Roedel0440d4c2007-10-24 12:49:50 +020022#define gart_iommu_aperture 0
23#define gart_iommu_aperture_allowed 0
Joerg Roedel395624f2007-10-24 12:49:47 +020024
Yinghai Luaaf23042008-01-30 13:33:09 +010025static inline void early_gart_iommu_check(void)
26{
27}
28
Joerg Roedel395624f2007-10-24 12:49:47 +020029static inline void gart_iommu_shutdown(void)
30{
31}
32
33#endif
34
Pavel Machekaa134f12008-04-08 10:49:03 +020035/* 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 Roedel395624f2007-10-24 12:49:47 +020055#endif