diff options
Diffstat (limited to 'arch/sh/boards/renesas/r7780rp')
-rw-r--r-- | arch/sh/boards/renesas/r7780rp/Kconfig | 18 | ||||
-rw-r--r-- | arch/sh/boards/renesas/r7780rp/Makefile | 6 | ||||
-rw-r--r-- | arch/sh/boards/renesas/r7780rp/irq-r7780rp.c | 21 | ||||
-rw-r--r-- | arch/sh/boards/renesas/r7780rp/irq-r7785rp.c | 29 | ||||
-rw-r--r-- | arch/sh/boards/renesas/r7780rp/irq.c | 25 | ||||
-rw-r--r-- | arch/sh/boards/renesas/r7780rp/setup.c | 74 |
6 files changed, 105 insertions, 68 deletions
diff --git a/arch/sh/boards/renesas/r7780rp/Kconfig b/arch/sh/boards/renesas/r7780rp/Kconfig index c26d9813d239..9fb11641fe13 100644 --- a/arch/sh/boards/renesas/r7780rp/Kconfig +++ b/arch/sh/boards/renesas/r7780rp/Kconfig | |||
@@ -1,14 +1,24 @@ | |||
1 | if SH_R7780RP | 1 | if SH_HIGHLANDER |
2 | 2 | ||
3 | menu "R7780RP options" | 3 | choice |
4 | prompt "Highlander options" | ||
5 | default SH_R7780MP | ||
6 | |||
7 | config SH_R7780RP | ||
8 | bool "R7780RP-1 board support" | ||
9 | select CPU_SUBTYPE_SH7780 | ||
4 | 10 | ||
5 | config SH_R7780MP | 11 | config SH_R7780MP |
6 | bool "R7780MP board support" | 12 | bool "R7780MP board support" |
7 | default y | 13 | select CPU_SUBTYPE_SH7780 |
8 | help | 14 | help |
9 | Selecting this option will enable support for the mass-production | 15 | Selecting this option will enable support for the mass-production |
10 | version of the R7780RP. If in doubt, say Y. | 16 | version of the R7780RP. If in doubt, say Y. |
11 | 17 | ||
12 | endmenu | 18 | config SH_R7785RP |
19 | bool "R7785RP board support" | ||
20 | select CPU_SUBTYPE_SH7785 | ||
21 | |||
22 | endchoice | ||
13 | 23 | ||
14 | endif | 24 | endif |
diff --git a/arch/sh/boards/renesas/r7780rp/Makefile b/arch/sh/boards/renesas/r7780rp/Makefile index ed5f5a9a3b3e..609e5d50dde8 100644 --- a/arch/sh/boards/renesas/r7780rp/Makefile +++ b/arch/sh/boards/renesas/r7780rp/Makefile | |||
@@ -1,7 +1,7 @@ | |||
1 | # | 1 | # |
2 | # Makefile for the R7780RP-1 specific parts of the kernel | 2 | # Makefile for the R7780RP-1 specific parts of the kernel |
3 | # | 3 | # |
4 | 4 | irqinit-y := irq-r7780rp.o | |
5 | obj-y := setup.o irq.o | 5 | irqinit-$(CONFIG_SH_R7785RP) := irq-r7785rp.o |
6 | |||
7 | obj-$(CONFIG_PUSH_SWITCH) += psw.o | 6 | obj-$(CONFIG_PUSH_SWITCH) += psw.o |
7 | obj-y := setup.o irq.o $(irqinit-y) | ||
diff --git a/arch/sh/boards/renesas/r7780rp/irq-r7780rp.c b/arch/sh/boards/renesas/r7780rp/irq-r7780rp.c new file mode 100644 index 000000000000..f5f358746c9e --- /dev/null +++ b/arch/sh/boards/renesas/r7780rp/irq-r7780rp.c | |||
@@ -0,0 +1,21 @@ | |||
1 | /* | ||
2 | * Renesas Solutions Highlander R7780RP-1 Support. | ||
3 | * | ||
4 | * Copyright (C) 2002 Atom Create Engineering Co., Ltd. | ||
5 | * Copyright (C) 2006 Paul Mundt | ||
6 | * | ||
7 | * This file is subject to the terms and conditions of the GNU General Public | ||
8 | * License. See the file "COPYING" in the main directory of this archive | ||
9 | * for more details. | ||
10 | */ | ||
11 | #include <linux/init.h> | ||
12 | #include <asm/io.h> | ||
13 | #include <asm/r7780rp.h> | ||
14 | |||
15 | void __init highlander_init_irq(void) | ||
16 | { | ||
17 | int i; | ||
18 | |||
19 | for (i = 0; i < 15; i++) | ||
20 | make_r7780rp_irq(i); | ||
21 | } | ||
diff --git a/arch/sh/boards/renesas/r7780rp/irq-r7785rp.c b/arch/sh/boards/renesas/r7780rp/irq-r7785rp.c new file mode 100644 index 000000000000..dd6ec4ce44dc --- /dev/null +++ b/arch/sh/boards/renesas/r7780rp/irq-r7785rp.c | |||
@@ -0,0 +1,29 @@ | |||
1 | /* | ||
2 | * Renesas Solutions Highlander R7780RP-1 Support. | ||
3 | * | ||
4 | * Copyright (C) 2002 Atom Create Engineering Co., Ltd. | ||
5 | * Copyright (C) 2006 Paul Mundt | ||
6 | * | ||
7 | * This file is subject to the terms and conditions of the GNU General Public | ||
8 | * License. See the file "COPYING" in the main directory of this archive | ||
9 | * for more details. | ||
10 | */ | ||
11 | #include <linux/init.h> | ||
12 | #include <asm/io.h> | ||
13 | #include <asm/r7780rp.h> | ||
14 | |||
15 | void __init highlander_init_irq(void) | ||
16 | { | ||
17 | ctrl_outw(0x0000, PA_IRLSSR1); /* FPGA IRLSSR1(CF_CD clear) */ | ||
18 | |||
19 | /* Setup the FPGA IRL */ | ||
20 | ctrl_outw(0x0000, PA_IRLPRA); /* FPGA IRLA */ | ||
21 | ctrl_outw(0xe598, PA_IRLPRB); /* FPGA IRLB */ | ||
22 | ctrl_outw(0x7060, PA_IRLPRC); /* FPGA IRLC */ | ||
23 | ctrl_outw(0x0000, PA_IRLPRD); /* FPGA IRLD */ | ||
24 | ctrl_outw(0x4321, PA_IRLPRE); /* FPGA IRLE */ | ||
25 | ctrl_outw(0x0000, PA_IRLPRF); /* FPGA IRLF */ | ||
26 | |||
27 | make_r7780rp_irq(1); /* CF card */ | ||
28 | make_r7780rp_irq(10); /* On-board ethernet */ | ||
29 | } | ||
diff --git a/arch/sh/boards/renesas/r7780rp/irq.c b/arch/sh/boards/renesas/r7780rp/irq.c index cc381e197783..e0b8eb52f376 100644 --- a/arch/sh/boards/renesas/r7780rp/irq.c +++ b/arch/sh/boards/renesas/r7780rp/irq.c | |||
@@ -14,10 +14,12 @@ | |||
14 | #include <linux/io.h> | 14 | #include <linux/io.h> |
15 | #include <asm/r7780rp.h> | 15 | #include <asm/r7780rp.h> |
16 | 16 | ||
17 | #ifdef CONFIG_SH_R7780MP | 17 | #ifdef CONFIG_SH_R7780RP |
18 | static int mask_pos[] = {12, 11, 9, 14, 15, 8, 13, 6, 5, 4, 3, 2, 0, 0, 1, 0}; | ||
19 | #else | ||
20 | static int mask_pos[] = {15, 14, 13, 12, 11, 10, 9, 8, 7, 5, 6, 4, 0, 1, 2, 0}; | 18 | static int mask_pos[] = {15, 14, 13, 12, 11, 10, 9, 8, 7, 5, 6, 4, 0, 1, 2, 0}; |
19 | #elif defined(CONFIG_SH_R7780MP) | ||
20 | static int mask_pos[] = {12, 11, 9, 14, 15, 8, 13, 6, 5, 4, 3, 2, 0, 0, 1, 0}; | ||
21 | #elif defined(CONFIG_SH_R7785RP) | ||
22 | static int mask_pos[] = {2, 11, 2, 2, 2, 2, 9, 8, 7, 5, 10, 2, 2, 2, 2, 2}; | ||
21 | #endif | 23 | #endif |
22 | 24 | ||
23 | static void enable_r7780rp_irq(unsigned int irq) | 25 | static void enable_r7780rp_irq(unsigned int irq) |
@@ -40,17 +42,10 @@ static struct irq_chip r7780rp_irq_chip __read_mostly = { | |||
40 | .mask_ack = disable_r7780rp_irq, | 42 | .mask_ack = disable_r7780rp_irq, |
41 | }; | 43 | }; |
42 | 44 | ||
43 | /* | 45 | void make_r7780rp_irq(unsigned int irq) |
44 | * Initialize IRQ setting | ||
45 | */ | ||
46 | void __init init_r7780rp_IRQ(void) | ||
47 | { | 46 | { |
48 | int i; | 47 | disable_irq_nosync(irq); |
49 | 48 | set_irq_chip_and_handler_name(irq, &r7780rp_irq_chip, | |
50 | for (i = 0; i < 15; i++) { | 49 | handle_level_irq, "level"); |
51 | disable_irq_nosync(i); | 50 | enable_r7780rp_irq(irq); |
52 | set_irq_chip_and_handler_name(i, &r7780rp_irq_chip, | ||
53 | handle_level_irq, "level"); | ||
54 | enable_r7780rp_irq(i); | ||
55 | } | ||
56 | } | 51 | } |
diff --git a/arch/sh/boards/renesas/r7780rp/setup.c b/arch/sh/boards/renesas/r7780rp/setup.c index 2faba6679e64..6af0cc35ceb7 100644 --- a/arch/sh/boards/renesas/r7780rp/setup.c +++ b/arch/sh/boards/renesas/r7780rp/setup.c | |||
@@ -1,10 +1,13 @@ | |||
1 | /* | 1 | /* |
2 | * arch/sh/boards/renesas/r7780rp/setup.c | 2 | * arch/sh/boards/renesas/r7780rp/setup.c |
3 | * | 3 | * |
4 | * Renesas Solutions Highlander Support. | ||
5 | * | ||
4 | * Copyright (C) 2002 Atom Create Engineering Co., Ltd. | 6 | * Copyright (C) 2002 Atom Create Engineering Co., Ltd. |
5 | * Copyright (C) 2005 - 2007 Paul Mundt | 7 | * Copyright (C) 2005 - 2007 Paul Mundt |
6 | * | 8 | * |
7 | * Renesas Solutions Highlander R7780RP-1 Support. | 9 | * This contains support for the R7780RP-1, R7780MP, and R7785RP |
10 | * Highlander modules. | ||
8 | * | 11 | * |
9 | * This file is subject to the terms and conditions of the GNU General Public | 12 | * This file is subject to the terms and conditions of the GNU General Public |
10 | * License. See the file "COPYING" in the main directory of this archive | 13 | * License. See the file "COPYING" in the main directory of this archive |
@@ -18,32 +21,6 @@ | |||
18 | #include <asm/clock.h> | 21 | #include <asm/clock.h> |
19 | #include <asm/io.h> | 22 | #include <asm/io.h> |
20 | 23 | ||
21 | extern void init_r7780rp_IRQ(void); | ||
22 | |||
23 | static struct resource m66596_usb_host_resources[] = { | ||
24 | [0] = { | ||
25 | .start = 0xa4800000, | ||
26 | .end = 0xa4ffffff, | ||
27 | .flags = IORESOURCE_MEM, | ||
28 | }, | ||
29 | [1] = { | ||
30 | .start = 6, /* irq number */ | ||
31 | .end = 6, | ||
32 | .flags = IORESOURCE_IRQ, | ||
33 | }, | ||
34 | }; | ||
35 | |||
36 | static struct platform_device m66596_usb_host_device = { | ||
37 | .name = "m66596-hcd", | ||
38 | .id = 0, | ||
39 | .dev = { | ||
40 | .dma_mask = NULL, /* don't use dma */ | ||
41 | .coherent_dma_mask = 0xffffffff, | ||
42 | }, | ||
43 | .num_resources = ARRAY_SIZE(m66596_usb_host_resources), | ||
44 | .resource = m66596_usb_host_resources, | ||
45 | }; | ||
46 | |||
47 | static struct resource cf_ide_resources[] = { | 24 | static struct resource cf_ide_resources[] = { |
48 | [0] = { | 25 | [0] = { |
49 | .start = PA_AREA5_IO + 0x1000, | 26 | .start = PA_AREA5_IO + 0x1000, |
@@ -56,10 +33,10 @@ static struct resource cf_ide_resources[] = { | |||
56 | .flags = IORESOURCE_MEM, | 33 | .flags = IORESOURCE_MEM, |
57 | }, | 34 | }, |
58 | [2] = { | 35 | [2] = { |
59 | #ifdef CONFIG_SH_R7780MP | 36 | #ifdef CONFIG_SH_R7780RP |
60 | .start = 1, | ||
61 | #else | ||
62 | .start = 4, | 37 | .start = 4, |
38 | #else | ||
39 | .start = 1, | ||
63 | #endif | 40 | #endif |
64 | .flags = IORESOURCE_IRQ, | 41 | .flags = IORESOURCE_IRQ, |
65 | }, | 42 | }, |
@@ -92,15 +69,18 @@ static struct resource heartbeat_resources[] = { | |||
92 | static struct platform_device heartbeat_device = { | 69 | static struct platform_device heartbeat_device = { |
93 | .name = "heartbeat", | 70 | .name = "heartbeat", |
94 | .id = -1, | 71 | .id = -1, |
72 | |||
73 | /* R7785RP has a slightly more sensible FPGA.. */ | ||
74 | #ifndef CONFIG_SH_R7785RP | ||
95 | .dev = { | 75 | .dev = { |
96 | .platform_data = heartbeat_bit_pos, | 76 | .platform_data = heartbeat_bit_pos, |
97 | }, | 77 | }, |
78 | #endif | ||
98 | .num_resources = ARRAY_SIZE(heartbeat_resources), | 79 | .num_resources = ARRAY_SIZE(heartbeat_resources), |
99 | .resource = heartbeat_resources, | 80 | .resource = heartbeat_resources, |
100 | }; | 81 | }; |
101 | 82 | ||
102 | static struct platform_device *r7780rp_devices[] __initdata = { | 83 | static struct platform_device *r7780rp_devices[] __initdata = { |
103 | &m66596_usb_host_device, | ||
104 | &cf_ide_device, | 84 | &cf_ide_device, |
105 | &heartbeat_device, | 85 | &heartbeat_device, |
106 | }; | 86 | }; |
@@ -110,6 +90,7 @@ static int __init r7780rp_devices_setup(void) | |||
110 | return platform_add_devices(r7780rp_devices, | 90 | return platform_add_devices(r7780rp_devices, |
111 | ARRAY_SIZE(r7780rp_devices)); | 91 | ARRAY_SIZE(r7780rp_devices)); |
112 | } | 92 | } |
93 | device_initcall(r7780rp_devices_setup); | ||
113 | 94 | ||
114 | /* | 95 | /* |
115 | * Platform specific clocks | 96 | * Platform specific clocks |
@@ -140,22 +121,22 @@ static struct clk *r7780rp_clocks[] = { | |||
140 | 121 | ||
141 | static void r7780rp_power_off(void) | 122 | static void r7780rp_power_off(void) |
142 | { | 123 | { |
143 | #ifdef CONFIG_SH_R7780MP | 124 | if (mach_is_r7780mp() || mach_is_r7785rp()) |
144 | ctrl_outw(0x0001, PA_POFF); | 125 | ctrl_outw(0x0001, PA_POFF); |
145 | #endif | ||
146 | } | 126 | } |
147 | 127 | ||
148 | /* | 128 | /* |
149 | * Initialize the board | 129 | * Initialize the board |
150 | */ | 130 | */ |
151 | static void __init r7780rp_setup(char **cmdline_p) | 131 | static void __init highlander_setup(char **cmdline_p) |
152 | { | 132 | { |
153 | u16 ver = ctrl_inw(PA_VERREG); | 133 | u16 ver = ctrl_inw(PA_VERREG); |
154 | int i; | 134 | int i; |
155 | 135 | ||
156 | device_initcall(r7780rp_devices_setup); | 136 | printk(KERN_INFO "Renesas Solutions Highlander %s support.\n", |
157 | 137 | mach_is_r7780rp() ? "R7780RP-1" : | |
158 | printk(KERN_INFO "Renesas Solutions Highlander R7780RP-1 support.\n"); | 138 | mach_is_r7780mp() ? "R7780MP" : |
139 | "R7785RP"); | ||
159 | 140 | ||
160 | printk(KERN_INFO "Board version: %d (revision %d), " | 141 | printk(KERN_INFO "Board version: %d (revision %d), " |
161 | "FPGA version: %d (revision %d)\n", | 142 | "FPGA version: %d (revision %d)\n", |
@@ -173,9 +154,10 @@ static void __init r7780rp_setup(char **cmdline_p) | |||
173 | } | 154 | } |
174 | 155 | ||
175 | ctrl_outw(0x0000, PA_OBLED); /* Clear LED. */ | 156 | ctrl_outw(0x0000, PA_OBLED); /* Clear LED. */ |
176 | #ifndef CONFIG_SH_R7780MP | 157 | |
177 | ctrl_outw(0x0001, PA_SDPOW); /* SD Power ON */ | 158 | if (mach_is_r7780rp()) |
178 | #endif | 159 | ctrl_outw(0x0001, PA_SDPOW); /* SD Power ON */ |
160 | |||
179 | ctrl_outw(ctrl_inw(PA_IVDRCTL) | 0x01, PA_IVDRCTL); /* Si13112 */ | 161 | ctrl_outw(ctrl_inw(PA_IVDRCTL) | 0x01, PA_IVDRCTL); /* Si13112 */ |
180 | 162 | ||
181 | pm_power_off = r7780rp_power_off; | 163 | pm_power_off = r7780rp_power_off; |
@@ -184,10 +166,10 @@ static void __init r7780rp_setup(char **cmdline_p) | |||
184 | /* | 166 | /* |
185 | * The Machine Vector | 167 | * The Machine Vector |
186 | */ | 168 | */ |
187 | struct sh_machine_vector mv_r7780rp __initmv = { | 169 | struct sh_machine_vector mv_highlander __initmv = { |
188 | .mv_name = "Highlander R7780RP-1", | 170 | .mv_name = "Highlander", |
189 | .mv_setup = r7780rp_setup, | ||
190 | .mv_nr_irqs = 109, | 171 | .mv_nr_irqs = 109, |
191 | .mv_init_irq = init_r7780rp_IRQ, | 172 | .mv_setup = highlander_setup, |
173 | .mv_init_irq = highlander_init_irq, | ||
192 | }; | 174 | }; |
193 | ALIAS_MV(r7780rp) | 175 | ALIAS_MV(highlander) |