diff options
author | Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com> | 2008-07-16 07:21:09 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2008-07-28 05:10:35 -0400 |
commit | cbe9da029d9cc4fff59d559789885079a84a0af8 (patch) | |
tree | 1730047636c75455eaf309f4e24e20de9dff54f0 /arch/sh/drivers/pci | |
parent | 1eca5c92729a83f64826d15a9ecb1652dda54bcb (diff) |
sh: Renesas R0P7785LC0011RL board support
This adds initial support for the Renesas R0P7785LC0011RL board.
This patch supports 29bit address mode only.
Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/drivers/pci')
-rw-r--r-- | arch/sh/drivers/pci/Makefile | 1 | ||||
-rw-r--r-- | arch/sh/drivers/pci/fixups-sh7785lcr.c | 46 | ||||
-rw-r--r-- | arch/sh/drivers/pci/ops-sh7785lcr.c | 66 |
3 files changed, 113 insertions, 0 deletions
diff --git a/arch/sh/drivers/pci/Makefile b/arch/sh/drivers/pci/Makefile index 0718805774e8..847e90894d1b 100644 --- a/arch/sh/drivers/pci/Makefile +++ b/arch/sh/drivers/pci/Makefile | |||
@@ -23,3 +23,4 @@ obj-$(CONFIG_SH_LANDISK) += ops-landisk.o | |||
23 | obj-$(CONFIG_SH_LBOX_RE2) += ops-lboxre2.o fixups-lboxre2.o | 23 | obj-$(CONFIG_SH_LBOX_RE2) += ops-lboxre2.o fixups-lboxre2.o |
24 | obj-$(CONFIG_SH_7780_SOLUTION_ENGINE) += ops-se7780.o fixups-se7780.o | 24 | obj-$(CONFIG_SH_7780_SOLUTION_ENGINE) += ops-se7780.o fixups-se7780.o |
25 | obj-$(CONFIG_SH_CAYMAN) += ops-cayman.o | 25 | obj-$(CONFIG_SH_CAYMAN) += ops-cayman.o |
26 | obj-$(CONFIG_SH_SH7785LCR) += ops-sh7785lcr.o fixups-sh7785lcr.o | ||
diff --git a/arch/sh/drivers/pci/fixups-sh7785lcr.c b/arch/sh/drivers/pci/fixups-sh7785lcr.c new file mode 100644 index 000000000000..4949e601387a --- /dev/null +++ b/arch/sh/drivers/pci/fixups-sh7785lcr.c | |||
@@ -0,0 +1,46 @@ | |||
1 | /* | ||
2 | * arch/sh/drivers/pci/fixups-sh7785lcr.c | ||
3 | * | ||
4 | * R0P7785LC0011RL PCI fixups | ||
5 | * Copyright (C) 2008 Yoshihiro Shimoda | ||
6 | * | ||
7 | * Based on arch/sh/drivers/pci/fixups-r7780rp.c | ||
8 | * Copyright (C) 2003 Lineo uSolutions, Inc. | ||
9 | * Copyright (C) 2004 - 2006 Paul Mundt | ||
10 | * | ||
11 | * This file is subject to the terms and conditions of the GNU General Public | ||
12 | * License. See the file "COPYING" in the main directory of this archive | ||
13 | * for more details. | ||
14 | */ | ||
15 | #include <linux/pci.h> | ||
16 | #include "pci-sh4.h" | ||
17 | |||
18 | int pci_fixup_pcic(void) | ||
19 | { | ||
20 | pci_write_reg(0x000043ff, SH4_PCIINTM); | ||
21 | pci_write_reg(0x0000380f, SH4_PCIAINTM); | ||
22 | |||
23 | pci_write_reg(0xfbb00047, SH7780_PCICMD); | ||
24 | pci_write_reg(0x00000000, SH7780_PCIIBAR); | ||
25 | |||
26 | pci_write_reg(0x00011912, SH7780_PCISVID); | ||
27 | pci_write_reg(0x08000000, SH7780_PCICSCR0); | ||
28 | pci_write_reg(0x0000001b, SH7780_PCICSAR0); | ||
29 | pci_write_reg(0xfd000000, SH7780_PCICSCR1); | ||
30 | pci_write_reg(0x0000000f, SH7780_PCICSAR1); | ||
31 | |||
32 | pci_write_reg(0xfd000000, SH7780_PCIMBR0); | ||
33 | pci_write_reg(0x00fc0000, SH7780_PCIMBMR0); | ||
34 | |||
35 | #ifdef CONFIG_32BIT | ||
36 | pci_write_reg(0xc0000000, SH7780_PCIMBR2); | ||
37 | pci_write_reg(0x20000000 - SH7780_PCI_IO_SIZE, SH7780_PCIMBMR2); | ||
38 | #endif | ||
39 | |||
40 | /* Set IOBR for windows containing area specified in pci.h */ | ||
41 | pci_write_reg((PCIBIOS_MIN_IO & ~(SH7780_PCI_IO_SIZE - 1)), | ||
42 | SH7780_PCIIOBR); | ||
43 | pci_write_reg(((SH7780_PCI_IO_SIZE - 1) & (7 << 18)), SH7780_PCIIOBMR); | ||
44 | |||
45 | return 0; | ||
46 | } | ||
diff --git a/arch/sh/drivers/pci/ops-sh7785lcr.c b/arch/sh/drivers/pci/ops-sh7785lcr.c new file mode 100644 index 000000000000..b3bd68702059 --- /dev/null +++ b/arch/sh/drivers/pci/ops-sh7785lcr.c | |||
@@ -0,0 +1,66 @@ | |||
1 | /* | ||
2 | * Author: Ian DaSilva (idasilva@mvista.com) | ||
3 | * | ||
4 | * Highly leveraged from pci-bigsur.c, written by Dustin McIntire. | ||
5 | * | ||
6 | * May be copied or modified under the terms of the GNU General Public | ||
7 | * License. See linux/COPYING for more information. | ||
8 | * | ||
9 | * PCI initialization for the Renesas R0P7785LC0011RL board | ||
10 | * Based on arch/sh/drivers/pci/ops-r7780rp.c | ||
11 | * | ||
12 | */ | ||
13 | #include <linux/kernel.h> | ||
14 | #include <linux/types.h> | ||
15 | #include <linux/init.h> | ||
16 | #include <linux/delay.h> | ||
17 | #include <linux/pci.h> | ||
18 | #include "pci-sh4.h" | ||
19 | |||
20 | static char irq_tab[] __initdata = { | ||
21 | 65, 66, 67, 68, | ||
22 | }; | ||
23 | |||
24 | int __init pcibios_map_platform_irq(struct pci_dev *pdev, u8 slot, u8 pin) | ||
25 | { | ||
26 | return irq_tab[slot]; | ||
27 | } | ||
28 | |||
29 | static struct resource sh7785_io_resource = { | ||
30 | .name = "SH7785_IO", | ||
31 | .start = SH7780_PCI_IO_BASE, | ||
32 | .end = SH7780_PCI_IO_BASE + SH7780_PCI_IO_SIZE - 1, | ||
33 | .flags = IORESOURCE_IO | ||
34 | }; | ||
35 | |||
36 | static struct resource sh7785_mem_resource = { | ||
37 | .name = "SH7785_mem", | ||
38 | .start = SH7780_PCI_MEMORY_BASE, | ||
39 | .end = SH7780_PCI_MEMORY_BASE + SH7780_PCI_MEM_SIZE - 1, | ||
40 | .flags = IORESOURCE_MEM | ||
41 | }; | ||
42 | |||
43 | struct pci_channel board_pci_channels[] = { | ||
44 | { &sh4_pci_ops, &sh7785_io_resource, &sh7785_mem_resource, 0, 0xff }, | ||
45 | { NULL, NULL, NULL, 0, 0 }, | ||
46 | }; | ||
47 | EXPORT_SYMBOL(board_pci_channels); | ||
48 | |||
49 | static struct sh4_pci_address_map sh7785_pci_map = { | ||
50 | .window0 = { | ||
51 | .base = SH7780_CS2_BASE_ADDR, | ||
52 | .size = 0x04000000, | ||
53 | }, | ||
54 | |||
55 | .window1 = { | ||
56 | .base = SH7780_CS3_BASE_ADDR, | ||
57 | .size = 0x04000000, | ||
58 | }, | ||
59 | |||
60 | .flags = SH4_PCIC_NO_RESET, | ||
61 | }; | ||
62 | |||
63 | int __init pcibios_init_platform(void) | ||
64 | { | ||
65 | return sh7780_pcic_init(&sh7785_pci_map); | ||
66 | } | ||