1 // SPDX-License-Identifier: GPL-2.0
3 * Renesas Technology Europe RSK+ 7203 Support.
5 * Copyright (C) 2008 - 2010 Paul Mundt
7 #include <linux/init.h>
8 #include <linux/types.h>
9 #include <linux/platform_device.h>
10 #include <linux/interrupt.h>
11 #include <linux/smsc911x.h>
12 #include <linux/input.h>
13 #include <linux/gpio.h>
14 #include <linux/gpio_keys.h>
15 #include <linux/leds.h>
16 #include <asm/machvec.h>
18 #include <cpu/sh7203.h>
20 static struct smsc911x_platform_config smsc911x_config
= {
21 .phy_interface
= PHY_INTERFACE_MODE_MII
,
22 .irq_polarity
= SMSC911X_IRQ_POLARITY_ACTIVE_LOW
,
23 .irq_type
= SMSC911X_IRQ_TYPE_OPEN_DRAIN
,
24 .flags
= SMSC911X_USE_32BIT
| SMSC911X_SWAP_FIFO
,
27 static struct resource smsc911x_resources
[] = {
31 .flags
= IORESOURCE_MEM
,
36 .flags
= IORESOURCE_IRQ
,
40 static struct platform_device smsc911x_device
= {
43 .num_resources
= ARRAY_SIZE(smsc911x_resources
),
44 .resource
= smsc911x_resources
,
46 .platform_data
= &smsc911x_config
,
50 static struct gpio_led rsk7203_gpio_leds
[] = {
57 .default_trigger
= "nand-disk",
62 .default_trigger
= "timer",
66 .name
= "red:heartbeat",
67 .default_trigger
= "heartbeat",
73 static struct gpio_led_platform_data rsk7203_gpio_leds_info
= {
74 .leds
= rsk7203_gpio_leds
,
75 .num_leds
= ARRAY_SIZE(rsk7203_gpio_leds
),
78 static struct platform_device led_device
= {
82 .platform_data
= &rsk7203_gpio_leds_info
,
86 static struct gpio_keys_button rsk7203_gpio_keys_table
[] = {
105 static struct gpio_keys_platform_data rsk7203_gpio_keys_info
= {
106 .buttons
= rsk7203_gpio_keys_table
,
107 .nbuttons
= ARRAY_SIZE(rsk7203_gpio_keys_table
),
108 .poll_interval
= 50, /* default to 50ms */
111 static struct platform_device keys_device
= {
112 .name
= "gpio-keys-polled",
114 .platform_data
= &rsk7203_gpio_keys_info
,
118 static struct platform_device
*rsk7203_devices
[] __initdata
= {
124 static int __init
rsk7203_devices_setup(void)
126 /* Select pins for SCIF0 */
127 gpio_request(GPIO_FN_TXD0
, NULL
);
128 gpio_request(GPIO_FN_RXD0
, NULL
);
130 /* Setup LAN9118: CS1 in 16-bit Big Endian Mode, IRQ0 at Port B */
131 __raw_writel(0x36db0400, 0xfffc0008); /* CS1BCR */
132 gpio_request(GPIO_FN_IRQ0_PB
, NULL
);
134 return platform_add_devices(rsk7203_devices
,
135 ARRAY_SIZE(rsk7203_devices
));
137 device_initcall(rsk7203_devices_setup
);