2 * arch/sh/drivers/pci/ops-titan.c
4 * Ported to new API by Paul Mundt <lethal@linux-sh.org>
6 * Modified from ops-snapgear.c written by David McCullough
7 * Highly leveraged from pci-bigsur.c, written by Dustin McIntire.
9 * May be copied or modified under the terms of the GNU General Public
10 * License. See linux/COPYING for more information.
12 * PCI initialization for the Titan boards
15 #include <linux/config.h>
16 #include <linux/kernel.h>
17 #include <linux/types.h>
18 #include <linux/init.h>
19 #include <linux/delay.h>
21 #include <asm/titan.h>
22 #include "pci-sh7751.h"
24 int __init pcibios_map_platform_irq(u8 slot, u8 pin)
29 case 0: irq = TITAN_IRQ_WAN; break; /* eth0 (WAN) */
30 case 1: irq = TITAN_IRQ_LAN; break; /* eth1 (LAN) */
31 case 2: irq = TITAN_IRQ_MPCIA; break; /* mPCI A */
32 case 3: irq = TITAN_IRQ_MPCIB; break; /* mPCI B */
33 case 4: irq = TITAN_IRQ_USB; break; /* USB */
35 printk(KERN_INFO "PCI: Bad IRQ mapping request for slot %d\n", slot);
39 printk("PCI: Mapping TITAN IRQ for slot %d, pin %c to irq %d\n",
40 slot, pin - 1 + 'A', irq);
45 static struct resource sh7751_io_resource = {
47 .start = SH7751_PCI_IO_BASE,
48 .end = SH7751_PCI_IO_BASE + SH7751_PCI_IO_SIZE - 1,
49 .flags = IORESOURCE_IO
52 static struct resource sh7751_mem_resource = {
54 .start = SH7751_PCI_MEMORY_BASE,
55 .end = SH7751_PCI_MEMORY_BASE + SH7751_PCI_MEM_SIZE - 1,
56 .flags = IORESOURCE_MEM
59 extern struct pci_ops sh7751_pci_ops;
61 struct pci_channel board_pci_channels[] = {
62 { &sh7751_pci_ops, &sh7751_io_resource, &sh7751_mem_resource, 0, 0xff },
63 { NULL, NULL, NULL, 0, 0 },
65 EXPORT_SYMBOL(board_pci_channels);
67 static struct sh7751_pci_address_map sh7751_pci_map = {
69 .base = SH7751_CS2_BASE_ADDR,
70 .size = SH7751_MEM_REGION_SIZE*2, /* cs2 and cs3 */
74 .base = SH7751_CS2_BASE_ADDR,
75 .size = SH7751_MEM_REGION_SIZE*2,
78 .flags = SH7751_PCIC_NO_RESET,
81 int __init pcibios_init_platform(void)
83 return sh7751_pcic_init(&sh7751_pci_map);