xref: /linux/arch/riscv/include/asm/pci.h (revision 0526b56cbc3c489642bd6a5fe4b718dea7ef0ee8)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * Copyright (C) 2016 SiFive
4  */
5 
6 #ifndef _ASM_RISCV_PCI_H
7 #define _ASM_RISCV_PCI_H
8 
9 #include <linux/types.h>
10 #include <linux/slab.h>
11 #include <linux/dma-mapping.h>
12 
13 #include <asm/io.h>
14 
15 #define PCIBIOS_MIN_IO		4
16 #define PCIBIOS_MIN_MEM		16
17 
18 #if defined(CONFIG_PCI) && defined(CONFIG_NUMA)
19 static inline int pcibus_to_node(struct pci_bus *bus)
20 {
21 	return dev_to_node(&bus->dev);
22 }
23 #ifndef cpumask_of_pcibus
24 #define cpumask_of_pcibus(bus)	(pcibus_to_node(bus) == -1 ?		\
25 				 cpu_all_mask :				\
26 				 cpumask_of_node(pcibus_to_node(bus)))
27 #endif
28 #endif /* defined(CONFIG_PCI) && defined(CONFIG_NUMA) */
29 
30 /* Generic PCI */
31 #include <asm-generic/pci.h>
32 
33 #endif  /* _ASM_RISCV_PCI_H */
34