<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic S32G3: Modifying RGMII TX clock from Linux in S32G</title>
    <link>https://community.nxp.com/t5/S32G/S32G3-Modifying-RGMII-TX-clock-from-Linux/m-p/2006059#M11914</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have a custom S32G399A board that uses PFE0 in RGMII mode to a gigabit transceiver (KSZ9131) wired to a RJ45 plug.&lt;/P&gt;&lt;P&gt;The hardware works fine when connected to a gigabit switch or router however when connected to a 100BASE-TX router the PFE0 TX clock does not get set to 25MHz and remains at 125MHz which is the speed for gigabit.&lt;/P&gt;&lt;P&gt;After some investigating I can see that the pfe0 tx clock comes from these two muxes:&lt;/P&gt;&lt;P&gt;EMAC0 mux&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="andopando_0-1733210657946.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/313671i4E958F51C86143D1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="andopando_0-1733210657946.png" alt="andopando_0-1733210657946.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CGM2 Mux 1 with divider. Setting this divider to this value (5) is what we need the kernel (and SCMI I suppose) to be able to do.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="andopando_1-1733210679156.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/313672i1FBD45BA9C182889/image-size/medium?v=v2&amp;amp;px=400" role="button" title="andopando_1-1733210679156.png" alt="andopando_1-1733210679156.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The pfeng driver seems to think it is setting the clock to 25MHz&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="andopando_2-1733210843717.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/313674i4C26AD318BBC03F2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="andopando_2-1733210843717.png" alt="andopando_2-1733210843717.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;however probing the physical pfe0 tx pin shows the old 125MHz clock and there is no ethernet traffic passing through.&lt;/P&gt;&lt;P&gt;I believe SCMI running in BL31 (part of TF-A) is responsible for clock management.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried patching the CGM2 part of the TF-A device tree to specify the 25MHz clock:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;diff --git a/fdts/s32g.dtsi b/fdts/s32g.dtsi
index 14ba9729d..02cd393e4 100644
--- a/fdts/s32g.dtsi
+++ b/fdts/s32g.dtsi
@@ -604,12 +604,15 @@

assigned-clocks =
&amp;lt;&amp;amp;plat_clks S32G_CLK_MC_CGM2_MUX0&amp;gt;,
+ &amp;lt;&amp;amp;plat_clks S32G_CLK_MC_CGM2_MUX1&amp;gt;,
&amp;lt;&amp;amp;plat_clks S32G_CLK_PFE_PE&amp;gt;;
assigned-clock-rates =
&amp;lt;0&amp;gt;,
+ &amp;lt;25000000&amp;gt;,
&amp;lt;600000000&amp;gt;;
assigned-clock-parents =
- &amp;lt;&amp;amp;plat_clks S32G_CLK_ACCEL_PLL_PHI1&amp;gt;;
+ &amp;lt;&amp;amp;plat_clks S32G_CLK_ACCEL_PLL_PHI1&amp;gt;,
+ &amp;lt;&amp;amp;plat_clks S32GEN1_CLK_PERIPH_PLL_PHI5&amp;gt;;
};

pfe: pfe@46000000 {&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And also this printout where the mux gets enabled to check when and how it's being set&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;diff --git a/drivers/nxp/s32/clk/enable_clk.c b/drivers/nxp/s32/clk/enable_clk.c
index a356da96c..24c1e59ec 100644
--- a/drivers/nxp/s32/clk/enable_clk.c
+++ b/drivers/nxp/s32/clk/enable_clk.c
@@ -762,7 +762,10 @@ static int enable_cgm_div(struct s32gen1_clk_obj *module,
return -EINVAL;
#endif
}
-
+ if(cgm_addr == (void*)MC_CGM2_BASE_ADDR){
+ NOTICE("\r\nEnabling CGM2 mux %d with div scaling %d\r\n",mux-&amp;gt;index, dc);
+ NOTICE("\r\npfreq %lu div-&amp;gt;freq %lu\r\n",pfreq, div-&amp;gt;freq);
+ }
cgm_mux_div_config(cgm_addr, mux-&amp;gt;index, dc - 1, div-&amp;gt;index);
return 0;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The shell clearly outputs that the mux is being enabled with the divider set to 5 however this doesn't seem to work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have found a temporary workaround of just setting the PHI5 output of the peripheral pll to 25MHz via this patch which does work and enables 100Base tx communications&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;diff --git a/fdts/s32cc.dtsi b/fdts/s32cc.dtsi
index 15ee06089..d8177c12b 100644
--- a/fdts/s32cc.dtsi
+++ b/fdts/s32cc.dtsi
@@ -428,7 +428,7 @@
&amp;lt;S32GEN1_PERIPH_PLL_VCO_FREQ&amp;gt;, &amp;lt;100000000&amp;gt;,
&amp;lt;80000000&amp;gt;, &amp;lt;80000000&amp;gt;,
&amp;lt;125000000&amp;gt;, &amp;lt;200000000&amp;gt;,
- &amp;lt;125000000&amp;gt;, &amp;lt;100000000&amp;gt;;
+ &amp;lt;25000000&amp;gt;, &amp;lt;100000000&amp;gt;;
};

