mirror of
https://git.openwrt.org/openwrt/openwrt.git
synced 2026-01-28 03:37:17 +01:00
realtek: pcs: cover number of links per SerDes for USXGMII
A SerDes may supply multiple ports and depending on that number, different hardware modes need to be used. While there are corresponding modes in the kernel in some cases (e.g. USXGMII with 4 2.5G ports aka 10G-QXGMII), this doesn't always map to Realtek hardware modes. Use the previously added link number accounting for that. An obvious example of this is the SerDes on XGS12xx-12 switches which is connected to an octa-PHY. This runs Realtek proprietary XSGMII mode (10G-pumped SGMII interface) for which there is no corresponding mode in the kernel. Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com> Link: https://github.com/openwrt/openwrt/pull/21365 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
This commit is contained in:
parent
76f392194b
commit
7cd3407fde
1 changed files with 11 additions and 2 deletions
|
|
@ -285,6 +285,8 @@ static int rtpcs_sds_determine_hw_mode(struct rtpcs_serdes *sds,
|
|||
phy_interface_t if_mode,
|
||||
enum rtpcs_sds_mode *hw_mode)
|
||||
{
|
||||
u8 n_links = sds->num_of_links;
|
||||
|
||||
switch (if_mode) {
|
||||
case PHY_INTERFACE_MODE_NA:
|
||||
*hw_mode = RTPCS_SDS_MODE_OFF;
|
||||
|
|
@ -308,8 +310,15 @@ static int rtpcs_sds_determine_hw_mode(struct rtpcs_serdes *sds,
|
|||
*hw_mode = RTPCS_SDS_MODE_QSGMII;
|
||||
break;
|
||||
case PHY_INTERFACE_MODE_USXGMII:
|
||||
/* TODO: set this depending on number of links on SerDes */
|
||||
*hw_mode = RTPCS_SDS_MODE_USXGMII_10GSXGMII;
|
||||
if (n_links == 1)
|
||||
*hw_mode = RTPCS_SDS_MODE_USXGMII_10GSXGMII;
|
||||
else if (n_links == 2)
|
||||
*hw_mode = RTPCS_SDS_MODE_USXGMII_10GDXGMII;
|
||||
else if (n_links <= 4)
|
||||
*hw_mode = RTPCS_SDS_MODE_USXGMII_10GQXGMII;
|
||||
else if (n_links <= 8)
|
||||
*hw_mode = RTPCS_SDS_MODE_XSGMII;
|
||||
|
||||
break;
|
||||
case PHY_INTERFACE_MODE_10G_QXGMII:
|
||||
*hw_mode = RTPCS_SDS_MODE_USXGMII_10GQXGMII;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue