1 --- a/arch/arm/mach-gemini/board-nas4220b.c
2 +++ b/arch/arm/mach-gemini/board-nas4220b.c
5 #include <mach/hardware.h>
6 #include <mach/global_reg.h>
7 +#include <mach/gmac.h>
11 +static struct mdio_gpio_platform_data ib4220b_mdio = {
14 + .phy_mask = ~(1 << 1),
17 +static struct platform_device ib4220b_phy_device = {
18 + .name = "mdio-gpio",
20 + .dev = { .platform_data = &ib4220b_mdio, },
23 +static struct gemini_gmac_platform_data ib4220b_gmac_data = {
24 + .bus_id[0] = "gpio-0:01",
25 + .interface[0] = PHY_INTERFACE_MODE_RGMII,
28 static struct gpio_led ib4220b_leds[] = {
30 .name = "nas4220b:orange:hdd",
31 @@ -87,15 +105,47 @@ static struct platform_device ib4220b_ke
35 +static void __init ib4220b_gmac_init(void)
39 + val = readl((void __iomem*)(IO_ADDRESS(GEMINI_GLOBAL_BASE) +
40 + GLOBAL_IO_DRIVING_CTRL));
41 + val |= (0x3 << GMAC0_PADS_SHIFT) | (0x3 << GMAC1_PADS_SHIFT);
42 + writel(val, (void __iomem*)(IO_ADDRESS(GEMINI_GLOBAL_BASE) +
43 + GLOBAL_IO_DRIVING_CTRL));
45 + val = (0x0 << GMAC0_RXDV_SKEW_SHIFT) | (0xf << GMAC0_RXC_SKEW_SHIFT) |
46 + (0x7 << GMAC0_TXEN_SKEW_SHIFT) | (0xb << GMAC0_TXC_SKEW_SHIFT) |
47 + (0x0 << GMAC1_RXDV_SKEW_SHIFT) | (0xf << GMAC1_RXC_SKEW_SHIFT) |
48 + (0x7 << GMAC1_TXEN_SKEW_SHIFT) | (0xa << GMAC1_TXC_SKEW_SHIFT);
49 + writel(val, (void __iomem*)(IO_ADDRESS(GEMINI_GLOBAL_BASE) +
50 + GLOBAL_GMAC_CTRL_SKEW_CTRL));
52 + writel(0x77777777, (void __iomem*)(IO_ADDRESS(GEMINI_GLOBAL_BASE) +
53 + GLOBAL_GMAC0_DATA_SKEW_CTRL));
54 + writel(0x77777777, (void __iomem*)(IO_ADDRESS(GEMINI_GLOBAL_BASE) +
55 + GLOBAL_GMAC1_DATA_SKEW_CTRL));
57 + val = readl((void __iomem*)(IO_ADDRESS(GEMINI_GLOBAL_BASE) +
58 + GLOBAL_ARBITRATION1_CTRL)) & ~BURST_LENGTH_MASK;
59 + val |= (0x20 << BURST_LENGTH_SHIFT) | GMAC0_HIGH_PRIO | GMAC1_HIGH_PRIO;
60 + writel(val, (void __iomem*)(IO_ADDRESS(GEMINI_GLOBAL_BASE) +
61 + GLOBAL_ARBITRATION1_CTRL));
64 static void __init ib4220b_init(void)
67 + ib4220b_gmac_init();
68 platform_register_uart();
69 platform_register_pflash(SZ_16M, NULL, 0);
70 platform_device_register(&ib4220b_led_device);
71 platform_device_register(&ib4220b_key_device);
72 platform_register_rtc();
73 platform_register_watchdog();
74 + platform_device_register(&ib4220b_phy_device);
75 + platform_register_ethernet(&ib4220b_gmac_data);
78 MACHINE_START(NAS4220B, "Raidsonic NAS IB-4220-B")
79 --- a/arch/arm/mach-gemini/board-wbd111.c
80 +++ b/arch/arm/mach-gemini/board-wbd111.c
82 #include <asm/mach/arch.h>
83 #include <asm/mach/time.h>
85 +#include <mach/gmac.h>
89 +static struct mdio_gpio_platform_data wbd111_mdio = {
92 + .phy_mask = ~(1 << 1),
95 +static struct platform_device wbd111_phy_device = {
96 + .name = "mdio-gpio",
99 + .platform_data = &wbd111_mdio,
103 +static struct gemini_gmac_platform_data gmac_data = {
104 + .bus_id[0] = "gpio-0:01",
105 + .interface[0] = PHY_INTERFACE_MODE_MII,
108 static struct gpio_keys_button wbd111_keys[] = {
111 @@ -123,6 +143,8 @@ static void __init wbd111_init(void)
112 platform_device_register(&wbd111_keys_device);
113 platform_register_rtc();
114 platform_register_watchdog();
115 + platform_device_register(&wbd111_phy_device);
116 + platform_register_ethernet(&gmac_data);
119 MACHINE_START(WBD111, "Wiliboard WBD-111")
120 --- a/arch/arm/mach-gemini/board-wbd222.c
121 +++ b/arch/arm/mach-gemini/board-wbd222.c
123 #include <asm/mach/arch.h>
124 #include <asm/mach/time.h>
126 +#include <mach/gmac.h>
130 +static struct mdio_gpio_platform_data wbd222_mdio = {
133 + .phy_mask = ~((1 << 1) | (1 << 3)),
136 +static struct platform_device wbd222_phy_device = {
137 + .name = "mdio-gpio",
140 + .platform_data = &wbd222_mdio,
144 +static struct gemini_gmac_platform_data gmac_data = {
145 + .bus_id[0] = "gpio-0:01",
146 + .interface[0] = PHY_INTERFACE_MODE_MII,
147 + .bus_id[1] = "gpio-0:03",
148 + .interface[1] = PHY_INTERFACE_MODE_MII,
151 static struct gpio_keys_button wbd222_keys[] = {
154 @@ -123,6 +145,8 @@ static void __init wbd222_init(void)
155 platform_device_register(&wbd222_keys_device);
156 platform_register_rtc();
157 platform_register_watchdog();
158 + platform_device_register(&wbd222_phy_device);
159 + platform_register_ethernet(&gmac_data);
162 MACHINE_START(WBD222, "Wiliboard WBD-222")
163 --- a/arch/arm/mach-gemini/board-rut1xx.c
164 +++ b/arch/arm/mach-gemini/board-rut1xx.c
166 #include <linux/input.h>
167 #include <linux/gpio_keys.h>
168 #include <linux/sizes.h>
169 +#include <linux/mdio-gpio.h>
171 #include <asm/mach-types.h>
172 #include <asm/mach/arch.h>
173 #include <asm/mach/time.h>
175 +#include <mach/gmac.h>
179 +static struct mdio_gpio_platform_data rut1xx_mdio = {
182 + .phy_mask = ~(1 << 1),
185 +static struct platform_device rut1xx_phy_device = {
186 + .name = "mdio-gpio",
189 + .platform_data = &rut1xx_mdio,
193 +static struct gemini_gmac_platform_data gmac_data = {
194 + .bus_id[0] = "gpio-0:01",
195 + .interface[0] = PHY_INTERFACE_MODE_MII,
198 static struct gpio_keys_button rut1xx_keys[] = {
201 @@ -81,6 +103,8 @@ static void __init rut1xx_init(void)
202 platform_device_register(&rut1xx_keys_device);
203 platform_register_rtc();
204 platform_register_watchdog();
205 + platform_device_register(&rut1xx_phy_device);
206 + platform_register_ethernet(&gmac_data);
209 MACHINE_START(RUT100, "Teltonika RUT100")