openwrt/target/linux/realtek
Markus Stockhausen 945a335f66 realtek: ethernet: Improve SMI polling configuration based on DTS
Although Zyxel XGS1210 devices are not yet officially supported there
are several patches floating around to enable them. This is a very imporant
one because it fixes a SMI misconfiguration. In the known DTS the SFP+
port settings are set as follows.

  phy26: ethernet-phy@26 {
    compatible = "ethernet-phy-ieee802.3-c45";
    phy-is-integrated;
    reg = <26>;
    sds = < 8 >;
  };

  phy27: ethernet-phy@27 {
    compatible = "ethernet-phy-ieee802.3-c45";
    phy-is-integrated;
    reg = <27>;
    sds = < 9 >;
  };

So these are PHYs linked to an internal SerDes. During initialization
rtl838x_mdio_init() generates smi_bus=0 & smi_addr=27/28 for these ports.
Although this seems like a valid configuration integrated PHYs attached
to an SerDes do not have an SMI bus. Later on the mdio reset wrongly feeds
the SMI registers and as a result the PHYs on SMI bus 0 do not work.

Without patch (loaded with rtk network on & initramfs):

...
mdio_bus mdio-bus: MDIO device at address 0 is missing.
mdio_bus mdio-bus: MDIO device at address 1 is missing.
mdio_bus mdio-bus: MDIO device at address 2 is missing.
mdio_bus mdio-bus: MDIO device at address 3 is missing.
mdio_bus mdio-bus: MDIO device at address 4 is missing.
mdio_bus mdio-bus: MDIO device at address 5 is missing.
mdio_bus mdio-bus: MDIO device at address 6 is missing.
mdio_bus mdio-bus: MDIO device at address 7 is missing.
...
rtl83xx-switch ... : no phy at 0
rtl83xx-switch ... : failed to connect to PHY: -ENODEV
rtl83xx-switch ... : error -19 setting up PHY for tree 0, switch 0, port 0
rtl83xx-switch ... : no phy at 1
rtl83xx-switch ... : failed to connect to PHY: -ENODEV
rtl83xx-switch ... : error -19 setting up PHY for tree 0, switch 0, port 1
...

With patch (loaded with rtk network on & initramfs):

...
rtl83xx-switch ... : PHY [mdio-bus:00] driver [REALTEK RTL8218D] (irq=POLL)
rtl83xx-switch ... : PHY [mdio-bus:01] driver [REALTEK RTL8218D] (irq=POLL)
...

Signed-off-by: Birger Koblitz <git@birger-koblitz.de>
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/16457
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-10-27 22:26:25 +01:00
..
base-files realtek: d-link: add support for dgs-1210-28p-f 2024-09-24 20:59:50 +02:00
dts realtek: remove wrong SMI bus from XGS1250 2024-10-27 22:26:25 +01:00
files/firmware/rtl838x_phy
files-6.6 realtek: ethernet: Improve SMI polling configuration based on DTS 2024-10-27 22:26:25 +01:00
image realtek: add support for Linksys LGS310C 2024-10-02 20:15:21 +02:00
patches-6.6 realtek: refresh patches 2024-10-17 19:31:38 +02:00
profiles target: use SPDX license identifiers on Makefiles 2021-02-10 15:47:18 +01:00
rtl838x realtek: drop 5.15 support 2024-09-20 11:16:02 +02:00
rtl839x kernel: Reorder config files 2024-10-22 21:13:26 +02:00
rtl930x realtek: drop 5.15 support 2024-09-20 11:16:02 +02:00
rtl931x realtek: drop 5.15 support 2024-09-20 11:16:02 +02:00
Makefile realtek: default to 6.6 2024-09-17 21:21:37 +02:00