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

14
#include <linux/ioport.h>
R
Rob Herring 已提交
15

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

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

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

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

R
Rob Herring 已提交
61 62 63 64 65 66 67 68 69
/*
 * 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 已提交
70 71 72
/*
 * PCI controllers
 */
73
extern struct pci_ops iop3xx_ops;
74 75
extern int iop3xx_pci_setup(int nr, struct pci_sys_data *);
extern void iop3xx_pci_preinit(void);
76
extern void iop3xx_pci_preinit_cond(void);
77

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

83
extern struct pci_ops via82c505_ops;
L
Linus Torvalds 已提交
84 85 86
extern int via82c505_setup(int nr, struct pci_sys_data *);
extern void via82c505_init(void *sysdata);

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

#endif /* __ASM_MACH_PCI_H */