1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (C) 2016 SiFive
6 #ifndef _ASM_RISCV_PCI_H
7 #define _ASM_RISCV_PCI_H
9 #include <linux/types.h>
10 #include <linux/slab.h>
11 #include <linux/dma-mapping.h>
15 #define PCIBIOS_MIN_IO 0
16 #define PCIBIOS_MIN_MEM 0
18 /* RISC-V shim does not initialize PCI bus */
19 #define pcibios_assign_all_busses() 1
21 #define ARCH_GENERIC_PCI_MMAP_RESOURCE 1
23 extern int isa_dma_bridge_buggy;
26 static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
28 /* no legacy IRQ on risc-v */
32 static inline int pci_proc_domain(struct pci_bus *bus)
34 /* always show the domain in /proc */
40 static inline int pcibus_to_node(struct pci_bus *bus)
42 return dev_to_node(&bus->dev);
44 #ifndef cpumask_of_pcibus
45 #define cpumask_of_pcibus(bus) (pcibus_to_node(bus) == -1 ? \
47 cpumask_of_node(pcibus_to_node(bus)))
49 #endif /* CONFIG_NUMA */
51 #endif /* CONFIG_PCI */
53 #endif /* _ASM_RISCV_PCI_H */