Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] On family D, rtl8365mb_pcs_config()
(drivers/net/dsa/realtek/rtl8365mb_main.c) now skips the…
--
net: dsa: realtek: rtl8365mb: add family D SDS13 PCS support
This patch extends the RTL8367S SGMII/HSGMII PCS code in rtl8365mb to
family D switches. On these switches the SerDes is reached through the
indexed SDS13 window and the SDS_MISC fields differ from family C. It adds
family D tuning tables and SDS_MISC programming, skips the steps that only
apply to family C, and stops advertising 10/100 Mbit/s on the family D
SerDes port.
> diff --git a/drivers/net/dsa/realtek/rtl8365mb_main.c b/drivers/net/dsa/realtek/rtl8365mb_main.c
> index 7500ea9b3a627..2e661ddd8cd23 100644
> --- a/drivers/net/dsa/realtek/rtl8365mb_main.c
> +++ b/drivers/net/dsa/realtek/rtl8365mb_main.c
[ ... ]
> @@ -1575,34 +1663,60 @@ static int rtl8365mb_pcs_config(struct phylink_pcs *pcs, unsigned int neg_mode,
[ ... ]
> ret = regmap_update_bits(priv->map, RTL8365MB_SDS_MISC_REG,
> - RTL8365MB_SDS_MISC_MAC8_SEL_SGMII_MASK |
> - RTL8365MB_SDS_MISC_MAC8_SEL_HSGMII_MASK,
> - mode == RTL8365MB_EXT_PORT_MODE_SGMII ?
> - RTL8365MB_SDS_MISC_MAC8_SEL_SGMII_MASK :
> - RTL8365MB_SDS_MISC_MAC8_SEL_HSGMII_MASK);
> + misc_mask, misc_val);
> if (ret)
> return ret;
>
> - val = mode << RTL8365MB_DIGITAL_INTERFACE_SELECT_MODE_OFFSET(id);
> - ret = regmap_update_bits(priv->map,
> - RTL8365MB_DIGITAL_INTERFACE_SELECT_REG(id),
> - RTL8365MB_DIGITAL_INTERFACE_SELECT_MODE_MASK(id),
> - val);
> - if (ret)
> - return ret;
> + if (!is_d) {
> + val = sds_mode << RTL8365MB_DIGITAL_INTERFACE_SELECT_MODE_OFFSET(id);
> + ret = regmap_update_bits(priv->map,
> + RTL8365MB_DIGITAL_INTERFACE_SELECT_REG(id),
> + RTL8365MB_DIGITAL_INTERFACE_SELECT_MODE_MASK(id),
> + val);
> + if (ret)
> + return ret;
> + }
>
> /* Take the SerDes out of reset. The vendor driver does this only
> * after the SerDes mux and the interface mode are configured.
> */
[Severity: Low]
On family D, rtl8365mb_pcs_config() no longer writes the
DIGITAL_INTERFACE_SELECT mode for the SerDes interface. Neither the code
nor the commit message gives a reason. Could a short comment here or a
sentence in the changelog explain it?
The skip itself looks necessary. id is RTL8365MB_SDS_EXT_INTERFACE_ID (1,
the family C id). On the RTL8367S-VB that id is the RGMII port 7, so the
write would overwrite port 7's mode. The family D mode values (0x02/0x12)
also don't fit in the 4-bit field.
Family D does still use this register, though.
rtl8365mb_ext_config_rgmii() programs it for the family D EXT1 RGMII port:
ret = regmap_update_bits(
priv->map, RTL8365MB_DIGITAL_INTERFACE_SELECT_REG(extint->id),
RTL8365MB_DIGITAL_INTERFACE_SELECT_MODE_MASK(extint->id),
...
On the SerDes path, the EXT0 mode field (bits 3:0 of
DIGITAL_INTERFACE_SELECT_REG0) keeps whatever the reset default, EEPROM
or bootloader left there. The comment just above also says the vendor
driver deasserts the SerDes reset only after "the interface mode" is
configured.
Does the vendor RTL8367D sequence leave the EXT0 select field alone
because the SDS_MISC mode field is enough to select the SerDes mode? Or
does it also program EXT0 at this point? If it does, could a bootloader
that leaves EXT0 in a non-SerDes mode keep the link from coming up?
The commit message covers the other family D differences (line rate
bypass, port 6 rate limiters, pause, 10/100 Mbit/s), but not this one.
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/236d…%40yahoo.com