]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
realtek: add macro for pse-pi
authorJonas Jelonek <jelonek.jonas@gmail.com>
Wed, 15 Jul 2026 08:34:19 +0000 (08:34 +0000)
committerJonas Jelonek <jelonek.jonas@gmail.com>
Fri, 17 Jul 2026 17:34:44 +0000 (19:34 +0200)
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 <jelonek.jonas@gmail.com>
target/linux/realtek/dts/macros.dtsi
target/linux/realtek/dts/rtl9302_zyxel_xmg1915-10ep.dts
target/linux/realtek/dts/rtl9313_zyxel_xs1930-12hp.dts

index 3285b9067c57b3c2b072a99413347306e1e6783b..718206ced95004bc9c7d175fb39a1acb983f0483 100644 (file)
                enet-phy-pair-order = <##po>; \
        };
 
+#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>; \
index 08049f0405de97659615070a6556e8324e72d297..bb95203cb0367b7d0d22579e25d3e98ee8233002 100644 (file)
                        #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)
                };
        };
 };
index 972fb2d348fedb7d5d15ad5124e964dfed985ca6..932e07bf780af04493b57dd4289472aaa6c82d45 100644 (file)
                                #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)
                        };
                };
        };