Hi Jonathan,

> OK, I've mapped the leds and the buttons. I've also moved the eth
> fixup into the pre-init. If it's in the regular init, then failsafe
> doesn't work, because the ethernet port never comes online. The mach
> file is a bit cleaner, now, too. Failsafe is confirmed to work
> correctly. Please push this patch into trunk rather than the earlier
> submitted one.
> 
> For the record, flashing this board without mii-tool is a bad idea. It
> is selected by default. If one doesn't update and install the package
> feed, though, the firmware will not include mii-tool. Flashing an
> image without mii-tool would semi-brick this board. It would require a
> serial cable to recover.
> 
> To my knowledge, everything works as intended.
> 
> Cheers,
> Signed off by Jonathan Bennett <jbscienc...@gmail.com>
> 

<...>

> 
> +static void __init tl_wa901nd_v2_setup(void)
> +{
> +     u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
> +     u8 *eeprom  = (u8 *) KSEG1ADDR(0x1fff1000);
> +
> +        ar71xx_init_mac(ar71xx_eth0_data.mac_addr, mac, 0);
> +
> +        ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
> +        ar71xx_eth0_data.speed       = SPEED_100;
> +        ar71xx_eth0_data.duplex      = DUPLEX_FULL;

You don't have to specify the speed and duplex values if you are using a 
phy_mask.

> +        ar71xx_eth0_data.phy_mask = 0xffffffff;      /* I don't really
> know the correct value here.
> +                                              * This selects any present phy.
> +                                              */

You should be able to determine the correct value from dmesg.

> +     ar71xx_add_device_mdio(0x0);
> +
> +     ar71xx_add_device_eth(0);
> +
> +     ar71xx_add_device_m25p80(&tl_wa901nd_v2_flash_data);
> +
> +     ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(tl_wa901nd_v2_leds_gpio),
> +                                     tl_wa901nd_v2_leds_gpio);
> +
> +     ar71xx_add_device_gpio_buttons(-1, TL_WA901ND_V2_BUTTONS_POLL_INTERVAL,
> +                                     ARRAY_SIZE(tl_wa901nd_v2_gpio_buttons),
> +                                     tl_wa901nd_v2_gpio_buttons);
> +
> +        ar913x_add_device_wmac(eeprom, mac);
> +}
> +
> +MIPS_MACHINE(AR71XX_MACH_TL_WA901ND_V2, "TL-WA901ND-v2", "TP-LINK
> TL-WA901ND v2",
> +          tl_wa901nd_v2_setup);

<...>

> Index: target/linux/ar71xx/base-files/lib/preinit/05_set_preinit_iface_ar71xx
> ===================================================================
> --- target/linux/ar71xx/base-files/lib/preinit/05_set_preinit_iface_ar71xx    
> (revision
> 25355)
> +++ target/linux/ar71xx/base-files/lib/preinit/05_set_preinit_iface_ar71xx    
> (working
> copy)
> @@ -8,6 +8,11 @@
> 
>  set_preinit_iface() {
>       ifname=eth0
> +     [ $(ar71xx_board_name) = "tl-wa901nd-v2" ] && mii-tool -R
> +     /* The TP-link WA901ND V2 requires a hardware reset of
> +      * its ethernet port before it will connect.
> +      */
> +

This looks strange. The phy core should reset the PHY automatically. Please try
to add this line into the machine setup code, somewhere before the
'ar71xx_add_device_eth(0)' call:

ar71xx_eth0_data.reset_bit = RESET_MODULE_GE0_MAC | RESET_MODULE_GE0_PHY;

Regards,
Gabor
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to