pci.h 2.4 KB
Newer Older
L
Linus Torvalds 已提交
1
/*
2
 *  arch/arm/include/asm/mach/pci.h
L
Linus Torvalds 已提交
3 4 5 6 7 8 9 10
 *
 *  Copyright (C) 2000 Russell King
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */

11 12 13
#ifndef __ASM_MACH_PCI_H
#define __ASM_MACH_PCI_H

L
Linus Torvalds 已提交
14 15 16 17
struct pci_sys_data;
struct pci_bus;

struct hw_pci {
18 19 20
#ifdef CONFIG_PCI_DOMAINS
	int		domain;
#endif
L
Linus Torvalds 已提交
21 22 23 24 25 26 27 28 29 30 31 32 33 34
	struct list_head buses;
	int		nr_controllers;
	int		(*setup)(int nr, struct pci_sys_data *);
	struct pci_bus *(*scan)(int nr, struct pci_sys_data *);
	void		(*preinit)(void);
	void		(*postinit)(void);
	u8		(*swizzle)(struct pci_dev *dev, u8 *pin);
	int		(*map_irq)(struct pci_dev *dev, u8 slot, u8 pin);
};

/*
 * Per-controller structure
 */
struct pci_sys_data {
35 36 37
#ifdef CONFIG_PCI_DOMAINS
	int		domain;
#endif
L
Linus Torvalds 已提交
38 39
	struct list_head node;
	int		busnr;		/* primary bus number			*/
40
	u64		mem_offset;	/* bus->cpu memory mapping offset	*/
L
Linus Torvalds 已提交
41 42 43 44 45 46 47 48
	unsigned long	io_offset;	/* bus->cpu IO mapping offset		*/
	struct pci_bus	*bus;		/* PCI bus				*/
	struct resource *resource[3];	/* Primary PCI bus resources		*/
					/* Bridge swizzling			*/
	u8		(*swizzle)(struct pci_dev *, u8 *);
					/* IRQ mapping				*/
	int		(*map_irq)(struct pci_dev *, u8, u8);
	struct hw_pci	*hw;
49
	void		*private_data;	/* platform controller private data	*/
L
Linus Torvalds 已提交
50 51 52 53 54
};

/*
 * This is the standard PCI-PCI bridge swizzling algorithm.
 */
55
#define pci_std_swizzle pci_common_swizzle
L
Linus Torvalds 已提交
56 57 58 59 60 61 62 63 64

/*
 * Call this with your hw_pci struct to initialise the PCI system.
 */
void pci_common_init(struct hw_pci *);

/*
 * PCI controllers
 */
65 66 67
extern int iop3xx_pci_setup(int nr, struct pci_sys_data *);
extern struct pci_bus *iop3xx_pci_scan_bus(int nr, struct pci_sys_data *);
extern void iop3xx_pci_preinit(void);
68
extern void iop3xx_pci_preinit_cond(void);
69

L
Linus Torvalds 已提交
70 71 72 73 74 75 76 77 78 79 80 81 82
extern int dc21285_setup(int nr, struct pci_sys_data *);
extern struct pci_bus *dc21285_scan_bus(int nr, struct pci_sys_data *);
extern void dc21285_preinit(void);
extern void dc21285_postinit(void);

extern int via82c505_setup(int nr, struct pci_sys_data *);
extern struct pci_bus *via82c505_scan_bus(int nr, struct pci_sys_data *);
extern void via82c505_init(void *sysdata);

extern int pci_v3_setup(int nr, struct pci_sys_data *);
extern struct pci_bus *pci_v3_scan_bus(int nr, struct pci_sys_data *);
extern void pci_v3_preinit(void);
extern void pci_v3_postinit(void);
83 84

#endif /* __ASM_MACH_PCI_H */