xref: /openbmc/linux/arch/microblaze/include/asm/pci.h (revision 70f6283a)
1830980a0SMichal Simek /*
2830980a0SMichal Simek  * This program is free software; you can redistribute it and/or
3830980a0SMichal Simek  * modify it under the terms of the GNU General Public License
4830980a0SMichal Simek  * as published by the Free Software Foundation; either version
5830980a0SMichal Simek  * 2 of the License, or (at your option) any later version.
6830980a0SMichal Simek  *
7830980a0SMichal Simek  * Based on powerpc version
8830980a0SMichal Simek  */
9830980a0SMichal Simek 
10830980a0SMichal Simek #ifndef __ASM_MICROBLAZE_PCI_H
11830980a0SMichal Simek #define __ASM_MICROBLAZE_PCI_H
12830980a0SMichal Simek #ifdef __KERNEL__
13830980a0SMichal Simek 
14830980a0SMichal Simek #include <linux/types.h>
15830980a0SMichal Simek #include <linux/slab.h>
16830980a0SMichal Simek #include <linux/string.h>
17830980a0SMichal Simek #include <linux/dma-mapping.h>
18830980a0SMichal Simek #include <linux/pci.h>
1984be456fSChristoph Hellwig #include <linux/scatterlist.h>
20830980a0SMichal Simek 
21830980a0SMichal Simek #include <asm/io.h>
22830980a0SMichal Simek #include <asm/prom.h>
23830980a0SMichal Simek #include <asm/pci-bridge.h>
24830980a0SMichal Simek 
25830980a0SMichal Simek #define PCIBIOS_MIN_IO		0x1000
26830980a0SMichal Simek #define PCIBIOS_MIN_MEM		0x10000000
27830980a0SMichal Simek 
28830980a0SMichal Simek /* Values for the `which' argument to sys_pciconfig_iobase syscall.  */
29830980a0SMichal Simek #define IOBASE_BRIDGE_NUMBER	0
30830980a0SMichal Simek #define IOBASE_MEMORY		1
31830980a0SMichal Simek #define IOBASE_IO		2
32830980a0SMichal Simek #define IOBASE_ISA_IO		3
33830980a0SMichal Simek #define IOBASE_ISA_MEM		4
34830980a0SMichal Simek 
35830980a0SMichal Simek #define pcibios_scan_all_fns(a, b)	0
36830980a0SMichal Simek 
37830980a0SMichal Simek /*
38830980a0SMichal Simek  * Set this to 1 if you want the kernel to re-assign all PCI
39830980a0SMichal Simek  * bus numbers (don't do that on ppc64 yet !)
40830980a0SMichal Simek  */
4172bdee79SBenjamin Herrenschmidt #define pcibios_assign_all_busses()	0
42830980a0SMichal Simek 
43830980a0SMichal Simek extern int pci_domain_nr(struct pci_bus *bus);
44830980a0SMichal Simek 
45830980a0SMichal Simek /* Decide whether to display the domain number in /proc */
46830980a0SMichal Simek extern int pci_proc_domain(struct pci_bus *bus);
47830980a0SMichal Simek 
48830980a0SMichal Simek struct vm_area_struct;
49830980a0SMichal Simek 
5070f6283aSDavid Woodhouse /* Tell PCI code what kind of PCI resource mappings we support */
51830980a0SMichal Simek #define HAVE_PCI_MMAP			1
5270f6283aSDavid Woodhouse #define ARCH_GENERIC_PCI_MMAP_RESOURCE	1
53e854d8b2SDavid Woodhouse #define arch_can_pci_mmap_io()		1
54830980a0SMichal Simek 
55830980a0SMichal Simek extern int pci_legacy_read(struct pci_bus *bus, loff_t port, u32 *val,
56830980a0SMichal Simek 			   size_t count);
57830980a0SMichal Simek extern int pci_legacy_write(struct pci_bus *bus, loff_t port, u32 val,
58830980a0SMichal Simek 			   size_t count);
59830980a0SMichal Simek extern int pci_mmap_legacy_page_range(struct pci_bus *bus,
60830980a0SMichal Simek 				      struct vm_area_struct *vma,
61830980a0SMichal Simek 				      enum pci_mmap_state mmap_state);
62830980a0SMichal Simek 
63830980a0SMichal Simek #define HAVE_PCI_LEGACY	1
64830980a0SMichal Simek 
65830980a0SMichal Simek /* The PCI address space does equal the physical memory
66830980a0SMichal Simek  * address space (no IOMMU).  The IDE and SCSI device layers use
67830980a0SMichal Simek  * this boolean for bounce buffer decisions.
68830980a0SMichal Simek  */
69830980a0SMichal Simek #define PCI_DMA_BUS_IS_PHYS     (1)
70830980a0SMichal Simek 
71830980a0SMichal Simek extern void pcibios_claim_one_bus(struct pci_bus *b);
72830980a0SMichal Simek 
73830980a0SMichal Simek extern void pcibios_finish_adding_to_bus(struct pci_bus *bus);
74830980a0SMichal Simek 
75830980a0SMichal Simek extern void pcibios_resource_survey(void);
76830980a0SMichal Simek 
77830980a0SMichal Simek struct file;
78830980a0SMichal Simek extern pgprot_t	pci_phys_mem_access_prot(struct file *file,
79830980a0SMichal Simek 					 unsigned long pfn,
80830980a0SMichal Simek 					 unsigned long size,
81830980a0SMichal Simek 					 pgprot_t prot);
82830980a0SMichal Simek 
83830980a0SMichal Simek #define HAVE_ARCH_PCI_RESOURCE_TO_USER
84830980a0SMichal Simek 
8525985edcSLucas De Marchi /* This part of code was originally in xilinx-pci.h */
86733cc218SMichal Simek #ifdef CONFIG_PCI_XILINX
87733cc218SMichal Simek extern void __init xilinx_pci_init(void);
88733cc218SMichal Simek #else
89733cc218SMichal Simek static inline void __init xilinx_pci_init(void) { return; }
90733cc218SMichal Simek #endif
91733cc218SMichal Simek 
92830980a0SMichal Simek #endif	/* __KERNEL__ */
93830980a0SMichal Simek #endif /* __ASM_MICROBLAZE_PCI_H */
94