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