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
14 #include <linux/kernel.h>
15 #include <linux/types.h>
16 #include <linux/init.h>
17 #include <linux/pci.h>
19 #include <asm/titan.h>
22 int __init pcibios_map_platform_irq(struct pci_dev *pdev, u8 slot, u8 pin)
27 case 0: irq = TITAN_IRQ_WAN; break; /* eth0 (WAN) */
28 case 1: irq = TITAN_IRQ_LAN; break; /* eth1 (LAN) */
29 case 2: irq = TITAN_IRQ_MPCIA; break; /* mPCI A */
30 case 3: irq = TITAN_IRQ_MPCIB; break; /* mPCI B */
31 case 4: irq = TITAN_IRQ_USB; break; /* USB */
33 printk(KERN_INFO "PCI: Bad IRQ mapping "
34 "request for slot %d\n", slot);
38 printk("PCI: Mapping TITAN IRQ for slot %d, pin %c to irq %d\n",
39 slot, pin - 1 + 'A', irq);
44 static struct resource sh7751_io_resource = {
46 .start = SH7751_PCI_IO_BASE,
47 .end = SH7751_PCI_IO_BASE + SH7751_PCI_IO_SIZE - 1,
48 .flags = IORESOURCE_IO
51 static struct resource sh7751_mem_resource = {
53 .start = SH7751_PCI_MEMORY_BASE,
54 .end = SH7751_PCI_MEMORY_BASE + SH7751_PCI_MEM_SIZE - 1,
55 .flags = IORESOURCE_MEM
58 struct pci_channel board_pci_channels[] = {
59 { &sh4_pci_ops, &sh7751_io_resource, &sh7751_mem_resource, 0, 0xff },
60 { NULL, NULL, NULL, 0, 0 },
62 EXPORT_SYMBOL(board_pci_channels);
64 static struct sh4_pci_address_map sh7751_pci_map = {
66 .base = SH7751_CS2_BASE_ADDR,
67 .size = SH7751_MEM_REGION_SIZE*2, /* cs2 and cs3 */
71 .base = SH7751_CS2_BASE_ADDR,
72 .size = SH7751_MEM_REGION_SIZE*2,
75 .flags = SH4_PCIC_NO_RESET,
78 int __init pcibios_init_platform(void)
80 return sh7751_pcic_init(&sh7751_pci_map);