openwrt/target/linux/realtek/dts
Markus Stockhausen 17822d5d18
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
realtek: use consistent definition in DTS for SFP(+) ports
We are slowly getting to the point where the mdio driver will be
carved out from the ethernet driver. Since the beginning it had
the feature to hand out SFP serdes as phys. So one can access
them from the phy driver. This will be kept during the final
migration and it even will provide a consistent interface for the
phy/serdes registers.

With this being done we need to identify how to handle the affected
ports in a generic way for all targets. Doing first things first,
this starts with a consistent DTS. Currently we have:

for RTL838x + Zyxel XGS1210:
  phy-mode = "1000base-x"
  managed = "in-band-status"
  phy-handle = ...

for all other RTL93x devices:
  phy-mode = "10gbase-r"
  managed = "in-band-status"
  pseudo-phy-handle = ...

Looking at the phylink kernel code one can see a nifty detail.
There is dynamic phy bringup depending on the mode.

int phylink_fwnode_phy_connect(struct phylink *pl,
                               const struct fwnode_handle *fwnode,
                               u32 flags)
{
        struct fwnode_handle *phy_fwnode;
        struct phy_device *phy_dev;
        int ret;

        /* Fixed links and 802.3z are handled without needing a PHY */
        if (pl->cfg_link_an_mode == MLO_AN_FIXED ||
            (pl->cfg_link_an_mode == MLO_AN_INBAND &&
             phy_interface_mode_is_8023z(pl->link_interface)))
                return 0;
        ...
}

Where 802.3z means 1000base-x or 2500base-x. Aligning this with
IEEE specs it means essentially:

- 10gbase-r defined ports with phy-handle must statically bring up
  a phylink from the beginning that immediately depends on a
  phy read_status() implementation.

- 1000base-x/2500base-x defined ports will dynamically bringup a
  phylink during link detection regardless of a phy-handle. So
  it usually runs at the moment when a SFP has been plugged in.

