From af4a0c34e128d8e1bcb5225ad4daefdc748def56 Mon Sep 17 00:00:00 2001 From: Gabor Juhos Date: Wed, 4 Jan 2012 21:10:12 +0000 Subject: [PATCH] backfire: ar71xx: fixes some stuffs for TP-LINK TL-MR3420 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 --- .../etc/defconfig/tl-mr3420/network | 24 +++++++++++++++++++ .../files/arch/mips/ar71xx/mach-tl-mr3420.c | 9 ++++--- 2 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 target/linux/ar71xx/base-files/etc/defconfig/tl-mr3420/network 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 index 0000000000..de201bf5ec --- /dev/null +++ b/target/linux/ar71xx/base-files/etc/defconfig/tl-mr3420/network @@ -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" diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-tl-mr3420.c b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-tl-mr3420.c index 76a917e930..2d2b05f560 100644 --- a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-tl-mr3420.c +++ b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-tl-mr3420.c @@ -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); -- 2.30.2