openwrt-pf/target/linux/realtek/dts/macros.dtsi
Carlo Szelinsky dd8f705e85
realtek: rtl9303: enable PSE on Hasivo S1100WP-8GT-SE
Wire the two HS104 controllers on the i2c-gpio bus and attach the 8 PoE
PHYs via a new PHY_C45_PSE macro. Add the STC8 syscon with its per-port
PoE LED triggers, enable LEDS_SYSCON, and pull the PSE and STC8 kmods
into the image.

Signed-off-by: Carlo Szelinsky <github@szelinsky.de>
Link: https://github.com/openwrt/openwrt/pull/22245
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-07-21 18:59:26 +02:00

107 lines
2.6 KiB
Text

// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/dts-v1/;
#define STRINGIZE(s) #s
#define LAN_LABEL(p, s) STRINGIZE(p ## s)
#define SWITCH_PORT_LABEL(n) LAN_LABEL(lan, n)
#define PHY_C22(p, n) \
phy##p: ethernet-phy@n { \
reg = <##n>; \
compatible = "ethernet-phy-ieee802.3-c22"; \
};
#define PHY_C22_SFP(p, n, s) \
phy##p: ethernet-phy@n { \
reg = <##n>; \
compatible = "ethernet-phy-ieee802.3-c22"; \
sfp = <&sfp##s>; \
};
#define PHY_C45(p, n) \
phy##p: ethernet-phy@n { \
reg = <##n>; \
compatible = "ethernet-phy-ieee802.3-c45"; \
};
#define PHY_C45_PAIR_ORDER(p, n, po) \
phy##p: ethernet-phy@n { \
reg = <##n>; \
compatible = "ethernet-phy-ieee802.3-c45"; \
enet-phy-pair-order = <##po>; \
};
#define PHY_C45_PSE(p, n, pi) \
phy##p: ethernet-phy@n { \
reg = <##n>; \
compatible = "ethernet-phy-ieee802.3-c45"; \
pses = <&pi>; \
};
#define HASH_PSE_CELLS #pse-cells
#define PSE_PI(p) \
pse_pi##p: pse-pi@p { \
reg = <p>; \
HASH_PSE_CELLS = <0>; \
};
#define SWITCH_PORT(p, l, m) \
port##p: port@##p { \
reg = <##p>; \
label = SWITCH_PORT_LABEL(l) ; \
phy-handle = <&phy##p>; \
phy-mode = #m ; \
};
#define SWITCH_PORT_SDS(p, l, s, i, m) \
port##p: port@##p { \
reg = <##p>; \
label = SWITCH_PORT_LABEL(l) ; \
pcs-handle = <&serdes##s i>; \
phy-handle = <&phy##p>; \
phy-mode = #m ; \
};
#define SWITCH_PORT_LED(p, l, s, i, c, m) \
port##p: port@##p { \
reg = <##p>; \
label = SWITCH_PORT_LABEL(l) ; \
led-set = <##c>; \
pcs-handle = <&serdes##s i>; \
phy-handle = <&phy##p>; \
phy-mode = #m ; \
};
#define SWITCH_PORT_SFP(p, l, s, c, g) \
port##p: port@##p { \
reg = <##p>; \
label = SWITCH_PORT_LABEL(l) ; \
led-set = <##c>; \
pcs-handle = <&serdes##s 0>; \
phy-mode = "1000base-x"; \
sfp = <&sfp##g>; \
managed = "in-band-status"; \
};
/* LED Set mode definitions */
#define RTL93XX_LED_SET_NONE (0)
#define RTL93XX_LED_SET_10G (1 << 0)
#define RTL93XX_LED_SET_5G (1 << 1)
#define RTL93XX_LED_SET_2P5G (1 << 3)
#define RTL93XX_LED_SET_1G (1 << 5)
#define RTL93XX_LED_SET_100M (1 << 7)
#define RTL93XX_LED_SET_10M (1 << 8)
#define RTL93XX_LED_SET_LINK (1 << 9)
#define RTL93XX_LED_SET_LINK_BLINK (1 << 10)
#define RTL93XX_LED_SET_ACT (1 << 11)
#define RTL93XX_LED_SET_RX (1 << 12)
#define RTL93XX_LED_SET_TX (1 << 13)
#define RTL93XX_LED_SET_COLLISION (1 << 14)
#define RTL93XX_LED_SET_DUPLEX (1 << 15)
/* LED Interface modes */
#define RTL93XX_LED_MODE_SERIAL 1
#define RTL93XX_LED_MODE_SINGLE_COLOR_SCAN 2
#define RTL93XX_LED_MODE_BI_COLOR_SCAN 3