2 * Belkin F5D825 V1 board support
4 * Copyright (C) 2011 Cezary Jackiewicz <cezary.jackiewicz@gmail.com>
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 <asm/mach-ralink/machine.h>
18 #include <asm/mach-ralink/dev-gpio-buttons.h>
19 #include <asm/mach-ralink/dev-gpio-leds.h>
20 #include <asm/mach-ralink/rt288x.h>
21 #include <asm/mach-ralink/rt288x_regs.h>
25 #include <linux/rtl8366.h>
26 #include <linux/ethtool.h>
28 #include <asm/mach-ralink/ramips_eth_platform.h>
30 #define F5D8235_GPIO_RTL8366_SCK 2
31 #define F5D8235_GPIO_RTL8366_SDA 1
33 #define F5D8235_GPIO_LED_USB_BLUE 7
34 #define F5D8235_GPIO_LED_USB_ORANGE 8
35 #define F5D8235_GPIO_BUTTON_WPS 0
36 #define F5D8235_GPIO_BUTTON_RESET 9
38 #define F5D8235_BUTTONS_POLL_INTERVAL 20
40 #ifdef CONFIG_MTD_PARTITIONS
41 static struct mtd_partition f5d8235_partitions
[] = {
46 .mask_flags
= MTD_WRITEABLE
,
48 .name
= "kernel and rootfs",
65 #endif /* CONFIG_MTD_PARTITIONS */
67 static struct physmap_flash_data f5d8235_flash_data
= {
68 #ifdef CONFIG_MTD_PARTITIONS
69 .nr_parts
= ARRAY_SIZE(f5d8235_partitions
),
70 .parts
= f5d8235_partitions
,
74 static struct rtl8366_platform_data f5d8235_rtl8366s_data
= {
75 .gpio_sda
= F5D8235_GPIO_RTL8366_SDA
,
76 .gpio_sck
= F5D8235_GPIO_RTL8366_SCK
,
79 static struct platform_device f5d8235_rtl8366s_device
= {
80 .name
= RTL8366S_DRIVER_NAME
,
83 .platform_data
= &f5d8235_rtl8366s_data
,
87 static struct gpio_led f5d8235_leds_gpio
[] __initdata
= {
89 .name
= "f5d8234-v1:blue:storage",
90 .gpio
= F5D8235_GPIO_LED_USB_BLUE
,
93 .name
= "f5d8234-v1:orange:storage",
94 .gpio
= F5D8235_GPIO_LED_USB_ORANGE
,
99 static struct gpio_button f5d8235_gpio_buttons
[] __initdata
= {
105 .gpio
= F5D8235_GPIO_BUTTON_RESET
,
110 .code
= KEY_WPS_BUTTON
,
112 .gpio
= F5D8235_GPIO_BUTTON_WPS
,
117 static void __init
f5d8235_init(void)
119 rt288x_gpio_init(RT2880_GPIO_MODE_UART0
| RT2880_GPIO_MODE_I2C
);
121 rt288x_register_flash(0, &f5d8235_flash_data
);
122 rt288x_register_wifi();
123 rt288x_register_wdt();
125 ramips_register_gpio_leds(-1, ARRAY_SIZE(f5d8235_leds_gpio
),
128 ramips_register_gpio_buttons(-1, F5D8235_BUTTONS_POLL_INTERVAL
,
129 ARRAY_SIZE(f5d8235_gpio_buttons
),
130 f5d8235_gpio_buttons
);
132 platform_device_register(&f5d8235_rtl8366s_device
);
134 rt288x_eth_data
.speed
= SPEED_1000
;
135 rt288x_eth_data
.duplex
= DUPLEX_FULL
;
136 rt288x_eth_data
.tx_fc
= 1;
137 rt288x_eth_data
.rx_fc
= 1;
138 rt288x_register_ethernet();
141 MIPS_MACHINE(RAMIPS_MACH_F5D8235_V1
, "F5D8235_V1",
142 "Belkin F5D8235 v1", f5d8235_init
);