xref: /openbmc/linux/arch/riscv/include/asm/pci.h (revision 6d60b6ee)
1 /*
2  * Copyright (C) 2016 SiFive
3  *
4  *   This program is free software; you can redistribute it and/or
5  *   modify it under the terms of the GNU General Public License
6  *   as published by the Free Software Foundation, version 2.
7  *
8  *   This program is distributed in the hope that it will be useful,
9  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
10  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11  *   GNU General Public License for more details.
12  */
13 
14 #ifndef __ASM_RISCV_PCI_H
15 #define __ASM_RISCV_PCI_H
16 
17 #include <linux/types.h>
18 #include <linux/slab.h>
19 #include <linux/dma-mapping.h>
20 
21 #include <asm/io.h>
22 
23 #define PCIBIOS_MIN_IO		0
24 #define PCIBIOS_MIN_MEM		0
25 
26 /* RISC-V shim does not initialize PCI bus */
27 #define pcibios_assign_all_busses() 1
28 
29 /* We do not have an IOMMU */
30 #define PCI_DMA_BUS_IS_PHYS 1
31 
32 extern int isa_dma_bridge_buggy;
33 
34 #ifdef CONFIG_PCI
35 static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
36 {
37 	/* no legacy IRQ on risc-v */
38 	return -ENODEV;
39 }
40 
41 static inline int pci_proc_domain(struct pci_bus *bus)
42 {
43 	/* always show the domain in /proc */
44 	return 1;
45 }
46 #endif  /* CONFIG_PCI */
47 
48 #endif  /* __ASM_PCI_H */
49