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 <asm/ilsel.h>
19 static struct resource heartbeat_resources
[] = {
23 .flags
= IORESOURCE_MEM
,
27 static struct platform_device heartbeat_device
= {
30 .num_resources
= ARRAY_SIZE(heartbeat_resources
),
31 .resource
= heartbeat_resources
,
34 static struct smc91x_platdata smc91x_info
= {
35 .flags
= SMC91X_USE_16BIT
| SMC91X_NOWAIT
,
38 static struct resource smc91x_resources
[] = {
41 .end
= 0x18000300 + 0x10 - 1,
42 .flags
= IORESOURCE_MEM
,
45 /* Filled in by ilsel */
46 .flags
= IORESOURCE_IRQ
,
50 static struct platform_device smc91x_device
= {
53 .resource
= smc91x_resources
,
54 .num_resources
= ARRAY_SIZE(smc91x_resources
),
56 .platform_data
= &smc91x_info
,
60 static struct resource r8a66597_usb_host_resources
[] = {
62 .name
= "r8a66597_hcd",
64 .end
= 0x18080000 - 1,
65 .flags
= IORESOURCE_MEM
,
68 .name
= "r8a66597_hcd",
69 /* Filled in by ilsel */
70 .flags
= IORESOURCE_IRQ
,
74 static struct platform_device r8a66597_usb_host_device
= {
75 .name
= "r8a66597_hcd",
78 .dma_mask
= NULL
, /* don't use dma */
79 .coherent_dma_mask
= 0xffffffff,
81 .num_resources
= ARRAY_SIZE(r8a66597_usb_host_resources
),
82 .resource
= r8a66597_usb_host_resources
,
85 static struct resource m66592_usb_peripheral_resources
[] = {
89 .end
= 0x180c0000 - 1,
90 .flags
= IORESOURCE_MEM
,
94 /* Filled in by ilsel */
95 .flags
= IORESOURCE_IRQ
,
99 static struct platform_device m66592_usb_peripheral_device
= {
100 .name
= "m66592_udc",
103 .dma_mask
= NULL
, /* don't use dma */
104 .coherent_dma_mask
= 0xffffffff,
106 .num_resources
= ARRAY_SIZE(m66592_usb_peripheral_resources
),
107 .resource
= m66592_usb_peripheral_resources
,
110 static struct platform_device
*x3proto_devices
[] __initdata
= {
113 &r8a66597_usb_host_device
,
114 &m66592_usb_peripheral_device
,
117 static int __init
x3proto_devices_setup(void)
119 r8a66597_usb_host_resources
[1].start
=
120 r8a66597_usb_host_resources
[1].end
= ilsel_enable(ILSEL_USBH_I
);
122 m66592_usb_peripheral_resources
[1].start
=
123 m66592_usb_peripheral_resources
[1].end
= ilsel_enable(ILSEL_USBP_I
);
125 smc91x_resources
[1].start
=
126 smc91x_resources
[1].end
= ilsel_enable(ILSEL_LAN
);
128 return platform_add_devices(x3proto_devices
,
129 ARRAY_SIZE(x3proto_devices
));
131 device_initcall(x3proto_devices_setup
);
133 static void __init
x3proto_init_irq(void)
135 plat_irq_setup_pins(IRQ_MODE_IRL3210
);
137 /* Set ICR0.LVLMODE */
138 ctrl_outl(ctrl_inl(0xfe410000) | (1 << 21), 0xfe410000);
141 static struct sh_machine_vector mv_x3proto __initmv
= {
142 .mv_name
= "x3proto",
143 .mv_init_irq
= x3proto_init_irq
,