diff options
author | Mark Maule <maule@sgi.com> | 2005-04-25 14:26:03 -0400 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2005-04-25 14:26:03 -0400 |
commit | e955d82543fea76b02aa243b182e782f71bda82c (patch) | |
tree | 58dc9df5161f47bca69c8dc9c819495f15694352 /arch/ia64/sn/include | |
parent | 25ee7e3832951cf5896b194f6cd929a44863f419 (diff) |
[IA64-SGI] sn2-pci-dma-abstraction.patch
Provide an abstraction of the altix pci dma runtime layer so that multiple
pci-based bridges can be supported.
Signed-off-by: Mark Maule <maule@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch/ia64/sn/include')
-rw-r--r-- | arch/ia64/sn/include/pci/pcibr_provider.h | 6 | ||||
-rw-r--r-- | arch/ia64/sn/include/pci/pcibus_provider_defs.h | 12 | ||||
-rw-r--r-- | arch/ia64/sn/include/pci/pcidev.h | 4 |
3 files changed, 18 insertions, 4 deletions
diff --git a/arch/ia64/sn/include/pci/pcibr_provider.h b/arch/ia64/sn/include/pci/pcibr_provider.h index b1f05ffec70b..1cd291d8badd 100644 --- a/arch/ia64/sn/include/pci/pcibr_provider.h +++ b/arch/ia64/sn/include/pci/pcibr_provider.h | |||
@@ -123,9 +123,11 @@ pcibr_lock(struct pcibus_info *pcibus_info) | |||
123 | } | 123 | } |
124 | #define pcibr_unlock(pcibus_info, flag) spin_unlock_irqrestore(&pcibus_info->pbi_lock, flag) | 124 | #define pcibr_unlock(pcibus_info, flag) spin_unlock_irqrestore(&pcibus_info->pbi_lock, flag) |
125 | 125 | ||
126 | extern int pcibr_init_provider(void); | ||
126 | extern void *pcibr_bus_fixup(struct pcibus_bussoft *); | 127 | extern void *pcibr_bus_fixup(struct pcibus_bussoft *); |
127 | extern uint64_t pcibr_dma_map(struct pcidev_info *, unsigned long, size_t, unsigned int); | 128 | extern dma_addr_t pcibr_dma_map(struct pci_dev *, unsigned long, size_t); |
128 | extern void pcibr_dma_unmap(struct pcidev_info *, dma_addr_t, int); | 129 | extern dma_addr_t pcibr_dma_map_consistent(struct pci_dev *, unsigned long, size_t); |
130 | extern void pcibr_dma_unmap(struct pci_dev *, dma_addr_t, int); | ||
129 | 131 | ||
130 | /* | 132 | /* |
131 | * prototypes for the bridge asic register access routines in pcibr_reg.c | 133 | * prototypes for the bridge asic register access routines in pcibr_reg.c |
diff --git a/arch/ia64/sn/include/pci/pcibus_provider_defs.h b/arch/ia64/sn/include/pci/pcibus_provider_defs.h index 07065615bbea..f546b4ece33c 100644 --- a/arch/ia64/sn/include/pci/pcibus_provider_defs.h +++ b/arch/ia64/sn/include/pci/pcibus_provider_defs.h | |||
@@ -18,6 +18,8 @@ | |||
18 | #define PCIIO_ASIC_TYPE_PIC 2 | 18 | #define PCIIO_ASIC_TYPE_PIC 2 |
19 | #define PCIIO_ASIC_TYPE_TIOCP 3 | 19 | #define PCIIO_ASIC_TYPE_TIOCP 3 |
20 | 20 | ||
21 | #define PCIIO_ASIC_MAX_TYPES 4 | ||
22 | |||
21 | /* | 23 | /* |
22 | * Common pciio bus provider data. There should be one of these as the | 24 | * Common pciio bus provider data. There should be one of these as the |
23 | * first field in any pciio based provider soft structure (e.g. pcibr_soft | 25 | * first field in any pciio based provider soft structure (e.g. pcibr_soft |
@@ -35,9 +37,15 @@ struct pcibus_bussoft { | |||
35 | }; | 37 | }; |
36 | 38 | ||
37 | /* | 39 | /* |
38 | * DMA mapping flags | 40 | * SN pci bus indirection |
39 | */ | 41 | */ |
40 | 42 | ||
41 | #define SN_PCIDMA_CONSISTENT 0x0001 | 43 | struct sn_pcibus_provider { |
44 | dma_addr_t (*dma_map)(struct pci_dev *, unsigned long, size_t); | ||
45 | dma_addr_t (*dma_map_consistent)(struct pci_dev *, unsigned long, size_t); | ||
46 | void (*dma_unmap)(struct pci_dev *, dma_addr_t, int); | ||
47 | void * (*bus_fixup)(struct pcibus_bussoft *); | ||
48 | }; | ||
42 | 49 | ||
50 | extern struct sn_pcibus_provider *sn_pci_provider[]; | ||
43 | #endif /* _ASM_IA64_SN_PCI_PCIBUS_PROVIDER_H */ | 51 | #endif /* _ASM_IA64_SN_PCI_PCIBUS_PROVIDER_H */ |
diff --git a/arch/ia64/sn/include/pci/pcidev.h b/arch/ia64/sn/include/pci/pcidev.h index 81eb95d3bf47..ed4031d80811 100644 --- a/arch/ia64/sn/include/pci/pcidev.h +++ b/arch/ia64/sn/include/pci/pcidev.h | |||
@@ -32,6 +32,9 @@ extern struct sn_irq_info **sn_irq; | |||
32 | #define SN_PCIDEV_BUSSOFT(pci_dev) \ | 32 | #define SN_PCIDEV_BUSSOFT(pci_dev) \ |
33 | (SN_PCIDEV_INFO(pci_dev)->pdi_host_pcidev_info->pdi_pcibus_info) | 33 | (SN_PCIDEV_INFO(pci_dev)->pdi_host_pcidev_info->pdi_pcibus_info) |
34 | 34 | ||
35 | #define SN_PCIDEV_BUSPROVIDER(pci_dev) \ | ||
36 | (SN_PCIDEV_INFO(pci_dev)->pdi_provider) | ||
37 | |||
35 | #define PCIIO_BUS_NONE 255 /* bus 255 reserved */ | 38 | #define PCIIO_BUS_NONE 255 /* bus 255 reserved */ |
36 | #define PCIIO_SLOT_NONE 255 | 39 | #define PCIIO_SLOT_NONE 255 |
37 | #define PCIIO_FUNC_NONE 255 | 40 | #define PCIIO_FUNC_NONE 255 |
@@ -46,6 +49,7 @@ struct pcidev_info { | |||
46 | struct pci_dev *pdi_linux_pcidev; /* Kernel pci_dev */ | 49 | struct pci_dev *pdi_linux_pcidev; /* Kernel pci_dev */ |
47 | 50 | ||
48 | struct sn_irq_info *pdi_sn_irq_info; | 51 | struct sn_irq_info *pdi_sn_irq_info; |
52 | struct sn_pcibus_provider *pdi_provider; /* sn pci ops */ | ||
49 | }; | 53 | }; |
50 | 54 | ||
51 | extern void sn_irq_fixup(struct pci_dev *pci_dev, | 55 | extern void sn_irq_fixup(struct pci_dev *pci_dev, |