diff options
author | Mark Maule <maule@sgi.com> | 2006-04-10 22:17:48 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-06-21 14:59:58 -0400 |
commit | fd58e55fcf5568e51da2ed54d7acd049c3fdb184 (patch) | |
tree | 2cf41864d66b8db39f637549d4652c7664256155 /include | |
parent | c34b4c734482dda750deb6089521f7c891b48736 (diff) |
[PATCH] PCI: msi abstractions and support for altix
Abstract portions of the MSI core for platforms that do not use standard
APIC interrupt controllers. This is implemented through a new arch-specific
msi setup routine, and a set of msi ops which can be set on a per platform
basis.
Signed-off-by: Mark Maule <maule@sgi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-i386/msi.h | 8 | ||||
-rw-r--r-- | include/asm-ia64/machvec.h | 7 | ||||
-rw-r--r-- | include/asm-ia64/machvec_sn2.h | 7 | ||||
-rw-r--r-- | include/asm-ia64/msi.h | 12 | ||||
-rw-r--r-- | include/asm-x86_64/msi.h | 8 |
5 files changed, 42 insertions, 0 deletions
diff --git a/include/asm-i386/msi.h b/include/asm-i386/msi.h index f041d4495faf..ed1014235e9c 100644 --- a/include/asm-i386/msi.h +++ b/include/asm-i386/msi.h | |||
@@ -12,4 +12,12 @@ | |||
12 | #define LAST_DEVICE_VECTOR 232 | 12 | #define LAST_DEVICE_VECTOR 232 |
13 | #define MSI_TARGET_CPU_SHIFT 12 | 13 | #define MSI_TARGET_CPU_SHIFT 12 |
14 | 14 | ||
15 | extern struct msi_ops msi_apic_ops; | ||
16 | |||
17 | static inline int msi_arch_init(void) | ||
18 | { | ||
19 | msi_register(&msi_apic_ops); | ||
20 | return 0; | ||
21 | } | ||
22 | |||
15 | #endif /* ASM_MSI_H */ | 23 | #endif /* ASM_MSI_H */ |
diff --git a/include/asm-ia64/machvec.h b/include/asm-ia64/machvec.h index 0df72a134c8b..15b545a897a4 100644 --- a/include/asm-ia64/machvec.h +++ b/include/asm-ia64/machvec.h | |||
@@ -75,6 +75,7 @@ typedef unsigned char ia64_mv_readb_relaxed_t (const volatile void __iomem *); | |||
75 | typedef unsigned short ia64_mv_readw_relaxed_t (const volatile void __iomem *); | 75 | typedef unsigned short ia64_mv_readw_relaxed_t (const volatile void __iomem *); |
76 | typedef unsigned int ia64_mv_readl_relaxed_t (const volatile void __iomem *); | 76 | typedef unsigned int ia64_mv_readl_relaxed_t (const volatile void __iomem *); |
77 | typedef unsigned long ia64_mv_readq_relaxed_t (const volatile void __iomem *); | 77 | typedef unsigned long ia64_mv_readq_relaxed_t (const volatile void __iomem *); |
78 | typedef int ia64_mv_msi_init_t (void); | ||
78 | 79 | ||
79 | static inline void | 80 | static inline void |
80 | machvec_noop (void) | 81 | machvec_noop (void) |
@@ -153,6 +154,7 @@ extern void machvec_tlb_migrate_finish (struct mm_struct *); | |||
153 | # define platform_readl_relaxed ia64_mv.readl_relaxed | 154 | # define platform_readl_relaxed ia64_mv.readl_relaxed |
154 | # define platform_readq_relaxed ia64_mv.readq_relaxed | 155 | # define platform_readq_relaxed ia64_mv.readq_relaxed |
155 | # define platform_migrate ia64_mv.migrate | 156 | # define platform_migrate ia64_mv.migrate |
157 | # define platform_msi_init ia64_mv.msi_init | ||
156 | # endif | 158 | # endif |
157 | 159 | ||
158 | /* __attribute__((__aligned__(16))) is required to make size of the | 160 | /* __attribute__((__aligned__(16))) is required to make size of the |
@@ -202,6 +204,7 @@ struct ia64_machine_vector { | |||
202 | ia64_mv_readl_relaxed_t *readl_relaxed; | 204 | ia64_mv_readl_relaxed_t *readl_relaxed; |
203 | ia64_mv_readq_relaxed_t *readq_relaxed; | 205 | ia64_mv_readq_relaxed_t *readq_relaxed; |
204 | ia64_mv_migrate_t *migrate; | 206 | ia64_mv_migrate_t *migrate; |
207 | ia64_mv_msi_init_t *msi_init; | ||
205 | } __attribute__((__aligned__(16))); /* align attrib? see above comment */ | 208 | } __attribute__((__aligned__(16))); /* align attrib? see above comment */ |
206 | 209 | ||
207 | #define MACHVEC_INIT(name) \ | 210 | #define MACHVEC_INIT(name) \ |
@@ -247,6 +250,7 @@ struct ia64_machine_vector { | |||
247 | platform_readl_relaxed, \ | 250 | platform_readl_relaxed, \ |
248 | platform_readq_relaxed, \ | 251 | platform_readq_relaxed, \ |
249 | platform_migrate, \ | 252 | platform_migrate, \ |
253 | platform_msi_init, \ | ||
250 | } | 254 | } |
251 | 255 | ||
252 | extern struct ia64_machine_vector ia64_mv; | 256 | extern struct ia64_machine_vector ia64_mv; |
@@ -400,5 +404,8 @@ extern int ia64_pci_legacy_write(struct pci_bus *bus, u16 port, u32 val, u8 size | |||
400 | #ifndef platform_migrate | 404 | #ifndef platform_migrate |
401 | # define platform_migrate machvec_noop_task | 405 | # define platform_migrate machvec_noop_task |
402 | #endif | 406 | #endif |
407 | #ifndef platform_msi_init | ||
408 | # define platform_msi_init ((ia64_mv_msi_init_t*)NULL) | ||
409 | #endif | ||
403 | 410 | ||
404 | #endif /* _ASM_IA64_MACHVEC_H */ | 411 | #endif /* _ASM_IA64_MACHVEC_H */ |
diff --git a/include/asm-ia64/machvec_sn2.h b/include/asm-ia64/machvec_sn2.h index da1d43755afe..cf724dc79d8c 100644 --- a/include/asm-ia64/machvec_sn2.h +++ b/include/asm-ia64/machvec_sn2.h | |||
@@ -67,6 +67,8 @@ extern ia64_mv_dma_sync_sg_for_device sn_dma_sync_sg_for_device; | |||
67 | extern ia64_mv_dma_mapping_error sn_dma_mapping_error; | 67 | extern ia64_mv_dma_mapping_error sn_dma_mapping_error; |
68 | extern ia64_mv_dma_supported sn_dma_supported; | 68 | extern ia64_mv_dma_supported sn_dma_supported; |
69 | extern ia64_mv_migrate_t sn_migrate; | 69 | extern ia64_mv_migrate_t sn_migrate; |
70 | extern ia64_mv_msi_init_t sn_msi_init; | ||
71 | |||
70 | 72 | ||
71 | /* | 73 | /* |
72 | * This stuff has dual use! | 74 | * This stuff has dual use! |
@@ -117,6 +119,11 @@ extern ia64_mv_migrate_t sn_migrate; | |||
117 | #define platform_dma_mapping_error sn_dma_mapping_error | 119 | #define platform_dma_mapping_error sn_dma_mapping_error |
118 | #define platform_dma_supported sn_dma_supported | 120 | #define platform_dma_supported sn_dma_supported |
119 | #define platform_migrate sn_migrate | 121 | #define platform_migrate sn_migrate |
122 | #ifdef CONFIG_PCI_MSI | ||
123 | #define platform_msi_init sn_msi_init | ||
124 | #else | ||
125 | #define platform_msi_init ((ia64_mv_msi_init_t*)NULL) | ||
126 | #endif | ||
120 | 127 | ||
121 | #include <asm/sn/io.h> | 128 | #include <asm/sn/io.h> |
122 | 129 | ||
diff --git a/include/asm-ia64/msi.h b/include/asm-ia64/msi.h index 97890f7762b3..bb92b0dbde2f 100644 --- a/include/asm-ia64/msi.h +++ b/include/asm-ia64/msi.h | |||
@@ -14,4 +14,16 @@ static inline void set_intr_gate (int nr, void *func) {} | |||
14 | #define ack_APIC_irq ia64_eoi | 14 | #define ack_APIC_irq ia64_eoi |
15 | #define MSI_TARGET_CPU_SHIFT 4 | 15 | #define MSI_TARGET_CPU_SHIFT 4 |
16 | 16 | ||
17 | extern struct msi_ops msi_apic_ops; | ||
18 | |||
19 | static inline int msi_arch_init(void) | ||
20 | { | ||
21 | if (platform_msi_init) | ||
22 | return platform_msi_init(); | ||
23 | |||
24 | /* default ops for most ia64 platforms */ | ||
25 | msi_register(&msi_apic_ops); | ||
26 | return 0; | ||
27 | } | ||
28 | |||
17 | #endif /* ASM_MSI_H */ | 29 | #endif /* ASM_MSI_H */ |
diff --git a/include/asm-x86_64/msi.h b/include/asm-x86_64/msi.h index 356e0e82f50b..8d6d6bf8fad5 100644 --- a/include/asm-x86_64/msi.h +++ b/include/asm-x86_64/msi.h | |||
@@ -13,4 +13,12 @@ | |||
13 | #define LAST_DEVICE_VECTOR 232 | 13 | #define LAST_DEVICE_VECTOR 232 |
14 | #define MSI_TARGET_CPU_SHIFT 12 | 14 | #define MSI_TARGET_CPU_SHIFT 12 |
15 | 15 | ||
16 | extern struct msi_ops msi_apic_ops; | ||
17 | |||
18 | static inline int msi_arch_init(void) | ||
19 | { | ||
20 | msi_register(&msi_apic_ops); | ||
21 | return 0; | ||
22 | } | ||
23 | |||
16 | #endif /* ASM_MSI_H */ | 24 | #endif /* ASM_MSI_H */ |