2 * Belkin F5D8235 v2 board support
4 * Copyright (C) 2010 Roman Yeryomin <roman@advem.lv>
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as published
8 * by the Free Software Foundation.
11 #include <linux/init.h>
12 #include <linux/platform_device.h>
14 #include <linux/rtl8366.h>
16 #include <asm/mach-ralink/machine.h>
17 #include <asm/mach-ralink/dev-gpio-buttons.h>
18 #include <asm/mach-ralink/dev-gpio-leds.h>
19 #include <asm/mach-ralink/rt305x.h>
20 #include <asm/mach-ralink/rt305x_regs.h>
24 #define F5D8235_V2_GPIO_LED_INTERNET_BLUE 5
25 #define F5D8235_V2_GPIO_LED_INTERNET_AMBER 6
26 #define F5D8235_V2_GPIO_LED_MODEM_BLUE 11
27 #define F5D8235_V2_GPIO_LED_MODEM_AMBER 8
28 #define F5D8235_V2_GPIO_LED_ROUTER 9
29 #define F5D8235_V2_GPIO_LED_STORAGE_BLUE 23
30 #define F5D8235_V2_GPIO_LED_STORAGE_AMBER 22
31 #define F5D8235_V2_GPIO_LED_SECURITY_BLUE 13
32 #define F5D8235_V2_GPIO_LED_SECURITY_AMBER 12
34 static struct gpio_led f5d8235v2_leds_gpio[] __initdata = {
36 .name = "f5d8235v2:blue:internet",
37 .gpio = F5D8235_V2_GPIO_LED_INTERNET_BLUE,
40 .name = "f5d8235v2:amber:internet",
41 .gpio = F5D8235_V2_GPIO_LED_INTERNET_AMBER,
44 .name = "f5d8235v2:blue:modem",
45 .gpio = F5D8235_V2_GPIO_LED_MODEM_BLUE,
48 .name = "f5d8235v2:amber:modem",
49 .gpio = F5D8235_V2_GPIO_LED_MODEM_AMBER,
52 .name = "f5d8235v2:blue:router",
53 .gpio = F5D8235_V2_GPIO_LED_ROUTER,
56 .name = "f5d8235v2:blue:storage",
57 .gpio = F5D8235_V2_GPIO_LED_STORAGE_BLUE,
60 .name = "f5d8235v2:amber:storage",
61 .gpio = F5D8235_V2_GPIO_LED_STORAGE_AMBER,
64 .name = "f5d8235v2:blue:security",
65 .gpio = F5D8235_V2_GPIO_LED_SECURITY_BLUE,
68 .name = "f5d8235v2:amber:security",
69 .gpio = F5D8235_V2_GPIO_LED_SECURITY_AMBER,
74 static struct rtl8366_platform_data f5d8235v2_switch_data = {
75 .gpio_sda = RT305X_GPIO_I2C_SD,
76 .gpio_sck = RT305X_GPIO_I2C_SCLK,
79 static struct platform_device f5d8235v2_switch = {
80 .name = RTL8366RB_DRIVER_NAME,
83 .platform_data = &f5d8235v2_switch_data,
87 static void __init f5d8235v2_init(void)
89 rt305x_gpio_init((RT305X_GPIO_MODE_GPIO <<
90 RT305X_GPIO_MODE_UART0_SHIFT) |
91 RT305X_GPIO_MODE_I2C |
92 RT305X_GPIO_MODE_SPI |
93 RT305X_GPIO_MODE_MDIO);
95 rt305x_register_flash(0);
97 ramips_register_gpio_leds(-1, ARRAY_SIZE(f5d8235v2_leds_gpio),
99 rt305x_esw_data.vlan_config = RT305X_ESW_VLAN_CONFIG_NONE;
100 rt305x_register_ethernet();
101 platform_device_register(&f5d8235v2_switch);
102 rt305x_register_wifi();
103 rt305x_register_wdt();
104 rt305x_register_usb();
107 MIPS_MACHINE(RAMIPS_MACH_F5D8235_V2, "F5D8235_V2", "Belkin F5D8235 v2",