2 #ifndef _ASM_PCI_BRIDGE_H
3 #define _ASM_PCI_BRIDGE_H
5 void pmac_find_bridges(void);
8 * pci_io_base returns the memory address at which you can access
9 * the I/O space for PCI bus number `bus' (or NULL on error).
11 * NOTE: This doesn't handle the new Uni-N chip which requires
14 void *pci_io_base(unsigned int bus
);
16 /* This version handles the new Uni-N host bridge, the iobase is now
17 * a per-device thing. I also added the memory base so PReP can
18 * be fixed to return 0xc0000000 (I didn't actually implement it)
20 * pci_dev_io_base() returns either a virtual (ioremap'ed) address or
21 * a physical address. In-kernel clients will use logical while the
22 * sys_pciconfig_iobase syscall returns a physical one to userland.
24 void *pci_dev_io_base(unsigned char bus
, unsigned char devfn
, int physical
);
25 void *pci_dev_mem_base(unsigned char bus
, unsigned char devfn
);
27 /* Returns the root-bridge number (Uni-N number) of a device */
28 int pci_dev_root_bridge(unsigned char bus
, unsigned char devfn
);
31 * pci_device_loc returns the bus number and device/function number
32 * for a device on a PCI bus, given its device_node struct.
33 * It returns 0 if OK, -1 on error.
35 int pci_device_loc(struct device_node
*dev
, unsigned char *bus_ptr
,
36 unsigned char *devfn_ptr
);
39 volatile unsigned int *cfg_addr
;
40 volatile unsigned char *cfg_data
;
41 void *io_base
; /* virtual */
42 unsigned long io_base_phys
;
45 struct bridge_data
*next
;
46 struct device_node
*node
;
50 #endif /* __KERNEL__ */