Nobuhiro Iwamatsu | c86c5a9 | 2007-03-26 14:27:43 +0900 | [diff] [blame] | 1 | /* |
| 2 | * linux/arch/sh/drivers/pci/ops-lboxre2.c |
| 3 | * |
| 4 | * Copyright (C) 2007 Nobuhiro Iwamatsu |
| 5 | * |
| 6 | * PCI initialization for the NTT COMWARE L-BOX RE2 |
| 7 | */ |
| 8 | #include <linux/kernel.h> |
| 9 | #include <linux/types.h> |
| 10 | #include <linux/init.h> |
| 11 | #include <linux/pci.h> |
| 12 | #include <linux/io.h> |
Paul Mundt | 7639a45 | 2008-10-20 13:02:48 +0900 | [diff] [blame] | 13 | #include <mach/lboxre2.h> |
Nobuhiro Iwamatsu | c86c5a9 | 2007-03-26 14:27:43 +0900 | [diff] [blame] | 14 | #include "pci-sh4.h" |
| 15 | |
| 16 | static char lboxre2_irq_tab[] __initdata = { |
| 17 | IRQ_ETH0, IRQ_ETH1, IRQ_INTA, IRQ_INTD, |
| 18 | }; |
| 19 | |
| 20 | int __init pcibios_map_platform_irq(struct pci_dev *pdev, u8 slot, u8 pin) |
| 21 | { |
| 22 | return lboxre2_irq_tab[slot]; |
| 23 | } |
| 24 | |
| 25 | static struct resource sh7751_io_resource = { |
| 26 | .name = "SH7751_IO", |
| 27 | .start = SH7751_PCI_IO_BASE , |
| 28 | .end = SH7751_PCI_IO_BASE + SH7751_PCI_IO_SIZE - 1, |
| 29 | .flags = IORESOURCE_IO |
| 30 | }; |
| 31 | |
| 32 | static struct resource sh7751_mem_resource = { |
| 33 | .name = "SH7751_mem", |
| 34 | .start = SH7751_PCI_MEMORY_BASE, |
| 35 | .end = SH7751_PCI_MEMORY_BASE + SH7751_PCI_MEM_SIZE - 1, |
| 36 | .flags = IORESOURCE_MEM |
| 37 | }; |
| 38 | |
| 39 | extern struct pci_ops sh7751_pci_ops; |
| 40 | |
| 41 | struct pci_channel board_pci_channels[] = { |
Magnus Damm | d0e3db4 | 2009-03-11 15:46:14 +0900 | [diff] [blame] | 42 | { sh7751_pci_init, &sh4_pci_ops, &sh7751_io_resource, &sh7751_mem_resource, 0, 0xff }, |
Nobuhiro Iwamatsu | c86c5a9 | 2007-03-26 14:27:43 +0900 | [diff] [blame] | 43 | { NULL, NULL, NULL, 0, 0 }, |
| 44 | }; |
| 45 | |
Nobuhiro Iwamatsu | c86c5a9 | 2007-03-26 14:27:43 +0900 | [diff] [blame] | 46 | static struct sh4_pci_address_map sh7751_pci_map = { |
| 47 | .window0 = { |
| 48 | .base = SH7751_CS3_BASE_ADDR, |
| 49 | .size = 0x04000000, |
| 50 | }, |
Nobuhiro Iwamatsu | c86c5a9 | 2007-03-26 14:27:43 +0900 | [diff] [blame] | 51 | }; |
| 52 | |
| 53 | int __init pcibios_init_platform(void) |
| 54 | { |
Magnus Damm | b8b47bf | 2009-03-11 15:41:51 +0900 | [diff] [blame] | 55 | return sh7751_pcic_init(&board_pci_channels[0], &sh7751_pci_map); |
Nobuhiro Iwamatsu | c86c5a9 | 2007-03-26 14:27:43 +0900 | [diff] [blame] | 56 | } |