1 --- a/arch/arm/mach-gemini/board-nas4220b.c 2011-04-21 13:19:09.878432930 +0200
2 +++ b/arch/arm/mach-gemini/board-nas4220b.c 2011-04-21 13:30:37.555082365 +0200
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",
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);
72 platform_device_register(&ib4220b_key_device);
73 platform_register_rtc();
74 platform_register_watchdog();
75 + platform_device_register(&ib4220b_phy_device);
76 + platform_register_ethernet(&ib4220b_gmac_data);
79 MACHINE_START(NAS4220B, "Raidsonic NAS IB-4220-B")
80 --- a/arch/arm/mach-gemini/board-wbd111.c
81 +++ b/arch/arm/mach-gemini/board-wbd111.c
83 #include <asm/mach/arch.h>
84 #include <asm/mach/time.h>
86 +#include <mach/gmac.h>
90 +static struct mdio_gpio_platform_data wbd111_mdio = {
93 + .phy_mask = ~(1 << 1),
96 +static struct platform_device wbd111_phy_device = {
97 + .name = "mdio-gpio",
100 + .platform_data = &wbd111_mdio,
104 +static struct gemini_gmac_platform_data gmac_data = {
105 + .bus_id[0] = "gpio-0:01",
106 + .interface[0] = PHY_INTERFACE_MODE_MII,
109 static struct gpio_keys_button wbd111_keys[] = {
112 @@ -123,6 +143,8 @@ static void __init wbd111_init(void)
113 platform_device_register(&wbd111_keys_device);
114 platform_register_rtc();
115 platform_register_watchdog();
116 + platform_device_register(&wbd111_phy_device);
117 + platform_register_ethernet(&gmac_data);
120 MACHINE_START(WBD111, "Wiliboard WBD-111")
121 --- a/arch/arm/mach-gemini/board-wbd222.c
122 +++ b/arch/arm/mach-gemini/board-wbd222.c
124 #include <asm/mach/arch.h>
125 #include <asm/mach/time.h>
127 +#include <mach/gmac.h>
131 +static struct mdio_gpio_platform_data wbd222_mdio = {
134 + .phy_mask = ~((1 << 1) | (1 << 3)),
137 +static struct platform_device wbd222_phy_device = {
138 + .name = "mdio-gpio",
141 + .platform_data = &wbd222_mdio,
145 +static struct gemini_gmac_platform_data gmac_data = {
146 + .bus_id[0] = "gpio-0:01",
147 + .interface[0] = PHY_INTERFACE_MODE_MII,
148 + .bus_id[1] = "gpio-0:03",
149 + .interface[1] = PHY_INTERFACE_MODE_MII,
152 static struct gpio_keys_button wbd222_keys[] = {
155 @@ -123,6 +145,8 @@ static void __init wbd222_init(void)
156 platform_device_register(&wbd222_keys_device);
157 platform_register_rtc();
158 platform_register_watchdog();
159 + platform_device_register(&wbd222_phy_device);
160 + platform_register_ethernet(&gmac_data);
163 MACHINE_START(WBD222, "Wiliboard WBD-222")
164 --- a/arch/arm/mach-gemini/board-rut1xx.c
165 +++ b/arch/arm/mach-gemini/board-rut1xx.c
167 #include <linux/input.h>
168 #include <linux/gpio_keys.h>
169 #include <linux/sizes.h>
170 +#include <linux/mdio-gpio.h>
172 #include <asm/mach-types.h>
173 #include <asm/mach/arch.h>
174 #include <asm/mach/time.h>
176 +#include <mach/gmac.h>
180 +static struct mdio_gpio_platform_data rut1xx_mdio = {
183 + .phy_mask = ~(1 << 1),
186 +static struct platform_device rut1xx_phy_device = {
187 + .name = "mdio-gpio",
190 + .platform_data = &rut1xx_mdio,
194 +static struct gemini_gmac_platform_data gmac_data = {
195 + .bus_id[0] = "gpio-0:01",
196 + .interface[0] = PHY_INTERFACE_MODE_MII,
199 static struct gpio_keys_button rut1xx_keys[] = {
202 @@ -81,6 +103,8 @@ static void __init rut1xx_init(void)
203 platform_device_register(&rut1xx_keys_device);
204 platform_register_rtc();
205 platform_register_watchdog();
206 + platform_device_register(&rut1xx_phy_device);
207 + platform_register_ethernet(&gmac_data);
210 MACHINE_START(RUT100, "Teltonika RUT100")