Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

phy: ti: phy-j721e-wiz: Add SGMII support in wiz driver for J7200

Select the same mac divider for SGMII too as the one being used for
QSGMII.

Enable full rate divider configuration support for J721E_WIZ_10G for
SGMII.

Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Signed-off-by: Roger Quadros <rogerq@kernel.org>
Link: https://lore.kernel.org/r/20220628122255.24265-2-rogerq@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Siddharth Vadapalli and committed by
Vinod Koul
27ecdd07 568035b0

+13 -6
+13 -6
drivers/phy/ti/phy-j721e-wiz.c
··· 325 325 int i; 326 326 327 327 for (i = 0; i < num_lanes; i++) { 328 - if (wiz->lane_phy_type[i] == PHY_TYPE_QSGMII) { 328 + if (wiz->lane_phy_type[i] == PHY_TYPE_SGMII || 329 + wiz->lane_phy_type[i] == PHY_TYPE_QSGMII) { 329 330 ret = regmap_field_write(wiz->p_mac_div_sel0[i], 1); 330 331 if (ret) 331 332 return ret; ··· 1026 1025 1027 1026 static int wiz_phy_fullrt_div(struct wiz *wiz, int lane) 1028 1027 { 1029 - if (wiz->type != AM64_WIZ_10G) 1028 + switch (wiz->type) { 1029 + case AM64_WIZ_10G: 1030 + if (wiz->lane_phy_type[lane] == PHY_TYPE_PCIE) 1031 + return regmap_field_write(wiz->p0_fullrt_div[lane], 0x1); 1032 + break; 1033 + case J721E_WIZ_10G: 1034 + if (wiz->lane_phy_type[lane] == PHY_TYPE_SGMII) 1035 + return regmap_field_write(wiz->p0_fullrt_div[lane], 0x2); 1036 + break; 1037 + default: 1030 1038 return 0; 1031 - 1032 - if (wiz->lane_phy_type[lane] == PHY_TYPE_PCIE) 1033 - return regmap_field_write(wiz->p0_fullrt_div[lane], 0x1); 1034 - 1039 + } 1035 1040 return 0; 1036 1041 } 1037 1042