blob: 1208583fcb83b433c2abc7b3a3a60a528f0c1fde [file] [log] [blame]
David S. Miller9fd8b642007-03-08 21:55:49 -08001/* pci_impl.h: Helper definitions for PCI controller support.
Linus Torvalds1da177e2005-04-16 15:20:36 -07002 *
David S. Miller9fd8b642007-03-08 21:55:49 -08003 * Copyright (C) 1999, 2007 David S. Miller (davem@davemloft.net)
Linus Torvalds1da177e2005-04-16 15:20:36 -07004 */
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. Millerde8d28b2006-06-22 16:18:54 -070012#include <asm/prom.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070013
14extern struct pci_controller_info *pci_controller_root;
David S. Miller1e8a8cc2007-02-28 23:38:38 -080015extern unsigned long pci_memspace_mask;
Linus Torvalds1da177e2005-04-16 15:20:36 -070016
17extern int pci_num_controllers;
18
19/* PCI bus scanning and fixup support. */
David S. Millera2fb23a2007-02-28 23:35:04 -080020extern struct pci_bus *pci_scan_one_pbm(struct pci_pbm_info *pbm);
David S. Miller9fd8b642007-03-08 21:55:49 -080021extern void pci_determine_mem_io_space(struct pci_pbm_info *pbm);
Linus Torvalds1da177e2005-04-16 15:20:36 -070022
David S. Miller97b3cf02007-03-11 16:42:53 -070023extern int pci_host_bridge_read_pci_cfg(struct pci_bus *bus_dev,
24 unsigned int devfn,
25 int where, int size,
26 u32 *value);
27extern int pci_host_bridge_write_pci_cfg(struct pci_bus *bus_dev,
28 unsigned int devfn,
29 int where, int size,
30 u32 value);
31
Linus Torvalds1da177e2005-04-16 15:20:36 -070032/* Error reporting support. */
33extern void pci_scan_for_target_abort(struct pci_controller_info *, struct pci_pbm_info *, struct pci_bus *);
34extern void pci_scan_for_master_abort(struct pci_controller_info *, struct pci_pbm_info *, struct pci_bus *);
35extern void pci_scan_for_parity_error(struct pci_controller_info *, struct pci_pbm_info *, struct pci_bus *);
36
37/* Configuration space access. */
38extern void pci_config_read8(u8 *addr, u8 *ret);
39extern void pci_config_read16(u16 *addr, u16 *ret);
40extern void pci_config_read32(u32 *addr, u32 *ret);
41extern void pci_config_write8(u8 *addr, u8 val);
42extern void pci_config_write16(u16 *addr, u16 val);
43extern void pci_config_write32(u32 *addr, u32 val);
44
45#endif /* !(PCI_IMPL_H) */