1 /* SPDX-License-Identifier: GPL-2.0 */
7 #include <linux/spinlock.h>
8 #include <linux/dma-mapping.h>
9 #include <linux/scatterlist.h>
10 #include <asm/machvec.h>
13 * The following structure is used to manage multiple PCI busses.
16 struct pci_iommu_arena
;
19 /* A controller. Used to manage multiple PCI busses. */
21 struct pci_controller
{
22 struct pci_controller
*next
;
24 struct resource
*io_space
;
25 struct resource
*mem_space
;
27 /* The following are for reporting to userland. The invariant is
28 that if we report a BWX-capable dense memory, we do not report
29 a sparse memory at all, even if it exists. */
30 unsigned long sparse_mem_base
;
31 unsigned long dense_mem_base
;
32 unsigned long sparse_io_base
;
33 unsigned long dense_io_base
;
35 /* This one's for the kernel only. It's in KSEG somewhere. */
36 unsigned long config_space_base
;
39 /* For compatibility with current (as of July 2003) pciutils
40 and XFree86. Eventually will be removed. */
41 unsigned int need_domain_info
;
43 struct pci_iommu_arena
*sg_pci
;
44 struct pci_iommu_arena
*sg_isa
;
49 /* Override the logic in pci_scan_bus for skipping already-configured
52 #define pcibios_assign_all_busses() 1
54 #define PCIBIOS_MIN_IO alpha_mv.min_io_address
55 #define PCIBIOS_MIN_MEM alpha_mv.min_mem_address
59 /* The PCI address space does not equal the physical memory address space.
60 The networking and block device layers use this boolean for bounce buffer
62 #define PCI_DMA_BUS_IS_PHYS 0
64 /* TODO: integrate with include/asm-generic/pci.h ? */
65 static inline int pci_get_legacy_ide_irq(struct pci_dev
*dev
, int channel
)
67 return channel
? 15 : 14;
70 #define pci_domain_nr(bus) ((struct pci_controller *)(bus)->sysdata)->index
72 static inline int pci_proc_domain(struct pci_bus
*bus
)
74 struct pci_controller
*hose
= bus
->sysdata
;
75 return hose
->need_domain_info
;
78 #endif /* __KERNEL__ */
80 /* Values for the `which' argument to sys_pciconfig_iobase. */
82 #define IOBASE_SPARSE_MEM 1
83 #define IOBASE_DENSE_MEM 2
84 #define IOBASE_SPARSE_IO 3
85 #define IOBASE_DENSE_IO 4
86 #define IOBASE_ROOT_BUS 5
87 #define IOBASE_FROM_HOSE 0x10000
89 extern struct pci_dev
*isa_bridge
;
91 extern int pci_legacy_read(struct pci_bus
*bus
, loff_t port
, u32
*val
,
93 extern int pci_legacy_write(struct pci_bus
*bus
, loff_t port
, u32 val
,
95 extern int pci_mmap_legacy_page_range(struct pci_bus
*bus
,
96 struct vm_area_struct
*vma
,
97 enum pci_mmap_state mmap_state
);
98 extern void pci_adjust_legacy_attr(struct pci_bus
*bus
,
99 enum pci_mmap_state mmap_type
);
100 #define HAVE_PCI_LEGACY 1
102 extern int pci_create_resource_files(struct pci_dev
*dev
);
103 extern void pci_remove_resource_files(struct pci_dev
*dev
);
105 #endif /* __ALPHA_PCI_H */