]> git.ipfire.org Git - thirdparty/openwrt.git/commit
realtek: mdio: drop realtek,smi-address property 22236/head
authorMarkus Stockhausen <markus.stockhausen@gmx.de>
Sun, 1 Mar 2026 16:34:49 +0000 (17:34 +0100)
committerRobert Marko <robert.marko@sartura.hr>
Sat, 21 Mar 2026 21:26:02 +0000 (22:26 +0100)
commit8b969f7e27ff46768260ecf2dd10d97b8dcc19a5
tree839b66170fecd84b993fb0cf8d5848884d69f81e
parent4c92254fd3337eab036c9e655bda0d0963e98f24
realtek: mdio: drop realtek,smi-address property

A phy node in the dts has two properties:

- reg: the (overall) address of the phy
- realtek,smi-address: the address of the phy on its bus

This notation does not align with upstream. reg should be the address
of the phy on its bus. But where to get the overall address that is
needed for register writes to the hardware?

Luckily the mdio driver and the hardware design sync the ports and
phys (overall) addresses. Thus derive missing data from the dts port
nodes (below ethernet-ports). To realize this

- carve out the port mapping into a separate function to align with
  the upstream driver.
- do more sanity checks and catch more inconsistencies
- raise more/better errors via dev_err_probe()

With this commit all dts files must be rewritten as follows:

- if phy has no realtek,smi-address leave it as is
- if phy has realtek,smi-address, write that value into the reg
  property and drop realtek,smi-address.

Remark: This commit might bring some confusion about the phyXX and
phy@YY and <reg=YY> naming convention. To be somehow consistent with
the current port/phy identifiers from now on the dts will have:

- phyXX: where XX matches the port number
- phy@YY: where YY is the phy address on the mdio bus
- <reg=YY>: where YY is the phy address on the mdio bus

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/22236
Signed-off-by: Robert Marko <robert.marko@sartura.hr>
13 files changed:
target/linux/realtek/dts/rtl9302_plasmacloud_common.dtsi
target/linux/realtek/dts/rtl9302_xikestor_sks8300-12e2t2x.dts
target/linux/realtek/dts/rtl9302_zyxel_xgs1010-12-a1.dts
target/linux/realtek/dts/rtl9302_zyxel_xgs1210-12-a1.dts
target/linux/realtek/dts/rtl9302_zyxel_xgs1210-12-b1.dts
target/linux/realtek/dts/rtl9302_zyxel_xgs1250-12-a1.dts
target/linux/realtek/dts/rtl9302_zyxel_xgs1250-12-b1.dts
target/linux/realtek/dts/rtl9303_hasivo_s1100w-8xgt-se.dts
target/linux/realtek/dts/rtl9303_hasivo_s1100wp-8gt-se.dts
target/linux/realtek/dts/rtl9303_xikestor_sks8300-8t.dts
target/linux/realtek/dts/rtl9311_linksys_lgs352c.dts
target/linux/realtek/dts/rtl9312_plasmacloud_common.dtsi
target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c