Enable ENETC on i.MX952 EVK
Subsystems (3)
cover Enable ENETC on i.MX952 EVK
---
Alice Guo (1):
imx952_evk: Enable ENETC0
Clark Wang (1):
net: fsl_enetc: fix the duplex setting on the iMX platform
Ye Li (1):
net: fsl_enetc: Add support for i.MX952
arch/arm/dts/imx952-evk-u-boot.dtsi | 94 ++++++++++++++++++++++++++++++++ arch/arm/dts/imx952-u-boot.dtsi | 100 ++++++++++++++++++++++++++++++++++ configs/imx952_evk_defconfig | 3 + drivers/net/Kconfig | 4 +- drivers/net/fsl_enetc.c | 46 ++++++++++++---- drivers/net/fsl_enetc_netc_blk_ctrl.c | 72 ++++++++++++++++++++++++ 6 files changed, 307 insertions(+), 12 deletions(-)
---
base-commit: f7e7c55e53e80100c327b9cb0512c069acf80ab5
change-id: 20260403-enetc-b2d80f42ba23
Best regards,
Signature · 1 line
Alice Guo <[email protected]>
PATCH 1/3 net: fsl_enetc: fix the duplex setting on the iMX platform
From: Clark Wang <[email protected]>
The iMX and LS platforms use different bits in the same register to set duplex, but their logics are opposite.
The current settings will result in unexpected configurations in RGMII mode.
--- drivers/net/fsl_enetc.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
drivers/net/fsl_enetc.c +9 -9
@@ -17,6 +17,7 @@#include <asm/io.h> #include <pci.h> #include <miiphy.h> +#include <linux/bitfield.h> #include <linux/bug.h> #include <linux/delay.h> #include <linux/build_bug.h>
@@ -388,7 +389,7 @@ static int enetc_init_sgmii(struct udevice *dev)/* set up MAC for RGMII */ static void enetc_init_rgmii (struct udevice *dev,struct phy_device *phydev) { -u32 old_val, val, dpx =0 ; +u32 old_val, val =0 ; old_val = val =enetc_read_mac_port (dev,ENETC_PM_IF_MODE );
@@ -408,15 +409,14 @@ static void enetc_init_rgmii(struct udevice *dev, struct phy_device *phydev) val |=ENETC_PM_IFM_SSP_10 ; } -if (enetc_is_imx95 (dev)) - dpx =ENETC_PM_IFM_FULL_DPX_IMX ; +if (enetc_is_imx95 (dev)) + val =u32_replace_bits (val, + phydev->duplex ==DUPLEX_FULL ?0 :1 , +ENETC_PM_IFM_FULL_DPX_IMX );else if (enetc_is_ls1028a (dev)) - dpx =ENETC_PM_IFM_FULL_DPX_LS ; - -if (phydev->duplex ==DUPLEX_FULL ) - val |= dpx; -else - val &= ~dpx; + val =u32_replace_bits (val, + phydev->duplex ==DUPLEX_FULL ?1 :0 , +ENETC_PM_IFM_FULL_DPX_LS );if (val == old_val)return ;
Signature · 1 line
2.43.0
PATCH 2/3 net: fsl_enetc: Add support for i.MX952
In reply to [email protected]From: Ye Li <[email protected]>
Extend ENETC driver to support i.MX952 platform where 2 ENETC controllers are located on different PCIe buses.
Key changes:
- Add enetc_dev_id_imx() to derive device ID from device tree "reg" property for i.MX952, mapping bus_devfn values 0x0 and 0x100 to device IDs 0 and 1 respectively
- Implement imx952_netcmix_init() to configure MII protocol and PCS settings based on PHY mode parsed from device tree
- Add i.MX952 to FSL_ENETC_NETC_BLK_CTRL Kconfig dependencies
--- drivers/net/Kconfig | 4 +- drivers/net/fsl_enetc.c | 28 +++++++++++++- drivers/net/fsl_enetc_netc_blk_ctrl.c | 72 +++++++++++++++++++++++++++++++++++ 3 files changed, 101 insertions(+), 3 deletions(-)
drivers/net/Kconfig +2 -2
@@ -1018,8 +1018,8 @@ config FSL_ENETC config FSL_ENETC_NETC_BLK_CTRL bool "NXP ENETC NETC blocks control driver" depends on FSL_ENETC - depends on IMX95 || IMX94 - default y if IMX95 || IMX94 + depends on IMX95 || IMX94 || IMX952 + default y if IMX95 || IMX94 || IMX952 help This driver configures Integrated Endpoint Register Block (IERB) and Privileged Register Block (PRB) of NETC. For i.MX platforms, it also
drivers/net/fsl_enetc.c +27 -1
@@ -67,10 +67,36 @@ static int enetc_is_ls1028a(struct udevice *dev) pplat->vendor ==PCI_VENDOR_ID_FREESCALE ; } +static int enetc_dev_id_imx (struct udevice *dev) +{ +if (IS_ENABLED (CONFIG_IMX952 )) { +int bus_devfn; +u32 reg[5 ]; +int error; + + error =ofnode_read_u32_array (dev_ofnode (dev),"reg" , reg,ARRAY_SIZE (reg)); +if (error) +return error; + + bus_devfn = (reg[0 ] >>8 ) &0xffff ; + +switch (bus_devfn) { +case 0 : +return 0 ; +case 0x100 : +return 1 ; +default : +return -EINVAL ; + } + } + +return PCI_DEV (pci_get_devfn (dev)) >>3 ; +} +static int enetc_dev_id (struct udevice *dev) {if (enetc_is_imx95 (dev)) -return PCI_DEV (pci_get_devfn (dev)) >>3 ; +return enetc_dev_id_imx (dev);if (enetc_is_ls1028a (dev))return PCI_FUNC (pci_get_devfn (dev));
drivers/net/fsl_enetc_netc_blk_ctrl.c +72 -0
99 lines not on this page · raw message
Signature · 1 line
2.43.0
PATCH 3/3 imx952_evk: Enable ENETC0
In reply to [email protected]From: Alice Guo <[email protected]>
Enable ENETC0 functionality on the i.MX952 EVK board.
--- arch/arm/dts/imx952-evk-u-boot.dtsi | 94 +++++++++++++++++++++++++++++++++ arch/arm/dts/imx952-u-boot.dtsi | 100 ++++++++++++++++++++++++++++++++++++ configs/imx952_evk_defconfig | 3 ++ 3 files changed, 197 insertions(+)
arch/arm/dts/imx952-evk-u-boot.dtsi +94 -0
@@ -5,6 +5,100 @@ #include "imx952-u-boot.dtsi" +&enetc0 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_enetc0>; + phy-handle = <ðphy0>; + phy-mode = "rgmii-id"; + status = "okay"; +}; + +&lpi2c6 { + clock-frequency = <100000>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_lpi2c6>; + status = "okay"; + + pcal6416: gpio@21 { + compatible = "nxp,pcal6416"; + #gpio-cells = <2>; + gpio-controller; + reg = <0x21>; + interrupt-controller; + #interrupt-cells = <2>; + interrupt-parent = <&gpio2>; + interrupts = <10 IRQ_TYPE_LEVEL_LOW>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_pcal6416>; + vcc-supply = <®_3p3v>; + }; +}; + +&netc_blk_ctrl { + status = "okay"; +}; + +&netc_bus0 { + status = "okay"; +}; + +&netc_emdio { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_emdio>; + status = "okay"; + + ethphy0: ethernet-phy@1 { + reg = <1>; + reset-gpios = <&pcal6416 13 GPIO_ACTIVE_LOW>; + reset-assert-us = <10000>; + reset-deassert-us = <80000>; + realtek,clkout-disable; + }; +}; + +&netc_timer { + status = "okay"; +}; + &wdog3 { status = "disabled"; }; + +&scmi_iomuxc { + pinctrl_lpi2c6: lpi2c6grp { + fsl,pins = < + IMX952_PAD_GPIO_IO02__WAKEUPMIX_TOP_LPI2C6_SDA 0x40000b9e + IMX952_PAD_GPIO_IO03__WAKEUPMIX_TOP_LPI2C6_SCL 0x40000b9e + >; + }; + + pinctrl_pcal6416: pcal6416grp { + fsl,pins = < + IMX952_PAD_GPIO_IO10__WAKEUPMIX_TOP_GPIO2_IO_10 0x31e + >; + }; + + pinctrl_emdio: emdiogrp{ + fsl,pins = < + IMX952_PAD_ENET1_MDC__NETCMIX_TOP_NETC_MDC 0x50e + IMX952_PAD_ENET1_MDIO__NETCMIX_TOP_NETC_MDIO 0x90e + >; + }; + + pinctrl_enetc0: enetc0grp { + fsl,pins = < + IMX952_PAD_ENET1_TD3__NETCMIX_TOP_ETH0_RGMII_TD3 0x50e + IMX952_PAD_ENET1_TD2__NETCMIX_TOP_ETH0_RGMII_TD2 0x50e + IMX952_PAD_ENET1_TD1__NETCMIX_TOP_ETH0_RGMII_TD1 0x50e + IMX952_PAD_ENET1_TD0__NETCMIX_TOP_ETH0_RGMII_TD0 0x50e + IMX952_PAD_ENET1_TX_CTL__NETCMIX_TOP_ETH0_RGMII_TX_CTL 0x50e + IMX952_PAD_ENET1_TXC__NETCMIX_TOP_ETH0_RGMII_TX_CLK 0x58e + IMX952_PAD_ENET1_RX_CTL__NETCMIX_TOP_ETH0_RGMII_RX_CTL 0x50e + IMX952_PAD_ENET1_RXC__NETCMIX_TOP_ETH0_RGMII_RX_CLK 0x58e + IMX952_PAD_ENET1_RD0__NETCMIX_TOP_ETH0_RGMII_RD0 0x50e + IMX952_PAD_ENET1_RD1__NETCMIX_TOP_ETH0_RGMII_RD1 0x50e + IMX952_PAD_ENET1_RD2__NETCMIX_TOP_ETH0_RGMII_RD2 0x50e + IMX952_PAD_ENET1_RD3__NETCMIX_TOP_ETH0_RGMII_RD3 0x50e + >; + }; +};
arch/arm/dts/imx952-u-boot.dtsi +100 -0
106 lines not on this page · raw message
configs/imx952_evk_defconfig +3 -0
@@ -40,6 +40,7 @@ CONFIG_DEFAULT_FDT_FILE="freescale/imx952-evk.dtb" CONFIG_SYS_CBSIZE=2048 CONFIG_SYS_PBSIZE=2074 CONFIG_BOARD_LATE_INIT=y +CONFIG_PCI_INIT_R=y CONFIG_SPL_MAX_SIZE=0x30000 CONFIG_SPL_BOARD_INIT=y CONFIG_SPL_LOAD_IMX_CONTAINER=y
@@ -111,6 +112,8 @@ CONFIG_DM_PCA953X=y CONFIG_ADP5585_GPIO=y CONFIG_DM_I2C=y CONFIG_SYS_I2C_IMX_LPI2C=y +CONFIG_I2C_MUX=y +CONFIG_I2C_MUX_PCA954x=y CONFIG_IMX_MU_MBOX=y CONFIG_SUPPORT_EMMC_RPMB=y CONFIG_SUPPORT_EMMC_BOOT=y
Signature · 1 line
2.43.0
Fabio Estevam
reviewerRe: [PATCH v1 3/3] imx952_evk: Enable ENETC0
Quoted 9 lines · On Fri, Apr 3, 2026 at 8:02 AM <[email protected]> wrote:
From: Alice Guo <[email protected]>
Enable ENETC0 functionality on the i.MX952 EVK board.
Signed-off-by Alice Guo <[email protected]>--- arch/arm/dts/imx952-evk-u-boot.dtsi | 94 +++++++++++++++++++++++++++++++++ arch/arm/dts/imx952-u-boot.dtsi | 100 ++++++++++++++++++++++++++++++++++++
Please explain in the commit log why you are adding these nodes to the u-boot.dtsi files.
Have they already been submitted to Linux? Have they landed in linux-next?
Please show the full picture here.
Fabio Estevam
reviewerRe: [EXT] Re: [PATCH v1 3/3] imx952_evk: Enable ENETC0
In reply to Alice GuoHi Alice,
Quoted 1 line · Alice Guo
ENETC device tree nodes have not yet been submitted to the Linux. They are not present in linux-next or devicetree-rebasing. Do I need to resubmit the patch to U-Boot after these nodes are included in linux-next?
Yes, please.
回复: [EXT] Re: [PATCH v1 3/3] imx952_evk: Enable ENETC0
In reply to Fabio EstevamQuoted 34 lines
-----邮件原件-----
发件人: Fabio Estevam <[email protected]>
发送时间: 2026年4月4日 19:39
收件人: Alice Guo (OSS) <[email protected]>
抄送: Marek Vasut <[email protected]>; [email protected]; Ye Li <[email protected]>; [email protected]; dl-uboot-imx <[email protected]>; Jerome Forissier <[email protected]>; Tom Rini <[email protected]>; Thomas Schäfer <[email protected]>; Michael Walle <[email protected]>; Clark Wang <[email protected]>; Christian Marangi <[email protected]>; Simon Glass <[email protected]>; Quentin Schulz <[email protected]>; Mikhail Kshevetskiy <[email protected]>; Robert Marko <[email protected]>; Yao Zi <[email protected]>; Heiko Thiery <[email protected]>; Marek Vasut <[email protected]>; Peng Fan <[email protected]>; Jacky Bai <[email protected]>; Andrew Goodbody <[email protected]>; Stefano Babic <[email protected]>; Alice Guo <[email protected]> 主题: [EXT] Re: [PATCH v1 3/3]imx952_evk: Enable ENETC0Caution: This is an external email. Please take care when clicking links or opening attachments. When in doubt, report the message using the 'Report this email' button
Quoted 8 lines · On Fri, Apr 3, 2026 at 8:02 AM <[email protected]> wrote:
From: Alice Guo <[email protected]>
Enable ENETC0 functionality on the i.MX952 EVK board.
Signed-off-by Alice Guo <[email protected]>--- arch/arm/dts/imx952-evk-u-boot.dtsi | 94+++++++++++++++++++++++++++++++++
Quoted 1 line
arch/arm/dts/imx952-u-boot.dtsi | 100
Quoted 8 lines
++++++++++++++++++++++++++++++++++++
Please explain in the commit log why you are adding these nodes to the
u-boot.dtsifiles.Have they already been submitted to Linux? Have they landed in linux-next?
Please show the full picture here.
Hi Fabio,
ENETC device tree nodes have not yet been submitted to the Linux. They are not present in linux-next or devicetree-rebasing. Do I need to resubmit the patch to U-Boot after these nodes are included in linux-next?
Best regards,
Alice Guo