diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2010-11-28 21:21:21 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2010-11-28 23:05:10 -0500 |
commit | 920adc75d51d23fe3e8a7ce2c946b2b24e6f7742 (patch) | |
tree | 53e4669e8c923d4d96d963fd82749d88043c0f59 | |
parent | 6d72ad35f1bfaf6e52ca7133cb51ce0e36f17528 (diff) |
ARM: mach-shmobile: Add mackerel board support
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-rw-r--r-- | arch/arm/mach-shmobile/Kconfig | 7 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/board-mackerel.c | 165 |
3 files changed, 172 insertions, 1 deletions
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig index cc543430170f..7b2edd799fb4 100644 --- a/arch/arm/mach-shmobile/Kconfig +++ b/arch/arm/mach-shmobile/Kconfig | |||
@@ -51,6 +51,11 @@ config AP4EVB_WVGA | |||
51 | 51 | ||
52 | endchoice | 52 | endchoice |
53 | 53 | ||
54 | config MACH_MACKEREL | ||
55 | bool "mackerel board" | ||
56 | depends on ARCH_SH7372 | ||
57 | select ARCH_REQUIRE_GPIOLIB | ||
58 | |||
54 | comment "SH-Mobile System Configuration" | 59 | comment "SH-Mobile System Configuration" |
55 | 60 | ||
56 | menu "Memory configuration" | 61 | menu "Memory configuration" |
@@ -59,7 +64,7 @@ config MEMORY_START | |||
59 | hex "Physical memory start address" | 64 | hex "Physical memory start address" |
60 | default "0x50000000" if MACH_G3EVM | 65 | default "0x50000000" if MACH_G3EVM |
61 | default "0x40000000" if MACH_G4EVM | 66 | default "0x40000000" if MACH_G4EVM |
62 | default "0x40000000" if MACH_AP4EVB | 67 | default "0x40000000" if MACH_AP4EVB || MACH_MACKEREL |
63 | default "0x00000000" | 68 | default "0x00000000" |
64 | ---help--- | 69 | ---help--- |
65 | Tweak this only when porting to a new machine which does not | 70 | Tweak this only when porting to a new machine which does not |
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile index ae416fe7daf2..11f3242ffc1d 100644 --- a/arch/arm/mach-shmobile/Makefile +++ b/arch/arm/mach-shmobile/Makefile | |||
@@ -20,3 +20,4 @@ obj-$(CONFIG_GENERIC_GPIO) += $(pfc-y) | |||
20 | obj-$(CONFIG_MACH_G3EVM) += board-g3evm.o | 20 | obj-$(CONFIG_MACH_G3EVM) += board-g3evm.o |
21 | obj-$(CONFIG_MACH_G4EVM) += board-g4evm.o | 21 | obj-$(CONFIG_MACH_G4EVM) += board-g4evm.o |
22 | obj-$(CONFIG_MACH_AP4EVB) += board-ap4evb.o | 22 | obj-$(CONFIG_MACH_AP4EVB) += board-ap4evb.o |
23 | obj-$(CONFIG_MACH_MACKEREL) += board-mackerel.o | ||
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c new file mode 100644 index 000000000000..b8df70928891 --- /dev/null +++ b/arch/arm/mach-shmobile/board-mackerel.c | |||
@@ -0,0 +1,165 @@ | |||
1 | /* | ||
2 | * mackerel board support | ||
3 | * | ||
4 | * Copyright (C) 2010 Renesas Solutions Corp. | ||
5 | * Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | ||
6 | * | ||
7 | * based on ap4evb | ||
8 | * Copyright (C) 2010 Magnus Damm | ||
9 | * Copyright (C) 2008 Yoshihiro Shimoda | ||
10 | * | ||
11 | * This program is free software; you can redistribute it and/or modify | ||
12 | * it under the terms of the GNU General Public License as published by | ||
13 | * the Free Software Foundation; version 2 of the License. | ||
14 | * | ||
15 | * This program is distributed in the hope that it will be useful, | ||
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
18 | * GNU General Public License for more details. | ||
19 | * | ||
20 | * You should have received a copy of the GNU General Public License | ||
21 | * along with this program; if not, write to the Free Software | ||
22 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
23 | */ | ||
24 | #include <linux/kernel.h> | ||
25 | #include <linux/init.h> | ||
26 | #include <linux/interrupt.h> | ||
27 | #include <linux/irq.h> | ||
28 | #include <linux/platform_device.h> | ||
29 | #include <linux/gpio.h> | ||
30 | #include <linux/input.h> | ||
31 | #include <linux/io.h> | ||
32 | #include <linux/mtd/mtd.h> | ||
33 | #include <linux/mtd/partitions.h> | ||
34 | #include <linux/mtd/physmap.h> | ||
35 | |||
36 | #include <mach/common.h> | ||
37 | #include <mach/sh7372.h> | ||
38 | |||
39 | #include <asm/mach/arch.h> | ||
40 | #include <asm/mach/time.h> | ||
41 | #include <asm/mach/map.h> | ||
42 | #include <asm/mach-types.h> | ||
43 | |||
44 | /* | ||
45 | * Address Interface BusWidth note | ||
46 | * ------------------------------------------------------------------ | ||
47 | * 0x0000_0000 NOR Flash ROM (MCP) 16bit SW7 : bit1 = ON | ||
48 | * 0x0800_0000 user area - | ||
49 | * 0x1000_0000 NOR Flash ROM (MCP) 16bit SW7 : bit1 = OFF | ||
50 | * 0x1400_0000 Ether (LAN9220) 16bit | ||
51 | * 0x1600_0000 user area - cannot use with NAND | ||
52 | * 0x1800_0000 user area - | ||
53 | * 0x1A00_0000 - | ||
54 | * 0x4000_0000 LPDDR2-SDRAM (POP) 32bit | ||
55 | */ | ||
56 | |||
57 | /* MTD */ | ||
58 | static struct mtd_partition nor_flash_partitions[] = { | ||
59 | { | ||
60 | .name = "loader", | ||
61 | .offset = 0x00000000, | ||
62 | .size = 512 * 1024, | ||
63 | .mask_flags = MTD_WRITEABLE, | ||
64 | }, | ||
65 | { | ||
66 | .name = "bootenv", | ||
67 | .offset = MTDPART_OFS_APPEND, | ||
68 | .size = 512 * 1024, | ||
69 | .mask_flags = MTD_WRITEABLE, | ||
70 | }, | ||
71 | { | ||
72 | .name = "kernel_ro", | ||
73 | .offset = MTDPART_OFS_APPEND, | ||
74 | .size = 8 * 1024 * 1024, | ||
75 | .mask_flags = MTD_WRITEABLE, | ||
76 | }, | ||
77 | { | ||
78 | .name = "kernel", | ||
79 | .offset = MTDPART_OFS_APPEND, | ||
80 | .size = 8 * 1024 * 1024, | ||
81 | }, | ||
82 | { | ||
83 | .name = "data", | ||
84 | .offset = MTDPART_OFS_APPEND, | ||
85 | .size = MTDPART_SIZ_FULL, | ||
86 | }, | ||
87 | }; | ||
88 | |||
89 | static struct physmap_flash_data nor_flash_data = { | ||
90 | .width = 2, | ||
91 | .parts = nor_flash_partitions, | ||
92 | .nr_parts = ARRAY_SIZE(nor_flash_partitions), | ||
93 | }; | ||
94 | |||
95 | static struct resource nor_flash_resources[] = { | ||
96 | [0] = { | ||
97 | .start = 0x00000000, | ||
98 | .end = 0x08000000 - 1, | ||
99 | .flags = IORESOURCE_MEM, | ||
100 | } | ||
101 | }; | ||
102 | |||
103 | static struct platform_device nor_flash_device = { | ||
104 | .name = "physmap-flash", | ||
105 | .dev = { | ||
106 | .platform_data = &nor_flash_data, | ||
107 | }, | ||
108 | .num_resources = ARRAY_SIZE(nor_flash_resources), | ||
109 | .resource = nor_flash_resources, | ||
110 | }; | ||
111 | |||
112 | static struct platform_device *mackerel_devices[] __initdata = { | ||
113 | &nor_flash_device, | ||
114 | }; | ||
115 | |||
116 | static struct map_desc mackerel_io_desc[] __initdata = { | ||
117 | /* create a 1:1 entity map for 0xe6xxxxxx | ||
118 | * used by CPGA, INTC and PFC. | ||
119 | */ | ||
120 | { | ||
121 | .virtual = 0xe6000000, | ||
122 | .pfn = __phys_to_pfn(0xe6000000), | ||
123 | .length = 256 << 20, | ||
124 | .type = MT_DEVICE_NONSHARED | ||
125 | }, | ||
126 | }; | ||
127 | |||
128 | static void __init mackerel_map_io(void) | ||
129 | { | ||
130 | iotable_init(mackerel_io_desc, ARRAY_SIZE(mackerel_io_desc)); | ||
131 | |||
132 | /* setup early devices and console here as well */ | ||
133 | sh7372_add_early_devices(); | ||
134 | shmobile_setup_console(); | ||
135 | } | ||
136 | |||
137 | static void __init mackerel_init(void) | ||
138 | { | ||
139 | sh7372_pinmux_init(); | ||
140 | |||
141 | /* enable SCIFA0 */ | ||
142 | gpio_request(GPIO_FN_SCIFA0_TXD, NULL); | ||
143 | gpio_request(GPIO_FN_SCIFA0_RXD, NULL); | ||
144 | |||
145 | sh7372_add_standard_devices(); | ||
146 | |||
147 | platform_add_devices(mackerel_devices, ARRAY_SIZE(mackerel_devices)); | ||
148 | } | ||
149 | |||
150 | static void __init mackerel_timer_init(void) | ||
151 | { | ||
152 | sh7372_clock_init(); | ||
153 | shmobile_timer.init(); | ||
154 | } | ||
155 | |||
156 | static struct sys_timer mackerel_timer = { | ||
157 | .init = mackerel_timer_init, | ||
158 | }; | ||
159 | |||
160 | MACHINE_START(MACKEREL, "mackerel") | ||
161 | .map_io = mackerel_map_io, | ||
162 | .init_irq = sh7372_init_irq, | ||
163 | .init_machine = mackerel_init, | ||
164 | .timer = &mackerel_timer, | ||
165 | MACHINE_END | ||