blob: 9089407d53266327c740707b673b01217b4c536c [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
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 Herringcc22b4c2011-06-28 21:22:40 -050011#include <video/vga.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070012
13#include <asm/irq.h>
14#include <asm/mach/pci.h>
15#include <asm/mach-types.h>
16
Ralf Baechled5341942011-06-10 15:30:21 +010017static int __init shark_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
Linus Torvalds1da177e2005-04-16 15:20:36 -070018{
19 if (dev->bus->number == 0)
Andrea Gelminiff4659c2010-05-23 21:55:47 +020020 if (dev->devfn == 0)
21 return 255;
22 else
23 return 11;
24 else
25 return 255;
Linus Torvalds1da177e2005-04-16 15:20:36 -070026}
27
28extern void __init via82c505_preinit(void);
29
30static struct hw_pci shark_pci __initdata = {
31 .setup = via82c505_setup,
Linus Torvalds1da177e2005-04-16 15:20:36 -070032 .map_irq = shark_map_irq,
33 .nr_controllers = 1,
Russell Kingc23bfc32012-03-10 12:49:16 +000034 .ops = &via82c505_ops,
Linus Torvalds1da177e2005-04-16 15:20:36 -070035 .preinit = via82c505_preinit,
36};
37
38static int __init shark_pci_init(void)
39{
Rob Herringc9d95fb2011-06-28 21:16:13 -050040 if (!machine_is_shark())
41 return;
42
43 pcibios_min_io = 0x6000;
44 pcibios_min_mem = 0x50000000;
Rob Herringcc22b4c2011-06-28 21:22:40 -050045 vga_base = 0xe8000000;
Rob Herringc9d95fb2011-06-28 21:16:13 -050046
47 pci_common_init(&shark_pci);
48
Linus Torvalds1da177e2005-04-16 15:20:36 -070049 return 0;
50}
51
52subsys_initcall(shark_pci_init);