blob: b3fa3e2ef184ffd24b2a3afb604254e3c03634ee [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
Uwe Zeisbergerf30c2262006-10-03 23:01:26 +02002 * linux/arch/sh/drivers/pci/ops-rts7751r2d.c
Linus Torvalds1da177e2005-04-16 15:20:36 -07003 *
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 Torvalds1da177e2005-04-16 15:20:36 -070013#include <linux/kernel.h>
14#include <linux/types.h>
15#include <linux/init.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070016#include <linux/pci.h>
Paul Mundt082c44d2006-10-19 16:16:18 +090017#include <linux/io.h>
18#include <asm/rts7751r2d.h>
Paul Mundt959f85f2006-09-27 16:43:28 +090019#include "pci-sh4.h"
Linus Torvalds1da177e2005-04-16 15:20:36 -070020
Paul Mundt082c44d2006-10-19 16:16:18 +090021static u8 rts7751r2d_irq_tab[] __initdata = {
Magnus Damm2eeec852007-08-12 15:29:16 +090022 IRQ_PCI_INTA,
23 IRQ_PCI_INTB,
24 IRQ_PCI_INTC,
25 IRQ_PCI_INTD,
Paul Mundt082c44d2006-10-19 16:16:18 +090026};
27
Paul Mundt959f85f2006-09-27 16:43:28 +090028int __init pcibios_map_platform_irq(struct pci_dev *pdev, u8 slot, u8 pin)
Linus Torvalds1da177e2005-04-16 15:20:36 -070029{
Paul Mundt082c44d2006-10-19 16:16:18 +090030 return rts7751r2d_irq_tab[slot];
Linus Torvalds1da177e2005-04-16 15:20:36 -070031}
32
33static struct resource sh7751_io_resource = {
34 .name = "SH7751_IO",
35 .start = 0x4000,
Magnus Damm123100c2008-02-14 14:05:57 +090036 .end = SH7751_PCI_IO_SIZE - 1,
Linus Torvalds1da177e2005-04-16 15:20:36 -070037 .flags = IORESOURCE_IO
38};
39
40static 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
47extern struct pci_ops sh7751_pci_ops;
48
49struct pci_channel board_pci_channels[] = {
Paul Mundt959f85f2006-09-27 16:43:28 +090050 { &sh4_pci_ops, &sh7751_io_resource, &sh7751_mem_resource, 0, 0xff },
Linus Torvalds1da177e2005-04-16 15:20:36 -070051 { NULL, NULL, NULL, 0, 0 },
52};
53EXPORT_SYMBOL(board_pci_channels);
54
Paul Mundt959f85f2006-09-27 16:43:28 +090055static struct sh4_pci_address_map sh7751_pci_map = {
Linus Torvalds1da177e2005-04-16 15:20:36 -070056 .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 Mundt959f85f2006-09-27 16:43:28 +090066 .flags = SH4_PCIC_NO_RESET,
Linus Torvalds1da177e2005-04-16 15:20:36 -070067};
68
69int __init pcibios_init_platform(void)
70{
Magnus Damm123100c2008-02-14 14:05:57 +090071 __set_io_port_base(SH7751_PCI_IO_BASE);
Linus Torvalds1da177e2005-04-16 15:20:36 -070072 return sh7751_pcic_init(&sh7751_pci_map);
73}
74