2 * arch/sh/boards/renesas/x3proto/setup.c
4 * Renesas SH-X3 Prototype Board Support.
6 * Copyright (C) 2007 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 <asm/ilsel.h>
18 static struct resource heartbeat_resources
[] = {
22 .flags
= IORESOURCE_MEM
,
26 static struct platform_device heartbeat_device
= {
29 .num_resources
= ARRAY_SIZE(heartbeat_resources
),
30 .resource
= heartbeat_resources
,
33 static struct resource smc91x_resources
[] = {
36 .end
= 0x18000300 + 0x10 - 1,
37 .flags
= IORESOURCE_MEM
,
40 /* Filled in by ilsel */
41 .flags
= IORESOURCE_IRQ
,
45 static struct platform_device smc91x_device
= {
48 .resource
= smc91x_resources
,
49 .num_resources
= ARRAY_SIZE(smc91x_resources
),
52 static struct resource r8a66597_usb_host_resources
[] = {
54 .name
= "r8a66597_hcd",
56 .end
= 0x18080000 - 1,
57 .flags
= IORESOURCE_MEM
,
60 .name
= "r8a66597_hcd",
61 /* Filled in by ilsel */
62 .flags
= IORESOURCE_IRQ
,
66 static struct platform_device r8a66597_usb_host_device
= {
67 .name
= "r8a66597_hcd",
70 .dma_mask
= NULL
, /* don't use dma */
71 .coherent_dma_mask
= 0xffffffff,
73 .num_resources
= ARRAY_SIZE(r8a66597_usb_host_resources
),
74 .resource
= r8a66597_usb_host_resources
,
77 static struct resource m66592_usb_peripheral_resources
[] = {
81 .end
= 0x180c0000 - 1,
82 .flags
= IORESOURCE_MEM
,
86 /* Filled in by ilsel */
87 .flags
= IORESOURCE_IRQ
,
91 static struct platform_device m66592_usb_peripheral_device
= {
95 .dma_mask
= NULL
, /* don't use dma */
96 .coherent_dma_mask
= 0xffffffff,
98 .num_resources
= ARRAY_SIZE(m66592_usb_peripheral_resources
),
99 .resource
= m66592_usb_peripheral_resources
,
102 static struct platform_device
*x3proto_devices
[] __initdata
= {
105 &r8a66597_usb_host_device
,
106 &m66592_usb_peripheral_device
,
109 static int __init
x3proto_devices_setup(void)
111 r8a66597_usb_host_resources
[1].start
=
112 r8a66597_usb_host_resources
[1].end
= ilsel_enable(ILSEL_USBH_I
);
114 m66592_usb_peripheral_resources
[1].start
=
115 m66592_usb_peripheral_resources
[1].end
= ilsel_enable(ILSEL_USBP_I
);
117 smc91x_resources
[1].start
=
118 smc91x_resources
[1].end
= ilsel_enable(ILSEL_LAN
);
120 return platform_add_devices(x3proto_devices
,
121 ARRAY_SIZE(x3proto_devices
));
123 device_initcall(x3proto_devices_setup
);
125 static void __init
x3proto_init_irq(void)
127 plat_irq_setup_pins(IRQ_MODE_IRL3210
);
129 /* Set ICR0.LVLMODE */
130 ctrl_outl(ctrl_inl(0xfe410000) | (1 << 21), 0xfe410000);
133 static struct sh_machine_vector mv_x3proto __initmv
= {
134 .mv_name
= "x3proto",
135 .mv_init_irq
= x3proto_init_irq
,