1
0
Fork 0
forked from mirror/openwrt
openwrt/target/linux/realtek
Markus Stockhausen 8b969f7e27
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>
2026-03-21 22:26:02 +01:00
..
base-files realtek: dts: convert LGS3xxC to NVMEM 2026-03-14 10:50:47 +01:00
dts realtek: mdio: drop realtek,smi-address property 2026-03-21 22:26:02 +01:00
files-6.12 realtek: mdio: drop realtek,smi-address property 2026-03-21 22:26:02 +01:00
image realtek: dts: add monitor IC node for XikeStor SKS8310-8X 2026-03-01 14:46:12 +01:00
patches-6.12 realtek: thermal: extend the driver to support rtl960x 2026-03-15 00:18:36 +01:00
profiles target: use SPDX license identifiers on Makefiles 2021-02-10 15:47:18 +01:00
rtl838x kernel: mfd: Add Hasivo STC8 mfd 2026-03-01 18:47:27 +01:00
rtl839x realtek: enable U-Boot env NVMEM layout for missing targets 2026-03-14 10:50:47 +01:00
rtl930x kernel: mfd: Add Hasivo STC8 mfd 2026-03-01 18:47:27 +01:00
rtl930x_nand realtek: enable U-Boot env NVMEM layout for missing targets 2026-03-14 10:50:47 +01:00
rtl931x kernel: mfd: Add Hasivo STC8 mfd 2026-03-01 18:47:27 +01:00
rtl931x_nand realtek: enable U-Boot env NVMEM layout for missing targets 2026-03-14 10:50:47 +01:00
Makefile realtek: add NAND targets for RTL93xx 2025-08-10 11:46:52 +02:00
modules.mk kernel: mfd: Add Hasivo STC8 mfd 2026-03-01 18:47:27 +01:00