Looking for support of TP-Link EAP225 v4

EAP225-Outdoor v3 support is now merged with 7e4de89e631a. This device won't be very different. Aside from the board name it's pretty much identical.

The watchdog on GPIO3/GPIO4 can always be added at a later point. The same hardware is at least also present on the EAP245v1, so perhaps this is also something all (single port) devices in this series have in common.

I did some tests using gpio-restart. They worked as expected for a regular reboot. This is a hack which covers not all cases.
This is the patch for rebooting.

diff --git a/target/linux/ath79/config-5.10 b/target/linux/ath79/config-5.10
index 75e282b..f8b9dc7 100644
--- a/target/linux/ath79/config-5.10
+++ b/target/linux/ath79/config-5.10
@@ -161,6 +159,8 @@ CONFIG_PHYLIB=y
 # CONFIG_PHY_AR7200_USB is not set
 # CONFIG_PHY_ATH79_USB is not set
diff --git a/target/linux/ath79/dts/qca9563_tplink_eap225-v4.dts b/target/linux/ath79/dts/qca9563_tplink_eap225-v4.dts
index 73de898..7e677a9 100644
--- a/target/linux/ath79/dts/qca9563_tplink_eap225-v4.dts
+++ b/target/linux/ath79/dts/qca9563_tplink_eap225-v4.dts
@@ -27,6 +27,15 @@
 			gpios = <&gpio 9 GPIO_ACTIVE_HIGH>;
+	gpio-restart {
+		compatible = "gpio-restart";
+		gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
+		priority = <254>;
+		active-delay = <100>;
+		inactive-delay = <100>;
+		wait-delay = <1800>;
+	};
 &eth0 {
diff --git a/target/linux/ath79/dts/qca9563_tplink_eap2x5-1port.dtsi b/target/linux/ath79/dts/qca9563_tplink_eap2x5-1port.dtsi
index 127741f..bbdfb01 100644
--- a/target/linux/ath79/dts/qca9563_tplink_eap2x5-1port.dtsi
+++ b/target/linux/ath79/dts/qca9563_tplink_eap2x5-1port.dtsi
@@ -108,7 +108,7 @@
 	phy6: ethernet-phy@6 {
 		reg = <6>;
-		reset-gpios = <&gpio 11 GPIO_ACTIVE_LOW>;

I had a look at TPLink's gpl code:

TPLink is using linux kernel 3.38.

  • linux/kernels/linux-3.3.8/drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c
    • In function ag71xx_phy_connect(struct ag71xx *ag) there is an explicit mdio bus reset which is not visible in the openwrt source.
  • linux/kernels/linux-3.3.8/drivers/net/phy/rtl8211.c
    • In rtl8211_config_init(struct phy_device *pdev) there is an explicit software reset (Bit 15) on init.
    • The phy is described in the openwrt source in drivers/net/phy/realtek.c
    • In rtl8211f_config_init(struct phy_device *phydev) (openwrt source) there is no reset and instead the delay configuration.

Various interesting files:


Thanks for investigating! In 5.15 this soft reset is also performed by the mainline driver (used by OpenWrt). 5.10 doesn't have this reset yet.

Now, this all occurs when initialising the phy on boot, not when shutting it down on shutdown or restart. If the ethernet port already works on both boot and reboot, I don't expect this soft reset to help make it work in u-boot after a reboot. Unless they've updated the bootloader, these devices don't have emergency TFTP loading support anyway, and you basically need to be next to the device to have serial access.

If you would like to add full reboot support using GPIO4, that's also fine for me. Just make sure you describe GPIO3, GPIO4, and the associated hardware in the commit message.