diff options
author | Paul Mundt <lethal@linux-sh.org> | 2007-03-12 01:38:59 -0400 |
---|---|---|
committer | Paul Mundt <lethal@hera.kernel.org> | 2007-05-06 22:10:53 -0400 |
commit | 32351a28a7e1f2c68afbe559dd35e1ad0301be6d (patch) | |
tree | 289c28c605da6876125fa2105d880860b88b5017 /arch/sh/drivers | |
parent | be782df54c51b50dd4dbc363a5a5afa04565fc60 (diff) |
sh: Add SH7785 Highlander board support (R7785RP).
This adds preliminary support for the SH7785-based Highlander board.
Some of the Highlander support code is reordered so that most of it
can be reused directly.
This also plugs in missing SH7785 checks in the places that need it,
as this is the first board to support the CPU.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/drivers')
-rw-r--r-- | arch/sh/drivers/Kconfig | 10 | ||||
-rw-r--r-- | arch/sh/drivers/pci/Makefile | 3 | ||||
-rw-r--r-- | arch/sh/drivers/pci/ops-r7780rp.c | 37 | ||||
-rw-r--r-- | arch/sh/drivers/pci/pci-sh4.h | 2 | ||||
-rw-r--r-- | arch/sh/drivers/pci/pci-sh7780.c | 17 | ||||
-rw-r--r-- | arch/sh/drivers/pci/pci-sh7780.h | 3 |
6 files changed, 55 insertions, 17 deletions
diff --git a/arch/sh/drivers/Kconfig b/arch/sh/drivers/Kconfig index c54c758e6243..420c6b2f33a5 100644 --- a/arch/sh/drivers/Kconfig +++ b/arch/sh/drivers/Kconfig | |||
@@ -1,5 +1,15 @@ | |||
1 | source "arch/sh/drivers/dma/Kconfig" | ||
2 | source "arch/sh/cchips/Kconfig" | ||
3 | |||
1 | menu "Additional SuperH Device Drivers" | 4 | menu "Additional SuperH Device Drivers" |
2 | 5 | ||
6 | config HEARTBEAT | ||
7 | bool "Heartbeat LED" | ||
8 | help | ||
9 | Use the power-on LED on your machine as a load meter. The exact | ||
10 | behavior is platform-dependent, but normally the flash frequency is | ||
11 | a hyperbolic function of the 5-minute load average. | ||
12 | |||
3 | config PUSH_SWITCH | 13 | config PUSH_SWITCH |
4 | tristate "Push switch support" | 14 | tristate "Push switch support" |
5 | help | 15 | help |
diff --git a/arch/sh/drivers/pci/Makefile b/arch/sh/drivers/pci/Makefile index cc8d0d0b1427..8a7e70651939 100644 --- a/arch/sh/drivers/pci/Makefile +++ b/arch/sh/drivers/pci/Makefile | |||
@@ -8,12 +8,13 @@ obj-$(CONFIG_PCI_AUTO) += pci-auto.o | |||
8 | obj-$(CONFIG_CPU_SUBTYPE_ST40STB1) += pci-st40.o | 8 | obj-$(CONFIG_CPU_SUBTYPE_ST40STB1) += pci-st40.o |
9 | obj-$(CONFIG_CPU_SUBTYPE_SH7751) += pci-sh7751.o ops-sh4.o | 9 | obj-$(CONFIG_CPU_SUBTYPE_SH7751) += pci-sh7751.o ops-sh4.o |
10 | obj-$(CONFIG_CPU_SUBTYPE_SH7780) += pci-sh7780.o ops-sh4.o | 10 | obj-$(CONFIG_CPU_SUBTYPE_SH7780) += pci-sh7780.o ops-sh4.o |
11 | obj-$(CONFIG_CPU_SUBTYPE_SH7785) += pci-sh7780.o ops-sh4.o | ||
11 | 12 | ||
12 | obj-$(CONFIG_SH_DREAMCAST) += ops-dreamcast.o fixups-dreamcast.o \ | 13 | obj-$(CONFIG_SH_DREAMCAST) += ops-dreamcast.o fixups-dreamcast.o \ |
13 | dma-dreamcast.o | 14 | dma-dreamcast.o |
14 | obj-$(CONFIG_SH_SECUREEDGE5410) += ops-snapgear.o | 15 | obj-$(CONFIG_SH_SECUREEDGE5410) += ops-snapgear.o |
15 | obj-$(CONFIG_SH_RTS7751R2D) += ops-rts7751r2d.o fixups-rts7751r2d.o | 16 | obj-$(CONFIG_SH_RTS7751R2D) += ops-rts7751r2d.o fixups-rts7751r2d.o |
16 | obj-$(CONFIG_SH_SH03) += ops-sh03.o fixups-sh03.o | 17 | obj-$(CONFIG_SH_SH03) += ops-sh03.o fixups-sh03.o |
17 | obj-$(CONFIG_SH_R7780RP) += ops-r7780rp.o fixups-r7780rp.o | 18 | obj-$(CONFIG_SH_HIGHLANDER) += ops-r7780rp.o fixups-r7780rp.o |
18 | obj-$(CONFIG_SH_TITAN) += ops-titan.o | 19 | obj-$(CONFIG_SH_TITAN) += ops-titan.o |
19 | obj-$(CONFIG_SH_LANDISK) += ops-landisk.o | 20 | obj-$(CONFIG_SH_LANDISK) += ops-landisk.o |
diff --git a/arch/sh/drivers/pci/ops-r7780rp.c b/arch/sh/drivers/pci/ops-r7780rp.c index eeea1577e112..6f4fb38bafa2 100644 --- a/arch/sh/drivers/pci/ops-r7780rp.c +++ b/arch/sh/drivers/pci/ops-r7780rp.c | |||
@@ -17,18 +17,35 @@ | |||
17 | #include <asm/io.h> | 17 | #include <asm/io.h> |
18 | #include "pci-sh4.h" | 18 | #include "pci-sh4.h" |
19 | 19 | ||
20 | static char r7780rp_irq_tab[] __initdata = { | ||
21 | 0, 1, 2, 3, | ||
22 | }; | ||
23 | |||
24 | static char r7780mp_irq_tab[] __initdata = { | ||
25 | 65, 66, 67, 68, | ||
26 | }; | ||
27 | |||
28 | static char r7785rp_irq_tab[][4] __initdata = { | ||
29 | { 65, 66, 67, 68 }, /* INT ABCD */ | ||
30 | { 66, 67, 68, 65 }, /* INT BCDA */ | ||
31 | { 67, 68, 65, 66 }, /* INT CDAB */ | ||
32 | { 68, 65, 66, 67 }, /* INT DABC */ | ||
33 | { 64, 64, 64, 64 }, /* PCI Host */ | ||
34 | }; | ||
35 | |||
20 | int __init pcibios_map_platform_irq(struct pci_dev *pdev, u8 slot, u8 pin) | 36 | int __init pcibios_map_platform_irq(struct pci_dev *pdev, u8 slot, u8 pin) |
21 | { | 37 | { |
22 | switch (slot) { | 38 | if (mach_is_r7780rp()) |
23 | case 0: return IRQ_PCISLOT1; /* PCI Interrupt #1 */ | 39 | return r7780rp_irq_tab[slot]; |
24 | case 1: return IRQ_PCISLOT2; /* PCI Interrupt #2 */ | 40 | if (mach_is_r7780mp()) |
25 | case 2: return IRQ_PCISLOT3; /* PCI Interrupt #3 */ | 41 | return r7780mp_irq_tab[slot]; |
26 | case 3: return IRQ_PCISLOT4; /* PCI Interrupt E4 */ | 42 | if (mach_is_r7785rp()) |
27 | default: | 43 | return r7785rp_irq_tab[slot][pin]; |
28 | printk(KERN_ERR "PCI: Bad IRQ mapping " | 44 | |
29 | "request for slot %d, func %d\n", slot, pin-1); | 45 | printk(KERN_ERR "PCI: Bad IRQ mapping " |
30 | return -1; | 46 | "request for slot %d, func %d\n", slot, pin-1); |
31 | } | 47 | |
48 | return -1; | ||
32 | } | 49 | } |
33 | 50 | ||
34 | static struct resource sh7780_io_resource = { | 51 | static struct resource sh7780_io_resource = { |
diff --git a/arch/sh/drivers/pci/pci-sh4.h b/arch/sh/drivers/pci/pci-sh4.h index 5a61d6041f2c..1901c33cde6a 100644 --- a/arch/sh/drivers/pci/pci-sh4.h +++ b/arch/sh/drivers/pci/pci-sh4.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #ifndef __PCI_SH4_H | 1 | #ifndef __PCI_SH4_H |
2 | #define __PCI_SH4_H | 2 | #define __PCI_SH4_H |
3 | 3 | ||
4 | #ifdef CONFIG_CPU_SUBTYPE_SH7780 | 4 | #if defined(CONFIG_CPU_SUBTYPE_SH7780) || defined(CONFIG_CPU_SUBTYPE_SH7785) |
5 | #include "pci-sh7780.h" | 5 | #include "pci-sh7780.h" |
6 | #else | 6 | #else |
7 | #include "pci-sh7751.h" | 7 | #include "pci-sh7751.h" |
diff --git a/arch/sh/drivers/pci/pci-sh7780.c b/arch/sh/drivers/pci/pci-sh7780.c index 602b644c35ad..16b30a9e94bb 100644 --- a/arch/sh/drivers/pci/pci-sh7780.c +++ b/arch/sh/drivers/pci/pci-sh7780.c | |||
@@ -48,7 +48,7 @@ | |||
48 | static int __init sh7780_pci_init(void) | 48 | static int __init sh7780_pci_init(void) |
49 | { | 49 | { |
50 | unsigned int id; | 50 | unsigned int id; |
51 | int ret; | 51 | int ret, match = 0; |
52 | 52 | ||
53 | pr_debug("PCI: Starting intialization.\n"); | 53 | pr_debug("PCI: Starting intialization.\n"); |
54 | 54 | ||
@@ -56,8 +56,17 @@ static int __init sh7780_pci_init(void) | |||
56 | 56 | ||
57 | /* check for SH7780/SH7780R hardware */ | 57 | /* check for SH7780/SH7780R hardware */ |
58 | id = pci_read_reg(SH7780_PCIVID); | 58 | id = pci_read_reg(SH7780_PCIVID); |
59 | if ((id != ((SH7780_DEVICE_ID << 16) | SH7780_VENDOR_ID)) && | 59 | if ((id & 0xffff) == SH7780_VENDOR_ID) { |
60 | (id != ((SH7781_DEVICE_ID << 16) | SH7780_VENDOR_ID))) { | 60 | switch ((id >> 16) & 0xffff) { |
61 | case SH7780_DEVICE_ID: | ||
62 | case SH7781_DEVICE_ID: | ||
63 | case SH7785_DEVICE_ID: | ||
64 | match = 1; | ||
65 | break; | ||
66 | } | ||
67 | } | ||
68 | |||
69 | if (unlikely(!match)) { | ||
61 | printk(KERN_ERR "PCI: This is not an SH7780 (%x)\n", id); | 70 | printk(KERN_ERR "PCI: This is not an SH7780 (%x)\n", id); |
62 | return -ENODEV; | 71 | return -ENODEV; |
63 | } | 72 | } |
@@ -138,7 +147,7 @@ int __init sh7780_pcic_init(struct sh4_pci_address_map *map) | |||
138 | * DMA interrupts... | 147 | * DMA interrupts... |
139 | */ | 148 | */ |
140 | 149 | ||
141 | #ifdef CONFIG_SH_R7780RP | 150 | #ifdef CONFIG_SH_HIGHLANDER |
142 | pci_fixup_pcic(); | 151 | pci_fixup_pcic(); |
143 | #endif | 152 | #endif |
144 | 153 | ||
diff --git a/arch/sh/drivers/pci/pci-sh7780.h b/arch/sh/drivers/pci/pci-sh7780.h index f02d2180a4bc..bd44255509e6 100644 --- a/arch/sh/drivers/pci/pci-sh7780.h +++ b/arch/sh/drivers/pci/pci-sh7780.h | |||
@@ -14,8 +14,9 @@ | |||
14 | 14 | ||
15 | /* Platform Specific Values */ | 15 | /* Platform Specific Values */ |
16 | #define SH7780_VENDOR_ID 0x1912 | 16 | #define SH7780_VENDOR_ID 0x1912 |
17 | #define SH7780_DEVICE_ID 0x0002 | ||
18 | #define SH7781_DEVICE_ID 0x0001 | 17 | #define SH7781_DEVICE_ID 0x0001 |
18 | #define SH7780_DEVICE_ID 0x0002 | ||
19 | #define SH7785_DEVICE_ID 0x0007 | ||
19 | 20 | ||
20 | /* SH7780 Control Registers */ | 21 | /* SH7780 Control Registers */ |
21 | #define SH7780_PCI_VCR0 0xFE000000 | 22 | #define SH7780_PCI_VCR0 0xFE000000 |