Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
Uwe Zeisberger | f30c226 | 2006-10-03 23:01:26 +0200 | [diff] [blame] | 2 | * linux/arch/sh/drivers/pci/ops-rts7751r2d.c |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 3 | * |
| 4 | * Author: Ian DaSilva (idasilva@mvista.com) |
| 5 | * |
| 6 | * Highly leveraged from pci-bigsur.c, written by Dustin McIntire. |
| 7 | * |
| 8 | * May be copied or modified under the terms of the GNU General Public |
| 9 | * License. See linux/COPYING for more information. |
| 10 | * |
| 11 | * PCI initialization for the Renesas SH7751R RTS7751R2D board |
| 12 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 13 | #include <linux/kernel.h> |
| 14 | #include <linux/types.h> |
| 15 | #include <linux/init.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 16 | #include <linux/pci.h> |
Paul Mundt | 082c44d | 2006-10-19 16:16:18 +0900 | [diff] [blame] | 17 | #include <linux/io.h> |
| 18 | #include <asm/rts7751r2d.h> |
Paul Mundt | 959f85f | 2006-09-27 16:43:28 +0900 | [diff] [blame] | 19 | #include "pci-sh4.h" |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 20 | |
Paul Mundt | 082c44d | 2006-10-19 16:16:18 +0900 | [diff] [blame] | 21 | static u8 rts7751r2d_irq_tab[] __initdata = { |
| 22 | IRQ_PCISLOT1, |
| 23 | IRQ_PCISLOT2, |
| 24 | IRQ_PCMCIA, |
| 25 | IRQ_PCIETH, |
| 26 | }; |
| 27 | |
Paul Mundt | 959f85f | 2006-09-27 16:43:28 +0900 | [diff] [blame] | 28 | int __init pcibios_map_platform_irq(struct pci_dev *pdev, u8 slot, u8 pin) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 29 | { |
Paul Mundt | 082c44d | 2006-10-19 16:16:18 +0900 | [diff] [blame] | 30 | return rts7751r2d_irq_tab[slot]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 31 | } |
| 32 | |
| 33 | static struct resource sh7751_io_resource = { |
| 34 | .name = "SH7751_IO", |
| 35 | .start = 0x4000, |
| 36 | .end = 0x4000 + SH7751_PCI_IO_SIZE - 1, |
| 37 | .flags = IORESOURCE_IO |
| 38 | }; |
| 39 | |
| 40 | static struct resource sh7751_mem_resource = { |
| 41 | .name = "SH7751_mem", |
| 42 | .start = SH7751_PCI_MEMORY_BASE, |
| 43 | .end = SH7751_PCI_MEMORY_BASE + SH7751_PCI_MEM_SIZE - 1, |
| 44 | .flags = IORESOURCE_MEM |
| 45 | }; |
| 46 | |
| 47 | extern struct pci_ops sh7751_pci_ops; |
| 48 | |
| 49 | struct pci_channel board_pci_channels[] = { |
Paul Mundt | 959f85f | 2006-09-27 16:43:28 +0900 | [diff] [blame] | 50 | { &sh4_pci_ops, &sh7751_io_resource, &sh7751_mem_resource, 0, 0xff }, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 51 | { NULL, NULL, NULL, 0, 0 }, |
| 52 | }; |
| 53 | EXPORT_SYMBOL(board_pci_channels); |
| 54 | |
Paul Mundt | 959f85f | 2006-09-27 16:43:28 +0900 | [diff] [blame] | 55 | static struct sh4_pci_address_map sh7751_pci_map = { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 56 | .window0 = { |
| 57 | .base = SH7751_CS3_BASE_ADDR, |
| 58 | .size = 0x04000000, |
| 59 | }, |
| 60 | |
| 61 | .window1 = { |
| 62 | .base = 0x00000000, /* Unused */ |
| 63 | .size = 0x00000000, /* Unused */ |
| 64 | }, |
| 65 | |
Paul Mundt | 959f85f | 2006-09-27 16:43:28 +0900 | [diff] [blame] | 66 | .flags = SH4_PCIC_NO_RESET, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 67 | }; |
| 68 | |
| 69 | int __init pcibios_init_platform(void) |
| 70 | { |
| 71 | return sh7751_pcic_init(&sh7751_pci_map); |
| 72 | } |
| 73 | |