We currently still rely on a phy-handle but do not want to bring
up the phy immediately. Commit 4457c1eee4 ("realtek: rtl93xx:
support SFPs with phys") tried to fix exactly that error for
10gbase-r definied ports. Kernel shows "sfp sfp-p8: sfp_add_phy
failed: -EBUSY" in that case.

But it did it in the wrong way. It implemented a workaround by
introducing a DTS property "pseudo-phy-handle". Instead it
should have simply converted the DTS nodes to 1000base-x.

Revert the commit and fix the DTS with wrong definitions. From
now on we have a consistent SFP definition throughout all DTS
and targets.

Aside from the positive effect this setting has it is more or
less an arbitrary speed definition. When plugging in the SFP the
real speed will be choosen dynamically.

Fixes: 4457c1eee4 ("realtek: rtl93xx: support SFPs with phys")
Tested-By: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/19648
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-08-07 13:47:27 +02:00
..
rtl83xx_d-link_dgs-1210_common.dtsi realtek: Drop unused property on DGS-1210 gpio0 2025-01-28 07:30:32 +01:00
rtl83xx_d-link_dgs-1210_gpio.dtsi realtek: switch RTL8231 driver for D-Link DGS-1210 2025-01-28 07:30:33 +01:00
rtl83xx_d-link_dgs-1210_gpio_sfp.dtsi realtek: add full SFP support to D-Link DGS-1210-28 series 2024-09-15 16:40:40 +02:00
rtl83xx_hpe_1920.dtsi realtek: add support for HPE 1920-48G (JG927A) and 1920-48G-PoE (JG928A) 2024-09-17 21:44:34 +02:00
rtl83xx_panasonic_mxxeg-pn28xx0k.dtsi realtek: normalize dts directory 2024-09-14 16:56:37 +02:00
rtl838x.dtsi realtek: add dts helper for internal phy with serdes 2025-06-22 16:37:32 +02:00
rtl839x.dtsi realtek: add dts helper for internal phy with serdes 2025-06-22 16:37:32 +02:00
rtl930x.dtsi realtek: add NAND hardware description to RTL93xx 2025-07-30 23:22:24 +02:00
rtl931x.dtsi realtek: add NAND hardware description to RTL93xx 2025-07-30 23:22:24 +02:00
rtl8380_d-link_dgs-1210-10mp-f.dts realtek: make use of serdes helper for D-Link DGS-1210-10MP 2025-06-22 16:37:32 +02:00
rtl8380_engenius_ews2910p-v1.dts realtek: engenius_ews2910p: support multiple hardware versions 2025-05-31 23:19:01 +02:00
rtl8380_engenius_ews2910p-v3.dts realtek: support EnGenius EWS2910P v3 2025-05-31 23:19:01 +02:00
rtl8380_engenius_ews2910p.dtsi realtek: make use of serdes helper for Engenius EWS2910P 2025-06-22 16:37:32 +02:00
rtl8380_hpe_1920-8g-poe-65w.dts realtek: normalize dts directory 2024-09-14 16:56:37 +02:00
rtl8380_hpe_1920-8g-poe-180w.dts realtek: HPE 1920 8G PoE+ 180W move fans to hwmon 2025-01-15 08:21:08 +01:00
rtl8380_hpe_1920-8g.dts realtek: normalize dts directory 2024-09-14 16:56:37 +02:00
rtl8380_hpe_1920-8g.dtsi realtek: make use of serdes helper for HPE 1920 8G 2025-06-22 16:37:33 +02:00
rtl8380_linksys_lgs310c.dts realtek: make use of serdes helper for Linksys LGS310C 2025-06-22 16:37:32 +02:00
rtl8380_netgear_gigabit.dtsi realtek: Simple conversions to RTL8231 MFD driver 2025-01-26 21:46:44 +01:00
rtl8380_netgear_gs108t-v3.dts realtek: normalize dts directory 2024-09-14 16:56:37 +02:00
rtl8380_netgear_gs110tpp-v1.dts realtek: add PoE enable line to Netgear GS110TPP 2025-01-28 20:59:04 +01:00
rtl8380_netgear_gs110tup-v1.dts realtek: normalize dts directory 2024-09-14 16:56:37 +02:00
rtl8380_netgear_gs308t-v1.dts realtek: normalize dts directory 2024-09-14 16:56:37 +02:00
rtl8380_netgear_gs310tp-v1.dts realtek: make use of serdes helper for Netgear GS310TP v1 2025-06-22 16:37:33 +02:00
rtl8380_panasonic_m8eg-pn28080k.dts realtek: make use of serdes helper for Panasonic M8EG PN28080K 2025-06-22 16:37:33 +02:00
rtl8380_tplink_sg2xxx.dtsi realtek: make use of serdes helper for TP-Link SG2xxx 2025-06-22 16:37:33 +02:00
rtl8380_tplink_sg2008p-v1.dts realtek: normalize dts directory 2024-09-14 16:56:37 +02:00
rtl8380_tplink_sg2210p-v3.dts realtek: normalize dts directory 2024-09-14 16:56:37 +02:00
rtl8380_zyxel_gs1900-8-v1.dts realtek: Split Zyxel GS1900-8 into v1 and v2 2025-01-25 15:07:13 +01:00
rtl8380_zyxel_gs1900-8-v2.dts realtek: Split Zyxel GS1900-8 into v1 and v2 2025-01-25 15:07:13 +01:00
rtl8380_zyxel_gs1900-8hp-v1.dts realtek: Move GS1900 external GPIO to new DTSI 2025-01-25 15:06:03 +01:00
rtl8380_zyxel_gs1900-8hp-v2.dts realtek: Move GS1900 external GPIO to new DTSI 2025-01-25 15:06:03 +01:00
rtl8380_zyxel_gs1900-10hp.dts realtek: make use of serdes helper for Zyxel GS1900-10HP 2025-06-22 16:37:33 +02:00
rtl8380_zyxel_gs1900.dtsi realtek: Move GS1900 external GPIO to new DTSI 2025-01-25 15:06:03 +01:00
rtl8380_zyxel_gs1900_gpio.dtsi realtek: Move GS1900 external GPIO to new DTSI 2025-01-25 15:06:03 +01:00
rtl8380_zyxel_gs1900_gpio_emulated.dtsi realtek: Move GS1900 external GPIO to new DTSI 2025-01-25 15:06:03 +01:00
rtl8382_allnet_all-sg8208m.dts realtek: normalize dts directory 2024-09-14 16:56:37 +02:00
rtl8382_apresia_aplgs120gtss.dts realtek: Switch ApresiaLightGS120GT-SS RTL8231 driver 2025-01-28 20:55:09 +01:00
rtl8382_d-link_dgs-1210-10p.dts realtek: make use of serdes helper for D-Link DGS-1210-10P 2025-06-22 16:37:33 +02:00
rtl8382_d-link_dgs-1210-16.dts realtek: normalize dts directory 2024-09-14 16:56:37 +02:00
rtl8382_d-link_dgs-1210-20.dts realtek: normalize dts directory 2024-09-14 16:56:37 +02:00
rtl8382_d-link_dgs-1210-26.dts realtek: make use of serdes helper for D-Link DGS-1210-26 2025-06-22 16:37:33 +02:00
rtl8382_d-link_dgs-1210-28.dts realtek: add full SFP support to D-Link DGS-1210-28 series 2024-09-15 16:40:40 +02:00
rtl8382_d-link_dgs-1210-28_common.dtsi realtek: add full SFP support to D-Link DGS-1210-28 series 2024-09-15 16:40:40 +02:00
rtl8382_d-link_dgs-1210-28mp-f.dts realtek: d-link: add support for dgs-1210-28p-f 2024-09-24 20:59:50 +02:00
rtl8382_d-link_dgs-1210-28p-f.dts realtek: d-link: add support for dgs-1210-28p-f 2024-09-24 20:59:50 +02:00
rtl8382_d-link_dgs-1210-28p_common.dtsi realtek: d-link: add support for dgs-1210-28p-f 2024-09-24 20:59:50 +02:00
rtl8382_hpe_1920-16g.dts realtek: normalize dts directory 2024-09-14 16:56:37 +02:00
rtl8382_hpe_1920-24g-poe-180w.dts realtek: HPE 1920 24G PoE+ 180W/370W move fans to hwmon 2025-01-16 07:32:16 +01:00
rtl8382_hpe_1920-24g-poe-370w.dts realtek: HPE 1920 24G PoE+ 180W/370W move fans to hwmon 2025-01-16 07:32:16 +01:00
rtl8382_hpe_1920-24g.dts realtek: rtl838x: refactor hpe_1920-24g dts 2024-12-31 08:29:56 +01:00
rtl8382_hpe_1920-24g.dtsi realtek: rtl838x: refactor hpe_1920-24g dts 2024-12-31 08:29:56 +01:00
rtl8382_hpe_1920.dtsi realtek: switch RTL8231 driver for HPE 1920-16/24G 2025-01-12 17:30:23 +01:00
rtl8382_inaba_aml2-17gp.dts realtek: normalize dts directory 2024-09-14 16:56:37 +02:00
rtl8382_iodata_bsh-g24mb.dts realtek: Simple conversions to RTL8231 MFD driver 2025-01-26 21:46:44 +01:00
rtl8382_panasonic_m16eg-pn28160k.dts realtek: normalize dts directory 2024-09-14 16:56:37 +02:00
rtl8382_panasonic_m24eg-pn28240k.dts realtek: normalize dts directory 2024-09-14 16:56:37 +02:00
rtl8382_tplink_t1600g-28ts-v3.dts realtek: normalize dts directory 2024-09-14 16:56:37 +02:00
rtl8382_zyxel_gs1900-16.dts realtek: Move GS1900 external GPIO to new DTSI 2025-01-25 15:06:03 +01:00
rtl8382_zyxel_gs1900-24-v1.dts realtek: make use of serdes helper for Zyxel GS1900-24(HP) v1/v2 2025-06-22 16:37:33 +02:00
rtl8382_zyxel_gs1900-24e.dts realtek: Move GS1900 external GPIO to new DTSI 2025-01-25 15:06:03 +01:00
rtl8382_zyxel_gs1900-24ep.dts realtek: Move GS1900 external GPIO to new DTSI 2025-01-25 15:06:03 +01:00
rtl8382_zyxel_gs1900-24hp-v1.dts realtek: make use of serdes helper for Zyxel GS1900-24(HP) v1/v2 2025-06-22 16:37:33 +02:00
rtl8382_zyxel_gs1900-24hp-v2.dts realtek: make use of serdes helper for Zyxel GS1900-24(HP) v1/v2 2025-06-22 16:37:33 +02:00
rtl8393_d-link_dgs-1210-52.dts realtek: fix cpu port link type 2025-05-06 10:56:58 +02:00
rtl8393_hpe_1920-48g-poe.dts rtl839x: fix sfp ports on HPE 1920-48G PoE 2025-06-22 11:13:01 +02:00
rtl8393_hpe_1920-48g.dts realtek: switch HP-1920-48G to new shared gpio driver 2025-06-22 11:13:01 +02:00
rtl8393_hpe_1920.dtsi rtl839x: fix sfp ports on HPE 1920-48G PoE 2025-06-22 11:13:01 +02:00
rtl8393_netgear_gs750e.dts realtek: fix cpu port link type 2025-05-06 10:56:58 +02:00
rtl8393_panasonic_m48eg-pn28480k.dts realtek: normalize dts directory 2024-09-14 16:56:37 +02:00
rtl8393_tplink_sg2452p-v4.dts realtek: align port names 2025-06-12 14:12:38 +02:00
rtl8393_zyxel_gs1900-48.dts realtek: Zyxel GS1900-48 dts fixes 2025-08-03 15:33:36 +02:00
rtl9302_zyxel_xgs1210-12.dts realtek: use consistent definition in DTS for SFP(+) ports 2025-08-07 13:47:27 +02:00
rtl9302_zyxel_xgs1250-12.dts realtek: use consistent definition in DTS for SFP(+) ports 2025-08-07 13:47:27 +02:00
rtl9303_hasivo_s1100w-8xgt-se.dts realtek: add support for Hasivo S1100W-8XGT-SE switch 2025-07-27 18:50:03 +02:00
rtl9303_tplink_tl-st1008f_v2.dts realtek: use consistent definition in DTS for SFP(+) ports 2025-08-07 13:47:27 +02:00
rtl9303_vimin_vm-s100-0800ms.dts realtek: use consistent definition in DTS for SFP(+) ports 2025-08-07 13:47:27 +02:00
rtl9303_xikestor_sks8300-8x.dts realtek: use consistent definition in DTS for SFP(+) ports 2025-08-07 13:47:27 +02:00