| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | /*
 | 
					
						
							| 
									
										
										
										
											2008-08-02 10:55:55 +01:00
										 |  |  |  *  arch/arm/include/asm/mach/pci.h | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  |  * | 
					
						
							|  |  |  |  *  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. | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-04-19 13:20:49 +01:00
										 |  |  | #ifndef __ASM_MACH_PCI_H
 | 
					
						
							|  |  |  | #define __ASM_MACH_PCI_H
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-07-09 21:59:03 -05:00
										 |  |  | #include <linux/ioport.h>
 | 
					
						
							| 
									
										
										
										
											2012-02-29 18:10:58 -06:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | struct pci_sys_data; | 
					
						
							| 
									
										
										
										
											2012-03-10 12:49:16 +00:00
										 |  |  | struct pci_ops; | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | struct pci_bus; | 
					
						
							| 
									
										
										
										
											2013-04-11 23:32:28 +02:00
										 |  |  | struct device; | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | struct hw_pci { | 
					
						
							| 
									
										
										
										
											2010-04-19 13:20:49 +01:00
										 |  |  | #ifdef CONFIG_PCI_DOMAINS
 | 
					
						
							|  |  |  | 	int		domain; | 
					
						
							| 
									
										
										
										
											2014-10-27 15:48:40 +08:00
										 |  |  | #endif
 | 
					
						
							|  |  |  | #ifdef CONFIG_PCI_MSI
 | 
					
						
							|  |  |  | 	struct msi_controller *msi_ctrl; | 
					
						
							| 
									
										
										
										
											2010-04-19 13:20:49 +01:00
										 |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2012-03-10 12:49:16 +00:00
										 |  |  | 	struct pci_ops	*ops; | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	int		nr_controllers; | 
					
						
							| 
									
										
										
										
											2013-02-11 08:46:10 +01:00
										 |  |  | 	void		**private_data; | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	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); | 
					
						
							| 
									
										
										
										
											2011-06-10 15:30:21 +01:00
										 |  |  | 	int		(*map_irq)(const struct pci_dev *dev, u8 slot, u8 pin); | 
					
						
							| 
									
										
										
										
											2013-03-26 18:14:24 +01:00
										 |  |  | 	resource_size_t (*align_resource)(struct pci_dev *dev, | 
					
						
							|  |  |  | 					  const struct resource *res, | 
					
						
							|  |  |  | 					  resource_size_t start, | 
					
						
							|  |  |  | 					  resource_size_t size, | 
					
						
							|  |  |  | 					  resource_size_t align); | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*
 | 
					
						
							|  |  |  |  * Per-controller structure | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | struct pci_sys_data { | 
					
						
							| 
									
										
										
										
											2010-04-19 13:20:49 +01:00
										 |  |  | #ifdef CONFIG_PCI_DOMAINS
 | 
					
						
							|  |  |  | 	int		domain; | 
					
						
							| 
									
										
										
										
											2014-10-27 15:48:40 +08:00
										 |  |  | #endif
 | 
					
						
							|  |  |  | #ifdef CONFIG_PCI_MSI
 | 
					
						
							|  |  |  | 	struct msi_controller *msi_ctrl; | 
					
						
							| 
									
										
										
										
											2010-04-19 13:20:49 +01:00
										 |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	struct list_head node; | 
					
						
							|  |  |  | 	int		busnr;		/* primary bus number			*/ | 
					
						
							| 
									
										
										
										
											2006-06-12 17:06:02 -07:00
										 |  |  | 	u64		mem_offset;	/* bus->cpu memory mapping offset	*/ | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	unsigned long	io_offset;	/* bus->cpu IO mapping offset		*/ | 
					
						
							|  |  |  | 	struct pci_bus	*bus;		/* PCI bus				*/ | 
					
						
							| 
									
										
										
										
											2011-10-28 16:26:16 -06:00
										 |  |  | 	struct list_head resources;	/* root bus resources (apertures)       */ | 
					
						
							| 
									
										
										
										
											2012-07-09 21:59:03 -05:00
										 |  |  | 	struct resource io_res; | 
					
						
							|  |  |  | 	char		io_res_name[12]; | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 					/* Bridge swizzling			*/ | 
					
						
							|  |  |  | 	u8		(*swizzle)(struct pci_dev *, u8 *); | 
					
						
							|  |  |  | 					/* IRQ mapping				*/ | 
					
						
							| 
									
										
										
										
											2011-06-10 15:30:21 +01:00
										 |  |  | 	int		(*map_irq)(const struct pci_dev *, u8, u8); | 
					
						
							| 
									
										
										
										
											2013-03-26 18:14:24 +01:00
										 |  |  | 					/* Resource alignement requirements	*/ | 
					
						
							|  |  |  | 	resource_size_t (*align_resource)(struct pci_dev *dev, | 
					
						
							|  |  |  | 					  const struct resource *res, | 
					
						
							|  |  |  | 					  resource_size_t start, | 
					
						
							|  |  |  | 					  resource_size_t size, | 
					
						
							|  |  |  | 					  resource_size_t align); | 
					
						
							| 
									
										
										
										
											2010-06-03 14:58:46 +03:00
										 |  |  | 	void		*private_data;	/* platform controller private data	*/ | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*
 | 
					
						
							|  |  |  |  * Call this with your hw_pci struct to initialise the PCI system. | 
					
						
							|  |  |  |  */ | 
					
						
							| 
									
										
										
										
											2013-04-11 23:32:28 +02:00
										 |  |  | void pci_common_init_dev(struct device *, struct hw_pci *); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*
 | 
					
						
							|  |  |  |  * Compatibility wrapper for older platforms that do not care about | 
					
						
							|  |  |  |  * passing the parent device. | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | static inline void pci_common_init(struct hw_pci *hw) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	pci_common_init_dev(NULL, hw); | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-02-29 18:10:58 -06:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * 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
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * PCI controllers | 
					
						
							|  |  |  |  */ | 
					
						
							| 
									
										
										
										
											2012-03-10 12:49:16 +00:00
										 |  |  | extern struct pci_ops iop3xx_ops; | 
					
						
							| 
									
										
										
										
											2006-09-18 23:16:23 +01:00
										 |  |  | extern int iop3xx_pci_setup(int nr, struct pci_sys_data *); | 
					
						
							|  |  |  | extern void iop3xx_pci_preinit(void); | 
					
						
							| 
									
										
										
										
											2008-03-26 19:12:38 -07:00
										 |  |  | extern void iop3xx_pci_preinit_cond(void); | 
					
						
							| 
									
										
										
										
											2006-09-18 23:16:23 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-10 12:49:16 +00:00
										 |  |  | extern struct pci_ops dc21285_ops; | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | extern int dc21285_setup(int nr, struct pci_sys_data *); | 
					
						
							|  |  |  | extern void dc21285_preinit(void); | 
					
						
							|  |  |  | extern void dc21285_postinit(void); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-04-19 13:20:49 +01:00
										 |  |  | #endif /* __ASM_MACH_PCI_H */
 |