1
1
openwrt/target/linux/realtek
Jonas Jelonek a4965dbf48
realtek: migrate PCS to fwnode_pcs provider/consumer API
PCS driver registers each SerDes as an fwnode_pcs provider in probe;
the resolver returns the cached or freshly-allocated rtpcs_link for
the requested (sds, link_idx) cell. DSA glue stops calling
rtpcs_create directly, drops .mac_select_pcs, and instead populates
phylink_config.num_available_pcs / fill_available_pcs from each
port's pcs-handle in phylink_get_caps. The rtl838x_port.pcs pointer
becomes a has_pcs bool populated at port probe via fwnode_property_
present, since nothing assigns the actual phylink_pcs anymore but the
"does this port use a PCS?" checks elsewhere still need a presence
flag.

Without .mac_select_pcs, phylink_major_config only searches the
pcs_list when state->interface is set in phylink_config.pcs_interfaces
(drivers/net/phy/phylink.c:1378). Populate it per port whenever the
port has a pcs-handle, listing the SerDes-routable interface modes for
each SoC variant -- without this, pcs_config / pcs_link_up are never
called and the SerDes is left unconfigured.

pcs_get_state still needs the MAC port number to index per-port link
status registers. Recover it at probe via rtpcs_map_links: walk the
sibling switch's ethernet-ports subtree (same backwards topology
lookup the sibling MDIO driver does for phy-handle), and for every
port whose pcs-handle resolves to one of our SerDes, store the port's
reg in sds->link_port[]. The resolver consults link_port[] when
allocating rtpcs_link and fails with -ENODEV if a consumer requested
a link the map step didn't record. Avoids a driver-side port_base
table that would have to encode per-SoC SerDes-to-port wiring (and
would silently break on non-contiguous variants); the DT is the
single source of truth.

Kconfig selects FWNODE_PCS.

Assisted-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Link: https://github.com/openwrt/openwrt/pull/23539
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-05-31 12:52:41 +02:00
..
base-files realtek: rtl930x: add support for Hasivo F1100W-4SX-4XGT and variants 2026-05-28 22:10:00 +02:00
dts realtek: dts: add link index cell to pcs-handle phandles 2026-05-31 12:52:40 +02:00
files-6.18 realtek: migrate PCS to fwnode_pcs provider/consumer API 2026-05-31 12:52:41 +02:00
image realtek: rtl930x: add support for Hasivo F1100W-4SX-4XGT and variants 2026-05-28 22:10:00 +02:00
patches-6.18 realtek: migrate PCS to fwnode_pcs provider/consumer API 2026-05-31 12:52:41 +02:00
profiles target: use SPDX license identifiers on Makefiles 2021-02-10 15:47:18 +01:00
rtl838x realtek: add Hasivo MCU watchdog driver 2026-05-31 10:57:26 +02:00
rtl839x realtek: add Hasivo MCU watchdog driver 2026-05-31 10:57:26 +02:00
rtl930x realtek: add Hasivo MCU watchdog driver 2026-05-31 10:57:26 +02:00
rtl930x_nand realtek: add Hasivo MCU watchdog driver 2026-05-31 10:57:26 +02:00
rtl931x realtek: add Hasivo MCU watchdog driver 2026-05-31 10:57:26 +02:00
rtl931x_nand realtek: add Hasivo MCU watchdog driver 2026-05-31 10:57:26 +02:00
Makefile realtek: switch to 6.18 2026-04-11 20:59:10 +02:00
modules.mk realtek: add Hasivo MCU watchdog driver 2026-05-31 10:57:26 +02:00