xref: /openbmc/linux/arch/microblaze/include/asm/pci.h (revision 2874c5fd)
12874c5fdSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-or-later */
2830980a0SMichal Simek /*
3830980a0SMichal Simek  *
4830980a0SMichal Simek  * Based on powerpc version
5830980a0SMichal Simek  */
6830980a0SMichal Simek 
7830980a0SMichal Simek #ifndef __ASM_MICROBLAZE_PCI_H
8830980a0SMichal Simek #define __ASM_MICROBLAZE_PCI_H
9830980a0SMichal Simek #ifdef __KERNEL__
10830980a0SMichal Simek 
11830980a0SMichal Simek #include <linux/types.h>
12830980a0SMichal Simek #include <linux/slab.h>
13830980a0SMichal Simek #include <linux/string.h>
14830980a0SMichal Simek #include <linux/dma-mapping.h>
15830980a0SMichal Simek #include <linux/pci.h>
1684be456fSChristoph Hellwig #include <linux/scatterlist.h>
17830980a0SMichal Simek 
18830980a0SMichal Simek #include <asm/io.h>
19830980a0SMichal Simek #include <asm/pci-bridge.h>
20830980a0SMichal Simek 
21830980a0SMichal Simek #define PCIBIOS_MIN_IO		0x1000
22830980a0SMichal Simek #define PCIBIOS_MIN_MEM		0x10000000
23830980a0SMichal Simek 
24830980a0SMichal Simek /* Values for the `which' argument to sys_pciconfig_iobase syscall.  */
25830980a0SMichal Simek #define IOBASE_BRIDGE_NUMBER	0
26830980a0SMichal Simek #define IOBASE_MEMORY		1
27830980a0SMichal Simek #define IOBASE_IO		2
28830980a0SMichal Simek #define IOBASE_ISA_IO		3
29830980a0SMichal Simek #define IOBASE_ISA_MEM		4
30830980a0SMichal Simek 
31830980a0SMichal Simek #define pcibios_scan_all_fns(a, b)	0
32830980a0SMichal Simek 
33830980a0SMichal Simek /*
34830980a0SMichal Simek  * Set this to 1 if you want the kernel to re-assign all PCI
35830980a0SMichal Simek  * bus numbers (don't do that on ppc64 yet !)
36830980a0SMichal Simek  */
3772bdee79SBenjamin Herrenschmidt #define pcibios_assign_all_busses()	0
38830980a0SMichal Simek 
39830980a0SMichal Simek extern int pci_domain_nr(struct pci_bus *bus);
40830980a0SMichal Simek 
41830980a0SMichal Simek /* Decide whether to display the domain number in /proc */
42830980a0SMichal Simek extern int pci_proc_domain(struct pci_bus *bus);
43830980a0SMichal Simek 
44830980a0SMichal Simek struct vm_area_struct;
45830980a0SMichal Simek 
4670f6283aSDavid Woodhouse /* Tell PCI code what kind of PCI resource mappings we support */
47830980a0SMichal Simek #define HAVE_PCI_MMAP			1
4870f6283aSDavid Woodhouse #define ARCH_GENERIC_PCI_MMAP_RESOURCE	1
49e854d8b2SDavid Woodhouse #define arch_can_pci_mmap_io()		1
50830980a0SMichal Simek 
51830980a0SMichal Simek extern int pci_legacy_read(struct pci_bus *bus, loff_t port, u32 *val,
52830980a0SMichal Simek 			   size_t count);
53830980a0SMichal Simek extern int pci_legacy_write(struct pci_bus *bus, loff_t port, u32 val,
54830980a0SMichal Simek 			   size_t count);
55830980a0SMichal Simek extern int pci_mmap_legacy_page_range(struct pci_bus *bus,
56830980a0SMichal Simek 				      struct vm_area_struct *vma,
57830980a0SMichal Simek 				      enum pci_mmap_state mmap_state);
58830980a0SMichal Simek 
59830980a0SMichal Simek #define HAVE_PCI_LEGACY	1
60830980a0SMichal Simek 
61830980a0SMichal Simek extern void pcibios_resource_survey(void);
62830980a0SMichal Simek 
63830980a0SMichal Simek struct file;
64830980a0SMichal Simek extern pgprot_t	pci_phys_mem_access_prot(struct file *file,
65830980a0SMichal Simek 					 unsigned long pfn,
66830980a0SMichal Simek 					 unsigned long size,
67830980a0SMichal Simek 					 pgprot_t prot);
68830980a0SMichal Simek 
69830980a0SMichal Simek #define HAVE_ARCH_PCI_RESOURCE_TO_USER
70830980a0SMichal Simek 
7125985edcSLucas De Marchi /* This part of code was originally in xilinx-pci.h */
72733cc218SMichal Simek #ifdef CONFIG_PCI_XILINX
73733cc218SMichal Simek extern void __init xilinx_pci_init(void);
74733cc218SMichal Simek #else
75733cc218SMichal Simek static inline void __init xilinx_pci_init(void) { return; }
76733cc218SMichal Simek #endif
77733cc218SMichal Simek 
78830980a0SMichal Simek #endif	/* __KERNEL__ */
79830980a0SMichal Simek #endif /* __ASM_MICROBLAZE_PCI_H */
80