From: Jonas Jelonek Date: Wed, 15 Jul 2026 08:34:19 +0000 (+0000) Subject: realtek: add macro for pse-pi X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f9484a2d8edc6f169ebc18e82f306a9ba7b9b95;p=thirdparty%2Fopenwrt.git realtek: add macro for pse-pi Add a macro PSE_PI for the common pse-pi definition, helping with devices which make use of the Realtek PSE MCU driver. While those definitions stay manageable for low port counts, this adds too much visual boilerplate with 24 or even 48 ports. The macro keeps it short with one line per pse-pi. Also make use of this macro directly for the two devices XS1930-12HP and XMG1915-10EP. Link: https://github.com/openwrt/openwrt/pull/24239 Signed-off-by: Jonas Jelonek --- diff --git a/target/linux/realtek/dts/macros.dtsi b/target/linux/realtek/dts/macros.dtsi index 3285b9067c5..718206ced95 100644 --- a/target/linux/realtek/dts/macros.dtsi +++ b/target/linux/realtek/dts/macros.dtsi @@ -32,6 +32,14 @@ enet-phy-pair-order = <##po>; \ }; +#define HASH_PSE_CELLS #pse-cells + +#define PSE_PI(p) \ + pse_pi##p: pse-pi@p { \ + reg =

; \ + HASH_PSE_CELLS = <0>; \ + }; + #define SWITCH_PORT(p, l, m) \ port##p: port@##p { \ reg = <##p>; \ diff --git a/target/linux/realtek/dts/rtl9302_zyxel_xmg1915-10ep.dts b/target/linux/realtek/dts/rtl9302_zyxel_xmg1915-10ep.dts index 08049f0405d..bb95203cb03 100644 --- a/target/linux/realtek/dts/rtl9302_zyxel_xmg1915-10ep.dts +++ b/target/linux/realtek/dts/rtl9302_zyxel_xmg1915-10ep.dts @@ -35,38 +35,14 @@ #address-cells = <1>; #size-cells = <0>; - pse_pi0: pse-pi@0 { - reg = <0>; - #pse-cells = <0>; - }; - pse_pi1: pse-pi@1 { - reg = <1>; - #pse-cells = <0>; - }; - pse_pi2: pse-pi@2 { - reg = <2>; - #pse-cells = <0>; - }; - pse_pi3: pse-pi@3 { - reg = <3>; - #pse-cells = <0>; - }; - pse_pi4: pse-pi@4 { - reg = <4>; - #pse-cells = <0>; - }; - pse_pi5: pse-pi@5 { - reg = <5>; - #pse-cells = <0>; - }; - pse_pi6: pse-pi@6 { - reg = <6>; - #pse-cells = <0>; - }; - pse_pi7: pse-pi@7 { - reg = <7>; - #pse-cells = <0>; - }; + PSE_PI(0) + PSE_PI(1) + PSE_PI(2) + PSE_PI(3) + PSE_PI(4) + PSE_PI(5) + PSE_PI(6) + PSE_PI(7) }; }; }; diff --git a/target/linux/realtek/dts/rtl9313_zyxel_xs1930-12hp.dts b/target/linux/realtek/dts/rtl9313_zyxel_xs1930-12hp.dts index 972fb2d348f..932e07bf780 100644 --- a/target/linux/realtek/dts/rtl9313_zyxel_xs1930-12hp.dts +++ b/target/linux/realtek/dts/rtl9313_zyxel_xs1930-12hp.dts @@ -66,38 +66,14 @@ #address-cells = <1>; #size-cells = <0>; - pse_pi0: pse-pi@0 { - reg = <0>; - #pse-cells = <0>; - }; - pse_pi1: pse-pi@1 { - reg = <1>; - #pse-cells = <0>; - }; - pse_pi2: pse-pi@2 { - reg = <2>; - #pse-cells = <0>; - }; - pse_pi3: pse-pi@3 { - reg = <3>; - #pse-cells = <0>; - }; - pse_pi4: pse-pi@4 { - reg = <4>; - #pse-cells = <0>; - }; - pse_pi5: pse-pi@5 { - reg = <5>; - #pse-cells = <0>; - }; - pse_pi6: pse-pi@6 { - reg = <6>; - #pse-cells = <0>; - }; - pse_pi7: pse-pi@7 { - reg = <7>; - #pse-cells = <0>; - }; + PSE_PI(0) + PSE_PI(1) + PSE_PI(2) + PSE_PI(3) + PSE_PI(4) + PSE_PI(5) + PSE_PI(6) + PSE_PI(7) }; }; };