aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/boards
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2006-09-27 02:59:17 -0400
committerPaul Mundt <lethal@linux-sh.org>2006-09-27 02:59:17 -0400
commit5283ecb5ccbdb90d49fce6488d3944bba63a591c (patch)
treea58e20bd532fa5f933d099bb7b5dd0637b581d33 /arch/sh/boards
parentd7c30c682a278abe1a52db83f69efec1a9d8f8c2 (diff)
sh: Add support for R7780RP and R7780MP boards.
This adds support for the Renesas SH7780 development boards, R7780RP and R7780MP. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/boards')
-rw-r--r--arch/sh/boards/renesas/r7780rp/Kconfig14
-rw-r--r--arch/sh/boards/renesas/r7780rp/Makefile6
-rw-r--r--arch/sh/boards/renesas/r7780rp/io.c338
-rw-r--r--arch/sh/boards/renesas/r7780rp/irq.c123
-rw-r--r--arch/sh/boards/renesas/r7780rp/led.c45
-rw-r--r--arch/sh/boards/renesas/r7780rp/setup.c164
6 files changed, 690 insertions, 0 deletions
diff --git a/arch/sh/boards/renesas/r7780rp/Kconfig b/arch/sh/boards/renesas/r7780rp/Kconfig
new file mode 100644
index 00000000000..c26d9813d23
--- /dev/null
+++ b/arch/sh/boards/renesas/r7780rp/Kconfig
@@ -0,0 +1,14 @@
1if SH_R7780RP
2
3menu "R7780RP options"
4
5config SH_R7780MP
6 bool "R7780MP board support"
7 default y
8 help
9 Selecting this option will enable support for the mass-production
10 version of the R7780RP. If in doubt, say Y.
11
12endmenu
13
14endif
diff --git a/arch/sh/boards/renesas/r7780rp/Makefile b/arch/sh/boards/renesas/r7780rp/Makefile
new file mode 100644
index 00000000000..f1776d02797
--- /dev/null
+++ b/arch/sh/boards/renesas/r7780rp/Makefile
@@ -0,0 +1,6 @@
1#
2# Makefile for the R7780RP-1 specific parts of the kernel
3#
4
5obj-y := setup.o io.o irq.o
6obj-$(CONFIG_HEARTBEAT) += led.o
diff --git a/arch/sh/boards/renesas/r7780rp/io.c b/arch/sh/boards/renesas/r7780rp/io.c
new file mode 100644
index 00000000000..f73ca3f0f5a
--- /dev/null
+++ b/arch/sh/boards/renesas/r7780rp/io.c
@@ -0,0 +1,338 @@
1/*
2 * linux/arch/sh/kernel/io_r7780rp.c
3 *
4 * Copyright (C) 2001 Ian da Silva, Jeremy Siegel
5 * Based largely on io_se.c.
6 *
7 * I/O routine for Renesas Solutions Highlander R7780RP-1
8 *
9 * Initial version only to support LAN access; some
10 * placeholder code from io_r7780rp.c left in with the
11 * expectation of later SuperIO and PCMCIA access.
12 */
13
14#include <linux/kernel.h>
15#include <linux/types.h>
16#include <asm/r7780rp/r7780rp.h>
17#include <asm/addrspace.h>
18#include <asm/io.h>
19
20#include <linux/module.h>
21#include <linux/pci.h>
22#include "../../../drivers/pci/pci-sh7780.h"
23
24/*
25 * The 7780 R7780RP-1 uses the built-in PCI controller (PCIC)
26 * of the 7780 processor, and has a SuperIO accessible via the PCI.
27 * The board also includes a PCMCIA controller on its memory bus,
28 * like the other Solution Engine boards.
29 */
30
31#define SH7780_PCIIOBR_MASK 0xFFFC0000 /* IO Space Mask */
32#define PCIIOBR (volatile long *)PCI_REG(SH7780_PCIIOBR)
33#define PCIMBR (volatile long *)PCI_REG(SH7780_PCIMBR)
34#define PCI_IO_AREA SH7780_PCI_IO_BASE
35#define PCI_MEM_AREA SH7780_PCI_CONFIG_BASE
36
37#define PCI_IOMAP(adr) (PCI_IO_AREA + (adr & ~SH7780_PCIIOBR_MASK))
38
39static inline void delay(void)
40{
41 ctrl_inw(0xa0000000);
42}
43
44static inline unsigned long port2adr(unsigned int port)
45{
46 if ((0x1f0 <= port && port < 0x1f8) || port == 0x3f6)
47 if (port == 0x3f6)
48 return (PA_AREA5_IO + 0x80c);
49 else
50 return (PA_AREA5_IO + 0x1000 + ((port-0x1f0) << 1));
51 else
52 maybebadio((unsigned long)port);
53
54 return port;
55}
56
57static inline unsigned long port88796l(unsigned int port, int flag)
58{
59 unsigned long addr;
60
61 if (flag)
62 addr = PA_AX88796L + ((port - AX88796L_IO_BASE) << 1);
63 else
64 addr = PA_AX88796L + ((port - AX88796L_IO_BASE) << 1) + 0x1000;
65
66 return addr;
67}
68
69/* The 7780 R7780RP-1 seems to have everything hooked */
70/* up pretty normally (nothing on high-bytes only...) so this */
71/* shouldn't be needed */
72static inline int shifted_port(unsigned long port)
73{
74 /* For IDE registers, value is not shifted */
75 if ((0x1f0 <= port && port < 0x1f8) || port == 0x3f6)
76 return 0;
77 else
78 return 1;
79}
80
81/* In case someone configures the kernel w/o PCI support: in that */
82/* scenario, don't ever bother to check for PCI-window addresses */
83
84/* NOTE: WINDOW CHECK MAY BE A BIT OFF, HIGH PCIBIOS_MIN_IO WRAPS? */
85#if defined(CONFIG_PCI)
86#define CHECK_SH7780_PCIIO(port) \
87 ((port >= PCIBIOS_MIN_IO) && (port < (PCIBIOS_MIN_IO + SH7780_PCI_IO_SIZE)))
88#else
89#define CHECK_SH7780_PCIIO(port) (0)
90#endif
91
92#if defined(CONFIG_NE2000) || defined(CONFIG_NE2000_MODULE)
93#define CHECK_AX88796L_PORT(port) \
94 ((port >= AX88796L_IO_BASE) && (port < (AX88796L_IO_BASE+0x20)))
95#else
96#define CHECK_AX88796L_PORT(port) (0)
97#endif
98
99/*
100 * General outline: remap really low stuff [eventually] to SuperIO,
101 * stuff in PCI IO space (at or above window at pci.h:PCIBIOS_MIN_IO)
102 * is mapped through the PCI IO window. Stuff with high bits (PXSEG)
103 * should be way beyond the window, and is used w/o translation for
104 * compatibility.
105 */
106u8 r7780rp_inb(unsigned long port)
107{
108 if (CHECK_AX88796L_PORT(port))
109 return ctrl_inw(port88796l(port, 0)) & 0xff;
110 else if (PXSEG(port))
111 return ctrl_inb(port);
112 else if (CHECK_SH7780_PCIIO(port) || shifted_port(port))
113 return ctrl_inb(PCI_IOMAP(port));
114
115 return ctrl_inw(port2adr(port)) & 0xff;
116}
117
118u8 r7780rp_inb_p(unsigned long port)
119{
120 u8 v;
121
122 if (CHECK_AX88796L_PORT(port))
123 v = ctrl_inw(port88796l(port, 0)) & 0xff;
124 else if (PXSEG(port))
125 v = ctrl_inb(port);
126 else if (CHECK_SH7780_PCIIO(port) || shifted_port(port))
127 v = ctrl_inb(PCI_IOMAP(port));
128 else
129 v = ctrl_inw(port2adr(port)) & 0xff;
130
131 delay();
132
133 return v;
134}
135
136u16 r7780rp_inw(unsigned long port)
137{
138 if (CHECK_AX88796L_PORT(port))
139 maybebadio(port);
140 else if (PXSEG(port))
141 return ctrl_inw(port);
142 else if (CHECK_SH7780_PCIIO(port) || shifted_port(port))
143 return ctrl_inw(PCI_IOMAP(port));
144 else
145 maybebadio(port);
146
147 return 0;
148}
149
150u32 r7780rp_inl(unsigned long port)
151{
152 if (CHECK_AX88796L_PORT(port))
153 maybebadio(port);
154 else if (PXSEG(port))
155 return ctrl_inl(port);
156 else if (CHECK_SH7780_PCIIO(port) || shifted_port(port))
157 return ctrl_inl(PCI_IOMAP(port));
158 else
159 maybebadio(port);
160
161 return 0;
162}
163
164void r7780rp_outb(u8 value, unsigned long port)
165{
166 if (CHECK_AX88796L_PORT(port))
167 ctrl_outw(value, port88796l(port, 0));
168 else if (PXSEG(port))
169 ctrl_outb(value, port);
170 else if (CHECK_SH7780_PCIIO(port) || shifted_port(port))
171 ctrl_outb(value, PCI_IOMAP(port));
172 else
173 ctrl_outw(value, port2adr(port));
174}
175
176void r7780rp_outb_p(u8 value, unsigned long port)
177{
178 if (CHECK_AX88796L_PORT(port))
179 ctrl_outw(value, port88796l(port, 0));
180 else if (PXSEG(port))
181 ctrl_outb(value, port);
182 else if (CHECK_SH7780_PCIIO(port) || shifted_port(port))
183 ctrl_outb(value, PCI_IOMAP(port));
184 else
185 ctrl_outw(value, port2adr(port));
186
187 delay();
188}
189
190void r7780rp_outw(u16 value, unsigned long port)
191{
192 if (CHECK_AX88796L_PORT(port))
193 maybebadio(port);
194 else if (PXSEG(port))
195 ctrl_outw(value, port);
196 else if (CHECK_SH7780_PCIIO(port) || shifted_port(port))
197 ctrl_outw(value, PCI_IOMAP(port));
198 else
199 maybebadio(port);
200}
201
202void r7780rp_outl(u32 value, unsigned long port)
203{
204 if (CHECK_AX88796L_PORT(port))
205 maybebadio(port);
206 else if (PXSEG(port))
207 ctrl_outl(value, port);
208 else if (CHECK_SH7780_PCIIO(port) || shifted_port(port))
209 ctrl_outl(value, PCI_IOMAP(port));
210 else
211 maybebadio(port);
212}
213
214void r7780rp_insb(unsigned long port, void *dst, unsigned long count)
215{
216 volatile u16 *p;
217 u8 *buf = dst;
218
219 if (CHECK_AX88796L_PORT(port)) {
220 p = (volatile u16 *)port88796l(port, 0);
221 while (count--)
222 *buf++ = *p & 0xff;
223 } else if (PXSEG(port)) {
224 while (count--)
225 *buf++ = *(volatile u8 *)port;
226 } else if (CHECK_SH7780_PCIIO(port) || shifted_port(port)) {
227 volatile u8 *bp = (volatile u8 *)PCI_IOMAP(port);
228
229 while (count--)
230 *buf++ = *bp;
231 } else {
232 p = (volatile u16 *)port2adr(port);
233 while (count--)
234 *buf++ = *p & 0xff;
235 }
236}
237
238void r7780rp_insw(unsigned long port, void *dst, unsigned long count)
239{
240 volatile u16 *p;
241 u16 *buf = dst;
242
243 if (CHECK_AX88796L_PORT(port))
244 p = (volatile u16 *)port88796l(port, 1);
245 else if (PXSEG(port))
246 p = (volatile u16 *)port;
247 else if (CHECK_SH7780_PCIIO(port) || shifted_port(port))
248 p = (volatile u16 *)PCI_IOMAP(port);
249 else
250 p = (volatile u16 *)port2adr(port);
251
252 while (count--)
253 *buf++ = *p;
254}
255
256void r7780rp_insl(unsigned long port, void *dst, unsigned long count)
257{
258 u32 *buf = dst;
259
260 if (CHECK_AX88796L_PORT(port))
261 maybebadio(port);
262 else if (CHECK_SH7780_PCIIO(port) || shifted_port(port)) {
263 volatile u32 *p = (volatile u32 *)PCI_IOMAP(port);
264
265 while (count--)
266 *buf++ = *p;
267 } else
268 maybebadio(port);
269}
270
271void r7780rp_outsb(unsigned long port, const void *src, unsigned long count)
272{
273 volatile u16 *p;
274 const u8 *buf = src;
275
276 if (CHECK_AX88796L_PORT(port)) {
277 p = (volatile u16 *)port88796l(port, 0);
278 while (count--)
279 *p = *buf++;
280 } else if (PXSEG(port))
281 while (count--)
282 ctrl_outb(*buf++, port);
283 else if (CHECK_SH7780_PCIIO(port) || shifted_port(port)) {
284 volatile u8 *bp = (volatile u8 *)PCI_IOMAP(port);
285
286 while (count--)
287 *bp = *buf++;
288 } else {
289 p = (volatile u16 *)port2adr(port);
290 while (count--)
291 *p = *buf++;
292 }
293}
294
295void r7780rp_outsw(unsigned long port, const void *src, unsigned long count)
296{
297 volatile u16 *p;
298 const u16 *buf = src;
299
300 if (CHECK_AX88796L_PORT(port))
301 p = (volatile u16 *)port88796l(port, 1);
302 else if (PXSEG(port))
303 p = (volatile u16 *)port;
304 else if (CHECK_SH7780_PCIIO(port) || shifted_port(port))
305 p = (volatile u16 *)PCI_IOMAP(port);
306 else
307 p = (volatile u16 *)port2adr(port);
308
309 while (count--)
310 *p = *buf++;
311}
312
313void r7780rp_outsl(unsigned long port, const void *src, unsigned long count)
314{
315 const u32 *buf = src;
316
317 if (CHECK_AX88796L_PORT(port))
318 maybebadio(port);
319 else if (CHECK_SH7780_PCIIO(port) || shifted_port(port)) {
320 volatile u32 *p = (volatile u32 *)PCI_IOMAP(port);
321
322 while (count--)
323 *p = *buf++;
324 } else
325 maybebadio(port);
326}
327
328void __iomem *r7780rp_ioport_map(unsigned long port, unsigned int size)
329{
330 if (CHECK_AX88796L_PORT(port))
331 return (void __iomem *)port88796l(port, size > 1);
332 else if (PXSEG(port))
333 return (void __iomem *)port;
334 else if (CHECK_SH7780_PCIIO(port) || shifted_port(port))
335 return (void __iomem *)PCI_IOMAP(port);
336
337 return (void __iomem *)port2adr(port);
338}
diff --git a/arch/sh/boards/renesas/r7780rp/irq.c b/arch/sh/boards/renesas/r7780rp/irq.c
new file mode 100644
index 00000000000..c7b9fe6e640
--- /dev/null
+++ b/arch/sh/boards/renesas/r7780rp/irq.c
@@ -0,0 +1,123 @@
1/*
2 * linux/arch/sh/boards/renesas/r7780rp/irq.c
3 *
4 * Copyright (C) 2000 Kazumoto Kojima
5 *
6 * Renesas Solutions Highlander R7780RP-1 Support.
7 *
8 * Modified for R7780RP-1 by
9 * Atom Create Engineering Co., Ltd. 2002.
10 */
11
12#include <linux/config.h>
13#include <linux/init.h>
14#include <linux/irq.h>
15#include <asm/io.h>
16#include <asm/irq.h>
17#include <asm/r7780rp/r7780rp.h>
18
19#ifdef CONFIG_SH_R7780MP
20static int mask_pos[] = {12, 11, 9, 14, 15, 8, 13, 6, 5, 4, 3, 2, 0, 0, 1, 0};
21#else
22static int mask_pos[] = {15, 14, 13, 12, 11, 10, 9, 8, 7, 5, 6, 4, 0, 1, 2, 0};
23#endif
24
25static void enable_r7780rp_irq(unsigned int irq);
26static void disable_r7780rp_irq(unsigned int irq);
27
28/* shutdown is same as "disable" */
29#define shutdown_r7780rp_irq disable_r7780rp_irq
30
31static void ack_r7780rp_irq(unsigned int irq);
32static void end_r7780rp_irq(unsigned int irq);
33
34static unsigned int startup_r7780rp_irq(unsigned int irq)
35{
36 enable_r7780rp_irq(irq);
37 return 0; /* never anything pending */
38}
39
40static void disable_r7780rp_irq(unsigned int irq)
41{
42 unsigned long flags;
43 unsigned short val;
44 unsigned short mask = 0xffff ^ (0x0001 << mask_pos[irq]);
45
46 /* Set the priority in IPR to 0 */
47 local_irq_save(flags);
48 val = ctrl_inw(IRLCNTR1);
49 val &= mask;
50 ctrl_outw(val, IRLCNTR1);
51 local_irq_restore(flags);
52}
53
54static void enable_r7780rp_irq(unsigned int irq)
55{
56 unsigned long flags;
57 unsigned short val;
58 unsigned short value = (0x0001 << mask_pos[irq]);
59
60 /* Set priority in IPR back to original value */
61 local_irq_save(flags);
62 val = ctrl_inw(IRLCNTR1);
63 val |= value;
64 ctrl_outw(val, IRLCNTR1);
65 local_irq_restore(flags);
66}
67
68static void ack_r7780rp_irq(unsigned int irq)
69{
70 disable_r7780rp_irq(irq);
71}
72
73static void end_r7780rp_irq(unsigned int irq)
74{
75 if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
76 enable_r7780rp_irq(irq);
77}
78
79static struct hw_interrupt_type r7780rp_irq_type = {
80 .typename = "R7780RP-IRQ",
81 .startup = startup_r7780rp_irq,
82 .shutdown = shutdown_r7780rp_irq,
83 .enable = enable_r7780rp_irq,
84 .disable = disable_r7780rp_irq,
85 .ack = ack_r7780rp_irq,
86 .end = end_r7780rp_irq,
87};
88
89static void make_r7780rp_irq(unsigned int irq)
90{
91 disable_irq_nosync(irq);
92 irq_desc[irq].handler = &r7780rp_irq_type;
93 disable_r7780rp_irq(irq);
94}
95
96/*
97 * Initialize IRQ setting
98 */
99void __init init_r7780rp_IRQ(void)
100{
101 int i;
102
103 /* IRL0=PCI Slot #A
104 * IRL1=PCI Slot #B
105 * IRL2=PCI Slot #C
106 * IRL3=PCI Slot #D
107 * IRL4=CF Card
108 * IRL5=CF Card Insert
109 * IRL6=M66596
110 * IRL7=SD Card
111 * IRL8=Touch Panel
112 * IRL9=SCI
113 * IRL10=Serial
114 * IRL11=Extention #A
115 * IRL11=Extention #B
116 * IRL12=Debug LAN
117 * IRL13=Push Switch
118 * IRL14=ZiggBee IO
119 */
120
121 for (i=0; i<15; i++)
122 make_r7780rp_irq(i);
123}
diff --git a/arch/sh/boards/renesas/r7780rp/led.c b/arch/sh/boards/renesas/r7780rp/led.c
new file mode 100644
index 00000000000..9f02766b6f5
--- /dev/null
+++ b/arch/sh/boards/renesas/r7780rp/led.c
@@ -0,0 +1,45 @@
1/*
2 * Copyright (C) Atom Create Engineering Co., Ltd.
3 *
4 * May be copied or modified under the terms of GNU General Public
5 * License. See linux/COPYING for more information.
6 *
7 * This file contains Renesas Solutions HIGHLANDER R7780RP-1 specific LED code.
8 */
9
10#include <linux/config.h>
11#include <linux/sched.h>
12#include <asm/io.h>
13#include <asm/r7780rp/r7780rp.h>
14
15/* Cycle the LED's in the clasic Knightriger/Sun pattern */
16void heartbeat_r7780rp(void)
17{
18 static unsigned int cnt = 0, period = 0;
19 volatile unsigned short *p = (volatile unsigned short *)PA_OBLED;
20 static unsigned bit = 0, up = 1;
21 unsigned bit_pos[] = {2, 1, 0, 3, 6, 5, 4, 7};
22
23 cnt += 1;
24 if (cnt < period)
25 return;
26
27 cnt = 0;
28
29 /* Go through the points (roughly!):
30 * f(0)=10, f(1)=16, f(2)=20, f(5)=35, f(int)->110
31 */
32 period = 110 - ((300 << FSHIFT)/((avenrun[0]/5) + (3<<FSHIFT)));
33
34 *p = 1 << bit_pos[bit];
35 if (up)
36 if (bit == 7) {
37 bit--;
38 up = 0;
39 } else
40 bit++;
41 else if (bit == 0)
42 up = 1;
43 else
44 bit--;
45}
diff --git a/arch/sh/boards/renesas/r7780rp/setup.c b/arch/sh/boards/renesas/r7780rp/setup.c
new file mode 100644
index 00000000000..0e4d5e1b541
--- /dev/null
+++ b/arch/sh/boards/renesas/r7780rp/setup.c
@@ -0,0 +1,164 @@
1/*
2 * arch/sh/boards/renesas/r7780rp/setup.c
3 *
4 * Copyright (C) 2002 Atom Create Engineering Co., Ltd.
5 * Copyright (C) 2005, 2006 Paul Mundt
6 *
7 * Renesas Solutions Highlander R7780RP-1 Support.
8 *
9 * 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
11 * for more details.
12 */
13#include <linux/init.h>
14#include <linux/platform_device.h>
15#include <asm/machvec.h>
16#include <asm/r7780rp/r7780rp.h>
17#include <asm/clock.h>
18#include <asm/io.h>
19
20extern void heartbeat_r7780rp(void);
21extern void init_r7780rp_IRQ(void);
22
23/*
24 * The Machine Vector
25 */
26struct sh_machine_vector mv_r7780rp __initmv = {
27 .mv_nr_irqs = 109,
28
29 .mv_inb = r7780rp_inb,
30 .mv_inw = r7780rp_inw,
31 .mv_inl = r7780rp_inl,
32 .mv_outb = r7780rp_outb,
33 .mv_outw = r7780rp_outw,
34 .mv_outl = r7780rp_outl,
35
36 .mv_inb_p = r7780rp_inb_p,
37 .mv_inw_p = r7780rp_inw,
38 .mv_inl_p = r7780rp_inl,
39 .mv_outb_p = r7780rp_outb_p,
40 .mv_outw_p = r7780rp_outw,
41 .mv_outl_p = r7780rp_outl,
42
43 .mv_insb = r7780rp_insb,
44 .mv_insw = r7780rp_insw,
45 .mv_insl = r7780rp_insl,
46 .mv_outsb = r7780rp_outsb,
47 .mv_outsw = r7780rp_outsw,
48 .mv_outsl = r7780rp_outsl,
49
50 .mv_ioport_map = r7780rp_ioport_map,
51 .mv_init_irq = init_r7780rp_IRQ,
52#ifdef CONFIG_HEARTBEAT
53 .mv_heartbeat = heartbeat_r7780rp,
54#endif
55};
56ALIAS_MV(r7780rp)
57
58static struct resource m66596_usb_host_resources[] = {
59 [0] = {
60 .start = 0xa4800000,
61 .end = 0xa4ffffff,
62 .flags = IORESOURCE_MEM,
63 },
64 [1] = {
65 .start = 6, /* irq number */
66 .end = 6,
67 .flags = IORESOURCE_IRQ,
68 },
69};
70
71static struct platform_device m66596_usb_host_device = {
72 .name = "m66596-hcd",
73 .id = 0,
74 .dev = {
75 .dma_mask = NULL, /* don't use dma */
76 .coherent_dma_mask = 0xffffffff,
77 },
78 .num_resources = ARRAY_SIZE(m66596_usb_host_resources),
79 .resource = m66596_usb_host_resources,
80};
81
82static struct platform_device *r7780rp_devices[] __initdata = {
83 &m66596_usb_host_device,
84};
85
86static int __init r7780rp_devices_setup(void)
87{
88 return platform_add_devices(r7780rp_devices,
89 ARRAY_SIZE(r7780rp_devices));
90}
91__initcall(r7780rp_devices_setup);
92
93/*
94 * Platform specific clocks
95 */
96static void ivdr_clk_enable(struct clk *clk)
97{
98 ctrl_outw(ctrl_inw(PA_IVDRCTL) | (1 << 8), PA_IVDRCTL);
99}
100
101static void ivdr_clk_disable(struct clk *clk)
102{
103 ctrl_outw(ctrl_inw(PA_IVDRCTL) & ~(1 << 8), PA_IVDRCTL);
104}
105
106static struct clk_ops ivdr_clk_ops = {
107 .enable = ivdr_clk_enable,
108 .disable = ivdr_clk_disable,
109};
110
111static struct clk ivdr_clk = {
112 .name = "ivdr_clk",
113 .ops = &ivdr_clk_ops,
114};
115
116static struct clk *r7780rp_clocks[] = {
117 &ivdr_clk,
118};
119
120const char *get_system_type(void)
121{
122 return "Highlander R7780RP-1";
123}
124
125static void r7780rp_power_off(void)
126{
127#ifdef CONFIG_SH_R7780MP
128 ctrl_outw(0x0001, PA_POFF);
129#endif
130}
131
132/*
133 * Initialize the board
134 */
135void __init platform_setup(void)
136{
137 u16 ver = ctrl_inw(PA_VERREG);
138 int i;
139
140 printk(KERN_INFO "Renesas Solutions Highlander R7780RP-1 support.\n");
141
142 printk(KERN_INFO "Board version: %d (revision %d), "
143 "FPGA version: %d (revision %d)\n",
144 (ver >> 12) & 0xf, (ver >> 8) & 0xf,
145 (ver >> 4) & 0xf, ver & 0xf);
146
147 /*
148 * Enable the important clocks right away..
149 */
150 for (i = 0; i < ARRAY_SIZE(r7780rp_clocks); i++) {
151 struct clk *clk = r7780rp_clocks[i];
152
153 clk_register(clk);
154 clk_enable(clk);
155 }
156
157 ctrl_outw(0x0000, PA_OBLED); /* Clear LED. */
158#ifndef CONFIG_SH_R7780MP
159 ctrl_outw(0x0001, PA_SDPOW); /* SD Power ON */
160#endif
161 ctrl_outw(ctrl_inw(PA_IVDRCTL) | 0x0100, PA_IVDRCTL); /* Si13112 */
162
163 pm_power_off = r7780rp_power_off;
164}