2 * Copyright (C) 2009 Renesas Solutions Corp.
4 * Kuninori Morimoto <morimoto.kuninori@renesas.com>
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
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>
18 #include <asm/heartbeat.h>
19 #include <cpu/sh7724.h>
22 * Address Interface BusWidth
23 *-----------------------------------------
24 * 0x0000_0000 uboot 16bit
25 * 0x0004_0000 Linux romImage 16bit
26 * 0x0014_0000 MTD for Linux 16bit
27 * 0x0400_0000 Internal I/O 16/32bit
28 * 0x0800_0000 DRAM 32bit
29 * 0x1800_0000 MFI 16bit
33 static unsigned char led_pos[] = { 0, 1, 2, 3 };
34 static struct heartbeat_data heartbeat_data = {
40 static struct resource heartbeat_resources[] = {
42 .start = 0xA405012C, /* PTG */
43 .end = 0xA405012E - 1,
44 .flags = IORESOURCE_MEM,
48 static struct platform_device heartbeat_device = {
52 .platform_data = &heartbeat_data,
54 .num_resources = ARRAY_SIZE(heartbeat_resources),
55 .resource = heartbeat_resources,
59 static struct mtd_partition nor_flash_partitions[] = {
61 .name = "boot loader",
63 .size = (5 * 1024 * 1024),
64 .mask_flags = MTD_CAP_ROM,
67 .offset = MTDPART_OFS_APPEND,
68 .size = MTDPART_SIZ_FULL,
72 static struct physmap_flash_data nor_flash_data = {
74 .parts = nor_flash_partitions,
75 .nr_parts = ARRAY_SIZE(nor_flash_partitions),
78 static struct resource nor_flash_resources[] = {
83 .flags = IORESOURCE_MEM,
87 static struct platform_device nor_flash_device = {
88 .name = "physmap-flash",
89 .resource = nor_flash_resources,
90 .num_resources = ARRAY_SIZE(nor_flash_resources),
92 .platform_data = &nor_flash_data,
96 static struct platform_device *ecovec_devices[] __initdata = {
101 static int __init devices_setup(void)
104 gpio_request(GPIO_FN_SCIF0_TXD, NULL);
105 gpio_request(GPIO_FN_SCIF0_RXD, NULL);
107 /* enable debug LED */
108 gpio_request(GPIO_PTG0, NULL);
109 gpio_request(GPIO_PTG1, NULL);
110 gpio_request(GPIO_PTG2, NULL);
111 gpio_request(GPIO_PTG3, NULL);
112 gpio_direction_output(GPIO_PTG0, 0);
113 gpio_direction_output(GPIO_PTG1, 0);
114 gpio_direction_output(GPIO_PTG2, 0);
115 gpio_direction_output(GPIO_PTG3, 0);
117 return platform_add_devices(ecovec_devices,
118 ARRAY_SIZE(ecovec_devices));
120 device_initcall(devices_setup);
122 static struct sh_machine_vector mv_ecovec __initmv = {
123 .mv_name = "R0P7724 (EcoVec)",