allow coexistance of N build and AC build.
[tomato.git] / release / src-rt-6.x / linux / linux-2.6 / arch / sh / drivers / pci / ops-titan.c
blobac8ee2312cd8935b3f8e53e0ef07d0592d866edd
1 /*
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>
18 #include <linux/io.h>
19 #include <asm/titan.h>
20 #include "pci-sh4.h"
22 static char titan_irq_tab[] __initdata = {
23 TITAN_IRQ_WAN,
24 TITAN_IRQ_LAN,
25 TITAN_IRQ_MPCIA,
26 TITAN_IRQ_MPCIB,
27 TITAN_IRQ_USB,
30 int __init pcibios_map_platform_irq(struct pci_dev *pdev, u8 slot, u8 pin)
32 int irq = titan_irq_tab[slot];
34 printk("PCI: Mapping TITAN IRQ for slot %d, pin %c to irq %d\n",
35 slot, pin - 1 + 'A', irq);
37 return irq;
40 static struct resource sh7751_io_resource = {
41 .name = "SH7751_IO",
42 .start = SH7751_PCI_IO_BASE,
43 .end = SH7751_PCI_IO_BASE + SH7751_PCI_IO_SIZE - 1,
44 .flags = IORESOURCE_IO
47 static struct resource sh7751_mem_resource = {
48 .name = "SH7751_mem",
49 .start = SH7751_PCI_MEMORY_BASE,
50 .end = SH7751_PCI_MEMORY_BASE + SH7751_PCI_MEM_SIZE - 1,
51 .flags = IORESOURCE_MEM
54 struct pci_channel board_pci_channels[] = {
55 { &sh4_pci_ops, &sh7751_io_resource, &sh7751_mem_resource, 0, 0xff },
56 { NULL, NULL, NULL, 0, 0 },
58 EXPORT_SYMBOL(board_pci_channels);
60 static struct sh4_pci_address_map sh7751_pci_map = {
61 .window0 = {
62 .base = SH7751_CS2_BASE_ADDR,
63 .size = SH7751_MEM_REGION_SIZE*2, /* cs2 and cs3 */
66 .window1 = {
67 .base = SH7751_CS2_BASE_ADDR,
68 .size = SH7751_MEM_REGION_SIZE*2,
71 .flags = SH4_PCIC_NO_RESET,
74 int __init pcibios_init_platform(void)
76 return sh7751_pcic_init(&sh7751_pci_map);