ar71xx: use the gpio_keys_polled driver instead of gpio_buttons
[openwrt/svn-archive/archive.git] / target / linux / ar71xx / files / arch / mips / ar71xx / mach-rb750.c
index 1698db9146426ac7535e5df4d970dc14af4622f8..547ad12d3f1d007500d7ee094a4e566ac5909991 100644 (file)
@@ -13,7 +13,7 @@
 #include <asm/mach-ar71xx/mach-rb750.h>
 
 #include "machtype.h"
-#include "dev-ap91-eth.h"
+#include "devices.h"
 
 static struct rb750_led_data rb750_leds[] = {
        {
@@ -50,12 +50,16 @@ static struct rb750_led_platform_data rb750_leds_data = {
 
 static struct platform_device rb750_leds_device = {
        .name   = "leds-rb750",
-       .id     = -1,
        .dev    = {
                .platform_data = &rb750_leds_data,
        }
 };
 
+static struct platform_device rb750_nand_device = {
+       .name   = "rb750-nand",
+       .id     = -1,
+};
+
 int rb750_latch_change(u32 mask_clr, u32 mask_set)
 {
        static DEFINE_SPINLOCK(lock);
@@ -99,7 +103,7 @@ int rb750_latch_change(u32 mask_clr, u32 mask_set)
 
        ret = 1;
 
- unlock:
+unlock:
        spin_unlock_irqrestore(&lock, flags);
        return ret;
 }
@@ -113,8 +117,27 @@ static void __init rb750_setup(void)
                                     AR724X_GPIO_FUNC_ETH_SWITCH_LED3_EN |
                                     AR724X_GPIO_FUNC_ETH_SWITCH_LED4_EN);
 
-       ap91_eth_init(NULL);
+       ar71xx_init_mac(ar71xx_eth0_data.mac_addr, ar71xx_mac_base, 0);
+       ar71xx_init_mac(ar71xx_eth1_data.mac_addr, ar71xx_mac_base, 1);
+
+       /* WAN port */
+       ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
+       ar71xx_eth0_data.speed = SPEED_100;
+       ar71xx_eth0_data.duplex = DUPLEX_FULL;
+       ar71xx_eth0_data.phy_mask = BIT(4);
+
+       /* LAN ports */
+       ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
+       ar71xx_eth1_data.speed = SPEED_1000;
+       ar71xx_eth1_data.duplex = DUPLEX_FULL;
+       ar71xx_eth1_data.has_ar7240_switch = 1;
+
+       ar71xx_add_device_mdio(0x0);
+       ar71xx_add_device_eth(1);
+       ar71xx_add_device_eth(0);
+
        platform_device_register(&rb750_leds_device);
+       platform_device_register(&rb750_nand_device);
 }
 
 MIPS_MACHINE(AR71XX_MACH_RB_750, "750i", "MikroTik RouterBOARD 750",