Skip to content

Commit d802e63

Browse files
0xharshalrobimarko
authored andcommitted
realtek: rtl931x: Support enable/disable SMI Polling for SerDes ports
During PHY matching, the SMI polling must be disabled to avoid conflicts during the complex detection routine. Only after this finished, SMI polling is allowed again. This was implemented for all realtek families besides RTL931x. Signed-off-by: Harshal Gohel <hg@simonwunderlich.de> Signed-off-by: Sharadanand Karanjkar <sk@simonwunderlich.de> Link: openwrt#19603 Signed-off-by: Robert Marko <robimarko@gmail.com>
1 parent 848887b commit d802e63

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

target/linux/realtek/files-6.12/drivers/net/phy/rtl83xx-phy.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,10 @@ static u64 disable_polling(int port)
120120
sw_w32_mask(BIT(port), 0, RTL930X_SMI_POLL_CTRL);
121121
break;
122122
case RTL9310_FAMILY_ID:
123-
pr_warn("%s not implemented for RTL931X\n", __func__);
123+
saved_state = sw_r32(RTL931X_SMI_PORT_POLLING_CTRL + 4);
124+
saved_state <<= 32;
125+
saved_state |= sw_r32(RTL931X_SMI_PORT_POLLING_CTRL);
126+
sw_w32_mask(BIT(port % 32), 0, RTL931X_SMI_PORT_POLLING_CTRL + ((port >> 5) << 2));
124127
break;
125128
}
126129

@@ -145,7 +148,8 @@ static int resume_polling(u64 saved_state)
145148
sw_w32(saved_state, RTL930X_SMI_POLL_CTRL);
146149
break;
147150
case RTL9310_FAMILY_ID:
148-
pr_warn("%s not implemented for RTL931X\n", __func__);
151+
sw_w32(saved_state >> 32, RTL931X_SMI_PORT_POLLING_CTRL + 4);
152+
sw_w32(saved_state, RTL931X_SMI_PORT_POLLING_CTRL);
149153
break;
150154
}
151155

0 commit comments

Comments
 (0)