aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/boards/mach-ecovec24/setup.c
diff options
context:
space:
mode:
authorKuninori Morimoto <morimoto.kuninori@renesas.com>2009-08-19 08:08:33 -0400
committerPaul Mundt <lethal@linux-sh.org>2009-08-19 21:13:16 -0400
commit4138b74066cc33ede31bfd6cb2b7a5e685cfd327 (patch)
tree6f415efe130af0f7af038ffa643ca2f1185ed41d /arch/sh/boards/mach-ecovec24/setup.c
parent24d76195d124986b7702821b8b6cc85942b13146 (diff)
sh: Add EcoVec (SH7724) board support
This adds preliminary support for the EcoVec board. Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/boards/mach-ecovec24/setup.c')
-rw-r--r--arch/sh/boards/mach-ecovec24/setup.c129
1 files changed, 129 insertions, 0 deletions
diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
new file mode 100644
index 000000000000..b634a72da1e6
--- /dev/null
+++ b/arch/sh/boards/mach-ecovec24/setup.c
@@ -0,0 +1,129 @@
1/*
2 * Copyright (C) 2009 Renesas Solutions Corp.
3 *
4 * Kuninori Morimoto <morimoto.kuninori@renesas.com>
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
11#include <linux/init.h>
12#include <linux/device.h>
13#include <linux/platform_device.h>
14#include <linux/mtd/physmap.h>
15#include <linux/gpio.h>
16#include <linux/interrupt.h>
17#include <asm/io.h>
18#include <asm/heartbeat.h>
19#include <cpu/sh7724.h>
20
21/*
22 * Area Address Interface size BusWidth
23 * 0 0x0000_0000 ~ 0x03FF_FFFF FROM 64MB 16bit
24 * 1 0x0400_0000 ~ 0x07FF_FFFF Internal I/O 64MB 16/32bit
25 * 2 0x0800_0000 ~ 0x0BFF_FFFF DRAM 2 64MB 32bit
26 * 3 0x0C00_0000 ~ 0x0FFF_FFFF DRAM 3 64MB 32bit
27 * 4 0x1000_0000 ~ 0x13FF_FFFF DRAM 4 64MB 32bit
28 * 5 0x1400_0000 ~ 0x17FF_FFFF DRAM 5 64MB 32bit
29 * 6 0x1800_0000 ~ 0x1BFF_FFFF MFI 64MB 16bit
30 */
31
32/* Heartbeat */
33static unsigned char led_pos[] = { 0, 1, 2, 3 };
34static struct heartbeat_data heartbeat_data = {
35 .regsize = 8,
36 .nr_bits = 4,
37 .bit_pos = led_pos,
38};
39
40static struct resource heartbeat_resources[] = {
41 [0] = {
42 .start = 0xA405012C, /* PTG */
43 .end = 0xA405012E - 1,
44 .flags = IORESOURCE_MEM,
45 },
46};
47
48static struct platform_device heartbeat_device = {
49 .name = "heartbeat",
50 .id = -1,
51 .dev = {
52 .platform_data = &heartbeat_data,
53 },
54 .num_resources = ARRAY_SIZE(heartbeat_resources),
55 .resource = heartbeat_resources,
56};
57
58/* MTD */
59static struct mtd_partition nor_flash_partitions[] = {
60 {
61 .name = "uboot",
62 .offset = 0,
63 .size = (256 * 1024),
64 .mask_flags = MTD_CAP_ROM,
65 }, {
66 .name = "kernel",
67 .offset = MTDPART_OFS_APPEND,
68 .size = (2 * 1024 * 1024),
69 }, {
70 .name = "free-area",
71 .offset = MTDPART_OFS_APPEND,
72 .size = MTDPART_SIZ_FULL,
73 },
74};
75
76static struct physmap_flash_data nor_flash_data = {
77 .width = 2,
78 .parts = nor_flash_partitions,
79 .nr_parts = ARRAY_SIZE(nor_flash_partitions),
80};
81
82static struct resource nor_flash_resources[] = {
83 [0] = {
84 .name = "NOR Flash",
85 .start = 0x00000000,
86 .end = 0x03ffffff,
87 .flags = IORESOURCE_MEM,
88 }
89};
90
91static struct platform_device nor_flash_device = {
92 .name = "physmap-flash",
93 .resource = nor_flash_resources,
94 .num_resources = ARRAY_SIZE(nor_flash_resources),
95 .dev = {
96 .platform_data = &nor_flash_data,
97 },
98};
99
100static struct platform_device *ecovec_devices[] __initdata = {
101 &heartbeat_device,
102 &nor_flash_device,
103};
104
105static int __init devices_setup(void)
106{
107 /* enable SCIFA0 */
108 gpio_request(GPIO_FN_SCIF0_TXD, NULL);
109 gpio_request(GPIO_FN_SCIF0_RXD, NULL);
110 gpio_request(GPIO_FN_SCIF0_SCK, NULL);
111
112 /* enable debug LED */
113 gpio_request(GPIO_PTG0, NULL);
114 gpio_request(GPIO_PTG1, NULL);
115 gpio_request(GPIO_PTG2, NULL);
116 gpio_request(GPIO_PTG3, NULL);
117 gpio_direction_output(GPIO_PTT0, 0);
118 gpio_direction_output(GPIO_PTT1, 0);
119 gpio_direction_output(GPIO_PTT2, 0);
120 gpio_direction_output(GPIO_PTT3, 0);
121
122 return platform_add_devices(ecovec_devices,
123 ARRAY_SIZE(ecovec_devices));
124}
125device_initcall(devices_setup);
126
127static struct sh_machine_vector mv_ecovec __initmv = {
128 .mv_name = "R0P7724 (EcoVec)",
129};