ar71xx: add initial support for the TL-WR741ND v4 board
[openwrt/openwrt.git] / target / linux / ar71xx / files / arch / mips / ar71xx / mach-rb750.c
index 9c8386b7ba3510470a24e6bd0d976fe44d83d44c..547ad12d3f1d007500d7ee094a4e566ac5909991 100644 (file)
@@ -14,7 +14,6 @@
 
 #include "machtype.h"
 #include "devices.h"
-#include "dev-ap91-eth.h"
 
 static struct rb750_led_data rb750_leds[] = {
        {
@@ -56,13 +55,6 @@ static struct platform_device rb750_leds_device = {
        }
 };
 
-static const char *rb750_port_names[AP91_ETH_NUM_PORT_NAMES] __initdata = {
-       "port5",
-       "port4",
-       "port3",
-       "port2",
-};
-
 static struct platform_device rb750_nand_device = {
        .name   = "rb750-nand",
        .id     = -1,
@@ -111,7 +103,7 @@ int rb750_latch_change(u32 mask_clr, u32 mask_set)
 
        ret = 1;
 
- unlock:
+unlock:
        spin_unlock_irqrestore(&lock, flags);
        return ret;
 }
@@ -127,7 +119,22 @@ static void __init rb750_setup(void)
 
        ar71xx_init_mac(ar71xx_eth0_data.mac_addr, ar71xx_mac_base, 0);
        ar71xx_init_mac(ar71xx_eth1_data.mac_addr, ar71xx_mac_base, 1);
-       ap91_eth_init(rb750_port_names);
+
+       /* 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);