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 <asm/ilsel.h>
20 static struct resource heartbeat_resources
[] = {
24 .flags
= IORESOURCE_MEM
,
28 static struct platform_device heartbeat_device
= {
31 .num_resources
= ARRAY_SIZE(heartbeat_resources
),
32 .resource
= heartbeat_resources
,
35 static struct smc91x_platdata smc91x_info
= {
36 .flags
= SMC91X_USE_16BIT
| SMC91X_NOWAIT
,
39 static struct resource smc91x_resources
[] = {
42 .end
= 0x18000300 + 0x10 - 1,
43 .flags
= IORESOURCE_MEM
,
46 /* Filled in by ilsel */
47 .flags
= IORESOURCE_IRQ
,
51 static struct platform_device smc91x_device
= {
54 .resource
= smc91x_resources
,
55 .num_resources
= ARRAY_SIZE(smc91x_resources
),
57 .platform_data
= &smc91x_info
,
61 static struct resource r8a66597_usb_host_resources
[] = {
63 .name
= "r8a66597_hcd",
65 .end
= 0x18080000 - 1,
66 .flags
= IORESOURCE_MEM
,
69 .name
= "r8a66597_hcd",
70 /* Filled in by ilsel */
71 .flags
= IORESOURCE_IRQ
,
75 static struct platform_device r8a66597_usb_host_device
= {
76 .name
= "r8a66597_hcd",
79 .dma_mask
= NULL
, /* don't use dma */
80 .coherent_dma_mask
= 0xffffffff,
82 .num_resources
= ARRAY_SIZE(r8a66597_usb_host_resources
),
83 .resource
= r8a66597_usb_host_resources
,
86 static struct resource m66592_usb_peripheral_resources
[] = {
90 .end
= 0x180c0000 - 1,
91 .flags
= IORESOURCE_MEM
,
95 /* Filled in by ilsel */
96 .flags
= IORESOURCE_IRQ
,
100 static struct platform_device m66592_usb_peripheral_device
= {
101 .name
= "m66592_udc",
104 .dma_mask
= NULL
, /* don't use dma */
105 .coherent_dma_mask
= 0xffffffff,
107 .num_resources
= ARRAY_SIZE(m66592_usb_peripheral_resources
),
108 .resource
= m66592_usb_peripheral_resources
,
111 static struct platform_device
*x3proto_devices
[] __initdata
= {
114 &r8a66597_usb_host_device
,
115 &m66592_usb_peripheral_device
,
118 static int __init
x3proto_devices_setup(void)
120 r8a66597_usb_host_resources
[1].start
=
121 r8a66597_usb_host_resources
[1].end
= ilsel_enable(ILSEL_USBH_I
);
123 m66592_usb_peripheral_resources
[1].start
=
124 m66592_usb_peripheral_resources
[1].end
= ilsel_enable(ILSEL_USBP_I
);
126 smc91x_resources
[1].start
=
127 smc91x_resources
[1].end
= ilsel_enable(ILSEL_LAN
);
129 return platform_add_devices(x3proto_devices
,
130 ARRAY_SIZE(x3proto_devices
));
132 device_initcall(x3proto_devices_setup
);
134 static void __init
x3proto_init_irq(void)
136 plat_irq_setup_pins(IRQ_MODE_IRL3210
);
138 /* Set ICR0.LVLMODE */
139 ctrl_outl(ctrl_inl(0xfe410000) | (1 << 21), 0xfe410000);
142 static struct sh_machine_vector mv_x3proto __initmv
= {
143 .mv_name
= "x3proto",
144 .mv_init_irq
= x3proto_init_irq
,