diff options
Diffstat (limited to 'arch/sh/drivers')
-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-dreamcast.c | 2 | ||||
-rw-r--r-- | arch/sh/drivers/pci/ops-sh7785lcr.c | 66 | ||||
-rw-r--r-- | arch/sh/drivers/pci/pci-auto.c | 2 | ||||
-rw-r--r-- | arch/sh/drivers/pci/pci.c | 2 |
6 files changed, 117 insertions, 2 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-dreamcast.c b/arch/sh/drivers/pci/ops-dreamcast.c index e1284fc69361..f54c291db37b 100644 --- a/arch/sh/drivers/pci/ops-dreamcast.c +++ b/arch/sh/drivers/pci/ops-dreamcast.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/init.h> | 22 | #include <linux/init.h> |
23 | #include <linux/irq.h> | 23 | #include <linux/irq.h> |
24 | #include <linux/pci.h> | 24 | #include <linux/pci.h> |
25 | #include <linux/module.h> | ||
25 | 26 | ||
26 | #include <asm/io.h> | 27 | #include <asm/io.h> |
27 | #include <asm/irq.h> | 28 | #include <asm/irq.h> |
@@ -48,6 +49,7 @@ struct pci_channel board_pci_channels[] = { | |||
48 | &gapspci_mem_resource, 0, 1 }, | 49 | &gapspci_mem_resource, 0, 1 }, |
49 | { 0, } | 50 | { 0, } |
50 | }; | 51 | }; |
52 | EXPORT_SYMBOL(board_pci_channels); | ||
51 | 53 | ||
52 | /* | 54 | /* |
53 | * The !gapspci_config_access case really shouldn't happen, ever, unless | 55 | * The !gapspci_config_access case really shouldn't happen, ever, unless |
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 | } | ||
diff --git a/arch/sh/drivers/pci/pci-auto.c b/arch/sh/drivers/pci/pci-auto.c index ea404704ace8..cf48b12ee58c 100644 --- a/arch/sh/drivers/pci/pci-auto.c +++ b/arch/sh/drivers/pci/pci-auto.c | |||
@@ -78,7 +78,7 @@ static struct pci_dev *fake_pci_dev(struct pci_channel *hose, | |||
78 | } | 78 | } |
79 | 79 | ||
80 | #define EARLY_PCI_OP(rw, size, type) \ | 80 | #define EARLY_PCI_OP(rw, size, type) \ |
81 | int early_##rw##_config_##size(struct pci_channel *hose, \ | 81 | static int early_##rw##_config_##size(struct pci_channel *hose, \ |
82 | int top_bus, int bus, int devfn, int offset, type value) \ | 82 | int top_bus, int bus, int devfn, int offset, type value) \ |
83 | { \ | 83 | { \ |
84 | return pci_##rw##_config_##size( \ | 84 | return pci_##rw##_config_##size( \ |
diff --git a/arch/sh/drivers/pci/pci.c b/arch/sh/drivers/pci/pci.c index f57095a2617c..d3839e609aac 100644 --- a/arch/sh/drivers/pci/pci.c +++ b/arch/sh/drivers/pci/pci.c | |||
@@ -135,7 +135,7 @@ int pcibios_enable_device(struct pci_dev *dev, int mask) | |||
135 | * If we set up a device for bus mastering, we need to check and set | 135 | * If we set up a device for bus mastering, we need to check and set |
136 | * the latency timer as it may not be properly set. | 136 | * the latency timer as it may not be properly set. |
137 | */ | 137 | */ |
138 | unsigned int pcibios_max_latency = 255; | 138 | static unsigned int pcibios_max_latency = 255; |
139 | 139 | ||
140 | void pcibios_set_master(struct pci_dev *dev) | 140 | void pcibios_set_master(struct pci_dev *dev) |
141 | { | 141 | { |