xref: /openbmc/linux/arch/ia64/include/asm/pci.h (revision 4f2c0a4acffbec01079c28f839422e64ddeff004)
1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
27f30491cSTony Luck #ifndef _ASM_IA64_PCI_H
37f30491cSTony Luck #define _ASM_IA64_PCI_H
47f30491cSTony Luck 
57f30491cSTony Luck #include <linux/mm.h>
67f30491cSTony Luck #include <linux/slab.h>
77f30491cSTony Luck #include <linux/spinlock.h>
87f30491cSTony Luck #include <linux/string.h>
97f30491cSTony Luck #include <linux/types.h>
1084be456fSChristoph Hellwig #include <linux/scatterlist.h>
117f30491cSTony Luck 
127f30491cSTony Luck #include <asm/io.h>
137f30491cSTony Luck #include <asm/hw_irq.h>
147f30491cSTony Luck 
15c140d879SDavid Howells struct pci_vector_struct {
16c140d879SDavid Howells 	__u16 segment;	/* PCI Segment number */
17c140d879SDavid Howells 	__u16 bus;	/* PCI Bus number */
18c140d879SDavid Howells 	__u32 pci_id;	/* ACPI split 16 bits device, 16 bits function (see section 6.1.1) */
19c140d879SDavid Howells 	__u8 pin;	/* PCI PIN (0 = A, 1 = B, 2 = C, 3 = D) */
20c140d879SDavid Howells 	__u32 irq;	/* IRQ assigned */
21c140d879SDavid Howells };
22c140d879SDavid Howells 
237f30491cSTony Luck /*
247f30491cSTony Luck  * Can be used to override the logic in pci_scan_bus for skipping already-configured bus
257f30491cSTony Luck  * numbers - to be used for buggy BIOSes or architectures with incomplete PCI setup by the
267f30491cSTony Luck  * loader.
277f30491cSTony Luck  */
287f30491cSTony Luck #define pcibios_assign_all_busses()     0
297f30491cSTony Luck 
307f30491cSTony Luck #define PCIBIOS_MIN_IO		0x1000
317f30491cSTony Luck #define PCIBIOS_MIN_MEM		0x10000000
327f30491cSTony Luck 
337f30491cSTony Luck #define HAVE_PCI_MMAP
34d9c102deSDavid Woodhouse #define ARCH_GENERIC_PCI_MMAP_RESOURCE
35ae749c7aSDavid Woodhouse #define arch_can_pci_mmap_wc()	1
36ae749c7aSDavid Woodhouse 
377f30491cSTony Luck #define HAVE_PCI_LEGACY
387f30491cSTony Luck extern int pci_mmap_legacy_page_range(struct pci_bus *bus,
39f19aeb1fSBenjamin Herrenschmidt 				      struct vm_area_struct *vma,
40f19aeb1fSBenjamin Herrenschmidt 				      enum pci_mmap_state mmap_state);
417f30491cSTony Luck 
42*05933aacSChristoph Hellwig char *pci_get_legacy_mem(struct pci_bus *bus);
43*05933aacSChristoph Hellwig int pci_legacy_read(struct pci_bus *bus, u16 port, u32 *val, u8 size);
44*05933aacSChristoph Hellwig int pci_legacy_write(struct pci_bus *bus, u16 port, u32 val, u8 size);
457f30491cSTony Luck 
467f30491cSTony Luck struct pci_controller {
477b199811SRafael J. Wysocki 	struct acpi_device *companion;
487f30491cSTony Luck 	void *iommu;
497f30491cSTony Luck 	int segment;
50b1e9cee7SBjorn Helgaas 	int node;		/* nearest node with memory or NUMA_NO_NODE for global allocation */
517f30491cSTony Luck 
527f30491cSTony Luck 	void *platform_data;
537f30491cSTony Luck };
547f30491cSTony Luck 
555cd7595dSYijing Wang 
567f30491cSTony Luck #define PCI_CONTROLLER(busdev) ((struct pci_controller *) busdev->sysdata)
577f30491cSTony Luck #define pci_domain_nr(busdev)    (PCI_CONTROLLER(busdev)->segment)
587f30491cSTony Luck 
597f30491cSTony Luck extern struct pci_ops pci_root_ops;
607f30491cSTony Luck 
pci_proc_domain(struct pci_bus * bus)617f30491cSTony Luck static inline int pci_proc_domain(struct pci_bus *bus)
627f30491cSTony Luck {
637f30491cSTony Luck 	return (pci_domain_nr(bus) != 0);
647f30491cSTony Luck }
657f30491cSTony Luck 
667f30491cSTony Luck #endif /* _ASM_IA64_PCI_H */
67