2 * arch/sh/boards/renesas/x3proto/setup.c
4 * Renesas SH-X3 Prototype Board Support.
6 * Copyright (C) 2007 - 2008 Paul Mundt
8 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file "COPYING" in the main directory of this archive
12 #include <linux/init.h>
13 #include <linux/platform_device.h>
14 #include <linux/kernel.h>
16 #include <linux/smc91x.h>
17 #include <linux/irq.h>
18 #include <linux/interrupt.h>
19 #include <linux/usb/r8a66597.h>
20 #include <linux/usb/m66592.h>
21 #include <asm/ilsel.h>
22 #include <asm/smp-ops.h>
24 static struct resource heartbeat_resources[] = {
28 .flags = IORESOURCE_MEM,
32 static struct platform_device heartbeat_device = {
35 .num_resources = ARRAY_SIZE(heartbeat_resources),
36 .resource = heartbeat_resources,
39 static struct smc91x_platdata smc91x_info = {
40 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
43 static struct resource smc91x_resources[] = {
46 .end = 0x18000300 + 0x10 - 1,
47 .flags = IORESOURCE_MEM,
50 /* Filled in by ilsel */
51 .flags = IORESOURCE_IRQ,
55 static struct platform_device smc91x_device = {
58 .resource = smc91x_resources,
59 .num_resources = ARRAY_SIZE(smc91x_resources),
61 .platform_data = &smc91x_info,
65 static struct r8a66597_platdata r8a66597_data = {
66 .xtal = R8A66597_PLATDATA_XTAL_12MHZ,
70 static struct resource r8a66597_usb_host_resources[] = {
73 .end = 0x18080000 - 1,
74 .flags = IORESOURCE_MEM,
77 /* Filled in by ilsel */
78 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW,
82 static struct platform_device r8a66597_usb_host_device = {
83 .name = "r8a66597_hcd",
86 .dma_mask = NULL, /* don't use dma */
87 .coherent_dma_mask = 0xffffffff,
88 .platform_data = &r8a66597_data,
90 .num_resources = ARRAY_SIZE(r8a66597_usb_host_resources),
91 .resource = r8a66597_usb_host_resources,
94 static struct m66592_platdata usbf_platdata = {
95 .xtal = M66592_PLATDATA_XTAL_24MHZ,
99 static struct resource m66592_usb_peripheral_resources[] = {
101 .name = "m66592_udc",
103 .end = 0x180c0000 - 1,
104 .flags = IORESOURCE_MEM,
107 .name = "m66592_udc",
108 /* Filled in by ilsel */
109 .flags = IORESOURCE_IRQ,
113 static struct platform_device m66592_usb_peripheral_device = {
114 .name = "m66592_udc",
117 .dma_mask = NULL, /* don't use dma */
118 .coherent_dma_mask = 0xffffffff,
119 .platform_data = &usbf_platdata,
121 .num_resources = ARRAY_SIZE(m66592_usb_peripheral_resources),
122 .resource = m66592_usb_peripheral_resources,
125 static struct platform_device *x3proto_devices[] __initdata = {
128 &r8a66597_usb_host_device,
129 &m66592_usb_peripheral_device,
132 static int __init x3proto_devices_setup(void)
134 r8a66597_usb_host_resources[1].start =
135 r8a66597_usb_host_resources[1].end = ilsel_enable(ILSEL_USBH_I);
137 m66592_usb_peripheral_resources[1].start =
138 m66592_usb_peripheral_resources[1].end = ilsel_enable(ILSEL_USBP_I);
140 smc91x_resources[1].start =
141 smc91x_resources[1].end = ilsel_enable(ILSEL_LAN);
143 return platform_add_devices(x3proto_devices,
144 ARRAY_SIZE(x3proto_devices));
146 device_initcall(x3proto_devices_setup);
148 static void __init x3proto_init_irq(void)
150 plat_irq_setup_pins(IRQ_MODE_IRL3210);
152 /* Set ICR0.LVLMODE */
153 __raw_writel(__raw_readl(0xfe410000) | (1 << 21), 0xfe410000);
156 static void __init x3proto_setup(char **cmdline_p)
158 register_smp_ops(&shx3_smp_ops);
161 static struct sh_machine_vector mv_x3proto __initmv = {
162 .mv_name = "x3proto",
163 .mv_setup = x3proto_setup,
164 .mv_init_irq = x3proto_init_irq,