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 <jelonek.jonas@gmail.com>
This commit is contained in:
Jonas Jelonek
2026-07-17 19:34:44 +02:00
parent 696b38be9c
commit 2f9484a2d8
3 changed files with 24 additions and 64 deletions
+8
View File
@@ -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 = <p>; \
HASH_PSE_CELLS = <0>; \
};
#define SWITCH_PORT(p, l, m) \
port##p: port@##p { \
reg = <##p>; \
@@ -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)
};
};
};
@@ -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)
};
};
};