2 * Renesas Technology Corp. SH7786 Urquell Support.
4 * Copyright (C) 2008 Kuninori Morimoto <morimoto.kuninori@renesas.com>
5 * Copyright (C) 2008 Yoshihiro Shimoda
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file "COPYING" in the main directory of this archive
11 #include <linux/init.h>
12 #include <linux/platform_device.h>
14 #include <linux/mtd/physmap.h>
15 #include <linux/delay.h>
16 #include <linux/gpio.h>
17 #include <linux/irq.h>
18 #include <mach/urquell.h>
19 #include <cpu/sh7786.h>
20 #include <asm/heartbeat.h>
21 #include <asm/sizes.h>
23 static struct resource heartbeat_resources[] = {
25 .start = BOARDREG(SLEDR),
26 .end = BOARDREG(SLEDR),
27 .flags = IORESOURCE_MEM,
31 static struct heartbeat_data heartbeat_data = {
35 static struct platform_device heartbeat_device = {
39 .platform_data = &heartbeat_data,
41 .num_resources = ARRAY_SIZE(heartbeat_resources),
42 .resource = heartbeat_resources,
45 static struct mtd_partition nor_flash_partitions[] = {
50 .mask_flags = MTD_WRITEABLE, /* Read-only */
54 .offset = MTDPART_OFS_APPEND,
56 .mask_flags = MTD_WRITEABLE, /* Read-only */
60 .offset = MTDPART_OFS_APPEND,
65 .offset = MTDPART_OFS_APPEND,
66 .size = MTDPART_SIZ_FULL,
70 static struct physmap_flash_data nor_flash_data = {
72 .parts = nor_flash_partitions,
73 .nr_parts = ARRAY_SIZE(nor_flash_partitions),
76 static struct resource nor_flash_resources[] = {
78 .start = NOR_FLASH_ADDR,
79 .end = NOR_FLASH_ADDR + NOR_FLASH_SIZE - 1,
80 .flags = IORESOURCE_MEM,
84 static struct platform_device nor_flash_device = {
85 .name = "physmap-flash",
87 .platform_data = &nor_flash_data,
89 .num_resources = ARRAY_SIZE(nor_flash_resources),
90 .resource = nor_flash_resources,
93 static struct platform_device *urquell_devices[] __initdata = {
98 static int __init urquell_devices_setup(void)
101 gpio_request(GPIO_FN_USB_OVC0, NULL);
102 gpio_request(GPIO_FN_USB_PENC0, NULL);
104 return platform_add_devices(urquell_devices,
105 ARRAY_SIZE(urquell_devices));
107 device_initcall(urquell_devices_setup);
109 static void urquell_power_off(void)
111 __raw_writew(0xa5a5, UBOARDREG(SRSTR));
114 /* Initialize the board */
115 static void __init urquell_setup(char **cmdline_p)
117 printk(KERN_INFO "Renesas Technology Corp. Urquell support.\n");
119 pm_power_off = urquell_power_off;
125 static struct sh_machine_vector mv_urquell __initmv = {
126 .mv_name = "Urquell",
127 .mv_setup = urquell_setup,