Hello Adrian,

On 1/31/20 5:45 PM, Adrian Schmutzler wrote:
> Hi,
> 
> during support of the Ubiquiti Nanostation Loco XW, we encountered the 
> following
> blocks in ar71xx which are only present for devices not migrated to ath79 yet:
> 
> static struct mdio_board_info ubnt_loco_m_xw_mdio_info[] = {
>       {
>               [...]
>               .platform_data = &ubnt_loco_m_xw_at803x_data,
>       },
> };
> static struct at803x_platform_data ubnt_loco_m_xw_at803x_data = {
>       .has_reset_gpio = 1,
>       .reset_gpio = 0,
> };
> 
> How is this translated into ath79? The Loco XW (just merged to master [1]) 
> seems
> to work well with the setup we have right now, other devices with reset_gpio 
> are
> few:

AFAIR this is due to a hardware bug, which sometimes leads to the PHY ending up 
in
an unrecoverable state when the link-state changes. I assume, the person who did
the device integration simply did not encounter the bug.

Usage of reset GPIOs is documented here. [0]

> adsc@buildfff:/data/openwrt$ grep -rn "reset_gpio"
> target/linux/ar71xx/files/arch/
> target/linux/ar71xx/files/arch/mips/ath79/mach-rambutan.c:35:   
> .has_reset_gpio
> = 1,
> target/linux/ar71xx/files/arch/mips/ath79/mach-rambutan.c:36:   .reset_gpio =
> 17,
> target/linux/ar71xx/files/arch/mips/ath79/mach-rambutan.c:48:   
> .has_reset_gpio
> = 1,
> target/linux/ar71xx/files/arch/mips/ath79/mach-rambutan.c:50:   .reset_gpio =
> 23,
> target/linux/ar71xx/files/arch/mips/ath79/mach-ubnt-xm.c:485:   
> .has_reset_gpio
> = 1,
> target/linux/ar71xx/files/arch/mips/ath79/mach-ubnt-xm.c:486:   .reset_gpio = 
> 0,
> target/linux/ar71xx/files/arch/mips/ath79/mach-fritz450e.c:124: 
> .has_reset_gpio
> = 1,
> target/linux/ar71xx/files/arch/mips/ath79/mach-fritz450e.c:126: .reset_gpio =
> FRITZ450E_GPIO_PHY_RESET,

At least for the AVM Repeater 450E, the reason is simple: EVA puts the PHY in 
reset.
As the subsystem can handle reset-gpio handling, this is the preferred way of
pulling the device out of reset.

Can't speak about the other boards though. The bug on the Nanostation is not 
quite common,
as only the AR8030 (a FE-PHY) is affected.

[0] 
https://elixir.bootlin.com/linux/v4.19.100/source/Documentation/devicetree/bindings/net/phy.txt#L54

Best wishes
David

_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to