sh: mach-x3proto: Fix up smc91x platform data.
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / arch / sh / boards / mach-x3proto / setup.c
bloba70d23b21788e99db83270818cd71939909d7be7
1 /*
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
10 * for more details.
12 #include <linux/init.h>
13 #include <linux/platform_device.h>
14 #include <linux/kernel.h>
15 #include <linux/io.h>
16 #include <linux/smc91x.h>
17 #include <asm/ilsel.h>
19 static struct resource heartbeat_resources[] = {
20 [0] = {
21 .start = 0xb8140020,
22 .end = 0xb8140020,
23 .flags = IORESOURCE_MEM,
27 static struct platform_device heartbeat_device = {
28 .name = "heartbeat",
29 .id = -1,
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[] = {
39 [0] = {
40 .start = 0x18000300,
41 .end = 0x18000300 + 0x10 - 1,
42 .flags = IORESOURCE_MEM,
44 [1] = {
45 /* Filled in by ilsel */
46 .flags = IORESOURCE_IRQ,
50 static struct platform_device smc91x_device = {
51 .name = "smc91x",
52 .id = -1,
53 .resource = smc91x_resources,
54 .num_resources = ARRAY_SIZE(smc91x_resources),
55 .dev = {
56 .platform_data = &smc91x_info,
60 static struct resource r8a66597_usb_host_resources[] = {
61 [0] = {
62 .name = "r8a66597_hcd",
63 .start = 0x18040000,
64 .end = 0x18080000 - 1,
65 .flags = IORESOURCE_MEM,
67 [1] = {
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",
76 .id = -1,
77 .dev = {
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[] = {
86 [0] = {
87 .name = "m66592_udc",
88 .start = 0x18080000,
89 .end = 0x180c0000 - 1,
90 .flags = IORESOURCE_MEM,
92 [1] = {
93 .name = "m66592_udc",
94 /* Filled in by ilsel */
95 .flags = IORESOURCE_IRQ,
99 static struct platform_device m66592_usb_peripheral_device = {
100 .name = "m66592_udc",
101 .id = -1,
102 .dev = {
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 = {
111 &heartbeat_device,
112 &smc91x_device,
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,