accelpll: accelpll@40040000 {&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This isn't ideal since we might have other things reliant on the PHI5 clock that need a different frequency. The divider of CGM2 Mux 1 seems like an easier thing to modify.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm running at-f 2.5 from bsp39 and kernel 5.15 from bsp39 as well but tried 5.10 from bsp38 with no difference&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 03 Dec 2024 11:48:52 GMT</pubDate>
    <dc:creator>andopando</dc:creator>
    <dc:date>2024-12-03T11:48:52Z</dc:date>
    <item>
      <title>S32G3: Modifying RGMII TX clock from Linux</title>
      <link>https://community.nxp.com/t5/S32G/S32G3-Modifying-RGMII-TX-clock-from-Linux/m-p/2006059#M11914</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have a custom S32G399A board that uses PFE0 in RGMII mode to a gigabit transceiver (KSZ9131) wired to a RJ45 plug.&lt;/P&gt;&lt;P&gt;The hardware works fine when connected to a gigabit switch or router however when connected to a 100BASE-TX router the PFE0 TX clock does not get set to 25MHz and remains at 125MHz which is the speed for gigabit.&lt;/P&gt;&lt;P&gt;After some investigating I can see that the pfe0 tx clock comes from these two muxes:&lt;/P&gt;&lt;P&gt;EMAC0 mux&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="andopando_0-1733210657946.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/313671i4E958F51C86143D1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="andopando_0-1733210657946.png" alt="andopando_0-1733210657946.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CGM2 Mux 1 with divider. Setting this divider to this value (5) is what we need the kernel (and SCMI I suppose) to be able to do.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="andopando_1-1733210679156.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/313672i1FBD45BA9C182889/image-size/medium?v=v2&amp;amp;px=400" role="button" title="andopando_1-1733210679156.png" alt="andopando_1-1733210679156.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The pfeng driver seems to think it is setting the clock to 25MHz&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="andopando_2-1733210843717.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/313674i4C26AD318BBC03F2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="andopando_2-1733210843717.png" alt="andopando_2-1733210843717.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;however probing the physical pfe0 tx pin shows the old 125MHz clock and there is no ethernet traffic passing through.&lt;/P&gt;&lt;P&gt;I believe SCMI running in BL31 (part of TF-A) is responsible for clock management.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried patching the CGM2 part of the TF-A device tree to specify the 25MHz clock:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;diff --git a/fdts/s32g.dtsi b/fdts/s32g.dtsi
index 14ba9729d..02cd393e4 100644
--- a/fdts/s32g.dtsi
+++ b/fdts/s32g.dtsi
@@ -604,12 +604,15 @@

assigned-clocks =
&amp;lt;&amp;amp;plat_clks S32G_CLK_MC_CGM2_MUX0&amp;gt;,
+ &amp;lt;&amp;amp;plat_clks S32G_CLK_MC_CGM2_MUX1&amp;gt;,
&amp;lt;&amp;amp;plat_clks S32G_CLK_PFE_PE&amp;gt;;
assigned-clock-rates =
&amp;lt;0&amp;gt;,
+ &amp;lt;25000000&amp;gt;,
&amp;lt;600000000&amp;gt;;
assigned-clock-parents =
- &amp;lt;&amp;amp;plat_clks S32G_CLK_ACCEL_PLL_PHI1&amp;gt;;
+ &amp;lt;&amp;amp;plat_clks S32G_CLK_ACCEL_PLL_PHI1&amp;gt;,
+ &amp;lt;&amp;amp;plat_clks S32GEN1_CLK_PERIPH_PLL_PHI5&amp;gt;;
};

