pci.h 2.3 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

R
Rob Herring 已提交
14

L
Linus Torvalds 已提交
15
struct pci_sys_data;
16
struct pci_ops;
L
Linus Torvalds 已提交
17 18 19
struct pci_bus;

struct hw_pci {
20 21 22
#ifdef CONFIG_PCI_DOMAINS
	int		domain;
#endif
23
	struct pci_ops	*ops;
L
Linus Torvalds 已提交
24 25 26 27 28 29
	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);
30
	int		(*map_irq)(const struct pci_dev *dev, u8 slot, u8 pin);
L
Linus Torvalds 已提交
31 32 33 34 35 36
};

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

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

R
Rob Herring 已提交
58 59 60 61 62 63 64 65 66
/*
 * Setup early fixed I/O mapping.
 */
#if defined(CONFIG_PCI)
extern void pci_map_io_early(unsigned long pfn);
#else
static inline void pci_map_io_early(unsigned long pfn) {}
#endif

L
Linus Torvalds 已提交
67 68 69
/*
 * PCI controllers
 */
70
extern struct pci_ops iop3xx_ops;
71 72
extern int iop3xx_pci_setup(int nr, struct pci_sys_data *);
extern void iop3xx_pci_preinit(void);
73
extern void iop3xx_pci_preinit_cond(void);
74

75
extern struct pci_ops dc21285_ops;
L
Linus Torvalds 已提交
76 77 78 79
extern int dc21285_setup(int nr, struct pci_sys_data *);
extern void dc21285_preinit(void);
extern void dc21285_postinit(void);

80
extern struct pci_ops via82c505_ops;
L
Linus Torvalds 已提交
81 82 83
extern int via82c505_setup(int nr, struct pci_sys_data *);
extern void via82c505_init(void *sysdata);

84
extern struct pci_ops pci_v3_ops;
L
Linus Torvalds 已提交
85 86 87
extern int pci_v3_setup(int nr, struct pci_sys_data *);
extern void pci_v3_preinit(void);
extern void pci_v3_postinit(void);
88 89

#endif /* __ASM_MACH_PCI_H */