The DLL is a Qualcomm-specific hardware component integrated within the MAC and should be configured in bypass mode for 10 Mbps and 100 Mbps speeds. If not bypassed, the timing delay will be incorrectly applied, which will disrupt signal sampling. Fixes: a7c30e62d4b8 ("net: stmmac: Add driver for Qualcomm ethqos") Signed-off-by: Yijie Yang --- drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index d8fd4d8f6ced..a4ea72f86ca8 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -64,6 +64,9 @@ #define SDCC_DLL_CONFIG2_DDR_TRAFFIC_INIT_SW BIT(1) #define SDCC_DLL_CONFIG2_DDR_CAL_EN BIT(0) +/* SDCC_USR_CTL fields */ +#define SDCC_USR_CTL_DLL_BYPASS BIT(30) + /* SDC4_STATUS bits */ #define SDC4_STATUS_DLL_LOCK BIT(7) @@ -609,6 +612,17 @@ static int ethqos_configure_rgmii(struct qcom_ethqos *ethqos, int speed) if (speed == SPEED_1000) ethqos_dll_configure(ethqos); + /* The DLL (Delay Locked Loop) aligns the clock and samples data + * in RGMII interfaces. It should be bypassed for 10 Mbps and + * 100 Mbps speeds. + */ + if (speed == SPEED_10 || speed == SPEED_100) { + rgmii_updatel(ethqos, SDCC_DLL_CONFIG_PDN, SDCC_DLL_CONFIG_PDN, + SDCC_HC_REG_DLL_CONFIG); + rgmii_updatel(ethqos, SDCC_USR_CTL_DLL_BYPASS, + SDCC_USR_CTL_DLL_BYPASS, SDCC_USR_CTL); + } + ethqos_rgmii_macro_init(ethqos, speed); return 0; -- 2.34.1