Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Sam Ravnborg | f5e706a | 2008-07-17 21:55:51 -0700 | [diff] [blame] | 2 | #ifndef __SPARC64_PCI_H |
| 3 | #define __SPARC64_PCI_H |
| 4 | |
| 5 | #ifdef __KERNEL__ |
| 6 | |
| 7 | #include <linux/dma-mapping.h> |
| 8 | |
| 9 | /* Can be used to override the logic in pci_scan_bus for skipping |
| 10 | * already-configured bus numbers - to be used for buggy BIOSes |
| 11 | * or architectures with incomplete PCI setup by the loader. |
| 12 | */ |
| 13 | #define pcibios_assign_all_busses() 0 |
Sam Ravnborg | f5e706a | 2008-07-17 21:55:51 -0700 | [diff] [blame] | 14 | |
| 15 | #define PCIBIOS_MIN_IO 0UL |
| 16 | #define PCIBIOS_MIN_MEM 0UL |
| 17 | |
| 18 | #define PCI_IRQ_NONE 0xffffffff |
| 19 | |
Sam Ravnborg | f5e706a | 2008-07-17 21:55:51 -0700 | [diff] [blame] | 20 | /* The PCI address space does not equal the physical memory |
| 21 | * address space. The networking and block device layers use |
| 22 | * this boolean for bounce buffer decisions. |
| 23 | */ |
| 24 | #define PCI_DMA_BUS_IS_PHYS (0) |
| 25 | |
Sam Ravnborg | f5e706a | 2008-07-17 21:55:51 -0700 | [diff] [blame] | 26 | /* PCI IOMMU mapping bypass support. */ |
| 27 | |
| 28 | /* PCI 64-bit addressing works for all slots on all controller |
| 29 | * types on sparc64. However, it requires that the device |
| 30 | * can drive enough of the 64 bits. |
| 31 | */ |
FUJITA Tomonori | 4ad9b20 | 2010-10-27 15:34:47 -0700 | [diff] [blame] | 32 | #define PCI64_REQUIRED_MASK (~(u64)0) |
Sam Ravnborg | f5e706a | 2008-07-17 21:55:51 -0700 | [diff] [blame] | 33 | #define PCI64_ADDR_BASE 0xfffc000000000000UL |
| 34 | |
Sam Ravnborg | f5e706a | 2008-07-17 21:55:51 -0700 | [diff] [blame] | 35 | /* Return the index of the PCI controller for device PDEV. */ |
| 36 | |
Sam Ravnborg | f05a686 | 2014-05-16 23:25:50 +0200 | [diff] [blame] | 37 | int pci_domain_nr(struct pci_bus *bus); |
Sam Ravnborg | f5e706a | 2008-07-17 21:55:51 -0700 | [diff] [blame] | 38 | static inline int pci_proc_domain(struct pci_bus *bus) |
| 39 | { |
| 40 | return 1; |
| 41 | } |
| 42 | |
| 43 | /* Platform support for /proc/bus/pci/X/Y mmap()s. */ |
| 44 | |
| 45 | #define HAVE_PCI_MMAP |
David Woodhouse | e854d8b | 2017-04-12 13:25:56 +0100 | [diff] [blame] | 46 | #define arch_can_pci_mmap_io() 1 |
Sam Ravnborg | f5e706a | 2008-07-17 21:55:51 -0700 | [diff] [blame] | 47 | #define HAVE_ARCH_PCI_GET_UNMAPPED_AREA |
| 48 | #define get_pci_unmapped_area get_fb_unmapped_area |
| 49 | |
Sam Ravnborg | f5e706a | 2008-07-17 21:55:51 -0700 | [diff] [blame] | 50 | static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) |
| 51 | { |
| 52 | return PCI_IRQ_NONE; |
| 53 | } |
| 54 | |
Sam Ravnborg | f5e706a | 2008-07-17 21:55:51 -0700 | [diff] [blame] | 55 | #define HAVE_ARCH_PCI_RESOURCE_TO_USER |
Sam Ravnborg | f5e706a | 2008-07-17 21:55:51 -0700 | [diff] [blame] | 56 | #endif /* __KERNEL__ */ |
| 57 | |
| 58 | #endif /* __SPARC64_PCI_H */ |