]> git.ipfire.org Git - thirdparty/openwrt.git/commit
realtek: convert access to RTL931x "even CMU" serdes pages 19873/head
authorMarkus Stockhausen <markus.stockhausen@gmx.de>
Wed, 27 Aug 2025 07:45:42 +0000 (03:45 -0400)
committerHauke Mehrtens <hauke@hauke-m.de>
Mon, 1 Sep 2025 22:51:43 +0000 (00:51 +0200)
commita8e3bff523bc639caa583953e81cdd9778268f1f
tree01c9e6e56a541e449238221f630833b360a9389f
parent207ab9c36af5f784cdc1562c88220472e95df878
realtek: convert access to RTL931x "even CMU" serdes pages

Currently the calculation for the CMU (even) SerDes works similar
to this pseudo code.

analog_backend_serdes = get_analog_serdes(frontend_serdes);
even_backend_serdes = analog_backend_serdes & ~1;
write_to(even_backend_serdes);

Because of the SerDes layout and frontend/backend mapping this can
be swapped to the following order with the same resulting Serdes.

even_frontend_serdes = frontend_serdes ~1;
analog_backend_serdes = get_analog_serdes(even_frontend_serdes);
write_to(analog_backed_serdes);

In the later example the frontend/backend mapping code is already
in our new functions. So swap the calculation logic and use the
new access functions. This allows to finally drop the old access
functions without mapping.

From now on all RTL931x SerDes functions will use a consistent
frontend view.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/19873
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c
target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.h
target/linux/realtek/files-6.12/drivers/net/phy/rtl83xx-phy.c