David S. Miller | 9fd8b64 | 2007-03-08 21:55:49 -0800 | [diff] [blame] | 1 | /* pci_impl.h: Helper definitions for PCI controller support. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | * |
David S. Miller | 9fd8b64 | 2007-03-08 21:55:49 -0800 | [diff] [blame] | 3 | * Copyright (C) 1999, 2007 David S. Miller (davem@davemloft.net) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | #ifndef PCI_IMPL_H |
| 7 | #define PCI_IMPL_H |
| 8 | |
| 9 | #include <linux/types.h> |
| 10 | #include <linux/spinlock.h> |
| 11 | #include <asm/io.h> |
David S. Miller | de8d28b | 2006-06-22 16:18:54 -0700 | [diff] [blame] | 12 | #include <asm/prom.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 13 | |
David S. Miller | 34768bc | 2007-05-07 23:06:27 -0700 | [diff] [blame] | 14 | extern struct pci_pbm_info *pci_pbm_root; |
David S. Miller | 1e8a8cc | 2007-02-28 23:38:38 -0800 | [diff] [blame] | 15 | extern unsigned long pci_memspace_mask; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 16 | |
David S. Miller | 6c108f1 | 2007-05-07 23:49:01 -0700 | [diff] [blame^] | 17 | extern int pci_num_pbms; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 18 | |
| 19 | /* PCI bus scanning and fixup support. */ |
David S. Miller | cfa0652 | 2007-05-07 21:51:41 -0700 | [diff] [blame] | 20 | extern void pci_get_pbm_props(struct pci_pbm_info *pbm); |
David S. Miller | a2fb23a | 2007-02-28 23:35:04 -0800 | [diff] [blame] | 21 | extern struct pci_bus *pci_scan_one_pbm(struct pci_pbm_info *pbm); |
David S. Miller | 9fd8b64 | 2007-03-08 21:55:49 -0800 | [diff] [blame] | 22 | extern void pci_determine_mem_io_space(struct pci_pbm_info *pbm); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 23 | |
David S. Miller | 97b3cf0 | 2007-03-11 16:42:53 -0700 | [diff] [blame] | 24 | extern int pci_host_bridge_read_pci_cfg(struct pci_bus *bus_dev, |
| 25 | unsigned int devfn, |
| 26 | int where, int size, |
| 27 | u32 *value); |
| 28 | extern int pci_host_bridge_write_pci_cfg(struct pci_bus *bus_dev, |
| 29 | unsigned int devfn, |
| 30 | int where, int size, |
| 31 | u32 value); |
| 32 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 33 | /* Error reporting support. */ |
David S. Miller | 6c108f1 | 2007-05-07 23:49:01 -0700 | [diff] [blame^] | 34 | extern void pci_scan_for_target_abort(struct pci_pbm_info *, struct pci_bus *); |
| 35 | extern void pci_scan_for_master_abort(struct pci_pbm_info *, struct pci_bus *); |
| 36 | extern void pci_scan_for_parity_error(struct pci_pbm_info *, struct pci_bus *); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 37 | |
| 38 | /* Configuration space access. */ |
| 39 | extern void pci_config_read8(u8 *addr, u8 *ret); |
| 40 | extern void pci_config_read16(u16 *addr, u16 *ret); |
| 41 | extern void pci_config_read32(u32 *addr, u32 *ret); |
| 42 | extern void pci_config_write8(u8 *addr, u8 val); |
| 43 | extern void pci_config_write16(u16 *addr, u16 val); |
| 44 | extern void pci_config_write32(u32 *addr, u32 val); |
| 45 | |
| 46 | #endif /* !(PCI_IMPL_H) */ |