diff options
author | Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com> | 2008-03-21 02:54:13 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2008-04-18 12:50:02 -0400 |
commit | 6e862995a07629858bfa16e0991a258de35007f3 (patch) | |
tree | 353fc5ae889e74f41d5032890d9843100f462e01 /arch/sh/boards | |
parent | d391c6217d3214bd8278e1e3517ef57abbc4b317 (diff) |
sh: Add support for Solution Engine SH7721 board
Add support for Solution Engine SH7721 board(MS7721RP01).
Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/boards')
-rw-r--r-- | arch/sh/boards/se/7721/Makefile | 1 | ||||
-rw-r--r-- | arch/sh/boards/se/7721/irq.c | 45 | ||||
-rw-r--r-- | arch/sh/boards/se/7721/setup.c | 99 |
3 files changed, 145 insertions, 0 deletions
diff --git a/arch/sh/boards/se/7721/Makefile b/arch/sh/boards/se/7721/Makefile new file mode 100644 index 000000000000..7f09030980b3 --- /dev/null +++ b/arch/sh/boards/se/7721/Makefile | |||
@@ -0,0 +1 @@ | |||
obj-y := setup.o irq.o | |||
diff --git a/arch/sh/boards/se/7721/irq.c b/arch/sh/boards/se/7721/irq.c new file mode 100644 index 000000000000..c4fdd622bf8b --- /dev/null +++ b/arch/sh/boards/se/7721/irq.c | |||
@@ -0,0 +1,45 @@ | |||
1 | /* | ||
2 | * linux/arch/sh/boards/se/7721/irq.c | ||
3 | * | ||
4 | * Copyright (C) 2008 Renesas Solutions Corp. | ||
5 | * | ||
6 | * This file is subject to the terms and conditions of the GNU General Public | ||
7 | * License. See the file "COPYING" in the main directory of this archive | ||
8 | * for more details. | ||
9 | */ | ||
10 | #include <linux/init.h> | ||
11 | #include <linux/irq.h> | ||
12 | #include <linux/interrupt.h> | ||
13 | #include <linux/io.h> | ||
14 | #include <asm/se7721.h> | ||
15 | |||
16 | enum { | ||
17 | UNUSED = 0, | ||
18 | |||
19 | /* board specific interrupt sources */ | ||
20 | MRSHPC, | ||
21 | }; | ||
22 | |||
23 | static struct intc_vect vectors[] __initdata = { | ||
24 | INTC_IRQ(MRSHPC, MRSHPC_IRQ0), | ||
25 | }; | ||
26 | |||
27 | static struct intc_prio_reg prio_registers[] __initdata = { | ||
28 | { FPGA_ILSR6, 0, 8, 4, /* IRLMSK */ | ||
29 | { 0, MRSHPC } }, | ||
30 | }; | ||
31 | |||
32 | static DECLARE_INTC_DESC(intc_desc, "SE7721", vectors, | ||
33 | NULL, NULL, prio_registers, NULL); | ||
34 | |||
35 | /* | ||
36 | * Initialize IRQ setting | ||
37 | */ | ||
38 | void __init init_se7721_IRQ(void) | ||
39 | { | ||
40 | /* PPCR */ | ||
41 | ctrl_outw(ctrl_inw(0xa4050118) & ~0x00ff, 0xa4050118); | ||
42 | |||
43 | register_intc_controller(&intc_desc); | ||
44 | intc_set_priority(MRSHPC_IRQ0, 0xf - MRSHPC_IRQ0); | ||
45 | } | ||
diff --git a/arch/sh/boards/se/7721/setup.c b/arch/sh/boards/se/7721/setup.c new file mode 100644 index 000000000000..1be3e92752f7 --- /dev/null +++ b/arch/sh/boards/se/7721/setup.c | |||
@@ -0,0 +1,99 @@ | |||
1 | /* | ||
2 | * linux/arch/sh/boards/se/7721/setup.c | ||
3 | * | ||
4 | * Copyright (C) 2008 Renesas Solutions Corp. | ||
5 | * | ||
6 | * Hitachi UL SolutionEngine 7721 Support. | ||
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 | */ | ||
13 | #include <linux/init.h> | ||
14 | #include <linux/platform_device.h> | ||
15 | #include <asm/machvec.h> | ||
16 | #include <asm/se7721.h> | ||
17 | #include <asm/io.h> | ||
18 | #include <asm/heartbeat.h> | ||
19 | |||
20 | static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 }; | ||
21 | |||
22 | static struct heartbeat_data heartbeat_data = { | ||
23 | .bit_pos = heartbeat_bit_pos, | ||
24 | .nr_bits = ARRAY_SIZE(heartbeat_bit_pos), | ||
25 | .regsize = 16, | ||
26 | }; | ||
27 | |||
28 | static struct resource heartbeat_resources[] = { | ||
29 | [0] = { | ||
30 | .start = PA_LED, | ||
31 | .end = PA_LED, | ||
32 | .flags = IORESOURCE_MEM, | ||
33 | }, | ||
34 | }; | ||
35 | |||
36 | static struct platform_device heartbeat_device = { | ||
37 | .name = "heartbeat", | ||
38 | .id = -1, | ||
39 | .dev = { | ||
40 | .platform_data = &heartbeat_data, | ||
41 | }, | ||
42 | .num_resources = ARRAY_SIZE(heartbeat_resources), | ||
43 | .resource = heartbeat_resources, | ||
44 | }; | ||
45 | |||
46 | static struct resource cf_ide_resources[] = { | ||
47 | [0] = { | ||
48 | .start = PA_MRSHPC_IO + 0x1f0, | ||
49 | .end = PA_MRSHPC_IO + 0x1f0 + 8 , | ||
50 | .flags = IORESOURCE_IO, | ||
51 | }, | ||
52 | [1] = { | ||
53 | .start = PA_MRSHPC_IO + 0x1f0 + 0x206, | ||
54 | .end = PA_MRSHPC_IO + 0x1f0 + 8 + 0x206 + 8, | ||
55 | .flags = IORESOURCE_IO, | ||
56 | }, | ||
57 | [2] = { | ||
58 | .start = MRSHPC_IRQ0, | ||
59 | .flags = IORESOURCE_IRQ, | ||
60 | }, | ||
61 | }; | ||
62 | |||
63 | static struct platform_device cf_ide_device = { | ||
64 | .name = "pata_platform", | ||
65 | .id = -1, | ||
66 | .num_resources = ARRAY_SIZE(cf_ide_resources), | ||
67 | .resource = cf_ide_resources, | ||
68 | }; | ||
69 | |||
70 | static struct platform_device *se7721_devices[] __initdata = { | ||
71 | &cf_ide_device, | ||
72 | &heartbeat_device | ||
73 | }; | ||
74 | |||
75 | static int __init se7721_devices_setup(void) | ||
76 | { | ||
77 | return platform_add_devices(se7721_devices, | ||
78 | ARRAY_SIZE(se7721_devices)); | ||
79 | } | ||
80 | device_initcall(se7721_devices_setup); | ||
81 | |||
82 | static void __init se7721_setup(char **cmdline_p) | ||
83 | { | ||
84 | /* for USB */ | ||
85 | ctrl_outw(0x0000, 0xA405010C); /* PGCR */ | ||
86 | ctrl_outw(0x0000, 0xA405010E); /* PHCR */ | ||
87 | ctrl_outw(0x00AA, 0xA4050118); /* PPCR */ | ||
88 | ctrl_outw(0x0000, 0xA4050124); /* PSELA */ | ||
89 | } | ||
90 | |||
91 | /* | ||
92 | * The Machine Vector | ||
93 | */ | ||
94 | struct sh_machine_vector mv_se7721 __initmv = { | ||
95 | .mv_name = "Solution Engine 7721", | ||
96 | .mv_setup = se7721_setup, | ||
97 | .mv_nr_irqs = 109, | ||
98 | .mv_init_irq = init_se7721_IRQ, | ||
99 | }; | ||