1
2
3
4
5
6
7
8
9
10
11#ifndef __ASM_MACH_PCI_H
12#define __ASM_MACH_PCI_H
13
14#include <linux/ioport.h>
15
16struct pci_sys_data;
17struct pci_ops;
18struct pci_bus;
19struct device;
20
21struct hw_pci {
22#ifdef CONFIG_PCI_DOMAINS
23 int domain;
24#endif
25#ifdef CONFIG_PCI_MSI
26 struct msi_controller *msi_ctrl;
27#endif
28 struct pci_ops *ops;
29 int nr_controllers;
30 void **private_data;
31 int (*setup)(int nr, struct pci_sys_data *);
32 struct pci_bus *(*scan)(int nr, struct pci_sys_data *);
33 void (*preinit)(void);
34 void (*postinit)(void);
35 u8 (*swizzle)(struct pci_dev *dev, u8 *pin);
36 int (*map_irq)(const struct pci_dev *dev, u8 slot, u8 pin);
37 resource_size_t (*align_resource)(struct pci_dev *dev,
38 const struct resource *res,
39 resource_size_t start,
40 resource_size_t size,
41 resource_size_t align);
42};
43
44
45
46
47struct pci_sys_data {
48#ifdef CONFIG_PCI_DOMAINS
49 int domain;
50#endif
51#ifdef CONFIG_PCI_MSI
52 struct msi_controller *msi_ctrl;
53#endif
54 struct list_head node;
55 int busnr;
56 u64 mem_offset;
57 unsigned long io_offset;
58 struct pci_bus *bus;
59 struct list_head resources;
60 struct resource io_res;
61 char io_res_name[12];
62
63 u8 (*swizzle)(struct pci_dev *, u8 *);
64
65 int (*map_irq)(const struct pci_dev *, u8, u8);
66
67 resource_size_t (*align_resource)(struct pci_dev *dev,
68 const struct resource *res,
69 resource_size_t start,
70 resource_size_t size,
71 resource_size_t align);
72 void *private_data;
73};
74
75
76
77
78void pci_common_init_dev(struct device *, struct hw_pci *);
79
80
81
82
83
84static inline void pci_common_init(struct hw_pci *hw)
85{
86 pci_common_init_dev(NULL, hw);
87}
88
89
90
91
92#if defined(CONFIG_PCI)
93extern void pci_map_io_early(unsigned long pfn);
94#else
95static inline void pci_map_io_early(unsigned long pfn) {}
96#endif
97
98
99
100
101extern struct pci_ops iop3xx_ops;
102extern int iop3xx_pci_setup(int nr, struct pci_sys_data *);
103extern void iop3xx_pci_preinit(void);
104extern void iop3xx_pci_preinit_cond(void);
105
106extern struct pci_ops dc21285_ops;
107extern int dc21285_setup(int nr, struct pci_sys_data *);
108extern void dc21285_preinit(void);
109extern void dc21285_postinit(void);
110
111#endif
112