Skip to content

Commit 7703273

Browse files
tthayer-inteldavem330
authored andcommitted
net: ethernet: stmmac: Fix altr_tse_pcs SGMII Initialization
Fix NETDEV WATCHDOG timeout on startup by adding missing register writes that properly setup SGMII. Signed-off-by: Thor Thayer <[email protected]> Acked-by: Giuseppe Cavallaro <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 44abafc commit 7703273

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/net/ethernet/stmicro/stmmac/altr_tse_pcs.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
#define TSE_PCS_CONTROL_AN_EN_MASK BIT(12)
3838
#define TSE_PCS_CONTROL_REG 0x00
3939
#define TSE_PCS_CONTROL_RESTART_AN_MASK BIT(9)
40+
#define TSE_PCS_CTRL_AUTONEG_SGMII 0x1140
4041
#define TSE_PCS_IF_MODE_REG 0x28
4142
#define TSE_PCS_LINK_TIMER_0_REG 0x24
4243
#define TSE_PCS_LINK_TIMER_1_REG 0x26
@@ -65,6 +66,7 @@
6566
#define TSE_PCS_SW_RESET_TIMEOUT 100
6667
#define TSE_PCS_USE_SGMII_AN_MASK BIT(1)
6768
#define TSE_PCS_USE_SGMII_ENA BIT(0)
69+
#define TSE_PCS_IF_USE_SGMII 0x03
6870

6971
#define SGMII_ADAPTER_CTRL_REG 0x00
7072
#define SGMII_ADAPTER_DISABLE 0x0001
@@ -101,7 +103,9 @@ int tse_pcs_init(void __iomem *base, struct tse_pcs *pcs)
101103
{
102104
int ret = 0;
103105

104-
writew(TSE_PCS_USE_SGMII_ENA, base + TSE_PCS_IF_MODE_REG);
106+
writew(TSE_PCS_IF_USE_SGMII, base + TSE_PCS_IF_MODE_REG);
107+
108+
writew(TSE_PCS_CTRL_AUTONEG_SGMII, base + TSE_PCS_CONTROL_REG);
105109

106110
writew(TSE_PCS_SGMII_LINK_TIMER_0, base + TSE_PCS_LINK_TIMER_0_REG);
107111
writew(TSE_PCS_SGMII_LINK_TIMER_1, base + TSE_PCS_LINK_TIMER_1_REG);

0 commit comments

Comments
 (0)