gemini: switch to 3.3
[openwrt/openwrt.git] / target / linux / gemini / patches-3.3 / 123-arm-gemini-wbd222-register-eth.patch
1 --- a/arch/arm/mach-gemini/board-wbd222.c
2 +++ b/arch/arm/mach-gemini/board-wbd222.c
3 @@ -22,9 +22,31 @@
4 #include <asm/mach/arch.h>
5 #include <asm/mach/time.h>
6
7 +#include <mach/gmac.h>
8
9 #include "common.h"
10
11 +static struct mdio_gpio_platform_data wbd222_mdio = {
12 + .mdc = 22,
13 + .mdio = 21,
14 + .phy_mask = ~((1 << 1) | (1 << 3)),
15 +};
16 +
17 +static struct platform_device wbd222_phy_device = {
18 + .name = "mdio-gpio",
19 + .id = 0,
20 + .dev = {
21 + .platform_data = &wbd222_mdio,
22 + },
23 +};
24 +
25 +static struct gemini_gmac_platform_data gmac_data = {
26 + .bus_id[0] = "0:01",
27 + .interface[0] = PHY_INTERFACE_MODE_MII,
28 + .bus_id[1] = "0:03",
29 + .interface[1] = PHY_INTERFACE_MODE_MII,
30 +};
31 +
32 static struct gpio_keys_button wbd222_keys[] = {
33 {
34 .code = KEY_SETUP,
35 @@ -127,6 +149,8 @@ static void __init wbd222_init(void)
36 platform_device_register(&wbd222_keys_device);
37 platform_register_rtc();
38 platform_register_watchdog();
39 + platform_device_register(&wbd222_phy_device);
40 + platform_register_ethernet(&gmac_data);
41 }
42
43 MACHINE_START(WBD222, "Wiliboard WBD-222")