1#ifndef __PPC_PCI_H
2#define __PPC_PCI_H
3#ifdef __KERNEL__
4
5#include <linux/types.h>
6#include <linux/slab.h>
7#include <linux/string.h>
8#include <linux/mm.h>
9#include <asm/scatterlist.h>
10#include <asm/io.h>
11#include <asm/pci-bridge.h>
12#include <asm-generic/pci-dma-compat.h>
13
14struct pci_dev;
15
16
17#define IOBASE_BRIDGE_NUMBER 0
18#define IOBASE_MEMORY 1
19#define IOBASE_IO 2
20#define IOBASE_ISA_IO 3
21#define IOBASE_ISA_MEM 4
22
23
24
25
26
27extern int pci_assign_all_busses;
28
29#define pcibios_assign_all_busses() (pci_assign_all_busses)
30#define pcibios_scan_all_fns(a, b) 0
31
32#define PCIBIOS_MIN_IO 0x1000
33#define PCIBIOS_MIN_MEM 0x10000000
34
35extern inline void pcibios_set_master(struct pci_dev *dev)
36{
37
38}
39
40extern inline void pcibios_penalize_isa_irq(int irq)
41{
42
43}
44
45extern unsigned long pci_resource_to_bus(struct pci_dev *pdev, struct resource *res);
46
47
48
49
50
51
52
53
54extern unsigned long phys_to_bus(unsigned long pa);
55extern unsigned long pci_phys_to_bus(unsigned long pa, int busnr);
56extern unsigned long pci_bus_to_phys(unsigned int ba, int busnr);
57
58
59
60
61
62#define PCI_DMA_BUS_IS_PHYS (1)
63
64
65#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
66#define DECLARE_PCI_UNMAP_LEN(LEN_NAME)
67#define pci_unmap_addr(PTR, ADDR_NAME) (0)
68#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0)
69#define pci_unmap_len(PTR, LEN_NAME) (0)
70#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0)
71
72
73
74
75
76#define pci_dac_dma_supported(pci_dev, mask) (0)
77
78
79#define pci_domain_nr(bus) ((struct pci_controller *)(bus)->sysdata)->index
80
81
82static inline int pci_name_bus(char *name, struct pci_bus *bus)
83{
84 sprintf(name, "%02x", bus->number);
85 return 0;
86}
87
88
89int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma,
90 enum pci_mmap_state mmap_state, int write_combine);
91
92
93#define HAVE_PCI_MMAP 1
94
95extern void
96pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
97 struct resource *res);
98
99extern void pcibios_add_platform_entries(struct pci_dev *dev);
100
101#endif
102
103#endif
104