]> git.ipfire.org Git - thirdparty/openwrt.git/commit
realtek: overwrite c22 polling unconditionally on RTL930x 19161/head
authorMarkus Stockhausen <markus.stockhausen@gmx.de>
Tue, 17 Jun 2025 07:43:36 +0000 (03:43 -0400)
committerRobert Marko <robimarko@gmail.com>
Wed, 25 Jun 2025 11:29:00 +0000 (13:29 +0200)
commit6a1d7bf52b94fd2ee75e8e98581665fc4f12cf98
tree75a7d0c926b48ef3d9dda4df40d7de97e2376bf3
parent126dc7ddb95540787b16429eebac5a0acb9a42c7
realtek: overwrite c22 polling unconditionally on RTL930x

During setup the mdio driver decides the polling mode of the 4 smi
busses depending on the DTS phy settings. This works as follows:

- set polling to c45 if at least one phy is ethernet-phy-ieee802.3-c45
- set polling to c22 if all phys are ethernet-phy-ieee802.3-c22

On RTL930x it is not possible to switch to c22 if uboot has set c45
before. Fix this by overwriting the bitfield properly. While we are
here:

- Sort variables according to kernel style (inverse christmas tree)
- Initialize fields properly with  = { 0 }
- Use GENMASK() for better readability
- Make use of RTMDIO_MAX_SMI_BUS

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/19161
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c