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
	int		nr_controllers;
26
	void		**private_data;
L
Linus Torvalds 已提交
27 28 29 30 31
	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);
32
	int		(*map_irq)(const struct pci_dev *dev, u8 slot, u8 pin);
L
Linus Torvalds 已提交
33 34 35 36 37 38
};

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

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

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

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

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

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

#endif /* __ASM_MACH_PCI_H */