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>
13 #include <linux/mtd/mtd.h>
14 #include <linux/mtd/partitions.h>
15 #include <linux/mtd/physmap.h>
17 #include <linux/rtl8366.h>
19 #include <asm/mach-ralink/machine.h>
20 #include <asm/mach-ralink/dev-gpio-buttons.h>
21 #include <asm/mach-ralink/dev-gpio-leds.h>
22 #include <asm/mach-ralink/rt305x.h>
23 #include <asm/mach-ralink/rt305x_regs.h>
27 #define F5D8235_V2_GPIO_LED_INTERNET_BLUE 5
28 #define F5D8235_V2_GPIO_LED_INTERNET_AMBER 6
29 #define F5D8235_V2_GPIO_LED_MODEM_BLUE 11
30 #define F5D8235_V2_GPIO_LED_MODEM_AMBER 8
31 #define F5D8235_V2_GPIO_LED_ROUTER 9
32 #define F5D8235_V2_GPIO_LED_STORAGE_BLUE 23
33 #define F5D8235_V2_GPIO_LED_STORAGE_AMBER 22
34 #define F5D8235_V2_GPIO_LED_SECURITY_BLUE 13
35 #define F5D8235_V2_GPIO_LED_SECURITY_AMBER 12
37 static struct gpio_led f5d8235v2_leds_gpio[] __initdata = {
39 .name = "f5d8235v2:blue:internet",
40 .gpio = F5D8235_V2_GPIO_LED_INTERNET_BLUE,
43 .name = "f5d8235v2:amber:internet",
44 .gpio = F5D8235_V2_GPIO_LED_INTERNET_AMBER,
47 .name = "f5d8235v2:blue:modem",
48 .gpio = F5D8235_V2_GPIO_LED_MODEM_BLUE,
51 .name = "f5d8235v2:amber:modem",
52 .gpio = F5D8235_V2_GPIO_LED_MODEM_AMBER,
55 .name = "f5d8235v2:blue:router",
56 .gpio = F5D8235_V2_GPIO_LED_ROUTER,
59 .name = "f5d8235v2:blue:storage",
60 .gpio = F5D8235_V2_GPIO_LED_STORAGE_BLUE,
63 .name = "f5d8235v2:amber:storage",
64 .gpio = F5D8235_V2_GPIO_LED_STORAGE_AMBER,
67 .name = "f5d8235v2:blue:security",
68 .gpio = F5D8235_V2_GPIO_LED_SECURITY_BLUE,
71 .name = "f5d8235v2:amber:security",
72 .gpio = F5D8235_V2_GPIO_LED_SECURITY_AMBER,
77 static struct mtd_partition f5d8235v2_partitions[] = {
82 .mask_flags = MTD_WRITEABLE,
84 .name = "kernel and rootfs",
102 static struct physmap_flash_data f5d8235v2_flash_data = {
103 .nr_parts = ARRAY_SIZE(f5d8235v2_partitions),
104 .parts = f5d8235v2_partitions,
108 static struct rtl8366_platform_data f5d8235v2_switch_data = {
109 .gpio_sda = RT305X_GPIO_I2C_SD,
110 .gpio_sck = RT305X_GPIO_I2C_SCLK,
113 static struct platform_device f5d8235v2_switch = {
114 .name = RTL8366RB_DRIVER_NAME,
117 .platform_data = &f5d8235v2_switch_data,
121 static void __init f5d8235v2_init(void)
123 rt305x_gpio_init((RT305X_GPIO_MODE_GPIO <<
124 RT305X_GPIO_MODE_UART0_SHIFT) |
125 RT305X_GPIO_MODE_I2C |
126 RT305X_GPIO_MODE_SPI |
127 RT305X_GPIO_MODE_MDIO);
128 rt305x_register_flash(0, &f5d8235v2_flash_data);
129 ramips_register_gpio_leds(-1, ARRAY_SIZE(f5d8235v2_leds_gpio),
130 f5d8235v2_leds_gpio);
131 rt305x_esw_data.vlan_config = RT305X_ESW_VLAN_CONFIG_NONE;
132 rt305x_register_ethernet();
133 platform_device_register(&f5d8235v2_switch);
134 rt305x_register_wifi();
135 rt305x_register_wdt();
136 rt305x_register_usb();
139 MIPS_MACHINE(RAMIPS_MACH_F5D8235_V2, "F5D8235_V2", "Belkin F5D8235 v2",