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 | cc22b4c | 2011-06-28 21:22:40 -0500 | [diff] [blame] | 11 | #include <video/vga.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 12 | |
| 13 | #include <asm/irq.h> |
| 14 | #include <asm/mach/pci.h> |
| 15 | #include <asm/mach-types.h> |
| 16 | |
Ralf Baechle | d534194 | 2011-06-10 15:30:21 +0100 | [diff] [blame] | 17 | 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] | 18 | { |
| 19 | if (dev->bus->number == 0) |
Andrea Gelmini | ff4659c | 2010-05-23 21:55:47 +0200 | [diff] [blame] | 20 | if (dev->devfn == 0) |
| 21 | return 255; |
| 22 | else |
| 23 | return 11; |
| 24 | else |
| 25 | return 255; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 26 | } |
| 27 | |
| 28 | extern void __init via82c505_preinit(void); |
| 29 | |
| 30 | static struct hw_pci shark_pci __initdata = { |
| 31 | .setup = via82c505_setup, |
Andrea Gelmini | ff4659c | 2010-05-23 21:55:47 +0200 | [diff] [blame] | 32 | .swizzle = pci_std_swizzle, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 33 | .map_irq = shark_map_irq, |
| 34 | .nr_controllers = 1, |
| 35 | .scan = via82c505_scan_bus, |
| 36 | .preinit = via82c505_preinit, |
| 37 | }; |
| 38 | |
| 39 | static int __init shark_pci_init(void) |
| 40 | { |
Rob Herring | c9d95fb | 2011-06-28 21:16:13 -0500 | [diff] [blame] | 41 | if (!machine_is_shark()) |
| 42 | return; |
| 43 | |
| 44 | pcibios_min_io = 0x6000; |
| 45 | pcibios_min_mem = 0x50000000; |
Rob Herring | cc22b4c | 2011-06-28 21:22:40 -0500 | [diff] [blame] | 46 | vga_base = 0xe8000000; |
Rob Herring | c9d95fb | 2011-06-28 21:16:13 -0500 | [diff] [blame] | 47 | |
| 48 | pci_common_init(&shark_pci); |
| 49 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 50 | return 0; |
| 51 | } |
| 52 | |
| 53 | subsys_initcall(shark_pci_init); |