ramips: image: use GENERIC_4M template for the ALL0256N board
[openwrt.git] / target / linux / gemini / patches / 003-missing_from_upstream.patch
1 --- a/arch/arm/mach-gemini/board-wbd111.c
2 +++ b/arch/arm/mach-gemini/board-wbd111.c
3 @@ -22,9 +22,29 @@
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 wbd111_mdio = {
12 +       .mdc            = 22,
13 +       .mdio           = 21,
14 +       .phy_mask       = ~(1 << 1),
15 +};
16 +
17 +static struct platform_device wbd111_phy_device = {
18 +       .name   = "mdio-gpio",
19 +       .id     = 0,
20 +       .dev    = {
21 +               .platform_data = &wbd111_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 +};
29 +
30  static struct gpio_keys_button wbd111_keys[] = {
31         {
32                 .code           = KEY_SETUP,
33 @@ -131,6 +151,8 @@ static void __init wbd111_init(void)
34                                  wbd111_num_partitions);
35         platform_device_register(&wbd111_leds_device);
36         platform_device_register(&wbd111_keys_device);
37 +       platform_device_register(&wbd111_phy_device);
38 +       platform_register_ethernet(&gmac_data);
39  }
40  
41  MACHINE_START(WBD111, "Wiliboard WBD-111")
42 --- a/arch/arm/mach-gemini/board-wbd222.c
43 +++ b/arch/arm/mach-gemini/board-wbd222.c
44 @@ -22,9 +22,31 @@
45  #include <asm/mach/arch.h>
46  #include <asm/mach/time.h>
47  
48 +#include <mach/gmac.h>
49  
50  #include "common.h"
51  
52 +static struct mdio_gpio_platform_data wbd222_mdio = {
53 +       .mdc            = 22,
54 +       .mdio           = 21,
55 +       .phy_mask       = ~((1 << 1) | (1 << 3)),
56 +};
57 +
58 +static struct platform_device wbd222_phy_device = {
59 +       .name   = "mdio-gpio",
60 +       .id     = 0,
61 +       .dev    = {
62 +               .platform_data = &wbd222_mdio,
63 +       },
64 +};
65 +
66 +static struct gemini_gmac_platform_data gmac_data = {
67 +       .bus_id[0] = "0:01",
68 +       .interface[0] = PHY_INTERFACE_MODE_MII,
69 +       .bus_id[1] = "0:03",
70 +        .interface[1] = PHY_INTERFACE_MODE_MII,
71 +};
72 +
73  static struct gpio_keys_button wbd222_keys[] = {
74         {
75                 .code           = KEY_SETUP,
76 @@ -131,6 +153,10 @@ static void __init wbd222_init(void)
77                 wbd222_num_partitions);
78         platform_device_register(&wbd222_leds_device);
79         platform_device_register(&wbd222_keys_device);
80 +       platform_device_register(&wbd222_phy_device);
81 +       platform_register_ethernet(&gmac_data);
82 +       platform_register_usb(0);
83 +       platform_register_usb(1);
84  }
85  
86  MACHINE_START(WBD222, "Wiliboard WBD-222")