Skip to content

Commit

Permalink
boards: nxp: Support NXP ENET_1G on mimxrt1170_evk
Browse files Browse the repository at this point in the history
Support NXP ENET_1G on mimxrt1170_evk/mimxrt1176/cm7 platform.
Added test configuration sample.net.zperf.nxp_enet1g and
documented the usage of the ethernet driver with ENET_1G
peripheral.

Fixes: zephyrproject-rtos#66348

Signed-off-by: Stanislav Poboril <stanislav.poboril@nxp.com>
  • Loading branch information
stanislav-poboril authored and nashif committed Jun 7, 2024
1 parent d124eec commit 684885a
Show file tree
Hide file tree
Showing 6 changed files with 158 additions and 13 deletions.
12 changes: 10 additions & 2 deletions boards/nxp/mimxrt1170_evk/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,9 @@ RT1170 EVKB (`mimxrt1170_evk@B//cm7/cm4`)
+-----------+------------+-------------------------------------+-----------------+-----------------+
| WATCHDOG | on-chip | watchdog | Supported (M7) | Supported (M7) |
+-----------+------------+-------------------------------------+-----------------+-----------------+
| ENET | on-chip | ethernet - 10/100M (ENET_QOS or | Supported (M7) | No support |
| ENET1G | | GigE not supported yet) | | |
| ENET | on-chip | ethernet - 10/100M | Supported (M7) | No support |
+-----------+------------+-------------------------------------+-----------------+-----------------+
| ENET1G | on-chip | ethernet - 10/100/1000M | Supported (M7) | No support |
+-----------+------------+-------------------------------------+-----------------+-----------------+
| SAI | on-chip | i2s | Supported | No support |
+-----------+------------+-------------------------------------+-----------------+-----------------+
Expand Down Expand Up @@ -444,3 +445,10 @@ should see the following message in the terminal:

.. _NXP MCUXpresso for Visual Studio Code:
https://www.nxp.com/design/software/development-software/mcuxpresso-software-and-tools-/mcuxpresso-for-visual-studio-code:MCUXPRESSO-VSC

ENET1G Driver
=============

Current default of ethernet driver is to use 100M Ethernet instance ENET.
To use the 1G Ethernet instance ENET1G, include the overlay to west build with
the option `-DEXTRA_DTC_OVERLAY_FILE=nxp,enet1g.overlay` instead.
36 changes: 36 additions & 0 deletions boards/nxp/mimxrt1170_evk/dts/nxp,enet1g.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Copyright 2023-2024 NXP
*
* ENET_1G binding overlay
*/

/ {
soc {
/delete-node/ ethernet@40424000;
};
};

&enet1g {
status = "okay";
};

&enet1g_mac {
status = "okay";
};

&enet1g_mdio {
status = "okay";
enet1g_phy: phy@1 {
status = "okay";
};
};

&enet1g_ptp_clock {
status = "okay";
};

&pinctrl {
/delete-node/ pinmux_enet;
/delete-node/ pinmux_enet_mdio;
/delete-node/ pinmux_ptp;
};
58 changes: 58 additions & 0 deletions boards/nxp/mimxrt1170_evk/mimxrt1170_evk-pinctrl.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,64 @@
pinmux_ptp: pinmux_ptp {
};

pinmux_enet1g: pinmux_enet1g {
group0 {
pinmux = <&iomuxc_gpio_disp_b1_11_enet_1g_tx_clk_io>, // ENET_RGMII_TXC
<&iomuxc_gpio_disp_b1_01_enet_1g_rx_clk>; // ENET_RGMII_RXC
bias-disable;
drive-strength = "high";
slew-rate = "fast";
input-enable;
};
group1 {
pinmux = <&iomuxc_gpio_disp_b1_09_enet_1g_tdata00>, // ENET_RGMII_TXD0
<&iomuxc_gpio_disp_b1_08_enet_1g_tdata01>, // ENET_RGMII_TXD1
<&iomuxc_gpio_disp_b1_07_enet_1g_tdata02>, // ENET_RGMII_TXD2
<&iomuxc_gpio_disp_b1_06_enet_1g_tdata03>, // ENET_RGMII_TXD3
<&iomuxc_gpio_disp_b1_10_enet_1g_tx_en>; // ENET_RGMII_TX_EN
drive-strength = "high";
bias-pull-up;
slew-rate = "fast";
};
group2 {
pinmux = <&iomuxc_gpio_disp_b1_02_enet_1g_rdata00>, // ENET_RGMII_RXD0
<&iomuxc_gpio_disp_b1_03_enet_1g_rdata01>, // ENET_RGMII_RXD1
<&iomuxc_gpio_disp_b1_04_enet_1g_rdata02>, // ENET_RGMII_RXD2
<&iomuxc_gpio_disp_b1_05_enet_1g_rdata03>, // ENET_RGMII_RXD3
<&iomuxc_gpio_disp_b1_00_enet_1g_rx_en>; // ENET_RGMII_RX_EN
drive-strength = "high";
bias-pull-down;
slew-rate = "fast";
input-enable;
};
};

