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/smc91x.h>
15 #include <linux/mtd/physmap.h>
16 #include <linux/delay.h>
17 #include <linux/gpio.h>
18 #include <linux/irq.h>
19 #include <mach/urquell.h>
20 #include <cpu/sh7786.h>
21 #include <asm/heartbeat.h>
22 #include <asm/sizes.h>
24 static struct resource heartbeat_resources[] = {
26 .start = BOARDREG(SLEDR),
27 .end = BOARDREG(SLEDR),
28 .flags = IORESOURCE_MEM,
32 static struct heartbeat_data heartbeat_data = {
36 static struct platform_device heartbeat_device = {
40 .platform_data = &heartbeat_data,
42 .num_resources = ARRAY_SIZE(heartbeat_resources),
43 .resource = heartbeat_resources,
46 static struct smc91x_platdata smc91x_info = {
47 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
50 static struct resource smc91x_eth_resources[] = {
55 .flags = IORESOURCE_MEM,
59 .flags = IORESOURCE_IRQ,
63 static struct platform_device smc91x_eth_device = {
65 .num_resources = ARRAY_SIZE(smc91x_eth_resources),
66 .resource = smc91x_eth_resources,
68 .platform_data = &smc91x_info,
72 static struct mtd_partition nor_flash_partitions[] = {
77 .mask_flags = MTD_WRITEABLE, /* Read-only */
81 .offset = MTDPART_OFS_APPEND,
83 .mask_flags = MTD_WRITEABLE, /* Read-only */
87 .offset = MTDPART_OFS_APPEND,
92 .offset = MTDPART_OFS_APPEND,
93 .size = MTDPART_SIZ_FULL,
97 static struct physmap_flash_data nor_flash_data = {
99 .parts = nor_flash_partitions,
100 .nr_parts = ARRAY_SIZE(nor_flash_partitions),
103 static struct resource nor_flash_resources[] = {
105 .start = NOR_FLASH_ADDR,
106 .end = NOR_FLASH_ADDR + NOR_FLASH_SIZE - 1,
107 .flags = IORESOURCE_MEM,
111 static struct platform_device nor_flash_device = {
112 .name = "physmap-flash",
114 .platform_data = &nor_flash_data,
116 .num_resources = ARRAY_SIZE(nor_flash_resources),
117 .resource = nor_flash_resources,
120 static struct platform_device *urquell_devices[] __initdata = {
126 static int __init urquell_devices_setup(void)
129 gpio_request(GPIO_FN_USB_OVC0, NULL);
130 gpio_request(GPIO_FN_USB_PENC0, NULL);
132 return platform_add_devices(urquell_devices,
133 ARRAY_SIZE(urquell_devices));
135 device_initcall(urquell_devices_setup);
137 static void urquell_power_off(void)
139 __raw_writew(0xa5a5, UBOARDREG(SRSTR));
142 static void __init urquell_init_irq(void)
144 plat_irq_setup_pins(IRQ_MODE_IRL3210_MASK);
147 /* Initialize the board */
148 static void __init urquell_setup(char **cmdline_p)
150 printk(KERN_INFO "Renesas Technology Corp. Urquell support.\n");
152 pm_power_off = urquell_power_off;
158 static struct sh_machine_vector mv_urquell __initmv = {
159 .mv_name = "Urquell",
160 .mv_setup = urquell_setup,
161 .mv_init_irq = urquell_init_irq,