aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile/board-g4evm.c
diff options
context:
space:
mode:
authorMagnus Damm <damm@opensource.se>2010-02-05 06:15:07 -0500
committerPaul Mundt <lethal@linux-sh.org>2010-02-07 22:45:32 -0500
commitf2aaf66df0858116b2fcdbbfe8126d4ff925ac61 (patch)
treebaf26f13f41b8716582ae126929d4f0a46f50906 /arch/arm/mach-shmobile/board-g4evm.c
parentc793c1b0c8ea11b46caf5a532752214b27a2df42 (diff)
ARM: mach-shmobile: SH-Mobile G4 support.
This adds preliminary support for the SH7377 (SH-Mobile G4) CPU and the G4EVM reference board. Only timer, serial console and NOR flash are supported at this point. Support for the interrupt controller, pinmux support, clock framework and runtime pm will be submitted as feature patches on top of this. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/arm/mach-shmobile/board-g4evm.c')
-rw-r--r--arch/arm/mach-shmobile/board-g4evm.c127
1 files changed, 127 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/board-g4evm.c b/arch/arm/mach-shmobile/board-g4evm.c
new file mode 100644
index 000000000000..0d2948f17766
--- /dev/null
+++ b/arch/arm/mach-shmobile/board-g4evm.c
@@ -0,0 +1,127 @@
1/*
2 * G4EVM board support
3 *
4 * Copyright (C) 2010 Magnus Damm
5 * Copyright (C) 2008 Yoshihiro Shimoda
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20#include <linux/kernel.h>
21#include <linux/init.h>
22#include <linux/interrupt.h>
23#include <linux/irq.h>
24#include <linux/platform_device.h>
25#include <linux/delay.h>
26#include <linux/mtd/mtd.h>
27#include <linux/mtd/partitions.h>
28#include <linux/mtd/physmap.h>
29#include <linux/io.h>
30#include <mach/common.h>
31#include <asm/mach-types.h>
32#include <asm/mach/arch.h>
33#include <asm/mach/map.h>
34
35static struct mtd_partition nor_flash_partitions[] = {
36 {
37 .name = "loader",
38 .offset = 0x00000000,
39 .size = 512 * 1024,
40 },
41 {
42 .name = "bootenv",
43 .offset = MTDPART_OFS_APPEND,
44 .size = 512 * 1024,
45 },
46 {
47 .name = "kernel_ro",
48 .offset = MTDPART_OFS_APPEND,
49 .size = 8 * 1024 * 1024,
50 .mask_flags = MTD_WRITEABLE,
51 },
52 {
53 .name = "kernel",
54 .offset = MTDPART_OFS_APPEND,
55 .size = 8 * 1024 * 1024,
56 },
57 {
58 .name = "data",
59 .offset = MTDPART_OFS_APPEND,
60 .size = MTDPART_SIZ_FULL,
61 },
62};
63
64static struct physmap_flash_data nor_flash_data = {
65 .width = 2,
66 .parts = nor_flash_partitions,
67 .nr_parts = ARRAY_SIZE(nor_flash_partitions),
68};
69
70static struct resource nor_flash_resources[] = {
71 [0] = {
72 .start = 0x00000000,
73 .end = 0x08000000 - 1,
74 .flags = IORESOURCE_MEM,
75 }
76};
77
78static struct platform_device nor_flash_device = {
79 .name = "physmap-flash",
80 .dev = {
81 .platform_data = &nor_flash_data,
82 },
83 .num_resources = ARRAY_SIZE(nor_flash_resources),
84 .resource = nor_flash_resources,
85};
86
87
88static struct platform_device *g4evm_devices[] __initdata = {
89 &nor_flash_device,
90};
91
92static struct map_desc g4evm_io_desc[] __initdata = {
93 /* create a 1:1 entity map for 0xe6xxxxxx
94 * used by CPGA, INTC and PFC.
95 */
96 {
97 .virtual = 0xe6000000,
98 .pfn = __phys_to_pfn(0xe6000000),
99 .length = 256 << 20,
100 .type = MT_DEVICE_NONSHARED
101 },
102};
103
104static void __init g4evm_map_io(void)
105{
106 iotable_init(g4evm_io_desc, ARRAY_SIZE(g4evm_io_desc));
107
108 /* setup early devices and clocks here as well */
109 sh7377_add_early_devices();
110 sh7367_clock_init(); /* use g3 clocks for now */
111}
112
113static void __init g4evm_init(void)
114{
115 sh7377_add_standard_devices();
116
117 platform_add_devices(g4evm_devices, ARRAY_SIZE(g4evm_devices));
118}
119
120MACHINE_START(G4EVM, "g4evm")
121 .phys_io = 0xe6000000,
122 .io_pg_offst = ((0xe6000000) >> 18) & 0xfffc,
123 .map_io = g4evm_map_io,
124 .init_irq = sh7377_init_irq,
125 .init_machine = g4evm_init,
126 .timer = &shmobile_timer,
127MACHINE_END