2 * mackerel board support
4 * Copyright (C) 2010 Renesas Solutions Corp.
5 * Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
8 * Copyright (C) 2010 Magnus Damm
9 * Copyright (C) 2008 Yoshihiro Shimoda
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.
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.
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
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>
32 #include <linux/mtd/mtd.h>
33 #include <linux/mtd/partitions.h>
34 #include <linux/mtd/physmap.h>
36 #include <mach/common.h>
37 #include <mach/sh7372.h>
39 #include <asm/mach/arch.h>
40 #include <asm/mach/time.h>
41 #include <asm/mach/map.h>
42 #include <asm/mach-types.h>
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 -
54 * 0x4000_0000 LPDDR2-SDRAM (POP) 32bit
58 static struct mtd_partition nor_flash_partitions[] = {
63 .mask_flags = MTD_WRITEABLE,
67 .offset = MTDPART_OFS_APPEND,
69 .mask_flags = MTD_WRITEABLE,
73 .offset = MTDPART_OFS_APPEND,
74 .size = 8 * 1024 * 1024,
75 .mask_flags = MTD_WRITEABLE,
79 .offset = MTDPART_OFS_APPEND,
80 .size = 8 * 1024 * 1024,
84 .offset = MTDPART_OFS_APPEND,
85 .size = MTDPART_SIZ_FULL,
89 static struct physmap_flash_data nor_flash_data = {
91 .parts = nor_flash_partitions,
92 .nr_parts = ARRAY_SIZE(nor_flash_partitions),
95 static struct resource nor_flash_resources[] = {
98 .end = 0x08000000 - 1,
99 .flags = IORESOURCE_MEM,
103 static struct platform_device nor_flash_device = {
104 .name = "physmap-flash",
106 .platform_data = &nor_flash_data,
108 .num_resources = ARRAY_SIZE(nor_flash_resources),
109 .resource = nor_flash_resources,
112 static struct platform_device *mackerel_devices[] __initdata = {
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.
121 .virtual = 0xe6000000,
122 .pfn = __phys_to_pfn(0xe6000000),
124 .type = MT_DEVICE_NONSHARED
128 static void __init mackerel_map_io(void)
130 iotable_init(mackerel_io_desc, ARRAY_SIZE(mackerel_io_desc));
132 /* setup early devices and console here as well */
133 sh7372_add_early_devices();
134 shmobile_setup_console();
137 static void __init mackerel_init(void)
139 sh7372_pinmux_init();
142 gpio_request(GPIO_FN_SCIFA0_TXD, NULL);
143 gpio_request(GPIO_FN_SCIFA0_RXD, NULL);
145 sh7372_add_standard_devices();
147 platform_add_devices(mackerel_devices, ARRAY_SIZE(mackerel_devices));
150 static void __init mackerel_timer_init(void)
153 shmobile_timer.init();
156 static struct sys_timer mackerel_timer = {
157 .init = mackerel_timer_init,
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,