backfire: ar71xx: fixes some stuffs for TP-LINK TL-MR3420
authorGabor Juhos <juhosg@openwrt.org>
Wed, 4 Jan 2012 21:10:12 +0000 (21:10 +0000)
committerGabor Juhos <juhosg@openwrt.org>
Wed, 4 Jan 2012 21:10:12 +0000 (21:10 +0000)
The patch fixes the following:

- Default network configuration
- QSS and reset buttons (failsafe is now working)
- PHY mask definition for the WAN interface
- And the WiFi LED is now working

Patch-by: Magyar Szabolcs (from #10724)
SVN-Revision: 29661

target/linux/ar71xx/base-files/etc/defconfig/tl-mr3420/network [new file with mode: 0644]
target/linux/ar71xx/files/arch/mips/ar71xx/mach-tl-mr3420.c

diff --git a/target/linux/ar71xx/base-files/etc/defconfig/tl-mr3420/network b/target/linux/ar71xx/base-files/etc/defconfig/tl-mr3420/network
new file mode 100644 (file)
index 0000000..de201bf
--- /dev/null
@@ -0,0 +1,24 @@
+config interface loopback
+       option ifname   lo
+       option proto    static
+       option ipaddr   127.0.0.1
+       option netmask  255.0.0.0
+
+config interface lan
+       option ifname   eth0
+       option type     bridge
+       option proto    static
+       option ipaddr   192.168.1.1
+       option netmask  255.255.255.0
+
+config interface wan
+       option ifname   eth1
+       option proto    dhcp
+
+config switch eth0
+       option enable_vlan      1
+
+config switch_vlan
+       option device   eth0
+       option vlan     1
+       option ports    "0 1 2 3 4"
index 76a917e93019ada60f35e4a668fd2fcf674bf9e9..2d2b05f560e0c8a64155f1ec2344ac189a0ddffa 100644 (file)
@@ -90,14 +90,14 @@ static struct gpio_button tl_mr3420_gpio_buttons[] __initdata = {
        {
                .desc           = "reset",
                .type           = EV_KEY,
-               .code           = KEY_RESTART,
+               .code           = BTN_0,
                .threshold      = 3,
                .gpio           = TL_MR3420_GPIO_BTN_RESET,
                .active_low     = 1,
        }, {
                .desc           = "qss",
                .type           = EV_KEY,
-               .code           = KEY_WPS_BUTTON,
+               .code           = BTN_1,
                .threshold      = 3,
                .gpio           = TL_MR3420_GPIO_BTN_QSS,
                .active_low     = 1,
@@ -123,13 +123,13 @@ static void __init tl_mr3420_setup(void)
                                        tl_mr3420_gpio_buttons);
 
        ar71xx_eth1_data.has_ar7240_switch = 1;
-
        ar71xx_set_mac_base(mac);
 
        /* 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;
@@ -142,7 +142,10 @@ static void __init tl_mr3420_setup(void)
 
        ar71xx_add_device_usb();
 
+       ap91_pci_setup_wmac_led_pin(0);
+
        ap91_pci_init(ee, mac);
 }
+
 MIPS_MACHINE(AR71XX_MACH_TL_MR3420, "TL-MR3420", "TP-LINK TL-MR3420",
             tl_mr3420_setup);