From cd28edd6ecb7b1fe8ffceb13f8dd467278bb7d9a Mon Sep 17 00:00:00 2001 From: Sander Vanheule Date: Tue, 21 Jul 2020 21:49:53 +0200 Subject: [PATCH] ath79: use hardware MDIO on MikroTik RouterBOARD wAP G-5HacT2HnD Instead of using a bit-banged GPIO, configure the GPIO output mux to use the SoC's MDIO functionality. According to the QCA955x datasheet, MDIO1 is associated with the use of SGMII. The following changes are also made: * Drop phy-mode from phy0: the ar71xx driver looks for this property in ethX nodes, but the correct value is already specified in the dtsi. * Drop the deprecated 'device-type = "ethernet-phy"' for phy0. Signed-off-by: Sander Vanheule [drop mdio2 from aliases] Signed-off-by: Adrian Schmutzler --- ...6_mikrotik_routerboard-wap-g-5hact2hnd.dts | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/target/linux/ath79/dts/qca9556_mikrotik_routerboard-wap-g-5hact2hnd.dts b/target/linux/ath79/dts/qca9556_mikrotik_routerboard-wap-g-5hact2hnd.dts index a3f9ec28a4..dbfe773577 100644 --- a/target/linux/ath79/dts/qca9556_mikrotik_routerboard-wap-g-5hact2hnd.dts +++ b/target/linux/ath79/dts/qca9556_mikrotik_routerboard-wap-g-5hact2hnd.dts @@ -10,7 +10,6 @@ model = "MikroTik RouterBOARD wAP G-5HacT2HnD"; aliases { - mdio-gpio1 = &mdio2; serial0 = &uart; }; @@ -24,23 +23,27 @@ debounce-interval = <60>; }; }; +}; - mdio2: mdio { - compatible = "virtual,mdio-gpio"; +&pinmux { + mdio_pins: mdio_pins { + /* GPIO 11 as MDIO(0x20), GPIO 12 as MDC(0x21) */ + pinctrl-single,bits = <0x8 0x20000000 0xff000000>, + <0xc 0x00000021 0x000000ff>; + }; +}; - gpios = <&gpio 12 GPIO_ACTIVE_HIGH>, /* MDC */ - <&gpio 11 GPIO_ACTIVE_HIGH>; /* MDIO */ - #address-cells = <1>; - #size-cells = <0>; +&mdio1 { + status = "okay"; - phy0: ethernet-phy@0 { - reg = <0>; - device_type = "ethernet-phy"; + pinctrl-names = "default"; + pinctrl-0 = <&mdio_pins>; - phy-mode = "sgmii"; + phy-mask = <0x1>; - at803x-override-sgmii-link-check; - }; + phy0: ethernet-phy@0 { + reg = <0>; + at803x-override-sgmii-link-check; }; }; -- 2.30.2