36cafed64853bbf1964dbff95b96a620398d67e7
[openwrt/svn-archive/archive.git] / target / linux / gemini / patches-3.3 / 124-arm-gemini-rut100-register-ethernet.patch
1 --- a/arch/arm/mach-gemini/board-rut1xx.c
2 +++ b/arch/arm/mach-gemini/board-rut1xx.c
3 @@ -14,13 +14,35 @@
4 #include <linux/leds.h>
5 #include <linux/input.h>
6 #include <linux/gpio_keys.h>
7 +#include <linux/mdio-gpio.h>
8
9 #include <asm/mach-types.h>
10 #include <asm/mach/arch.h>
11 #include <asm/mach/time.h>
12
13 +#include <mach/gmac.h>
14 +
15 #include "common.h"
16
17 +static struct mdio_gpio_platform_data rut1xx_mdio = {
18 + .mdc = 22,
19 + .mdio = 21,
20 + .phy_mask = ~(1 << 1),
21 +};
22 +
23 +static struct platform_device rut1xx_phy_device = {
24 + .name = "mdio-gpio",
25 + .id = 0,
26 + .dev = {
27 + .platform_data = &rut1xx_mdio,
28 + },
29 +};
30 +
31 +static struct gemini_gmac_platform_data gmac_data = {
32 + .bus_id[0] = "0:01",
33 + .interface[0] = PHY_INTERFACE_MODE_MII,
34 +};
35 +
36 static struct gpio_keys_button rut1xx_keys[] = {
37 {
38 .code = KEY_SETUP,
39 @@ -84,6 +106,8 @@ static void __init rut1xx_init(void)
40 platform_device_register(&rut1xx_keys_device);
41 platform_register_rtc();
42 platform_register_watchdog();
43 + platform_device_register(&rut1xx_phy_device);
44 + platform_register_ethernet(&gmac_data);
45 }
46
47 MACHINE_START(RUT100, "Teltonika RUT100")