diff options
author | Joerg Roedel <joerg.roedel@amd.com> | 2008-09-11 10:51:41 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-09-19 06:59:15 -0400 |
commit | a80dc3e0e0dc8393158de317d66ae0f345dc58f9 (patch) | |
tree | d7e18a5d25a6dc1101fe699966a9b59b9b88a2f2 /include | |
parent | 3eaf28a1cd2686aaa185b54d5a5e18e91b41f7f2 (diff) |
AMD IOMMU: add MSI interrupt support
The AMD IOMMU can generate interrupts for various reasons. This patch
adds the basic interrupt enabling infrastructure to the driver.
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-x86/amd_iommu.h | 3 | ||||
-rw-r--r-- | include/asm-x86/amd_iommu_types.h | 7 |
2 files changed, 10 insertions, 0 deletions
diff --git a/include/asm-x86/amd_iommu.h b/include/asm-x86/amd_iommu.h index 30a12049353b..2fd97cb250c7 100644 --- a/include/asm-x86/amd_iommu.h +++ b/include/asm-x86/amd_iommu.h | |||
@@ -20,10 +20,13 @@ | |||
20 | #ifndef _ASM_X86_AMD_IOMMU_H | 20 | #ifndef _ASM_X86_AMD_IOMMU_H |
21 | #define _ASM_X86_AMD_IOMMU_H | 21 | #define _ASM_X86_AMD_IOMMU_H |
22 | 22 | ||
23 | #include <linux/irqreturn.h> | ||
24 | |||
23 | #ifdef CONFIG_AMD_IOMMU | 25 | #ifdef CONFIG_AMD_IOMMU |
24 | extern int amd_iommu_init(void); | 26 | extern int amd_iommu_init(void); |
25 | extern int amd_iommu_init_dma_ops(void); | 27 | extern int amd_iommu_init_dma_ops(void); |
26 | extern void amd_iommu_detect(void); | 28 | extern void amd_iommu_detect(void); |
29 | extern irqreturn_t amd_iommu_int_handler(int irq, void *data); | ||
27 | #else | 30 | #else |
28 | static inline int amd_iommu_init(void) { return -ENODEV; } | 31 | static inline int amd_iommu_init(void) { return -ENODEV; } |
29 | static inline void amd_iommu_detect(void) { } | 32 | static inline void amd_iommu_detect(void) { } |
diff --git a/include/asm-x86/amd_iommu_types.h b/include/asm-x86/amd_iommu_types.h index a5629a21557c..8533f09b34b7 100644 --- a/include/asm-x86/amd_iommu_types.h +++ b/include/asm-x86/amd_iommu_types.h | |||
@@ -37,6 +37,7 @@ | |||
37 | /* Capability offsets used by the driver */ | 37 | /* Capability offsets used by the driver */ |
38 | #define MMIO_CAP_HDR_OFFSET 0x00 | 38 | #define MMIO_CAP_HDR_OFFSET 0x00 |
39 | #define MMIO_RANGE_OFFSET 0x0c | 39 | #define MMIO_RANGE_OFFSET 0x0c |
40 | #define MMIO_MISC_OFFSET 0x10 | ||
40 | 41 | ||
41 | /* Masks, shifts and macros to parse the device range capability */ | 42 | /* Masks, shifts and macros to parse the device range capability */ |
42 | #define MMIO_RANGE_LD_MASK 0xff000000 | 43 | #define MMIO_RANGE_LD_MASK 0xff000000 |
@@ -48,6 +49,7 @@ | |||
48 | #define MMIO_GET_LD(x) (((x) & MMIO_RANGE_LD_MASK) >> MMIO_RANGE_LD_SHIFT) | 49 | #define MMIO_GET_LD(x) (((x) & MMIO_RANGE_LD_MASK) >> MMIO_RANGE_LD_SHIFT) |
49 | #define MMIO_GET_FD(x) (((x) & MMIO_RANGE_FD_MASK) >> MMIO_RANGE_FD_SHIFT) | 50 | #define MMIO_GET_FD(x) (((x) & MMIO_RANGE_FD_MASK) >> MMIO_RANGE_FD_SHIFT) |
50 | #define MMIO_GET_BUS(x) (((x) & MMIO_RANGE_BUS_MASK) >> MMIO_RANGE_BUS_SHIFT) | 51 | #define MMIO_GET_BUS(x) (((x) & MMIO_RANGE_BUS_MASK) >> MMIO_RANGE_BUS_SHIFT) |
52 | #define MMIO_MSI_NUM(x) ((x) & 0x1f) | ||
51 | 53 | ||
52 | /* Flag masks for the AMD IOMMU exclusion range */ | 54 | /* Flag masks for the AMD IOMMU exclusion range */ |
53 | #define MMIO_EXCL_ENABLE_MASK 0x01ULL | 55 | #define MMIO_EXCL_ENABLE_MASK 0x01ULL |
@@ -255,10 +257,15 @@ struct amd_iommu { | |||
255 | u8 *evt_buf; | 257 | u8 *evt_buf; |
256 | /* size of event buffer */ | 258 | /* size of event buffer */ |
257 | u32 evt_buf_size; | 259 | u32 evt_buf_size; |
260 | /* MSI number for event interrupt */ | ||
261 | u16 evt_msi_num; | ||
258 | 262 | ||
259 | /* if one, we need to send a completion wait command */ | 263 | /* if one, we need to send a completion wait command */ |
260 | int need_sync; | 264 | int need_sync; |
261 | 265 | ||
266 | /* true if interrupts for this IOMMU are already enabled */ | ||
267 | bool int_enabled; | ||
268 | |||
262 | /* default dma_ops domain for that IOMMU */ | 269 | /* default dma_ops domain for that IOMMU */ |
263 | struct dma_ops_domain *default_dom; | 270 | struct dma_ops_domain *default_dom; |
264 | }; | 271 | }; |