pinmux_enet1g_mdio: pinmux_enet1g_mdio {
group0 {
pinmux = <&iomuxc_gpio_disp_b2_13_gpio11_io14>; // ETHPHY_RST_B
drive-strength = "high";
bias-pull-down;
slew-rate = "slow";
};
group1 {
pinmux = <&iomuxc_gpio_disp_b2_12_gpio_mux5_io13>; // RGMII1_PHY_INTB
drive-strength = "high";
bias-pull-down;
slew-rate = "fast";
input-enable;
};
group2 {
pinmux = <&iomuxc_gpio_emc_b2_19_enet_1g_mdc>, // ENET_RGMII_MDC
<&iomuxc_gpio_emc_b2_20_enet_1g_mdio>; // ENET_RGMII_MDIO
drive-strength = "high";
bias-pull-down;
slew-rate = "fast";
};
};

pinmux_enet1g_ptp: pinmux_enet1g_ptp {
};

pinmux_flexcan3: pinmux_flexcan3 {
group0 {
pinmux = <&iomuxc_lpsr_gpio_lpsr_01_can3_rx>,
Expand Down
28 changes: 28 additions & 0 deletions boards/nxp/mimxrt1170_evk/mimxrt1170_evk.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,34 @@
pinctrl-names = "default";
};

&enet1g_mac {
status = "disabled";
pinctrl-0 = <&pinmux_enet1g>;
pinctrl-names = "default";
phy-handle = <&enet1g_phy>;
phy-connection-type = "rgmii";
zephyr,random-mac-address;
};

&enet1g_mdio {
status = "disabled";
pinctrl-0 = <&pinmux_enet1g_mdio>;
pinctrl-names = "default";
enet1g_phy: phy@1 {
compatible = "realtek,rtl8211f";
reg = <1>;
status = "disabled";
reset-gpios = <&gpio11 14 GPIO_ACTIVE_HIGH>;
int-gpios = <&gpio5 13 GPIO_ACTIVE_LOW>;
};
};

&enet1g_ptp_clock {
status = "disabled";
pinctrl-0 = <&pinmux_enet1g_ptp>;
pinctrl-names = "default";
};

&csi {
pinctrl-0 = <&pinmux_csi>;
pinctrl-names = "default";
Expand Down
30 changes: 19 additions & 11 deletions dts/arm/nxp/nxp_rt11xx.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -776,22 +776,30 @@
};
};

/*
* enet1g peripheral to use with kinetis-ethernet (eth_mcux) driver
* just like the enet peripheral (i.e. only 10/100Mbit for now)
*/
enet1g: ethernet@40420000 {
compatible = "nxp,kinetis-ethernet";
compatible = "nxp,enet1g";
reg = <0x40420000 0x628>;
interrupts = <141 0>;
interrupt-names = "COMMON";
clocks = <&ccm IMX_CCM_ENET1G_CLK 0 0>;
status = "disabled";
phy-addr = <1>;
ptp1g: ptp {
compatible = "nxp,kinetis-ptp";
enet1g_mac: ethernet {
compatible = "nxp,enet-mac";
interrupts = <141 0>;
interrupt-names = "COMMON";
nxp,mdio = <&enet1g_mdio>;
nxp,ptp-clock = <&enet1g_ptp_clock>;
status = "disabled";
};
enet1g_mdio: mdio {
compatible = "nxp,enet-mdio";
status = "disabled";
#address-cells = <1>;
#size-cells = <0>;
};
enet1g_ptp_clock: ptp_clock {
compatible = "nxp,enet-ptp-clock";
interrupts = <142 0>;
interrupt-names = "IEEE1588_TMR";
status = "disabled";
clocks = <&ccm IMX_CCM_ENET_PLL 0 0>;
};
};

Expand Down
7 changes: 7 additions & 0 deletions samples/net/zperf/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,10 @@ tests:
depends_on:
- arduino_spi
- arduino_gpio
sample.net.zperf.nxp_enet1g:
extra_args: EXTRA_DTC_OVERLAY_FILE="nxp,enet1g.overlay"
tags:
- net
- zperf
platform_allow:
- mimxrt1170_evk/mimxrt1176/cm7

0 comments on commit 684885a

Please sign in to comment.