Commit | Line | Data |
---|---|---|
1da177e4 | 1 | /* |
4baa9922 | 2 | * arch/arm/include/asm/mach/pci.h |
1da177e4 LT |
3 | * |
4 | * Copyright (C) 2000 Russell King | |
5 | * | |
6 | * This program is free software; you can redistribute it and/or modify | |
7 | * it under the terms of the GNU General Public License version 2 as | |
8 | * published by the Free Software Foundation. | |
9 | */ | |
10 | ||
52882173 AV |
11 | #ifndef __ASM_MACH_PCI_H |
12 | #define __ASM_MACH_PCI_H | |
13 | ||
c2794437 | 14 | |
1da177e4 | 15 | struct pci_sys_data; |
c23bfc38 | 16 | struct pci_ops; |
1da177e4 LT |
17 | struct pci_bus; |
18 | ||
19 | struct hw_pci { | |
52882173 AV |
20 | #ifdef CONFIG_PCI_DOMAINS |
21 | int domain; | |
22 | #endif | |
c23bfc38 | 23 | struct pci_ops *ops; |
1da177e4 LT |
24 | int nr_controllers; |
25 | int (*setup)(int nr, struct pci_sys_data *); | |
26 | struct pci_bus *(*scan)(int nr, struct pci_sys_data *); | |
27 | void (*preinit)(void); | |
28 | void (*postinit)(void); | |
29 | u8 (*swizzle)(struct pci_dev *dev, u8 *pin); | |
d5341942 | 30 | int (*map_irq)(const struct pci_dev *dev, u8 slot, u8 pin); |
1da177e4 LT |
31 | }; |
32 | ||
33 | /* | |
34 | * Per-controller structure | |
35 | */ | |
36 | struct pci_sys_data { | |
52882173 AV |
37 | #ifdef CONFIG_PCI_DOMAINS |
38 | int domain; | |
39 | #endif | |
1da177e4 LT |
40 | struct list_head node; |
41 | int busnr; /* primary bus number */ | |
e31dd6e4 | 42 | u64 mem_offset; /* bus->cpu memory mapping offset */ |
1da177e4 LT |
43 | unsigned long io_offset; /* bus->cpu IO mapping offset */ |
44 | struct pci_bus *bus; /* PCI bus */ | |
37d15909 | 45 | struct list_head resources; /* root bus resources (apertures) */ |
1da177e4 LT |
46 | /* Bridge swizzling */ |
47 | u8 (*swizzle)(struct pci_dev *, u8 *); | |
48 | /* IRQ mapping */ | |
d5341942 | 49 | int (*map_irq)(const struct pci_dev *, u8, u8); |
35fe2fc4 | 50 | void *private_data; /* platform controller private data */ |
1da177e4 LT |
51 | }; |
52 | ||
1da177e4 LT |
53 | /* |
54 | * Call this with your hw_pci struct to initialise the PCI system. | |
55 | */ | |
56 | void pci_common_init(struct hw_pci *); | |
57 | ||
c2794437 RH |
58 | /* |
59 | * Setup early fixed I/O mapping. | |
60 | */ | |
61 | #if defined(CONFIG_PCI) | |
62 | extern void pci_map_io_early(unsigned long pfn); | |
63 | #else | |
64 | static inline void pci_map_io_early(unsigned long pfn) {} | |
65 | #endif | |
66 | ||
1da177e4 LT |
67 | /* |
68 | * PCI controllers | |
69 | */ | |
c23bfc38 | 70 | extern struct pci_ops iop3xx_ops; |
0cb015f9 | 71 | extern int iop3xx_pci_setup(int nr, struct pci_sys_data *); |
0cb015f9 | 72 | extern void iop3xx_pci_preinit(void); |
c34002c1 | 73 | extern void iop3xx_pci_preinit_cond(void); |
0cb015f9 | 74 | |
c23bfc38 | 75 | extern struct pci_ops dc21285_ops; |
1da177e4 | 76 | extern int dc21285_setup(int nr, struct pci_sys_data *); |
1da177e4 LT |
77 | extern void dc21285_preinit(void); |
78 | extern void dc21285_postinit(void); | |
79 | ||
c23bfc38 | 80 | extern struct pci_ops via82c505_ops; |
1da177e4 | 81 | extern int via82c505_setup(int nr, struct pci_sys_data *); |
1da177e4 LT |
82 | extern void via82c505_init(void *sysdata); |
83 | ||
c23bfc38 | 84 | extern struct pci_ops pci_v3_ops; |
1da177e4 | 85 | extern int pci_v3_setup(int nr, struct pci_sys_data *); |
1da177e4 LT |
86 | extern void pci_v3_preinit(void); |
87 | extern void pci_v3_postinit(void); | |
52882173 AV |
88 | |
89 | #endif /* __ASM_MACH_PCI_H */ |