| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* | 
 | 2 |  *  linux/arch/arm/mach-shark/pci.c | 
 | 3 |  * | 
 | 4 |  *  PCI bios-type initialisation for PCI machines | 
 | 5 |  * | 
 | 6 |  *  Bits taken from various places. | 
 | 7 |  */ | 
 | 8 | #include <linux/kernel.h> | 
 | 9 | #include <linux/pci.h> | 
 | 10 | #include <linux/init.h> | 
| Rob Herring | c04dc9a | 2012-02-28 13:15:43 -0600 | [diff] [blame] | 11 | #include <linux/io.h> | 
| Rob Herring | cc22b4c | 2011-06-28 21:22:40 -0500 | [diff] [blame] | 12 | #include <video/vga.h> | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 13 |  | 
 | 14 | #include <asm/irq.h> | 
 | 15 | #include <asm/mach/pci.h> | 
 | 16 | #include <asm/mach-types.h> | 
 | 17 |  | 
| Rob Herring | c04dc9a | 2012-02-28 13:15:43 -0600 | [diff] [blame] | 18 | #define IO_START	0x40000000 | 
 | 19 |  | 
| Ralf Baechle | d534194 | 2011-06-10 15:30:21 +0100 | [diff] [blame] | 20 | static int __init shark_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 21 | { | 
 | 22 | 	if (dev->bus->number == 0) | 
| Andrea Gelmini | ff4659c | 2010-05-23 21:55:47 +0200 | [diff] [blame] | 23 | 		if (dev->devfn == 0) | 
 | 24 | 			return 255; | 
 | 25 | 		else | 
 | 26 | 			return 11; | 
 | 27 | 	else | 
 | 28 | 		return 255; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 29 | } | 
 | 30 |  | 
 | 31 | extern void __init via82c505_preinit(void); | 
 | 32 |  | 
 | 33 | static struct hw_pci shark_pci __initdata = { | 
 | 34 | 	.setup		= via82c505_setup, | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 35 | 	.map_irq	= shark_map_irq, | 
 | 36 | 	.nr_controllers = 1, | 
| Russell King | c23bfc3 | 2012-03-10 12:49:16 +0000 | [diff] [blame] | 37 | 	.ops		= &via82c505_ops, | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 38 | 	.preinit	= via82c505_preinit, | 
 | 39 | }; | 
 | 40 |  | 
 | 41 | static int __init shark_pci_init(void) | 
 | 42 | { | 
| Rob Herring | c9d95fb | 2011-06-28 21:16:13 -0500 | [diff] [blame] | 43 | 	if (!machine_is_shark()) | 
| Arnd Bergmann | 9c7f4f5 | 2012-04-30 16:36:59 +0000 | [diff] [blame] | 44 | 		return -ENODEV; | 
| Rob Herring | c9d95fb | 2011-06-28 21:16:13 -0500 | [diff] [blame] | 45 |  | 
 | 46 | 	pcibios_min_io = 0x6000; | 
 | 47 | 	pcibios_min_mem = 0x50000000; | 
| Rob Herring | cc22b4c | 2011-06-28 21:22:40 -0500 | [diff] [blame] | 48 | 	vga_base = 0xe8000000; | 
| Rob Herring | c9d95fb | 2011-06-28 21:16:13 -0500 | [diff] [blame] | 49 |  | 
| Rob Herring | c04dc9a | 2012-02-28 13:15:43 -0600 | [diff] [blame] | 50 | 	pci_ioremap_io(0, IO_START); | 
 | 51 |  | 
| Rob Herring | c9d95fb | 2011-06-28 21:16:13 -0500 | [diff] [blame] | 52 | 	pci_common_init(&shark_pci); | 
 | 53 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 54 | 	return 0; | 
 | 55 | } | 
 | 56 |  | 
 | 57 | subsys_initcall(shark_pci_init); |