Hello @andopando,
Checking the internal documentation I was able to find the following, this is meant to use PFE_EMAC1 as RGMII but it can be translated to PFE_EMAC0:
In linux modify arch/arm64/boot/dts/freescale/s32g274a-rdb2.dtsi:
//
//// Comment out original nodes &gmac0_mdio and &pfe_netif1 ////
//
// &gmac0_mdio {
// /* AQR107 */
// gmac_mdio_a_phy3: ethernet-phy@3 {
// compatible = "ethernet-phy-ieee802.3-c45";
// #address-cells = <1>;
// #size-cells = <0>;
// /*
// * Warning: from board rev D it is subject
// * for eth fixup: addr changed to 0x8
// */
// reg = <3>;
// };
// };
//
// &pfe_netif1 {
// phy-mode = "sgmii";
// phy-handle = <&gmac_mdio_a_phy3>;
// };
//
//
//// Add these new nodes ////
//
&gmac0 {
status = "disabled";
};
&gmac0_mdio {
status = "disabled";
};
&pfe_mdio1 {
status = "okay";
/* KSZ9031 GMAC */
pfe_mdio_a_phy1: ethernet-phy@1 {
reg = <1>;
};
};
&pfe {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&pfe2mdiob_pins>,
<&pfe2rgmiib_pins>, <&pfe1mdioa_pins>, <&pfe1rgmiia_pins>;
};
&pfe_netif1 {
status = "okay";
phy-handle = <&pfe_mdio_a_phy1>;
phy-mode = "rgmii-id";
};
&pinctrl {
pfe1mdioa_pins: pfe1mdioa {
pfe1mdioa_grp0 {
pinmux = <S32CC_PINMUX(60, FUNC2)>;
output-enable;
slew-rate = <S32CC_FAST_SLEW_166MHZ>;
};
pfe1mdioa_grp1 {
pinmux = <S32CC_PINMUX(61, FUNC2)>;
output-enable;
input-enable;
slew-rate = <S32CC_FAST_SLEW_166MHZ>;
};
pfe1mdioa_grp2 {
pinmux = <S32CC_PINMUX(857, FUNC2)>;
};
};
pfe1rgmiia_pins: pfe1rgmiia {
pfe1rgmiia_grp0 {
pinmux = <S32CC_PINMUX(66, FUNC2)>;
output-enable;
slew-rate = <S32CC_FAST_SLEW_166MHZ>;
bias-pull-up;
};
pfe1rgmiia_grp1 {
pinmux = <S32CC_PINMUX(866, FUNC2)>,
<S32CC_PINMUX(859, FUNC2)>,
<S32CC_PINMUX(865, FUNC2)>,
<S32CC_PINMUX(861, FUNC2)>,
<S32CC_PINMUX(862, FUNC2)>,
<S32CC_PINMUX(863, FUNC2)>,
<S32CC_PINMUX(864, FUNC2)>;
};
pfe1rgmiia_grp2 {
pinmux = <S32CC_PINMUX(67, FUNC2)>,
<S32CC_PINMUX(68, FUNC2)>,
<S32CC_PINMUX(69, FUNC2)>,
<S32CC_PINMUX(70, FUNC2)>,
<S32CC_PINMUX(71, FUNC3)>;
output-enable;
slew-rate = <S32CC_FAST_SLEW_166MHZ>;
};
pfe1rgmiia_grp3 {
pinmux = <S32CC_PINMUX(72, FUNC0)>,
<S32CC_PINMUX(73, FUNC0)>,
<S32CC_PINMUX(74, FUNC0)>,
<S32CC_PINMUX(75, FUNC0)>,
<S32CC_PINMUX(76, FUNC0)>,
<S32CC_PINMUX(77, FUNC0)>;
input-enable;
slew-rate = <S32CC_FAST_SLEW_166MHZ>;
};
};
};
This changes above apply for BSP39 and onwards.
For BSP38 and earlier you need to to the following:
in u-boot (also meant for PFE_EMAC1):
setenv hwconfig "pcie0:mode=pcie,clock=ext;pcie1:mode=sgmii,clock=ext,fmhz=125,xpcs_mode=2G5"
setenv pfeng_mode 'enable,sgmii,rgmii,rgmii'
setenv s32cc_gmac_mode disable
saveenv
In arch/arm64/boot/dts/freescale/s32g274a-rdb2.dtsi (also meant for PFE_EMAC2):
//// Comment out original nodes &gmac0_mdio and &pfe_netif1 ////
// &gmac0_mdio {
// /* AQR107 */
// gmac_mdio_a_phy3: ethernet-phy@3 {
// compatible = "ethernet-phy-ieee802.3-c45";
// #address-cells = <1>;
// #size-cells = <0>;
// /*
// * Warning: from board rev D it is subject
// * for eth fixup: addr changed to 0x8
// */
// reg = <3>;
// };
// };
// &pfe_netif1 {
// phy-mode = "sgmii";
// phy-handle = <&gmac_mdio_a_phy3>;
// };
//// Add these new nodes ////
&gmac0 {
status = "disabled";
};
&gmac0_mdio {
status = "disabled";
};
&pfe_mdio1 {
status = "okay";
/* KSZ9031 GMAC */
pfe_mdio_a_phy1: ethernet-phy@1 {
reg = <1>;
};
};
&pfe {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&pfe2mdiob_pins>,
<&pfe2rgmiib_pins>, <&pfe1mdioa_pins>, <&pfe1rgmiia_pins>;
};
&pfe_netif1 {
status = "okay";
phy-handle = <&pfe_mdio_a_phy1>;
phy-mode = "rgmii-id";
};
&pinctrl {
pfe1mdioa_pins: pfe1mdioa {
pfe1mdioa_grp0 {
pinmux = <S32CC_PINMUX(60, FUNC2)>;
output-enable;
slew-rate = <S32CC_SLEW_208MHZ>;
};
pfe1mdioa_grp1 {
pinmux = <S32CC_PINMUX(61, FUNC2)>;
output-enable;
input-enable;
slew-rate = <S32CC_SLEW_208MHZ>;
};
pfe1mdioa_grp2 {
pinmux = <S32CC_PINMUX(857, FUNC2)>;
};
};
pfe1rgmiia_pins: pfe1rgmiia {
pfe1rgmiia_grp0 {
pinmux = <S32CC_PINMUX(66, FUNC2)>;
output-enable;
slew-rate = <S32CC_SLEW_208MHZ>;
bias-pull-up;
};
pfe1rgmiia_grp1 {
pinmux = <S32CC_PINMUX(866, FUNC2)>,
<S32CC_PINMUX(859, FUNC2)>,
<S32CC_PINMUX(865, FUNC2)>,
<S32CC_PINMUX(861, FUNC2)>,
<S32CC_PINMUX(862, FUNC2)>,
<S32CC_PINMUX(863, FUNC2)>,
<S32CC_PINMUX(864, FUNC2)>;
};
pfe1rgmiia_grp2 {
pinmux = <S32CC_PINMUX(67, FUNC2)>,
<S32CC_PINMUX(68, FUNC2)>,
<S32CC_PINMUX(69, FUNC2)>,
<S32CC_PINMUX(70, FUNC2)>,
<S32CC_PINMUX(71, FUNC3)>;
output-enable;
slew-rate = <S32CC_SLEW_208MHZ>;
};
pfe1rgmiia_grp3 {
pinmux = <S32CC_PINMUX(72, FUNC0)>,
<S32CC_PINMUX(73, FUNC0)>,
<S32CC_PINMUX(74, FUNC0)>,
<S32CC_PINMUX(75, FUNC0)>,
<S32CC_PINMUX(76, FUNC0)>,
<S32CC_PINMUX(77, FUNC0)>;
input-enable;
slew-rate = <S32CC_SLEW_208MHZ>;
};
};
};
To recompile the device tree you can use:
make -j ARCH=arm64 CROSS_COMPILE=<path-to-your-cross-compiler> dtbs
and then just change the device tree file in the corresponding partition of your eMMC/SD card
Let me know the results after this change.