initial commit with v2.6.9
[linux-2.6.9-moxart.git] / arch / sh / drivers / pci / ops-bigsur.c
blob9b43da67804b1da041abc2ad06fa0dc830b886e4
1 /*
2 * linux/arch/sh/kernel/pci-bigsur.c
4 * By Dustin McIntire (dustin@sensoria.com) (c)2001
6 * Ported to new API by Paul Mundt <lethal@linux-sh.org>.
8 * May be copied or modified under the terms of the GNU General Public
9 * License. See linux/COPYING for more information.
11 * PCI initialization for the Hitachi Big Sur Evaluation Board
14 #include <linux/config.h>
15 #include <linux/kernel.h>
16 #include <linux/types.h>
17 #include <linux/init.h>
18 #include <linux/delay.h>
19 #include <linux/pci.h>
21 #include <asm/io.h>
22 #include "pci-sh7751.h"
23 #include <asm/bigsur/bigsur.h>
25 #define BIGSUR_PCI_IO 0x4000
26 #define BIGSUR_PCI_MEM 0xfd000000
28 static struct resource sh7751_io_resource = {
29 .name = "SH7751 IO",
30 .start = BIGSUR_PCI_IO,
31 .end = BIGSUR_PCI_IO + (64*1024) - 1,
32 .flags = IORESOURCE_IO,
35 static struct resource sh7751_mem_resource = {
36 .name = "SH7751 mem",
37 .start = BIGSUR_PCI_MEM,
38 .end = BIGSUR_PCI_MEM + (64*1024*1024) - 1,
39 .flags = IORESOURCE_MEM,
42 extern struct pci_ops sh7751_pci_ops;
44 struct pci_channel board_pci_channels[] = {
45 { &sh7751_pci_ops, &sh7751_io_resource, &sh7751_mem_resource, 0, 0xff },
46 { 0, }
49 static struct sh7751_pci_address_map sh7751_pci_map = {
50 .window0 = {
51 .base = SH7751_CS3_BASE_ADDR,
52 .size = BIGSUR_LSR0_SIZE,
55 .window1 = {
56 .base = SH7751_CS3_BASE_ADDR,
57 .size = BIGSUR_LSR1_SIZE,
62 * Initialize the Big Sur PCI interface
63 * Setup hardware to be Central Funtion
64 * Copy the BSR regs to the PCI interface
65 * Setup PCI windows into local RAM
67 int __init pcibios_init_platform(void)
69 return sh7751_pcic_init(&sh7751_pci_map);
72 int pcibios_map_platform_irq(u8 slot, u8 pin)
74 /*
75 * The Big Sur can be used in a CPCI chassis, but the SH7751 PCI
76 * interface is on the wrong end of the board so that it can also
77 * support a V320 CPI interface chip... Therefor the IRQ mapping is
78 * somewhat use dependent... I'l assume a linear map for now, i.e.
79 * INTA=slot0,pin0... INTD=slot3,pin0...
80 */
81 int irq = (slot + pin-1) % 4 + BIGSUR_SH7751_PCI_IRQ_BASE;
83 PCIDBG(2, "PCI: Mapping Big Sur IRQ for slot %d, pin %c to irq %d\n",
84 slot, pin-1+'A', irq);
86 return irq;