2 * arch/sh/drivers/pci/ops-snapgear.c
4 * Author: David McCullough <davidm@snapgear.com>
6 * Ported to new API by Paul Mundt <lethal@linux-sh.org>
8 * Highly leveraged from pci-bigsur.c, written by Dustin McIntire.
10 * May be copied or modified under the terms of the GNU General Public
11 * License. See linux/COPYING for more information.
13 * PCI initialization for the SnapGear boards
16 #include <linux/kernel.h>
17 #include <linux/types.h>
18 #include <linux/init.h>
19 #include <linux/delay.h>
20 #include <linux/pci.h>
23 #include "pci-sh7751.h"
25 #define SNAPGEAR_PCI_IO 0x4000
26 #define SNAPGEAR_PCI_MEM 0xfd000000
28 /* PCI: default LOCAL memory window sizes (seen from PCI bus) */
29 #define SNAPGEAR_LSR0_SIZE (64*(1<<20)) //64MB
30 #define SNAPGEAR_LSR1_SIZE (64*(1<<20)) //64MB
32 static struct resource sh7751_io_resource = {
34 .start = SNAPGEAR_PCI_IO,
35 .end = SNAPGEAR_PCI_IO + (64*1024) - 1, /* 64KiB I/O */
36 .flags = IORESOURCE_IO,
39 static struct resource sh7751_mem_resource = {
41 .start = SNAPGEAR_PCI_MEM,
42 .end = SNAPGEAR_PCI_MEM + (64*1024*1024) - 1, /* 64MiB mem */
43 .flags = IORESOURCE_MEM,
46 extern struct pci_ops sh7751_pci_ops;
48 struct pci_channel board_pci_channels[] = {
49 { &sh7751_pci_ops, &sh7751_io_resource, &sh7751_mem_resource, 0, 0xff },
53 static struct sh7751_pci_address_map sh7751_pci_map = {
55 .base = SH7751_CS2_BASE_ADDR,
56 .size = SNAPGEAR_LSR0_SIZE,
60 .base = SH7751_CS2_BASE_ADDR,
61 .size = SNAPGEAR_LSR1_SIZE,
64 .flags = SH7751_PCIC_NO_RESET,
68 * Initialize the SnapGear PCI interface
69 * Setup hardware to be Central Funtion
70 * Copy the BSR regs to the PCI interface
71 * Setup PCI windows into local RAM
73 int __init pcibios_init_platform(void)
75 return sh7751_pcic_init(&sh7751_pci_map);
78 int __init pcibios_map_platform_irq(u8 slot, u8 pin)
83 case 8: /* the PCI bridge */ break;
84 case 11: irq = 8; break; /* USB */
85 case 12: irq = 11; break; /* PCMCIA */
86 case 13: irq = 5; break; /* eth0 */
87 case 14: irq = 8; break; /* eth1 */
88 case 15: irq = 11; break; /* safenet (unused) */
91 printk("PCI: Mapping SnapGear IRQ for slot %d, pin %c to irq %d\n",
92 slot, pin - 1 + 'A', irq);
97 void __init pcibios_fixup(void)
99 /* Nothing to fixup .. */