pfe: pfe@46000000 {&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And also this printout where the mux gets enabled to check when and how it's being set&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;diff --git a/drivers/nxp/s32/clk/enable_clk.c b/drivers/nxp/s32/clk/enable_clk.c
index a356da96c..24c1e59ec 100644
--- a/drivers/nxp/s32/clk/enable_clk.c
+++ b/drivers/nxp/s32/clk/enable_clk.c
@@ -762,7 +762,10 @@ static int enable_cgm_div(struct s32gen1_clk_obj *module,
return -EINVAL;
#endif
}
-
+ if(cgm_addr == (void*)MC_CGM2_BASE_ADDR){
+ NOTICE("\r\nEnabling CGM2 mux %d with div scaling %d\r\n",mux-&amp;gt;index, dc);
+ NOTICE("\r\npfreq %lu div-&amp;gt;freq %lu\r\n",pfreq, div-&amp;gt;freq);
+ }
cgm_mux_div_config(cgm_addr, mux-&amp;gt;index, dc - 1, div-&amp;gt;index);
return 0;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The shell clearly outputs that the mux is being enabled with the divider set to 5 however this doesn't seem to work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have found a temporary workaround of just setting the PHI5 output of the peripheral pll to 25MHz via this patch which does work and enables 100Base tx communications&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;diff --git a/fdts/s32cc.dtsi b/fdts/s32cc.dtsi
index 15ee06089..d8177c12b 100644
--- a/fdts/s32cc.dtsi
+++ b/fdts/s32cc.dtsi
@@ -428,7 +428,7 @@
&amp;lt;S32GEN1_PERIPH_PLL_VCO_FREQ&amp;gt;, &amp;lt;100000000&amp;gt;,
&amp;lt;80000000&amp;gt;, &amp;lt;80000000&amp;gt;,
&amp;lt;125000000&amp;gt;, &amp;lt;200000000&amp;gt;,
- &amp;lt;125000000&amp;gt;, &amp;lt;100000000&amp;gt;;
+ &amp;lt;25000000&amp;gt;, &amp;lt;100000000&amp;gt;;
};

