realtek: pcs: rtl931x: adjust SerDes page numbers
authorJonas Jelonek <[email protected]>
Fri, 10 Oct 2025 09:40:26 +0000 (09:40 +0000)
committerHauke Mehrtens <[email protected]>
Sun, 19 Oct 2025 21:49:56 +0000 (23:49 +0200)
commita89d8acb5b37a0e83468a2d03158d0ae86972563
treef7c0a364d3fe95e3e3ba64899b24c1ecb3d2b177
parent1089e3c69606d5e06de8eaa16520de1f7b640e42
realtek: pcs: rtl931x: adjust SerDes page numbers

Adjust the SerDes page numbers to account for the different mapping used
by 'mdio-realtek-otto' and 'mdio-realtek-otto-serdes' drivers.

While importing the SerDes configuration code from PHY driver to PCS
driver, all helper calls to access the SerDes registers had to be
adjusted to use the proper helpers within the PCS driver. However, there
is one important implication of this: 'mdio-realtek-otto' and
'mdio-realtek-otto-serdes' use a slightly different page mapping.

While the old helpers in 'mdio-realtek-otto' used a page mapping of
0x00/0x100/0x200, 'mdio-realtek-otto-serdes' uses a mapping of
0x00/0x40/0x80 to provide consumers with the ability to only operate on
frontend SerDes. Thus, all page numbers > 63/0x3f have to be adjusted
like the following:

before: rtsds_931x_write_field(sds, 0x101, ... // old helper calls
after: rtpcs_sds_write(ctrl, sds, 0x41, ...

Signed-off-by: Jonas Jelonek <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/20369
Signed-off-by: Hauke Mehrtens <[email protected]>
target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c