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/kernel.h>
15 #include <linux/types.h>
16 #include <linux/init.h>
17 #include <linux/delay.h>
18 #include <linux/pci.h>
21 #include "pci-sh7751.h"
22 #include <asm/bigsur/bigsur.h>
24 #define BIGSUR_PCI_IO 0x4000
25 #define BIGSUR_PCI_MEM 0xfd000000
27 static struct resource sh7751_io_resource = {
29 .start = BIGSUR_PCI_IO,
30 .end = BIGSUR_PCI_IO + (64*1024) - 1,
31 .flags = IORESOURCE_IO,
34 static struct resource sh7751_mem_resource = {
36 .start = BIGSUR_PCI_MEM,
37 .end = BIGSUR_PCI_MEM + (64*1024*1024) - 1,
38 .flags = IORESOURCE_MEM,
41 extern struct pci_ops sh7751_pci_ops;
43 struct pci_channel board_pci_channels[] = {
44 { &sh7751_pci_ops, &sh7751_io_resource, &sh7751_mem_resource, 0, 0xff },
48 static struct sh7751_pci_address_map sh7751_pci_map = {
50 .base = SH7751_CS3_BASE_ADDR,
51 .size = BIGSUR_LSR0_SIZE,
55 .base = SH7751_CS3_BASE_ADDR,
56 .size = BIGSUR_LSR1_SIZE,
61 * Initialize the Big Sur PCI interface
62 * Setup hardware to be Central Funtion
63 * Copy the BSR regs to the PCI interface
64 * Setup PCI windows into local RAM
66 int __init pcibios_init_platform(void)
68 return sh7751_pcic_init(&sh7751_pci_map);
71 int pcibios_map_platform_irq(u8 slot, u8 pin)
74 * The Big Sur can be used in a CPCI chassis, but the SH7751 PCI
75 * interface is on the wrong end of the board so that it can also
76 * support a V320 CPI interface chip... Therefor the IRQ mapping is
77 * somewhat use dependent... I'l assume a linear map for now, i.e.
78 * INTA=slot0,pin0... INTD=slot3,pin0...
80 int irq = (slot + pin-1) % 4 + BIGSUR_SH7751_PCI_IRQ_BASE;
82 PCIDBG(2, "PCI: Mapping Big Sur IRQ for slot %d, pin %c to irq %d\n",
83 slot, pin-1+'A', irq);