accelpll: accelpll@40040000 {&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This isn't ideal since we might have other things reliant on the PHI5 clock that need a different frequency. The divider of CGM2 Mux 1 seems like an easier thing to modify.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm running at-f 2.5 from bsp39 and kernel 5.15 from bsp39 as well but tried 5.10 from bsp38 with no difference&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2024 11:48:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32G/S32G3-Modifying-RGMII-TX-clock-from-Linux/m-p/2006059#M11914</guid>
      <dc:creator>andopando</dc:creator>
      <dc:date>2024-12-03T11:48:52Z</dc:date>
    </item>
    <item>
      <title>Re: S32G3: Modifying RGMII TX clock from Linux</title>
      <link>https://community.nxp.com/t5/S32G/S32G3-Modifying-RGMII-TX-clock-from-Linux/m-p/2006463#M11922</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/224977"&gt;@andopando&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Thanks a lot for the very detailed description of your problem. Can you share the changes you did to the device tree to enable the RGMII mode?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Alejandro&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2024 01:16:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32G/S32G3-Modifying-RGMII-TX-clock-from-Linux/m-p/2006463#M11922</guid>
      <dc:creator>alejandro_e</dc:creator>
      <dc:date>2024-12-04T01:16:12Z</dc:date>
    </item>
    <item>
      <title>Re: S32G3: Modifying RGMII TX clock from Linux</title>
      <link>https://community.nxp.com/t5/S32G/S32G3-Modifying-RGMII-TX-clock-from-Linux/m-p/2006542#M11929</link>
      <description>&lt;P&gt;Hi Alejandro,&lt;/P&gt;&lt;P&gt;Thanks for the quick reply!&lt;/P&gt;&lt;P&gt;I've attached a combined patch file of our changes of the DT's for AT-F 2.5 from bsp38.&lt;/P&gt;&lt;P&gt;I've also attached a patch file of the relevant patches we made to the kernel DT as well. This is for kernel 5.10-184 from bsp38&lt;/P&gt;&lt;P&gt;I've omitted some other changes unrelated to ethernet like can, spi to make the patch list shorter but it's still quite long, apologies.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One more thing I should mention is we have a bootloader that runs before anything else and it sets up some clocks as well but I believe only for the cores, qspi flash.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2024 03:28:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32G/S32G3-Modifying-RGMII-TX-clock-from-Linux/m-p/2006542#M11929</guid>
      <dc:creator>andopando</dc:creator>
      <dc:date>2024-12-04T03:28:08Z</dc:date>
    </item>
    <item>
      <title>Re: S32G3: Modifying RGMII TX clock from Linux</title>
      <link>https://community.nxp.com/t5/S32G/S32G3-Modifying-RGMII-TX-clock-from-Linux/m-p/2007362#M11946</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/224977"&gt;@andopando&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;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:&lt;/P&gt;
&lt;P&gt;In linux modify&amp;nbsp;&lt;STRONG data-fm-marker="37"&gt;arch/arm64/boot/dts/freescale/s32g274a-rdb2.dtsi&lt;/STRONG&gt;:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;//
//// Comment out original nodes &amp;amp;gmac0_mdio and &amp;amp;pfe_netif1 ////
// 
// &amp;amp;gmac0_mdio {
//     /* AQR107 */
//     gmac_mdio_a_phy3: ethernet-phy@3 {
//         compatible = "ethernet-phy-ieee802.3-c45";
//         #address-cells = &amp;lt;1&amp;gt;;
//         #size-cells = &amp;lt;0&amp;gt;;
//         /*
//          * Warning: from board rev D it is subject
//          * for eth fixup: addr changed to 0x8
//          */
//         reg = &amp;lt;3&amp;gt;;
//     };
// };
//
// &amp;amp;pfe_netif1 {
//     phy-mode = "sgmii";
//     phy-handle = &amp;lt;&amp;amp;gmac_mdio_a_phy3&amp;gt;;
// };
//

//
//// Add these new nodes ////
//

&amp;amp;gmac0 {
    status = "disabled";
};

&amp;amp;gmac0_mdio {
    status = "disabled";
};

&amp;amp;pfe_mdio1 {
    status = "okay";
    /* KSZ9031 GMAC */
    pfe_mdio_a_phy1: ethernet-phy@1 {
        reg = &amp;lt;1&amp;gt;;
    };
};
&amp;amp;pfe {
    status = "okay";
    pinctrl-names = "default";
    pinctrl-0 = &amp;lt;&amp;amp;pfe2mdiob_pins&amp;gt;,
            &amp;lt;&amp;amp;pfe2rgmiib_pins&amp;gt;, &amp;lt;&amp;amp;pfe1mdioa_pins&amp;gt;, &amp;lt;&amp;amp;pfe1rgmiia_pins&amp;gt;;
};

&amp;amp;pfe_netif1 {
    status = "okay";
    phy-handle = &amp;lt;&amp;amp;pfe_mdio_a_phy1&amp;gt;;
    phy-mode = "rgmii-id";
};

&amp;amp;pinctrl {
    pfe1mdioa_pins: pfe1mdioa {
        pfe1mdioa_grp0 {
            pinmux = &amp;lt;S32CC_PINMUX(60, FUNC2)&amp;gt;;
            output-enable;
            slew-rate = &amp;lt;S32CC_FAST_SLEW_166MHZ&amp;gt;;
        };

        pfe1mdioa_grp1 {
            pinmux = &amp;lt;S32CC_PINMUX(61, FUNC2)&amp;gt;;
            output-enable;
            input-enable;
            slew-rate = &amp;lt;S32CC_FAST_SLEW_166MHZ&amp;gt;;
        };

        pfe1mdioa_grp2 {
            pinmux = &amp;lt;S32CC_PINMUX(857, FUNC2)&amp;gt;;
        };

    };

    pfe1rgmiia_pins: pfe1rgmiia {
        pfe1rgmiia_grp0 {
            pinmux = &amp;lt;S32CC_PINMUX(66, FUNC2)&amp;gt;;
            output-enable;
            slew-rate = &amp;lt;S32CC_FAST_SLEW_166MHZ&amp;gt;;
            bias-pull-up;
        };

        pfe1rgmiia_grp1 {
            pinmux = &amp;lt;S32CC_PINMUX(866, FUNC2)&amp;gt;,
                 &amp;lt;S32CC_PINMUX(859, FUNC2)&amp;gt;,
                 &amp;lt;S32CC_PINMUX(865, FUNC2)&amp;gt;,
                 &amp;lt;S32CC_PINMUX(861, FUNC2)&amp;gt;,
                 &amp;lt;S32CC_PINMUX(862, FUNC2)&amp;gt;,
                 &amp;lt;S32CC_PINMUX(863, FUNC2)&amp;gt;,
                 &amp;lt;S32CC_PINMUX(864, FUNC2)&amp;gt;;
        };

        pfe1rgmiia_grp2 {
            pinmux = &amp;lt;S32CC_PINMUX(67, FUNC2)&amp;gt;,
                 &amp;lt;S32CC_PINMUX(68, FUNC2)&amp;gt;,
                 &amp;lt;S32CC_PINMUX(69, FUNC2)&amp;gt;,
                 &amp;lt;S32CC_PINMUX(70, FUNC2)&amp;gt;,
                 &amp;lt;S32CC_PINMUX(71, FUNC3)&amp;gt;;
            output-enable;
            slew-rate = &amp;lt;S32CC_FAST_SLEW_166MHZ&amp;gt;;
        };

        pfe1rgmiia_grp3 {
            pinmux = &amp;lt;S32CC_PINMUX(72, FUNC0)&amp;gt;,
                 &amp;lt;S32CC_PINMUX(73, FUNC0)&amp;gt;,
                 &amp;lt;S32CC_PINMUX(74, FUNC0)&amp;gt;,
                 &amp;lt;S32CC_PINMUX(75, FUNC0)&amp;gt;,
                 &amp;lt;S32CC_PINMUX(76, FUNC0)&amp;gt;,
                 &amp;lt;S32CC_PINMUX(77, FUNC0)&amp;gt;;
            input-enable;
            slew-rate = &amp;lt;S32CC_FAST_SLEW_166MHZ&amp;gt;;
        };

    };
};&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This changes above apply for BSP39 and onwards.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For BSP38 and earlier you need to to the following:&lt;/P&gt;
&lt;P&gt;in u-boot (also meant for PFE_EMAC1):&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;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&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;In&amp;nbsp;&lt;STRONG data-fm-marker="96"&gt;arch/arm64/boot/dts/freescale/s32g274a-rdb2.dtsi&amp;nbsp;&lt;/STRONG&gt;(also meant for PFE_EMAC2):&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;//// Comment out original nodes &amp;amp;gmac0_mdio and &amp;amp;pfe_netif1 ////
// &amp;amp;gmac0_mdio {
//     /* AQR107 */
//     gmac_mdio_a_phy3: ethernet-phy@3 {
//         compatible = "ethernet-phy-ieee802.3-c45";
//         #address-cells = &amp;lt;1&amp;gt;;
//         #size-cells = &amp;lt;0&amp;gt;;
//         /*
//          * Warning: from board rev D it is subject
//          * for eth fixup: addr changed to 0x8
//          */
//         reg = &amp;lt;3&amp;gt;;
//     };
// };

// &amp;amp;pfe_netif1 {
//     phy-mode = "sgmii";
//     phy-handle = &amp;lt;&amp;amp;gmac_mdio_a_phy3&amp;gt;;
// };


//// Add these new nodes ////
&amp;amp;gmac0 {
    status = "disabled";
};

&amp;amp;gmac0_mdio {
    status = "disabled";
};

&amp;amp;pfe_mdio1 {
    status = "okay";
    /* KSZ9031 GMAC */
    pfe_mdio_a_phy1: ethernet-phy@1 {
        reg = &amp;lt;1&amp;gt;;
    };
};

&amp;amp;pfe {
    status = "okay";
    pinctrl-names = "default";
    pinctrl-0 = &amp;lt;&amp;amp;pfe2mdiob_pins&amp;gt;,
            &amp;lt;&amp;amp;pfe2rgmiib_pins&amp;gt;, &amp;lt;&amp;amp;pfe1mdioa_pins&amp;gt;, &amp;lt;&amp;amp;pfe1rgmiia_pins&amp;gt;;
};

&amp;amp;pfe_netif1 {
    status = "okay";
    phy-handle = &amp;lt;&amp;amp;pfe_mdio_a_phy1&amp;gt;;
    phy-mode = "rgmii-id";
};

&amp;amp;pinctrl {
    pfe1mdioa_pins: pfe1mdioa {
        pfe1mdioa_grp0 {
            pinmux = &amp;lt;S32CC_PINMUX(60, FUNC2)&amp;gt;;
            output-enable;
            slew-rate = &amp;lt;S32CC_SLEW_208MHZ&amp;gt;;
        };

        pfe1mdioa_grp1 {
            pinmux = &amp;lt;S32CC_PINMUX(61, FUNC2)&amp;gt;;
            output-enable;
            input-enable;
            slew-rate = &amp;lt;S32CC_SLEW_208MHZ&amp;gt;;
        };

        pfe1mdioa_grp2 {
            pinmux = &amp;lt;S32CC_PINMUX(857, FUNC2)&amp;gt;;
        };

    };

    pfe1rgmiia_pins: pfe1rgmiia {
        pfe1rgmiia_grp0 {
            pinmux = &amp;lt;S32CC_PINMUX(66, FUNC2)&amp;gt;;
            output-enable;
            slew-rate = &amp;lt;S32CC_SLEW_208MHZ&amp;gt;;
            bias-pull-up;
        };

        pfe1rgmiia_grp1 {
            pinmux = &amp;lt;S32CC_PINMUX(866, FUNC2)&amp;gt;,
                 &amp;lt;S32CC_PINMUX(859, FUNC2)&amp;gt;,
                 &amp;lt;S32CC_PINMUX(865, FUNC2)&amp;gt;,
                 &amp;lt;S32CC_PINMUX(861, FUNC2)&amp;gt;,
                 &amp;lt;S32CC_PINMUX(862, FUNC2)&amp;gt;,
                 &amp;lt;S32CC_PINMUX(863, FUNC2)&amp;gt;,
                 &amp;lt;S32CC_PINMUX(864, FUNC2)&amp;gt;;
        };

        pfe1rgmiia_grp2 {
            pinmux = &amp;lt;S32CC_PINMUX(67, FUNC2)&amp;gt;,
                 &amp;lt;S32CC_PINMUX(68, FUNC2)&amp;gt;,
                 &amp;lt;S32CC_PINMUX(69, FUNC2)&amp;gt;,
                 &amp;lt;S32CC_PINMUX(70, FUNC2)&amp;gt;,
                 &amp;lt;S32CC_PINMUX(71, FUNC3)&amp;gt;;
            output-enable;
            slew-rate = &amp;lt;S32CC_SLEW_208MHZ&amp;gt;;
        };

        pfe1rgmiia_grp3 {
            pinmux = &amp;lt;S32CC_PINMUX(72, FUNC0)&amp;gt;,
                 &amp;lt;S32CC_PINMUX(73, FUNC0)&amp;gt;,
                 &amp;lt;S32CC_PINMUX(74, FUNC0)&amp;gt;,
                 &amp;lt;S32CC_PINMUX(75, FUNC0)&amp;gt;,
                 &amp;lt;S32CC_PINMUX(76, FUNC0)&amp;gt;,
                 &amp;lt;S32CC_PINMUX(77, FUNC0)&amp;gt;;
            input-enable;
            slew-rate = &amp;lt;S32CC_SLEW_208MHZ&amp;gt;;
        };

    };
};&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To recompile the device tree you can use:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;make -j ARCH=arm64 CROSS_COMPILE=&amp;lt;path-to-your-cross-compiler&amp;gt; dtbs&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp; and then just change the device tree file in the corresponding partition of your eMMC/SD card&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let me know the results after this change.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2024 19:04:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32G/S32G3-Modifying-RGMII-TX-clock-from-Linux/m-p/2007362#M11946</guid>
      <dc:creator>alejandro_e</dc:creator>
      <dc:date>2024-12-04T19:04:52Z</dc:date>
    </item>
  </channel>
</rss>

