1
1
openwrt/target/linux/realtek/dts/rtl9313_zyxel_xs1930-12hp.dts
Jonas Jelonek 43562f97e7
realtek: dts: add link index cell to pcs-handle phandles
A SerDes can host multiple PCS links: QSGMII binds four ports to one
SerDes, USXGMII variants up to eight. Today pcs-handle references the
SerDes as a whole, with no way to express which link inside the SerDes
a port wants. The driver gets away with this because it carries its own
port->link bookkeeping and the link slot is implicit in DSA's port
iteration order -- functional, but the wiring information lives nowhere
in DT.

The upcoming fwnode_pcs migration moves PCS lookup to the generic
fwnode provider API, which disambiguates multiple instances per fwnode
via phandle cells. To make that landable as small, code-only commits,
the DT needs to carry the link index ahead of time.

Bump #pcs-cells from 0 to 1 on every SerDes node in the four SoC DTSIs
and append the link cell to every pcs-handle reference across boards
and the SWITCH_PORT_* macros. Cell values match the existing wiring:
0 for single-link SerDes (10GBase-R, SGMII, fiber, single-link
USXGMII), 0..3 per SerDes for QSGMII and USXGMII-QX, 0..7 for the
RTL9311 octal USXGMII layout.

No code reads the new cell yet -- of_parse_phandle_with_args() in the
PCS driver already cooperates with cells = 0 or 1, and the DSA glue
uses of_parse_phandle() which ignores cells entirely. The change is
runtime-neutral on its own; it exists so the follow-up code patches
can be a few lines each instead of dragging a bridge counter into the
driver to invent slot numbers DT could have provided directly.

Link: https://github.com/openwrt/openwrt/pull/23539
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-05-31 12:52:40 +02:00

91 lines
2.1 KiB
Plaintext

// SPDX-License-Identifier: GPL-2.0-or-later
/dts-v1/;
#include "rtl9313_zyxel_xs1930-aqr813.dtsi"
#include <dt-bindings/input/input.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/leds/common.h>
#include <dt-bindings/mux/mux.h>
#include <dt-bindings/phy/phy.h>
/ {
compatible = "zyxel,xs1930-12hp", "realtek,rtl9313-soc";
model = "Zyxel XS1930-12HP";
leds {
led_poe_max: led-7 {
color = <LED_COLOR_ID_RED>;
function = "poe-usage";
gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
};
};
};
&led_set {
/* Phantom port chain padding (2 LEDs) */
led_set1 = <RTL93XX_LED_SET_NONE
RTL93XX_LED_SET_NONE>;
/* The LED PCB has two daisy-chained RTL8231 in scan mode.
* Net LEDs for P3-P12 are on the first RTL8231, P1/P2
* net LEDs are on the second. The 12 real ports provide
* 36 LED bits but the chain requires 65 bits to correctly
* span both chips. Phantom ports 1-7, 9-10 (set0, 3 LEDs
* each) and port 11 (set1, 2 LEDs) pad the chain with
* the remaining 29 bits.
*/
realtek,led-set0-force-port-mask = <0x00000000 0x000006FE>;
realtek,led-set1-force-port-mask = <0x00000000 0x00000800>;
};
&led_sys_green { gpios = <&gpio0 23 GPIO_ACTIVE_LOW>; };
&led_sys_red { gpios = <&gpio0 0 GPIO_ACTIVE_LOW>; };
&gpio0 {
poe_enable_hog {
gpio-hog;
gpios = <10 GPIO_ACTIVE_HIGH>;
output-high;
line-name = "poe-enable";
};
};
&i2c_mst1 {
/* PoE management MCU sits here */
i2c3: i2c@3 { reg = <3>; };
};
&mdio_ctrl {
pinctrl-names = "default";
pinctrl-0 = <&pinmux_enable_mdc_mdio_0>,
<&pinmux_enable_mdc_mdio_1>,
<&pinmux_enable_mdc_mdio_2>;
};
&mdio_bus1 {
PHY_C45(52, 0) /* AQR113C */
};
&mdio_bus2 {
PHY_C45(53, 8) /* AQR113C */
};
&switch0 {
ethernet-ports {
/* Copper ports behind AQR113C */
SWITCH_PORT_LED(52, 9, 10, 0, 0, usxgmii)
SWITCH_PORT_LED(53, 10, 11, 0, 0, usxgmii)
SWITCH_PORT_SFP(54, 11, 12, 0, 1)
SWITCH_PORT_SFP(55, 12, 13, 0, 2)
};
};
&port52 { managed = "in-band-status"; };
&port53 { managed = "in-band-status"; };
&serdes10 { tx-polarity = <PHY_POL_INVERT>; };
&serdes11 { tx-polarity = <PHY_POL_INVERT>; };