2 * Renesas Technology Europe RSK+ 7203 Support.
4 * Copyright (C) 2008 Paul Mundt
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
10 #include <linux/init.h>
11 #include <linux/types.h>
12 #include <linux/platform_device.h>
13 #include <linux/interrupt.h>
14 #include <linux/smsc911x.h>
15 #include <linux/gpio.h>
16 #include <linux/leds.h>
17 #include <asm/machvec.h>
19 #include <cpu/sh7203.h>
21 static struct smsc911x_platform_config smsc911x_config
= {
22 .phy_interface
= PHY_INTERFACE_MODE_MII
,
23 .irq_polarity
= SMSC911X_IRQ_POLARITY_ACTIVE_LOW
,
24 .irq_type
= SMSC911X_IRQ_TYPE_OPEN_DRAIN
,
25 .flags
= SMSC911X_USE_32BIT
| SMSC911X_SWAP_FIFO
,
28 static struct resource smsc911x_resources
[] = {
32 .flags
= IORESOURCE_MEM
,
37 .flags
= IORESOURCE_IRQ
,
41 static struct platform_device smsc911x_device
= {
44 .num_resources
= ARRAY_SIZE(smsc911x_resources
),
45 .resource
= smsc911x_resources
,
47 .platform_data
= &smsc911x_config
,
51 static struct gpio_led rsk7203_gpio_leds
[] = {
58 .default_trigger
= "nand-disk",
63 .default_trigger
= "timer",
67 .name
= "red:heartbeat",
68 .default_trigger
= "heartbeat",
74 static struct gpio_led_platform_data rsk7203_gpio_leds_info
= {
75 .leds
= rsk7203_gpio_leds
,
76 .num_leds
= ARRAY_SIZE(rsk7203_gpio_leds
),
79 static struct platform_device led_device
= {
83 .platform_data
= &rsk7203_gpio_leds_info
,
87 static struct platform_device
*rsk7203_devices
[] __initdata
= {
92 static int __init
rsk7203_devices_setup(void)
94 /* Select pins for SCIF0 */
95 gpio_request(GPIO_FN_TXD0
, NULL
);
96 gpio_request(GPIO_FN_RXD0
, NULL
);
98 /* Setup LAN9118: CS1 in 16-bit Big Endian Mode, IRQ0 at Port B */
99 __raw_writel(0x36db0400, 0xfffc0008); /* CS1BCR */
100 gpio_request(GPIO_FN_IRQ0_PB
, NULL
);
102 return platform_add_devices(rsk7203_devices
,
103 ARRAY_SIZE(rsk7203_devices
));
105 device_initcall(rsk7203_devices_setup
);