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-lboxre2.c | 41 | ||||
-rw-r--r-- | arch/sh/drivers/pci/ops-lboxre2.c | 63 | ||||
-rw-r--r-- | arch/sh/drivers/pci/pci-sh7751.c | 2 |
4 files changed, 106 insertions, 1 deletions
diff --git a/arch/sh/drivers/pci/Makefile b/arch/sh/drivers/pci/Makefile index 8a7e70651939..b1391cb080d1 100644 --- a/arch/sh/drivers/pci/Makefile +++ b/arch/sh/drivers/pci/Makefile | |||
@@ -18,3 +18,4 @@ obj-$(CONFIG_SH_SH03) += ops-sh03.o fixups-sh03.o | |||
18 | obj-$(CONFIG_SH_HIGHLANDER) += ops-r7780rp.o fixups-r7780rp.o | 18 | obj-$(CONFIG_SH_HIGHLANDER) += ops-r7780rp.o fixups-r7780rp.o |
19 | obj-$(CONFIG_SH_TITAN) += ops-titan.o | 19 | obj-$(CONFIG_SH_TITAN) += ops-titan.o |
20 | obj-$(CONFIG_SH_LANDISK) += ops-landisk.o | 20 | obj-$(CONFIG_SH_LANDISK) += ops-landisk.o |
21 | obj-$(CONFIG_SH_LBOX_RE2) += ops-lboxre2.o fixups-lboxre2.o | ||
diff --git a/arch/sh/drivers/pci/fixups-lboxre2.c b/arch/sh/drivers/pci/fixups-lboxre2.c new file mode 100644 index 000000000000..40b19bdfb891 --- /dev/null +++ b/arch/sh/drivers/pci/fixups-lboxre2.c | |||
@@ -0,0 +1,41 @@ | |||
1 | /* | ||
2 | * arch/sh/drivers/pci/fixups-lboxre2.c | ||
3 | * | ||
4 | * L-BOX RE2 PCI fixups | ||
5 | * | ||
6 | * Copyright (C) 2007 Nobuhiro Iwamatsu | ||
7 | * | ||
8 | * This file is subject to the terms and conditions of the GNU General Public | ||
9 | * License. See the file "COPYING" in the main directory of this archive | ||
10 | * for more details. | ||
11 | */ | ||
12 | #include "pci-sh4.h" | ||
13 | |||
14 | #define PCIMCR_MRSET_OFF 0xBFFFFFFF | ||
15 | #define PCIMCR_RFSH_OFF 0xFFFFFFFB | ||
16 | |||
17 | int pci_fixup_pcic(void) | ||
18 | { | ||
19 | unsigned long bcr1, mcr; | ||
20 | |||
21 | bcr1 = inl(SH7751_BCR1); | ||
22 | bcr1 |= 0x40080000; /* Enable Bit 19 BREQEN, set PCIC to slave */ | ||
23 | pci_write_reg(bcr1, SH4_PCIBCR1); | ||
24 | |||
25 | /* Enable all interrupts, so we known what to fix */ | ||
26 | pci_write_reg(0x0000c3ff, SH4_PCIINTM); | ||
27 | pci_write_reg(0x0000380f, SH4_PCIAINTM); | ||
28 | pci_write_reg(0xfb900047, SH7751_PCICONF1); | ||
29 | pci_write_reg(0xab000001, SH7751_PCICONF4); | ||
30 | |||
31 | mcr = inl(SH7751_MCR); | ||
32 | mcr = (mcr & PCIMCR_MRSET_OFF) & PCIMCR_RFSH_OFF; | ||
33 | pci_write_reg(mcr, SH4_PCIMCR); | ||
34 | |||
35 | pci_write_reg(0x0c000000, SH7751_PCICONF5); | ||
36 | pci_write_reg(0xd0000000, SH7751_PCICONF6); | ||
37 | pci_write_reg(0x0c000000, SH4_PCILAR0); | ||
38 | pci_write_reg(0x00000000, SH4_PCILAR1); | ||
39 | |||
40 | return 0; | ||
41 | } | ||
diff --git a/arch/sh/drivers/pci/ops-lboxre2.c b/arch/sh/drivers/pci/ops-lboxre2.c new file mode 100644 index 000000000000..a13cb764b0b9 --- /dev/null +++ b/arch/sh/drivers/pci/ops-lboxre2.c | |||
@@ -0,0 +1,63 @@ | |||
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> | ||
13 | #include <asm/lboxre2.h> | ||
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[] = { | ||
42 | { &sh4_pci_ops, &sh7751_io_resource, &sh7751_mem_resource, 0, 0xff }, | ||
43 | { NULL, NULL, NULL, 0, 0 }, | ||
44 | }; | ||
45 | |||
46 | EXPORT_SYMBOL(board_pci_channels); | ||
47 | |||
48 | static struct sh4_pci_address_map sh7751_pci_map = { | ||
49 | .window0 = { | ||
50 | .base = SH7751_CS3_BASE_ADDR, | ||
51 | .size = 0x04000000, | ||
52 | }, | ||
53 | .window1 = { | ||
54 | .base = 0x00000000, /* Unused */ | ||
55 | .size = 0x00000000, /* Unused */ | ||
56 | }, | ||
57 | .flags = SH4_PCIC_NO_RESET, | ||
58 | }; | ||
59 | |||
60 | int __init pcibios_init_platform(void) | ||
61 | { | ||
62 | return sh7751_pcic_init(&sh7751_pci_map); | ||
63 | } | ||
diff --git a/arch/sh/drivers/pci/pci-sh7751.c b/arch/sh/drivers/pci/pci-sh7751.c index 9ddff760d3c6..f3ead58a9519 100644 --- a/arch/sh/drivers/pci/pci-sh7751.c +++ b/arch/sh/drivers/pci/pci-sh7751.c | |||
@@ -194,7 +194,7 @@ int __init sh7751_pcic_init(struct sh4_pci_address_map *map) | |||
194 | * DMA interrupts... | 194 | * DMA interrupts... |
195 | */ | 195 | */ |
196 | 196 | ||
197 | #ifdef CONFIG_SH_RTS7751R2D | 197 | #if defined(CONFIG_SH_RTS7751R2D) || defined(CONFIG_SH_LBOX_RE2) |
198 | pci_fixup_pcic(); | 198 | pci_fixup_pcic(); |
199 | #endif | 199 | #endif |
200 | 200 | ||