Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 158087
b: refs/heads/master
c: 9355a08
h: refs/heads/master
i:
  158085: e4a0a28
  158083: 99fdba1
  158079: b07a464
v: v3
  • Loading branch information
Joerg Roedel committed Sep 3, 2009
1 parent f93f707 commit 4e8e016
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 274 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 03362a05c55122baff3556109c922285299dfec4
refs/heads/master: 9355a08186e52b7c120adea91c984923b54efa10
1 change: 1 addition & 0 deletions trunk/arch/x86/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,7 @@ config GART_IOMMU
bool "GART IOMMU support" if EMBEDDED
default y
select SWIOTLB
select AGP
depends on X86_64 && PCI
---help---
Support for full DMA access of devices with 32bit memory access only
Expand Down
1 change: 0 additions & 1 deletion trunk/arch/x86/include/asm/amd_iommu.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#ifdef CONFIG_AMD_IOMMU
extern int amd_iommu_init(void);
extern int amd_iommu_init_dma_ops(void);
extern int amd_iommu_init_passthrough(void);
extern void amd_iommu_detect(void);
extern irqreturn_t amd_iommu_int_handler(int irq, void *data);
extern void amd_iommu_flush_all_domains(void);
Expand Down
21 changes: 10 additions & 11 deletions trunk/arch/x86/include/asm/amd_iommu_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,16 +143,24 @@
#define EVT_BUFFER_SIZE 8192 /* 512 entries */
#define EVT_LEN_MASK (0x9ULL << 56)

#define PAGE_MODE_NONE 0x00
#define PAGE_MODE_1_LEVEL 0x01
#define PAGE_MODE_2_LEVEL 0x02
#define PAGE_MODE_3_LEVEL 0x03
#define PAGE_MODE_4_LEVEL 0x04
#define PAGE_MODE_5_LEVEL 0x05
#define PAGE_MODE_6_LEVEL 0x06

#define IOMMU_PDE_NL_0 0x000ULL
#define IOMMU_PDE_NL_1 0x200ULL
#define IOMMU_PDE_NL_2 0x400ULL
#define IOMMU_PDE_NL_3 0x600ULL

#define PM_LEVEL_SHIFT(x) (12 + ((x) * 9))
#define PM_LEVEL_SIZE(x) (((x) < 6) ? \
((1ULL << PM_LEVEL_SHIFT((x))) - 1): \
(0xffffffffffffffffULL))
#define PM_LEVEL_INDEX(x, a) (((a) >> PM_LEVEL_SHIFT((x))) & 0x1ffULL)

#define IOMMU_PTE_L2_INDEX(address) (((address) >> 30) & 0x1ffULL)
#define IOMMU_PTE_L1_INDEX(address) (((address) >> 21) & 0x1ffULL)
#define IOMMU_PTE_L0_INDEX(address) (((address) >> 12) & 0x1ffULL)
Expand Down Expand Up @@ -195,14 +203,11 @@
#define PD_DMA_OPS_MASK (1UL << 0) /* domain used for dma_ops */
#define PD_DEFAULT_MASK (1UL << 1) /* domain is a default dma_ops
domain for an IOMMU */
#define PD_PASSTHROUGH_MASK (1UL << 2) /* domain has no page
translation */

extern bool amd_iommu_dump;
#define DUMP_printk(format, arg...) \
do { \
if (amd_iommu_dump) \
printk(KERN_INFO "AMD-Vi: " format, ## arg); \
printk(KERN_INFO "AMD IOMMU: " format, ## arg); \
} while(0);

/*
Expand Down Expand Up @@ -341,9 +346,6 @@ struct amd_iommu {
/* if one, we need to send a completion wait command */
bool need_sync;

/* becomes true if a command buffer reset is running */
bool reset_in_progress;

/* default dma_ops domain for that IOMMU */
struct dma_ops_domain *default_dom;
};
Expand Down Expand Up @@ -464,7 +466,4 @@ static inline void amd_iommu_stats_init(void) { }

#endif /* CONFIG_AMD_IOMMU_STATS */

/* some function prototypes */
extern void amd_iommu_reset_cmd_buffer(struct amd_iommu *iommu);

#endif /* _ASM_X86_AMD_IOMMU_TYPES_H */
Loading

0 comments on commit 4e8e016

Please sign in to comment.