rtl838x: dts: use macros for phy and switch definitions

It's quite more readable, saves some tedious copy&pasting, not so
error prone etc.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
This commit is contained in:
Petr Štetiar 2020-11-04 16:20:17 +01:00
parent 0516aa398c
commit e267445510
5 changed files with 170 additions and 719 deletions

View File

@ -103,46 +103,14 @@
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;
/* Internal phy */ INTERNAL_PHY(8)
phy8: ethernet-phy@8 { INTERNAL_PHY(9)
reg = <8>; INTERNAL_PHY(10)
compatible = "ethernet-phy-ieee802.3-c22"; INTERNAL_PHY(11)
}; INTERNAL_PHY(12)
INTERNAL_PHY(13)
phy9: ethernet-phy@9 { INTERNAL_PHY(14)
reg = <9>; INTERNAL_PHY(15)
compatible = "ethernet-phy-ieee802.3-c22";
};
phy10: ethernet-phy@10 {
reg = <10>;
compatible = "ethernet-phy-ieee802.3-c22";
};
phy11: ethernet-phy@11 {
reg = <11>;
compatible = "ethernet-phy-ieee802.3-c22";
};
phy12: ethernet-phy@12 {
reg = <12>;
compatible = "ethernet-phy-ieee802.3-c22";
};
phy13: ethernet-phy@13 {
reg = <13>;
compatible = "ethernet-phy-ieee802.3-c22";
};
phy14: ethernet-phy@14 {
reg = <14>;
compatible = "ethernet-phy-ieee802.3-c22";
};
phy15: ethernet-phy@15 {
reg = <15>;
compatible = "ethernet-phy-ieee802.3-c22";
};
}; };
}; };
@ -151,61 +119,14 @@
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;
port@0 { SWITCH_PORT(8, 1, internal)
reg = <8>; SWITCH_PORT(9, 2, internal)
label = "lan1"; SWITCH_PORT(10, 3, internal)
phy-handle = <&phy8>; SWITCH_PORT(11, 4, internal)
phy-mode = "internal"; SWITCH_PORT(12, 5, internal)
}; SWITCH_PORT(13, 6, internal)
SWITCH_PORT(14, 7, internal)
port@1 { SWITCH_PORT(15, 8, internal)
reg = <9>;
label = "lan2";
phy-handle = <&phy9>;
phy-mode = "internal";
};
port@2 {
reg = <10>;
label = "lan3";
phy-handle = <&phy10>;
phy-mode = "internal";
};
port@3 {
reg = <11>;
label = "lan4";
phy-handle = <&phy11>;
phy-mode = "internal";
};
port@4 {
reg = <12>;
label = "lan5";
phy-handle = <&phy12>;
phy-mode = "internal";
};
port@5 {
reg = <13>;
label = "lan6";
phy-handle = <&phy13>;
phy-mode = "internal";
};
port@6 {
reg = <14>;
label = "lan7";
phy-handle = <&phy14>;
phy-mode = "internal";
};
port@7 {
reg = <15>;
label = "lan8";
phy-handle = <&phy15>;
phy-mode = "internal";
};
port@28 { port@28 {
ethernet = <&ethernet0>; ethernet = <&ethernet0>;

View File

@ -99,8 +99,6 @@
}; };
}; };
&ethernet0 { &ethernet0 {
mdio: mdio-bus { mdio: mdio-bus {
compatible = "realtek,rtl838x-mdio"; compatible = "realtek,rtl838x-mdio";
@ -108,49 +106,16 @@
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;
/* Internal phy */ INTERNAL_PHY(8)
phy8: ethernet-phy@8 { INTERNAL_PHY(9)
reg = <8>; INTERNAL_PHY(10)
compatible = "ethernet-phy-ieee802.3-c22"; INTERNAL_PHY(11)
}; INTERNAL_PHY(12)
phy9: ethernet-phy@9 { INTERNAL_PHY(13)
reg = <9>; INTERNAL_PHY(14)
compatible = "ethernet-phy-ieee802.3-c22"; INTERNAL_PHY(15)
}; INTERNAL_PHY(24)
phy10: ethernet-phy@10 { INTERNAL_PHY(26)
reg = <10>;
compatible = "ethernet-phy-ieee802.3-c22";
};
phy11: ethernet-phy@11 {
reg = <11>;
compatible = "ethernet-phy-ieee802.3-c22";
};
phy12: ethernet-phy@12 {
reg = <12>;
compatible = "ethernet-phy-ieee802.3-c22";
};
phy13: ethernet-phy@13 {
reg = <13>;
compatible = "ethernet-phy-ieee802.3-c22";
};
phy14: ethernet-phy@14 {
reg = <14>;
compatible = "ethernet-phy-ieee802.3-c22";
};
phy15: ethernet-phy@15 {
reg = <15>;
compatible = "ethernet-phy-ieee802.3-c22";
};
phy24: ethernet-phy@24 {
compatible = "ethernet-phy-ieee802.3-c22";
phy-is-integrated;
reg = <24>;
};
phy26: ethernet-phy@26 {
compatible = "ethernet-phy-ieee802.3-c22";
phy-is-integrated;
reg = <26>;
};
}; };
}; };
@ -159,67 +124,17 @@
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;
port@0 { SWITCH_PORT(8, 1, internal)
reg = <8>; SWITCH_PORT(9, 2, internal)
label = "lan1"; SWITCH_PORT(10, 3, internal)
phy-handle = <&phy8>; SWITCH_PORT(11, 4, internal)
phy-mode = "internal"; SWITCH_PORT(12, 5, internal)
}; SWITCH_PORT(13, 6, internal)
port@1 { SWITCH_PORT(14, 7, internal)
reg = <9>; SWITCH_PORT(15, 8, internal)
label = "lan2"; SWITCH_PORT(24, 9, internal)
phy-handle = <&phy9>; SWITCH_PORT(26, 10, internal)
phy-mode = "internal";
};
port@2 {
reg = <10>;
label = "lan3";
phy-handle = <&phy10>;
phy-mode = "internal";
};
port@3 {
reg = <11>;
label = "lan4";
phy-handle = <&phy11>;
phy-mode = "internal";
};
port@4 {
reg = <12>;
label = "lan5";
phy-handle = <&phy12>;
phy-mode = "internal";
};
port@5 {
reg = <13>;
label = "lan6";
phy-handle = <&phy13>;
phy-mode = "internal";
};
port@6 {
reg = <14>;
label = "lan7";
phy-handle = <&phy14>;
phy-mode = "internal";
};
port@7 {
reg = <15>;
label = "lan8";
phy-handle = <&phy15>;
phy-mode = "internal";
};
port@24 {
reg = <24>;
label = "lan9";
phy-mode = "internal";
phy-handle = <&phy24>;
};
port@26 {
reg = <26>;
label = "lan10";
phy-mode = "internal";
phy-handle = <&phy26>;
};
port@28 { port@28 {
ethernet = <&ethernet0>; ethernet = <&ethernet0>;
reg = <28>; reg = <28>;

View File

@ -14,107 +14,28 @@
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;
/* External phy RTL8218B */ EXTERNAL_PHY(0)
phy0: ethernet-phy@0 { EXTERNAL_PHY(1)
reg = <0>; EXTERNAL_PHY(2)
compatible = "ethernet-phy-ieee802.3-c22"; EXTERNAL_PHY(3)
}; EXTERNAL_PHY(4)
phy1: ethernet-phy@1 { EXTERNAL_PHY(5)
reg = <1>; EXTERNAL_PHY(6)
compatible = "ethernet-phy-ieee802.3-c22"; EXTERNAL_PHY(7)
};
phy2: ethernet-phy@2 {
reg = <2>;
compatible = "ethernet-phy-ieee802.3-c22";
};
phy3: ethernet-phy@3 {
reg = <3>;
compatible = "ethernet-phy-ieee802.3-c22";
};
phy4: ethernet-phy@4 {
reg = <4>;
compatible = "ethernet-phy-ieee802.3-c22";
};
phy5: ethernet-phy@5 {
reg = <5>;
compatible = "ethernet-phy-ieee802.3-c22";
};
phy6: ethernet-phy@6 {
reg = <6>;
compatible = "ethernet-phy-ieee802.3-c22";
};
phy7: ethernet-phy@7 {
reg = <7>;
compatible = "ethernet-phy-ieee802.3-c22";
};
/* Internal phy RTL8218B */ INTERNAL_PHY(8)
phy8: ethernet-phy@8 { INTERNAL_PHY(9)
reg = <8>; INTERNAL_PHY(10)
compatible = "ethernet-phy-ieee802.3-c22"; INTERNAL_PHY(11)
phy-is-integrated; INTERNAL_PHY(12)
}; INTERNAL_PHY(13)
phy9: ethernet-phy@9 { INTERNAL_PHY(14)
reg = <9>; INTERNAL_PHY(15)
compatible = "ethernet-phy-ieee802.3-c22";
phy-is-integrated;
};
phy10: ethernet-phy@10 {
reg = <10>;
compatible = "ethernet-phy-ieee802.3-c22";
phy-is-integrated;
};
phy11: ethernet-phy@11 {
reg = <11>;
compatible = "ethernet-phy-ieee802.3-c22";
phy-is-integrated;
};
phy12: ethernet-phy@12 {
reg = <12>;
compatible = "ethernet-phy-ieee802.3-c22";
phy-is-integrated;
};
phy13: ethernet-phy@13 {
reg = <13>;
compatible = "ethernet-phy-ieee802.3-c22";
phy-is-integrated;
};
phy14: ethernet-phy@14 {
reg = <14>;
compatible = "ethernet-phy-ieee802.3-c22";
phy-is-integrated;
};
phy15: ethernet-phy@15 {
reg = <15>;
compatible = "ethernet-phy-ieee802.3-c22";
phy-is-integrated;
};
/* External phy: RTL8214FC */ EXTERNAL_SFP_PHY(24)
phy24: ethernet-phy@24 { EXTERNAL_SFP_PHY(25)
compatible = "ethernet-phy-ieee802.3-c22"; EXTERNAL_SFP_PHY(26)
sfp; EXTERNAL_SFP_PHY(27)
media = "fibre";
reg = <24>;
};
phy25: ethernet-phy@25 {
compatible = "ethernet-phy-ieee802.3-c22";
sfp;
media = "fibre";
reg = <25>;
};
phy26: ethernet-phy@26 {
compatible = "ethernet-phy-ieee802.3-c22";
sfp;
media = "fibre";
reg = <26>;
};
phy27: ethernet-phy@27 {
compatible = "ethernet-phy-ieee802.3-c22";
sfp;
media = "fibre";
reg = <27>;
};
}; };
}; };
@ -123,127 +44,29 @@
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;
port@0 { SWITCH_PORT(0, 1, qsgmii)
reg = <0>; SWITCH_PORT(1, 2, qsgmii)
label = "lan1"; SWITCH_PORT(2, 3, qsgmii)
phy-handle = <&phy0>; SWITCH_PORT(3, 4, qsgmii)
phy-mode = "qsgmii"; SWITCH_PORT(4, 5, qsgmii)
}; SWITCH_PORT(5, 6, qsgmii)
port@1 { SWITCH_PORT(6, 7, qsgmii)
reg = <1>; SWITCH_PORT(7, 8, qsgmii)
label = "lan2";
phy-handle = <&phy1>; SWITCH_PORT(8, 9, internal)
phy-mode = "qsgmii"; SWITCH_PORT(9, 10, internal)
}; SWITCH_PORT(10, 11, internal)
port@2 { SWITCH_PORT(11, 12, internal)
reg = <2>; SWITCH_PORT(12, 13, internal)
label = "lan3"; SWITCH_PORT(13, 14, internal)
phy-handle = <&phy2>; SWITCH_PORT(14, 15, internal)
phy-mode = "qsgmii"; SWITCH_PORT(15, 16, internal)
};
port@3 { SWITCH_PORT(24, 17, qsgmii)
reg = <3>; SWITCH_PORT(25, 18, qsgmii)
label = "lan4"; SWITCH_PORT(26, 19, qsgmii)
phy-handle = <&phy3>; SWITCH_PORT(27, 20, qsgmii)
phy-mode = "qsgmii";
};
port@4 {
reg = <4>;
label = "lan5";
phy-handle = <&phy4>;
phy-mode = "qsgmii";
};
port@5 {
reg = <5>;
label = "lan6";
phy-handle = <&phy5>;
phy-mode = "qsgmii";
};
port@6 {
reg = <6>;
label = "lan7";
phy-handle = <&phy6>;
phy-mode = "qsgmii";
};
port@7 {
reg = <7>;
label = "lan8";
phy-handle = <&phy7>;
phy-mode = "qsgmii";
};
port@8 {
reg = <8>;
label = "lan9";
phy-handle = <&phy8>;
phy-mode = "internal";
};
port@9 {
reg = <9>;
label = "lan10";
phy-handle = <&phy9>;
phy-mode = "internal";
};
port@10 {
reg = <10>;
label = "lan11";
phy-handle = <&phy10>;
phy-mode = "internal";
};
port@11 {
reg = <11>;
label = "lan12";
phy-handle = <&phy11>;
phy-mode = "internal";
};
port@12 {
reg = <12>;
label = "lan13";
phy-handle = <&phy12>;
phy-mode = "internal";
};
port@13 {
reg = <13>;
label = "lan14";
phy-handle = <&phy13>;
phy-mode = "internal";
};
port@14 {
reg = <14>;
label = "lan15";
phy-handle = <&phy14>;
phy-mode = "internal";
};
port@15 {
reg = <15>;
label = "lan16";
phy-handle = <&phy15>;
phy-mode = "internal";
};
port@24 {
reg = <24>;
label = "lan17";
phy-handle = <&phy24>;
phy-mode = "qsgmii";
};
port@25 {
reg = <25>;
label = "lan18";
phy-handle = <&phy25>;
phy-mode = "qsgmii";
};
port@26 {
reg = <26>;
label = "lan19";
phy-handle = <&phy26>;
phy-mode = "qsgmii";
};
port@27 {
reg = <27>;
label = "lan20";
phy-handle = <&phy27>;
phy-mode = "qsgmii";
};
port@28 { port@28 {
ethernet = <&ethernet0>; ethernet = <&ethernet0>;
reg = <28>; reg = <28>;

View File

@ -14,141 +14,37 @@
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;
/* External phy RTL8218B */ EXTERNAL_PHY(0)
phy0: ethernet-phy@0 { EXTERNAL_PHY(1)
reg = <0>; EXTERNAL_PHY(2)
compatible = "ethernet-phy-ieee802.3-c22"; EXTERNAL_PHY(3)
}; EXTERNAL_PHY(4)
phy1: ethernet-phy@1 { EXTERNAL_PHY(5)
reg = <1>; EXTERNAL_PHY(6)
compatible = "ethernet-phy-ieee802.3-c22"; EXTERNAL_PHY(7)
};
phy2: ethernet-phy@2 {
reg = <2>;
compatible = "ethernet-phy-ieee802.3-c22";
};
phy3: ethernet-phy@3 {
reg = <3>;
compatible = "ethernet-phy-ieee802.3-c22";
};
phy4: ethernet-phy@4 {
reg = <4>;
compatible = "ethernet-phy-ieee802.3-c22";
};
phy5: ethernet-phy@5 {
reg = <5>;
compatible = "ethernet-phy-ieee802.3-c22";
};
phy6: ethernet-phy@6 {
reg = <6>;
compatible = "ethernet-phy-ieee802.3-c22";
};
phy7: ethernet-phy@7 {
reg = <7>;
compatible = "ethernet-phy-ieee802.3-c22";
};
/* Internal phy RTL8218B */ INTERNAL_PHY(8)
phy8: ethernet-phy@8 { INTERNAL_PHY(9)
reg = <8>; INTERNAL_PHY(10)
compatible = "ethernet-phy-ieee802.3-c22"; INTERNAL_PHY(11)
phy-is-integrated; INTERNAL_PHY(12)
}; INTERNAL_PHY(13)
phy9: ethernet-phy@9 { INTERNAL_PHY(14)
reg = <9>; INTERNAL_PHY(15)
compatible = "ethernet-phy-ieee802.3-c22";
phy-is-integrated;
};
phy10: ethernet-phy@10 {
reg = <10>;
compatible = "ethernet-phy-ieee802.3-c22";
phy-is-integrated;
};
phy11: ethernet-phy@11 {
reg = <11>;
compatible = "ethernet-phy-ieee802.3-c22";
phy-is-integrated;
};
phy12: ethernet-phy@12 {
reg = <12>;
compatible = "ethernet-phy-ieee802.3-c22";
phy-is-integrated;
};
phy13: ethernet-phy@13 {
reg = <13>;
compatible = "ethernet-phy-ieee802.3-c22";
phy-is-integrated;
};
phy14: ethernet-phy@14 {
reg = <14>;
compatible = "ethernet-phy-ieee802.3-c22";
phy-is-integrated;
};
phy15: ethernet-phy@15 {
reg = <15>;
compatible = "ethernet-phy-ieee802.3-c22";
phy-is-integrated;
};
/* External phy RTL8218B */ EXTERNAL_PHY(16)
phy16: ethernet-phy@16 { EXTERNAL_PHY(17)
reg = <16>; EXTERNAL_PHY(18)
compatible = "ethernet-phy-ieee802.3-c22"; EXTERNAL_PHY(19)
}; EXTERNAL_PHY(20)
phy17: ethernet-phy@17 { EXTERNAL_PHY(21)
reg = <17>; EXTERNAL_PHY(22)
compatible = "ethernet-phy-ieee802.3-c22"; EXTERNAL_PHY(23)
};
phy18: ethernet-phy@18 {
reg = <18>;
compatible = "ethernet-phy-ieee802.3-c22";
};
phy19: ethernet-phy@19 {
reg = <19>;
compatible = "ethernet-phy-ieee802.3-c22";
};
phy20: ethernet-phy@20 {
reg = <20>;
compatible = "ethernet-phy-ieee802.3-c22";
};
phy21: ethernet-phy@21 {
reg = <21>;
compatible = "ethernet-phy-ieee802.3-c22";
};
phy22: ethernet-phy@22 {
reg = <22>;
compatible = "ethernet-phy-ieee802.3-c22";
};
phy23: ethernet-phy@23 {
reg = <23>;
compatible = "ethernet-phy-ieee802.3-c22";
};
/* External phy: RTL8214FC */ EXTERNAL_SFP_PHY(24)
phy24: ethernet-phy@24 { EXTERNAL_SFP_PHY(25)
compatible = "ethernet-phy-ieee802.3-c22"; EXTERNAL_SFP_PHY(26)
sfp; EXTERNAL_SFP_PHY(27)
media = "fibre";
reg = <24>;
};
phy25: ethernet-phy@25 {
compatible = "ethernet-phy-ieee802.3-c22";
sfp;
media = "fibre";
reg = <25>;
};
phy26: ethernet-phy@26 {
compatible = "ethernet-phy-ieee802.3-c22";
sfp;
media = "fibre";
reg = <26>;
};
phy27: ethernet-phy@27 {
compatible = "ethernet-phy-ieee802.3-c22";
sfp;
media = "fibre";
reg = <27>;
};
}; };
}; };
@ -157,175 +53,38 @@
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;
port@0 { SWITCH_PORT(0, 1, qsgmii)
reg = <0>; SWITCH_PORT(1, 2, qsgmii)
label = "lan1"; SWITCH_PORT(2, 3, qsgmii)
phy-handle = <&phy0>; SWITCH_PORT(3, 4, qsgmii)
phy-mode = "qsgmii"; SWITCH_PORT(4, 5, qsgmii)
}; SWITCH_PORT(5, 6, qsgmii)
port@1 { SWITCH_PORT(6, 7, qsgmii)
reg = <1>; SWITCH_PORT(7, 8, qsgmii)
label = "lan2";
phy-handle = <&phy1>; SWITCH_PORT(8, 9, internal)
phy-mode = "qsgmii"; SWITCH_PORT(9, 10, internal)
}; SWITCH_PORT(10, 11, internal)
port@2 { SWITCH_PORT(11, 12, internal)
reg = <2>; SWITCH_PORT(12, 13, internal)
label = "lan3"; SWITCH_PORT(13, 14, internal)
phy-handle = <&phy2>; SWITCH_PORT(14, 15, internal)
phy-mode = "qsgmii"; SWITCH_PORT(15, 16, internal)
};
port@3 { SWITCH_PORT(16, 17, qsgmii)
reg = <3>; SWITCH_PORT(17, 18, qsgmii)
label = "lan4"; SWITCH_PORT(18, 19, qsgmii)
phy-handle = <&phy3>; SWITCH_PORT(19, 20, qsgmii)
phy-mode = "qsgmii"; SWITCH_PORT(20, 21, qsgmii)
}; SWITCH_PORT(21, 22, qsgmii)
port@4 { SWITCH_PORT(22, 23, qsgmii)
reg = <4>; SWITCH_PORT(23, 24, qsgmii)
label = "lan5";
phy-handle = <&phy4>; SWITCH_PORT(24, 25, qsgmii)
phy-mode = "qsgmii"; SWITCH_PORT(25, 26, qsgmii)
}; SWITCH_PORT(26, 27, qsgmii)
port@5 { SWITCH_PORT(27, 28, qsgmii)
reg = <5>;
label = "lan6";
phy-handle = <&phy5>;
phy-mode = "qsgmii";
};
port@6 {
reg = <6>;
label = "lan7";
phy-handle = <&phy6>;
phy-mode = "qsgmii";
};
port@7 {
reg = <7>;
label = "lan8";
phy-handle = <&phy7>;
phy-mode = "qsgmii";
};
port@8 {
reg = <8>;
label = "lan9";
phy-handle = <&phy8>;
phy-mode = "internal";
};
port@9 {
reg = <9>;
label = "lan10";
phy-handle = <&phy9>;
phy-mode = "internal";
};
port@10 {
reg = <10>;
label = "lan11";
phy-handle = <&phy10>;
phy-mode = "internal";
};
port@11 {
reg = <11>;
label = "lan12";
phy-handle = <&phy11>;
phy-mode = "internal";
};
port@12 {
reg = <12>;
label = "lan13";
phy-handle = <&phy12>;
phy-mode = "internal";
};
port@13 {
reg = <13>;
label = "lan14";
phy-handle = <&phy13>;
phy-mode = "internal";
};
port@14 {
reg = <14>;
label = "lan15";
phy-handle = <&phy14>;
phy-mode = "internal";
};
port@15 {
reg = <15>;
label = "lan16";
phy-handle = <&phy15>;
phy-mode = "internal";
};
port@16 {
reg = <16>;
label = "lan17";
phy-handle = <&phy16>;
phy-mode = "qsgmii";
};
port@17 {
reg = <17>;
label = "lan18";
phy-handle = <&phy17>;
phy-mode = "qsgmii";
};
port@18 {
reg = <18>;
label = "lan19";
phy-handle = <&phy18>;
phy-mode = "qsgmii";
};
port@19 {
reg = <19>;
label = "lan20";
phy-handle = <&phy19>;
phy-mode = "qsgmii";
};
port@20 {
reg = <20>;
label = "lan21";
phy-handle = <&phy20>;
phy-mode = "qsgmii";
};
port@21 {
reg = <21>;
label = "lan22";
phy-handle = <&phy21>;
phy-mode = "qsgmii";
};
port@22 {
reg = <22>;
label = "lan23";
phy-handle = <&phy22>;
phy-mode = "qsgmii";
};
port@23 {
reg = <23>;
label = "lan24";
phy-handle = <&phy23>;
phy-mode = "qsgmii";
};
port@24 {
reg = <24>;
label = "lan25";
phy-handle = <&phy24>;
phy-mode = "qsgmii";
};
port@25 {
reg = <25>;
label = "lan26";
phy-handle = <&phy25>;
phy-mode = "qsgmii";
};
port@26 {
reg = <26>;
label = "lan27";
phy-handle = <&phy26>;
phy-mode = "qsgmii";
};
port@27 {
reg = <27>;
label = "lan28";
phy-handle = <&phy27>;
phy-mode = "qsgmii";
};
port@28 { port@28 {
ethernet = <&ethernet0>; ethernet = <&ethernet0>;
reg = <28>; reg = <28>;

View File

@ -2,6 +2,39 @@
/dts-v1/; /dts-v1/;
#define STRINGIZE(s) #s
#define LAN_LABEL(p, s) STRINGIZE(p ## s)
#define SWITCH_PORT_LABEL(n) LAN_LABEL(lan, n)
#define INTERNAL_PHY(n) \
phy##n: ethernet-phy@##n { \
reg = <##n>; \
compatible = "ethernet-phy-ieee802.3-c22"; \
phy-is-integrated; \
};
#define EXTERNAL_PHY(n) \
phy##n: ethernet-phy@##n { \
reg = <##n>; \
compatible = "ethernet-phy-ieee802.3-c22"; \
};
#define EXTERNAL_SFP_PHY(n) \
phy##n: ethernet-phy@##n { \
compatible = "ethernet-phy-ieee802.3-c22"; \
sfp; \
media = "fibre"; \
reg = <##n>; \
};
#define SWITCH_PORT(n, s, m) \
port@##n { \
reg = <##n>; \
label = SWITCH_PORT_LABEL(s) ; \
phy-handle = <&phy##n>; \
phy-mode = #m ; \
};
/ { / {
#address-cells = <1>; #address-cells = <1>;
#size-cells = <1>; #size-cells = <1>;