* [PATCH 01/10] usb: ehci-mx6: Extend support to i.MX91, i.MX93, i.MX94, and i.MX95
2025-09-23 11:11 [PATCH 00/10] Enable USB and ENETC on i.MX943 EVK Alice Guo (OSS)
@ 2025-09-23 11:11 ` Alice Guo (OSS)
2025-09-23 11:11 ` [PATCH 02/10] arm: arch-imx9: Add USB2.0 and USB3.0 base address definitions Alice Guo (OSS)
` (9 subsequent siblings)
10 siblings, 0 replies; 17+ messages in thread
From: Alice Guo (OSS) @ 2025-09-23 11:11 UTC (permalink / raw)
To: Marek Vasut, Tom Rini, Stefano Babic, Fabio Estevam,
NXP i.MX U-Boot Team, Alice Guo, Lukasz Majewski,
Mattijs Korpershoek, Joe Hershberger, Ramon Fried
Cc: u-boot, Ye Li, Peng Fan, Jacky Bai, Marek Vasut
From: Alice Guo <alice.guo@nxp.com>
Since the EHCI USB driver is shared across i.MX91, i.MX93, i.MX94, and
i.MX95, the condition check is updated to use IMX9.
Signed-off-by: Alice Guo <alice.guo@nxp.com>
Reviewed-by: Marek Vasut <marek.vasut@mailbox.org>
---
drivers/usb/host/Kconfig | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 5c9e8fc9d15..16f210b1281 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -209,10 +209,10 @@ config USB_EHCI_MX6
config USB_EHCI_MX7
bool "Support for i.MX7/i.MX8M/i.MX9 on-chip EHCI USB controller"
- depends on ARCH_MX7 || IMX8M || IMX93 || IMX95
+ depends on ARCH_MX7 || IMX8M || IMX9
select EHCI_HCD_INIT_AFTER_RESET if ARCH_MX7
- select PHY if IMX8M || IMX93 || IMX95
- select NOP_PHY if IMX8M || IMX93 || IMX95
+ select PHY if IMX8M || IMX9
+ select NOP_PHY if IMX8M || IMX9
default y
---help---
Enables support for the on-chip EHCI controller on i.MX7/i.MX8M/i.MX9 SoCs.
--
2.43.0
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH 02/10] arm: arch-imx9: Add USB2.0 and USB3.0 base address definitions
2025-09-23 11:11 [PATCH 00/10] Enable USB and ENETC on i.MX943 EVK Alice Guo (OSS)
2025-09-23 11:11 ` [PATCH 01/10] usb: ehci-mx6: Extend support to i.MX91, i.MX93, i.MX94, and i.MX95 Alice Guo (OSS)
@ 2025-09-23 11:11 ` Alice Guo (OSS)
2025-09-23 11:11 ` [PATCH 03/10] imx943_evk: Enable USB 2.0 controller host mode Alice Guo (OSS)
` (8 subsequent siblings)
10 siblings, 0 replies; 17+ messages in thread
From: Alice Guo (OSS) @ 2025-09-23 11:11 UTC (permalink / raw)
To: Marek Vasut, Tom Rini, Stefano Babic, Fabio Estevam,
NXP i.MX U-Boot Team, Alice Guo, Lukasz Majewski,
Mattijs Korpershoek, Joe Hershberger, Ramon Fried
Cc: u-boot, Ye Li, Peng Fan, Jacky Bai
From: Alice Guo <alice.guo@nxp.com>
Add USB1_BASE_ADDR and USB2_BASE_ADDR for i.MX9 platform, and define
USB_BASE_ADDR as an alias to USB2_BASE_ADDR.
Signed-off-by: Alice Guo <alice.guo@nxp.com>
---
arch/arm/include/asm/arch-imx9/imx-regs.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/arm/include/asm/arch-imx9/imx-regs.h b/arch/arm/include/asm/arch-imx9/imx-regs.h
index e641ed299c0..2d084e5227a 100644
--- a/arch/arm/include/asm/arch-imx9/imx-regs.h
+++ b/arch/arm/include/asm/arch-imx9/imx-regs.h
@@ -39,6 +39,11 @@
#define ANATOP_BASE_ADDR 0x44480000UL
+#define USB1_BASE_ADDR 0x4c100000
+#define USB2_BASE_ADDR 0x4c200000
+
+#define USB_BASE_ADDR USB2_BASE_ADDR
+
#define BLK_CTRL_WAKEUPMIX_BASE_ADDR 0x42420000
#define BLK_CTRL_NS_ANOMIX_BASE_ADDR 0x44210000
#define BLK_CTRL_S_ANOMIX_BASE_ADDR 0x444f0000
--
2.43.0
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH 03/10] imx943_evk: Enable USB 2.0 controller host mode
2025-09-23 11:11 [PATCH 00/10] Enable USB and ENETC on i.MX943 EVK Alice Guo (OSS)
2025-09-23 11:11 ` [PATCH 01/10] usb: ehci-mx6: Extend support to i.MX91, i.MX93, i.MX94, and i.MX95 Alice Guo (OSS)
2025-09-23 11:11 ` [PATCH 02/10] arm: arch-imx9: Add USB2.0 and USB3.0 base address definitions Alice Guo (OSS)
@ 2025-09-23 11:11 ` Alice Guo (OSS)
2025-09-23 11:11 ` [PATCH 04/10] Add serial# for SPL SDP download Alice Guo (OSS)
` (7 subsequent siblings)
10 siblings, 0 replies; 17+ messages in thread
From: Alice Guo (OSS) @ 2025-09-23 11:11 UTC (permalink / raw)
To: Marek Vasut, Tom Rini, Stefano Babic, Fabio Estevam,
NXP i.MX U-Boot Team, Alice Guo, Lukasz Majewski,
Mattijs Korpershoek, Joe Hershberger, Ramon Fried
Cc: u-boot, Ye Li, Peng Fan, Jacky Bai
From: Alice Guo <alice.guo@nxp.com>
This patch enables the USB 2.0 controller to operate in host mode on the
i.MX943 EVK board. It updates the device tree files to configure the USB
2.0 controller appropriately and modifies the defconfig to include
necessary support.
Signed-off-by: Alice Guo <alice.guo@nxp.com>
---
arch/arm/dts/imx943-evk-u-boot.dtsi | 9 +++++++++
arch/arm/dts/imx943-u-boot.dtsi | 28 ++++++++++++++++++++++++++++
configs/imx943_evk_defconfig | 3 +++
3 files changed, 40 insertions(+)
diff --git a/arch/arm/dts/imx943-evk-u-boot.dtsi b/arch/arm/dts/imx943-evk-u-boot.dtsi
index 5496385dc4d..e6abe7ed2e0 100644
--- a/arch/arm/dts/imx943-evk-u-boot.dtsi
+++ b/arch/arm/dts/imx943-evk-u-boot.dtsi
@@ -13,6 +13,15 @@
bootph-pre-ram;
};
+&usb2 {
+ dr_mode = "host";
+ hnp-disable;
+ srp-disable;
+ adp-disable;
+ disable-over-current;
+ status = "okay";
+};
+
&usdhc1 {
bootph-pre-ram;
};
diff --git a/arch/arm/dts/imx943-u-boot.dtsi b/arch/arm/dts/imx943-u-boot.dtsi
index 9c4882f7d79..9b2c1072366 100644
--- a/arch/arm/dts/imx943-u-boot.dtsi
+++ b/arch/arm/dts/imx943-u-boot.dtsi
@@ -83,6 +83,13 @@
};
};
};
+
+ usbphynop: usbphynop {
+ compatible = "usb-nop-xceiv";
+ clocks = <&scmi_clk IMX94_CLK_HSIO>;
+ clock-names = "main_clk";
+ #phy-cells = <0>;
+ };
};
&cpu0 {
@@ -192,6 +199,27 @@
&{/soc} {
bootph-all;
+ usb2: usb@4c200000 {
+ compatible = "fsl,imx95-usb", "fsl,imx7d-usb", "fsl,imx27-usb";
+ reg = <0x0 0x4c200000 0x0 0x200>;
+ interrupts = <GIC_SPI 181 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 387 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&scmi_clk IMX94_CLK_HSIO>,
+ <&scmi_clk IMX94_CLK_32K>;
+ clock-names = "usb_ctrl_root", "usb_wakeup";
+ power-domains = <&scmi_devpd IMX94_PD_HSIO_TOP>;
+ phys = <&usbphynop>;
+ fsl,usbmisc = <&usbmisc 0>;
+ status = "disabled";
+ };
+
+ usbmisc: usbmisc@4c200200 {
+ compatible = "fsl,imx95-usbmisc", "fsl,imx7d-usbmisc", "fsl,imx6q-usbmisc";
+ reg = <0x0 0x4c200200 0x0 0x200>,
+ <0x0 0x4c010014 0x0 0x04>;
+ #index-cells = <1>;
+ };
+
elemu1: mailbox@47530000 {
compatible = "fsl,imx93-mu-s4";
reg = <0x0 0x47530000 0x0 0x10000>;
diff --git a/configs/imx943_evk_defconfig b/configs/imx943_evk_defconfig
index 27230ed3207..d308d29a1a5 100644
--- a/configs/imx943_evk_defconfig
+++ b/configs/imx943_evk_defconfig
@@ -66,6 +66,7 @@ CONFIG_CMD_GPT=y
CONFIG_CMD_MMC=y
CONFIG_CMD_PCI=y
CONFIG_CMD_POWEROFF=y
+CONFIG_CMD_USB=y
CONFIG_CMD_SNTP=y
CONFIG_CMD_CACHE=y
CONFIG_CMD_EFIDEBUG=y
@@ -112,4 +113,6 @@ CONFIG_DM_REGULATOR_GPIO=y
CONFIG_DM_RTC=y
CONFIG_DM_SERIAL=y
CONFIG_FSL_LPUART=y
+CONFIG_USB=y
+CONFIG_USB_EHCI_HCD=y
CONFIG_ULP_WATCHDOG=y
--
2.43.0
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH 04/10] Add serial# for SPL SDP download
2025-09-23 11:11 [PATCH 00/10] Enable USB and ENETC on i.MX943 EVK Alice Guo (OSS)
` (2 preceding siblings ...)
2025-09-23 11:11 ` [PATCH 03/10] imx943_evk: Enable USB 2.0 controller host mode Alice Guo (OSS)
@ 2025-09-23 11:11 ` Alice Guo (OSS)
2025-09-23 11:11 ` [PATCH 05/10] usb: f_sdp: Update SDP driver to support PQC container Alice Guo (OSS)
` (6 subsequent siblings)
10 siblings, 0 replies; 17+ messages in thread
From: Alice Guo (OSS) @ 2025-09-23 11:11 UTC (permalink / raw)
To: Marek Vasut, Tom Rini, Stefano Babic, Fabio Estevam,
NXP i.MX U-Boot Team, Alice Guo, Lukasz Majewski,
Mattijs Korpershoek, Joe Hershberger, Ramon Fried
Cc: u-boot, Ye Li, Peng Fan, Jacky Bai, Frank Li
From: Frank Li <Frank.Li@nxp.com>
After update this, uuu(>1.6) can use below command to filter out devices
when multi boards connected.
uuu -ms <serial#> ...
[sudo] uuu -lsusb can list known devices with serial# informaiton.
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Alice Guo <alice.guo@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
---
arch/arm/mach-imx/spl.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/arch/arm/mach-imx/spl.c b/arch/arm/mach-imx/spl.c
index 518d9cb1262..d4ede46b751 100644
--- a/arch/arm/mach-imx/spl.c
+++ b/arch/arm/mach-imx/spl.c
@@ -21,6 +21,8 @@
#include <g_dnl.h>
#include <linux/libfdt.h>
#include <memalign.h>
+#include <asm/setup.h>
+#include <asm/bootm.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -184,6 +186,14 @@ u32 spl_boot_device(void)
#ifdef CONFIG_SPL_USB_GADGET
int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name)
{
+#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
+ struct tag_serialnr serialnr;
+ char serial_string[0x21] = {0};
+
+ get_board_serial(&serialnr);
+ snprintf(serial_string, sizeof(serial_string), "%08x%08x", serialnr.high, serialnr.low);
+ g_dnl_set_serialnumber(serial_string);
+#endif
put_unaligned(CONFIG_USB_GADGET_PRODUCT_NUM + 0xfff, &dev->idProduct);
return 0;
--
2.43.0
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH 05/10] usb: f_sdp: Update SDP driver to support PQC container
2025-09-23 11:11 [PATCH 00/10] Enable USB and ENETC on i.MX943 EVK Alice Guo (OSS)
` (3 preceding siblings ...)
2025-09-23 11:11 ` [PATCH 04/10] Add serial# for SPL SDP download Alice Guo (OSS)
@ 2025-09-23 11:11 ` Alice Guo (OSS)
2025-09-29 8:51 ` Mattijs Korpershoek
2025-09-23 11:11 ` [PATCH 06/10] phy: imx8mq-usb: Add SPL support for i.MX8MQ, i.MX8MP, i.MX95, and i.MX94 USB3.0 PHY Alice Guo (OSS)
` (5 subsequent siblings)
10 siblings, 1 reply; 17+ messages in thread
From: Alice Guo (OSS) @ 2025-09-23 11:11 UTC (permalink / raw)
To: Marek Vasut, Tom Rini, Stefano Babic, Fabio Estevam,
NXP i.MX U-Boot Team, Alice Guo, Lukasz Majewski,
Mattijs Korpershoek, Joe Hershberger, Ramon Fried
Cc: u-boot, Ye Li, Peng Fan, Jacky Bai
From: Ye Li <ye.li@nxp.com>
Since PQC container has changed version to 0x2 in container header,
update the header's check.
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Alice Guo <alice.guo@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Jacky Bai <ping.bai@nxp.com>
---
drivers/usb/gadget/f_sdp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/f_sdp.c b/drivers/usb/gadget/f_sdp.c
index 647001d8dd0..f72e27028b7 100644
--- a/drivers/usb/gadget/f_sdp.c
+++ b/drivers/usb/gadget/f_sdp.c
@@ -765,7 +765,7 @@ static ulong search_container_header(ulong p, int size)
for (i = 0; i < size; i += 4) {
hdr = (u8 *)(p + i);
- if (*(hdr + 3) == 0x87 && *hdr == 0)
+ if (*(hdr + 3) == 0x87 && (*hdr == 0 || *hdr == 2))
if (*(hdr + 1) != 0 || *(hdr + 2) != 0)
return p + i;
}
--
2.43.0
^ permalink raw reply related [flat|nested] 17+ messages in thread* Re: [PATCH 05/10] usb: f_sdp: Update SDP driver to support PQC container
2025-09-23 11:11 ` [PATCH 05/10] usb: f_sdp: Update SDP driver to support PQC container Alice Guo (OSS)
@ 2025-09-29 8:51 ` Mattijs Korpershoek
0 siblings, 0 replies; 17+ messages in thread
From: Mattijs Korpershoek @ 2025-09-29 8:51 UTC (permalink / raw)
To: Alice Guo (OSS), Marek Vasut, Tom Rini, Stefano Babic,
Fabio Estevam, NXP i.MX U-Boot Team, Alice Guo, Lukasz Majewski,
Mattijs Korpershoek, Joe Hershberger, Ramon Fried
Cc: u-boot, Ye Li, Peng Fan, Jacky Bai
Hi Alice,
Thank you for the patch.
On Tue, Sep 23, 2025 at 19:11, "Alice Guo (OSS)" <alice.guo@oss.nxp.com> wrote:
> From: Ye Li <ye.li@nxp.com>
>
> Since PQC container has changed version to 0x2 in container header,
> update the header's check.
>
> Signed-off-by: Ye Li <ye.li@nxp.com>
> Signed-off-by: Alice Guo <alice.guo@nxp.com>
> Acked-by: Peng Fan <peng.fan@nxp.com>
> Reviewed-by: Jacky Bai <ping.bai@nxp.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
> ---
> drivers/usb/gadget/f_sdp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/gadget/f_sdp.c b/drivers/usb/gadget/f_sdp.c
> index 647001d8dd0..f72e27028b7 100644
> --- a/drivers/usb/gadget/f_sdp.c
> +++ b/drivers/usb/gadget/f_sdp.c
> @@ -765,7 +765,7 @@ static ulong search_container_header(ulong p, int size)
>
> for (i = 0; i < size; i += 4) {
> hdr = (u8 *)(p + i);
> - if (*(hdr + 3) == 0x87 && *hdr == 0)
> + if (*(hdr + 3) == 0x87 && (*hdr == 0 || *hdr == 2))
> if (*(hdr + 1) != 0 || *(hdr + 2) != 0)
> return p + i;
> }
>
> --
> 2.43.0
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 06/10] phy: imx8mq-usb: Add SPL support for i.MX8MQ, i.MX8MP, i.MX95, and i.MX94 USB3.0 PHY
2025-09-23 11:11 [PATCH 00/10] Enable USB and ENETC on i.MX943 EVK Alice Guo (OSS)
` (4 preceding siblings ...)
2025-09-23 11:11 ` [PATCH 05/10] usb: f_sdp: Update SDP driver to support PQC container Alice Guo (OSS)
@ 2025-09-23 11:11 ` Alice Guo (OSS)
2025-09-23 11:11 ` [PATCH 07/10] imx943_evk: Add support for booting from USB SDP on USB3.0 Alice Guo (OSS)
` (4 subsequent siblings)
10 siblings, 0 replies; 17+ messages in thread
From: Alice Guo (OSS) @ 2025-09-23 11:11 UTC (permalink / raw)
To: Marek Vasut, Tom Rini, Stefano Babic, Fabio Estevam,
NXP i.MX U-Boot Team, Alice Guo, Lukasz Majewski,
Mattijs Korpershoek, Joe Hershberger, Ramon Fried
Cc: u-boot, Ye Li, Peng Fan, Jacky Bai
From: Alice Guo <alice.guo@nxp.com>
This patch adds SPL Kconfig option (SPL_PHY_IMX8MQ_USB) for the i.MX8MQ,
i.MX8MP, i.MX95, and i.MX94 USB3.0 PHY driver, allowing the driver to be
compiled and probed in SPL stage.
Signed-off-by: Alice Guo <alice.guo@nxp.com>
---
drivers/phy/Kconfig | 14 +++++++++++---
drivers/phy/Makefile | 2 +-
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig
index d36a5f00ef8..420d7c7a44d 100644
--- a/drivers/phy/Kconfig
+++ b/drivers/phy/Kconfig
@@ -289,11 +289,19 @@ config PHY_NPCM_USB
Support the USB PHY in NPCM SoCs
config PHY_IMX8MQ_USB
- bool "NXP i.MX8MQ/i.MX8MP/i.MX95 USB PHY Driver"
+ bool "NXP i.MX8MQ/i.MX8MP/i.MX95/i.MX94 USB PHY Driver"
depends on PHY
- depends on IMX8MQ || IMX8MP || IMX95
+ depends on IMX8MQ || IMX8MP || IMX95 || IMX94
help
- Support the USB3.0 PHY in NXP i.MX8MQ, i.MX8MP, and i.MX95 SoC
+ Support the USB3.0 PHY in NXP i.MX8MQ, i.MX8MP, i.MX95, and i.MX94 SoCs.
+
+config SPL_PHY_IMX8MQ_USB
+ bool "Enable NXP i.MX8MQ/i.MX8MP/i.MX95/i.MX94 USB3.0 PHY Driver in SPL"
+ depends on SPL_PHY
+ depends on IMX8MQ || IMX8MP || IMX95 || IMX94
+ help
+ Enable support for the USB3.0 PHY in NXP i.MX8MQ, i.MX8MP, i.MX95, and
+ i.MX94 SoCs in SPL.
config PHY_IMX8M_PCIE
bool "NXP i.MX8MM/i.MX8MP PCIe PHY Driver"
diff --git a/drivers/phy/Makefile b/drivers/phy/Makefile
index 98c1ef8683b..5a6df0ecfeb 100644
--- a/drivers/phy/Makefile
+++ b/drivers/phy/Makefile
@@ -38,7 +38,7 @@ obj-$(CONFIG_PHY_DA8XX_USB) += phy-da8xx-usb.o
obj-$(CONFIG_PHY_EXYNOS_USBDRD) += phy-exynos-usbdrd.o
obj-$(CONFIG_PHY_MTK_TPHY) += phy-mtk-tphy.o
obj-$(CONFIG_PHY_NPCM_USB) += phy-npcm-usb.o
-obj-$(CONFIG_PHY_IMX8MQ_USB) += phy-imx8mq-usb.o
+obj-$(CONFIG_$(PHASE_)PHY_IMX8MQ_USB) += phy-imx8mq-usb.o
obj-$(CONFIG_PHY_IMX8M_PCIE) += phy-imx8m-pcie.o
obj-$(CONFIG_PHY_XILINX_ZYNQMP) += phy-zynqmp.o
obj-y += cadence/
--
2.43.0
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH 07/10] imx943_evk: Add support for booting from USB SDP on USB3.0
2025-09-23 11:11 [PATCH 00/10] Enable USB and ENETC on i.MX943 EVK Alice Guo (OSS)
` (5 preceding siblings ...)
2025-09-23 11:11 ` [PATCH 06/10] phy: imx8mq-usb: Add SPL support for i.MX8MQ, i.MX8MP, i.MX95, and i.MX94 USB3.0 PHY Alice Guo (OSS)
@ 2025-09-23 11:11 ` Alice Guo (OSS)
2025-09-23 11:11 ` [PATCH 08/10] net: fsl_enetc: Add i.MX94 support to NETC block control driver Alice Guo (OSS)
` (3 subsequent siblings)
10 siblings, 0 replies; 17+ messages in thread
From: Alice Guo (OSS) @ 2025-09-23 11:11 UTC (permalink / raw)
To: Marek Vasut, Tom Rini, Stefano Babic, Fabio Estevam,
NXP i.MX U-Boot Team, Alice Guo, Lukasz Majewski,
Mattijs Korpershoek, Joe Hershberger, Ramon Fried
Cc: u-boot, Ye Li, Peng Fan, Jacky Bai
From: Alice Guo <alice.guo@nxp.com>
This patch is used to enable USB Gadget in SPL to make i.MX943 evk board
can use SDP on USB3.0 interface.
Signed-off-by: Alice Guo <alice.guo@nxp.com>
---
arch/arm/dts/imx943-evk-u-boot.dtsi | 24 ++++++++++++++++++++++
arch/arm/dts/imx943-u-boot.dtsi | 40 +++++++++++++++++++++++++++++++++++++
configs/imx943_evk_defconfig | 14 +++++++++++++
3 files changed, 78 insertions(+)
diff --git a/arch/arm/dts/imx943-evk-u-boot.dtsi b/arch/arm/dts/imx943-evk-u-boot.dtsi
index e6abe7ed2e0..3995176f090 100644
--- a/arch/arm/dts/imx943-evk-u-boot.dtsi
+++ b/arch/arm/dts/imx943-evk-u-boot.dtsi
@@ -22,6 +22,30 @@
status = "okay";
};
+&usb3 {
+ bootph-pre-ram;
+ status = "okay";
+};
+
+&usb3_dwc3 {
+ bootph-pre-ram;
+ dr_mode = "otg";
+ hnp-disable;
+ srp-disable;
+ adp-disable;
+ usb-role-switch;
+ role-switch-default-mode = "peripheral";
+ snps,dis-u1-entry-quirk;
+ snps,dis-u2-entry-quirk;
+ status = "okay";
+};
+
+&usb3_phy {
+ bootph-pre-ram;
+ orientation-switch;
+ status = "okay";
+};
+
&usdhc1 {
bootph-pre-ram;
};
diff --git a/arch/arm/dts/imx943-u-boot.dtsi b/arch/arm/dts/imx943-u-boot.dtsi
index 9b2c1072366..8c89b8be04b 100644
--- a/arch/arm/dts/imx943-u-boot.dtsi
+++ b/arch/arm/dts/imx943-u-boot.dtsi
@@ -199,6 +199,46 @@
&{/soc} {
bootph-all;
+ usb3: usb@4c010010 {
+ compatible = "fsl,imx95-dwc3", "fsl,imx8mp-dwc3";
+ reg = <0x0 0x4c010010 0x0 0x04>,
+ <0x0 0x4c1f0000 0x0 0x20>;
+ ranges;
+ interrupts = <GIC_SPI 386 IRQ_TYPE_LEVEL_HIGH>;
+ #address-cells = <2>;
+ #size-cells = <2>;
+ clocks = <&scmi_clk IMX94_CLK_HSIO>,
+ <&scmi_clk IMX94_CLK_32K>;
+ clock-names = "hsio", "suspend";
+ power-domains = <&scmi_devpd IMX94_PD_HSIO_TOP>;
+ status = "disabled";
+
+ usb3_dwc3: usb@4c100000 {
+ compatible = "snps,dwc3";
+ reg = <0x0 0x4c100000 0x0 0x10000>;
+ interrupts = <GIC_SPI 180 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&scmi_clk IMX94_CLK_HSIO>,
+ <&scmi_clk IMX94_CLK_24M>,
+ <&scmi_clk IMX94_CLK_32K>;
+ clock-names = "bus_early", "ref", "suspend";
+ phys = <&usb3_phy>, <&usb3_phy>;
+ phy-names = "usb2-phy", "usb3-phy";
+ snps,gfladj-refclk-lpm-sel-quirk;
+ snps,parkmode-disable-ss-quirk;
+ };
+ };
+
+ usb3_phy: phy@4c1f0040 {
+ compatible = "fsl,imx95-usb-phy", "fsl,imx8mp-usb-phy";
+ reg = <0x0 0x4c1f0040 0x0 0x40>,
+ <0x0 0x4c1fc000 0x0 0x100>;
+ clocks = <&scmi_clk IMX94_CLK_HSIO>;
+ clock-names = "phy";
+ #phy-cells = <0>;
+ power-domains = <&scmi_devpd IMX94_PD_HSIO_TOP>;
+ status = "disabled";
+ };
+
usb2: usb@4c200000 {
compatible = "fsl,imx95-usb", "fsl,imx7d-usb", "fsl,imx27-usb";
reg = <0x0 0x4c200000 0x0 0x200>;
diff --git a/configs/imx943_evk_defconfig b/configs/imx943_evk_defconfig
index d308d29a1a5..e4fcf2eb576 100644
--- a/configs/imx943_evk_defconfig
+++ b/configs/imx943_evk_defconfig
@@ -100,6 +100,8 @@ CONFIG_IMX_RGPIO2P=y
CONFIG_IMX_MU_MBOX=y
CONFIG_SUPPORT_EMMC_BOOT=y
CONFIG_FSL_USDHC=y
+CONFIG_SPL_PHY=y
+CONFIG_SPL_PHY_IMX8MQ_USB=y
CONFIG_PINCTRL=y
CONFIG_SPL_PINCTRL=y
CONFIG_PINCTRL_IMX_SCMI=y
@@ -114,5 +116,17 @@ CONFIG_DM_RTC=y
CONFIG_DM_SERIAL=y
CONFIG_FSL_LPUART=y
CONFIG_USB=y
+CONFIG_SPL_DM_USB_GADGET=y
+CONFIG_USB_XHCI_HCD=y
CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_DWC3=y
+CONFIG_USB_DWC3_GENERIC=y
+CONFIG_SPL_USB_DWC3_GENERIC=y
+CONFIG_USB_GADGET=y
+CONFIG_SPL_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="FSL"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0525
+CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
+CONFIG_SDP_LOADADDR=0x90400000
+CONFIG_SPL_USB_SDP_SUPPORT=y
CONFIG_ULP_WATCHDOG=y
--
2.43.0
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH 08/10] net: fsl_enetc: Add i.MX94 support to NETC block control driver
2025-09-23 11:11 [PATCH 00/10] Enable USB and ENETC on i.MX943 EVK Alice Guo (OSS)
` (6 preceding siblings ...)
2025-09-23 11:11 ` [PATCH 07/10] imx943_evk: Add support for booting from USB SDP on USB3.0 Alice Guo (OSS)
@ 2025-09-23 11:11 ` Alice Guo (OSS)
2025-10-11 9:39 ` Ye Li
2025-09-23 11:11 ` [PATCH 09/10] net: fsl_enetc_mdio: Add support for phy-supply property Alice Guo (OSS)
` (2 subsequent siblings)
10 siblings, 1 reply; 17+ messages in thread
From: Alice Guo (OSS) @ 2025-09-23 11:11 UTC (permalink / raw)
To: Marek Vasut, Tom Rini, Stefano Babic, Fabio Estevam,
NXP i.MX U-Boot Team, Alice Guo, Lukasz Majewski,
Mattijs Korpershoek, Joe Hershberger, Ramon Fried
Cc: u-boot, Ye Li, Peng Fan, Jacky Bai
From: Ye Li <ye.li@nxp.com>
Extend the NETC block control driver to support the i.MX94 SoC.
Acked-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Jacky Bai <ping.bai@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Alice Guo <alice.guo@nxp.com>
---
drivers/net/Kconfig | 5 +-
drivers/net/fsl_enetc_netc_blk_ctrl.c | 338 +++++++++++++++++++++++++++++++++-
2 files changed, 333 insertions(+), 10 deletions(-)
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index d1cb69f85ad..4ad226bea4f 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -1002,8 +1002,9 @@ config FSL_ENETC
config FSL_ENETC_NETC_BLK_CTRL
bool "NXP ENETC NETC blocks control driver"
- depends on FSL_ENETC && IMX95
- default y if IMX95
+ depends on FSL_ENETC
+ depends on IMX95 || IMX94
+ default y if IMX95 || IMX94
help
This driver configures Integrated Endpoint Register Block (IERB) and
Privileged Register Block (PRB) of NETC. For i.MX platforms, it also
diff --git a/drivers/net/fsl_enetc_netc_blk_ctrl.c b/drivers/net/fsl_enetc_netc_blk_ctrl.c
index 46b68d3d8a4..2d705c61ecd 100644
--- a/drivers/net/fsl_enetc_netc_blk_ctrl.c
+++ b/drivers/net/fsl_enetc_netc_blk_ctrl.c
@@ -43,6 +43,19 @@
#define PCS_PROT_SFI BIT(4)
#define PCS_PROT_10G_SXGMII BIT(6)
+#define IMX94_MISC_SOC_CONTROL 0x0
+#define SEL_XPCS_1 BIT(1)
+#define IMX94_XPCS_PORT_0 0x0
+#define IMX94_XPCS_PORT_1 0x1
+
+#define IMX94_EXT_PIN_CONTROL 0x10
+#define MAC2_MAC3_SEL BIT(1)
+
+#define IMX94_CFG_LINK_PCS_PROT(a) (0x14 + (a) * 4)
+#define IMX94_NETC_LINK_CFG(a) (0x4c + (a) * 4)
+#define NETC_LINK_CFG_MII_PROT GENMASK(3, 0)
+#define NETC_LINK_CFG_IO_VAR GENMASK(19, 16)
+
/* NETC privileged register block register */
#define PRB_NETCRR 0x100
#define NETCRR_SR BIT(0)
@@ -55,6 +68,7 @@
/* NETC integrated endpoint register block register */
#define IERB_EMDIOFAUXR 0x344
#define IERB_T0FAUXR 0x444
+#define IERB_ETBCR(a) (0x300c + 0x100 * (a))
#define IERB_EFAUXR(a) (0x3044 + 0x100 * (a))
#define IERB_VFAUXR(a) (0x4004 + 0x40 * (a))
#define FAUXR_LDID GENMASK(3, 0)
@@ -64,6 +78,26 @@
#define IMX95_ENETC1_BUS_DEVFN 0x40
#define IMX95_ENETC2_BUS_DEVFN 0x80
+#define IMX94_ENETC3_BUS_DEVFN 0x0
+#define IMX94_TIMER0_BUS_DEVFN 0x1
+#define IMX94_SWITCH_BUS_DEVFN 0x2
+#define IMX94_ENETC0_BUS_DEVFN 0x100
+#define IMX94_TIMER1_BUS_DEVFN 0x101
+#define IMX94_ENETC1_BUS_DEVFN 0x140
+#define IMX94_ENETC2_BUS_DEVFN 0x180
+#define IMX94_TIMER2_BUS_DEVFN 0x181
+#define IMX94_ENETC0_LINK 3
+#define IMX94_ENETC1_LINK 4
+#define IMX94_ENETC2_LINK 5
+#define IMX94_ENETC0_OFFSET 0
+#define IMX94_ENETC1_OFFSET 1
+#define IMX94_ENETC2_OFFSET 2
+#define IMX94_SWITCH_PORT2 2
+#define IMX94_SWITCH_CPU_PORT 3
+#define IMX94_TIMER0_ID 0
+#define IMX94_TIMER1_ID 1
+#define IMX94_TIMER2_ID 2
+
/* Flags for different platforms */
#define NETC_HAS_NETCMIX BIT(0)
@@ -73,6 +107,15 @@ struct netc_blk_ctrl {
void __iomem *netcmix;
};
+struct netc_devinfo {
+ int (*netcmix_init)(struct udevice *dev);
+ int (*ierb_init)(struct udevice *dev);
+ void (*xpcs_port_init)(struct netc_blk_ctrl *priv, int port);
+};
+
+static struct netc_blk_ctrl *netc_bc;
+static struct netc_devinfo *netc_di;
+
static void netc_reg_write(void __iomem *base, u32 offset, u32 val)
{
writel(val, base + offset);
@@ -183,6 +226,150 @@ static int imx95_netcmix_init(struct udevice *dev)
return 0;
}
+static int imx94_enetc_get_link_num(ofnode np)
+{
+ int bus_devfn;
+
+ bus_devfn = netc_of_pci_get_bus_devfn(np);
+ if (bus_devfn < 0)
+ return -EINVAL;
+
+ /* Parse ENETC link number */
+ switch (bus_devfn) {
+ case IMX94_ENETC0_BUS_DEVFN:
+ return IMX94_ENETC0_LINK;
+ case IMX94_ENETC1_BUS_DEVFN:
+ return IMX94_ENETC1_LINK;
+ case IMX94_ENETC2_BUS_DEVFN:
+ return IMX94_ENETC2_LINK;
+ default:
+ return -EINVAL;
+ }
+}
+
+static int imx94_link_config(struct netc_blk_ctrl *priv,
+ ofnode np, int link_id)
+{
+ phy_interface_t interface;
+ int mii_proto;
+ u32 val;
+
+ interface = ofnode_read_phy_mode(np);
+ if (interface == -1)
+ return -EINVAL;
+
+ mii_proto = netc_get_link_mii_protocol(interface);
+ if (mii_proto < 0)
+ return -EINVAL;
+
+ val = mii_proto & NETC_LINK_CFG_MII_PROT;
+ if (mii_proto == MII_PROT_SERIAL) {
+ int pcs_proto = PCS_PROT_1G_SGMII;
+
+ if (pcs_proto == PHY_INTERFACE_MODE_2500BASEX)
+ pcs_proto = PCS_PROT_2500M_SGMII;
+
+ netc_reg_write(priv->netcmix, IMX94_CFG_LINK_PCS_PROT(link_id),
+ pcs_proto);
+ val = u32_replace_bits(val, IO_VAR_16FF_16G_SERDES,
+ NETC_LINK_CFG_IO_VAR);
+ }
+
+ netc_reg_write(priv->netcmix, IMX94_NETC_LINK_CFG(link_id), val);
+
+ if (link_id == IMX94_ENETC0_LINK) {
+ val = netc_reg_read(priv->netcmix, IMX94_EXT_PIN_CONTROL);
+ val |= MAC2_MAC3_SEL;
+ netc_reg_write(priv->netcmix, IMX94_EXT_PIN_CONTROL, val);
+ }
+
+ return 0;
+}
+
+static int imx94_enetc_link_config(struct netc_blk_ctrl *priv,
+ ofnode np, bool *enetc0_en)
+{
+ int link_id;
+
+ link_id = imx94_enetc_get_link_num(np);
+ if (link_id < 0)
+ return -EINVAL;
+
+ if (link_id == IMX94_ENETC0_LINK)
+ *enetc0_en = true;
+
+ return imx94_link_config(priv, np, link_id);
+}
+
+static int imx94_switch_link_config(struct netc_blk_ctrl *priv,
+ ofnode np, bool *swp2_en)
+{
+ ofnode ports, child;
+ int port_id, err = 0;
+
+ ports = ofnode_find_subnode(np, "ports");
+ if (!ofnode_valid(ports))
+ ports = ofnode_find_subnode(np, "ethernet-ports");
+ if (!ofnode_valid(ports))
+ return -ENODEV;
+
+ ofnode_for_each_subnode(child, ports) {
+ if (ofnode_read_u32(child, "reg", &port_id) < 0) {
+ err = -ENODEV;
+ goto end;
+ }
+
+ if (port_id == IMX94_SWITCH_CPU_PORT)
+ continue;
+
+ if (port_id == IMX94_SWITCH_PORT2)
+ *swp2_en = true;
+
+ err = imx94_link_config(priv, child, port_id);
+ if (err)
+ goto end;
+ }
+
+end:
+ return err;
+}
+
+static int imx94_netcmix_init(struct udevice *dev)
+{
+ struct netc_blk_ctrl *priv = dev_get_priv(dev);
+ ofnode child, gchild;
+ bool enetc0_en = false, swp2_en = false;
+ int err;
+
+ dev_for_each_subnode(child, dev) {
+ if (!ofnode_is_enabled(child))
+ continue;
+
+ ofnode_for_each_subnode(gchild, child) {
+ if (!ofnode_is_enabled(gchild))
+ continue;
+
+ if (ofnode_device_is_compatible(gchild, "pci1131,e101")) {
+ err = imx94_enetc_link_config(priv, gchild, &enetc0_en);
+ if (err)
+ return err;
+ } else if (ofnode_device_is_compatible(gchild, "pci1131,eef2")) {
+ err = imx94_switch_link_config(priv, gchild, &swp2_en);
+ if (err)
+ return err;
+ }
+ }
+ }
+
+ if (enetc0_en && swp2_en) {
+ dev_err(dev, "Cannot enable swp2 and enetc0 at the same time\n");
+
+ return -EINVAL;
+ }
+
+ return 0;
+}
+
static bool netc_ierb_is_locked(struct netc_blk_ctrl *priv)
{
return !!(netc_reg_read(priv->prb, PRB_NETCRR) & NETCRR_LOCK);
@@ -238,9 +425,99 @@ static int imx95_ierb_init(struct udevice *dev)
return 0;
}
+static int imx94_enetc_get_enetc_offset(ofnode np)
+{
+ int bus_devfn;
+
+ bus_devfn = netc_of_pci_get_bus_devfn(np);
+ if (bus_devfn < 0)
+ return -EINVAL;
+
+ /* Parse ENETC offset */
+ switch (bus_devfn) {
+ case IMX94_ENETC0_BUS_DEVFN:
+ return IMX94_ENETC0_OFFSET;
+ case IMX94_ENETC1_BUS_DEVFN:
+ return IMX94_ENETC1_OFFSET;
+ case IMX94_ENETC2_BUS_DEVFN:
+ return IMX94_ENETC2_OFFSET;
+ default:
+ return -EINVAL;
+ }
+}
+
+static int imx94_enetc_get_timer_id(ofnode np)
+{
+ int bus_devfn;
+
+ bus_devfn = netc_of_pci_get_bus_devfn(np);
+ if (bus_devfn < 0)
+ return -EINVAL;
+
+ /* Parse ENETC PTP timer ID */
+ switch (bus_devfn) {
+ case IMX94_TIMER0_BUS_DEVFN:
+ return IMX94_TIMER0_ID;
+ case IMX94_TIMER1_BUS_DEVFN:
+ return IMX94_TIMER1_ID;
+ case IMX94_TIMER2_BUS_DEVFN:
+ return IMX94_TIMER2_ID;
+ default:
+ return -EINVAL;
+ }
+}
+
+static int imx94_enetc_update_tid(struct netc_blk_ctrl *priv, ofnode pf_np)
+{
+ ofnode timer_np;
+ int offset, tid;
+
+ offset = imx94_enetc_get_enetc_offset(pf_np);
+ if (offset < 0) {
+ printf("Find unknown PF node.\n");
+ return offset;
+ }
+
+ timer_np = ofnode_parse_phandle(pf_np, "nxp,ptp-timer", 0);
+ if (!ofnode_valid(timer_np)) {
+ /*
+ * If nxp,ptp-timer is not set, the first timer of the bus
+ * where enetc is located will be used as the default timer.
+ */
+ tid = IMX94_TIMER1_ID;
+ goto update_reg;
+ }
+
+ tid = imx94_enetc_get_timer_id(timer_np);
+ if (tid < 0) {
+ printf("Incorrect bus/devfn of ptp-timer.\n");
+ return tid;
+ }
+
+update_reg:
+ netc_reg_write(priv->ierb, IERB_ETBCR(offset), tid);
+
+ return 0;
+}
+
+static int imx94_ierb_init(struct udevice *dev)
+{
+ struct netc_blk_ctrl *priv = dev_get_priv(dev);
+ ofnode bus_np, pf_np;
+ int ret = 0;
+
+ dev_for_each_subnode(bus_np, dev)
+ ofnode_for_each_subnode(pf_np, bus_np)
+ if (ofnode_device_is_compatible(pf_np, "pci1131,e101"))
+ ret = imx94_enetc_update_tid(priv, pf_np);
+
+ return ret;
+}
+
static int netc_ierb_init(struct udevice *dev)
{
struct netc_blk_ctrl *priv = dev_get_priv(dev);
+ struct netc_devinfo *devinfo = (struct netc_devinfo *)dev_get_driver_data(dev);
int err;
if (netc_ierb_is_locked(priv)) {
@@ -251,9 +528,11 @@ static int netc_ierb_init(struct udevice *dev)
}
}
- err = imx95_ierb_init(dev);
- if (err)
- return err;
+ if (devinfo->ierb_init) {
+ err = devinfo->ierb_init(dev);
+ if (err)
+ return err;
+ }
err = netc_lock_ierb(priv);
if (err) {
@@ -264,6 +543,31 @@ static int netc_ierb_init(struct udevice *dev)
return 0;
}
+static void imx94_netc_xpcs_port_init(struct netc_blk_ctrl *priv, int port)
+{
+ u32 val;
+
+ val = netc_reg_read(priv->netcmix, IMX94_MISC_SOC_CONTROL);
+ if (port == IMX94_XPCS_PORT_1)
+ val |= SEL_XPCS_1;
+ else
+ val &= ~SEL_XPCS_1;
+ netc_reg_write(priv->netcmix, IMX94_MISC_SOC_CONTROL, val);
+}
+
+void netc_xpcs_port_init(int port)
+{
+ struct netc_blk_ctrl *priv = netc_bc;
+ struct netc_devinfo *devinfo;
+
+ if (!priv)
+ return;
+
+ devinfo = netc_di;
+ if (devinfo->xpcs_port_init)
+ devinfo->xpcs_port_init(priv, port);
+}
+
static int netc_prb_check_error(struct netc_blk_ctrl *priv)
{
if (netc_reg_read(priv->prb, PRB_NETCSR) & NETCSR_ERROR)
@@ -272,14 +576,27 @@ static int netc_prb_check_error(struct netc_blk_ctrl *priv)
return 0;
}
+static const struct netc_devinfo imx95_devinfo = {
+ .netcmix_init = imx95_netcmix_init,
+ .ierb_init = imx95_ierb_init,
+};
+
+static const struct netc_devinfo imx94_devinfo = {
+ .netcmix_init = imx94_netcmix_init,
+ .ierb_init = imx94_ierb_init,
+ .xpcs_port_init = imx94_netc_xpcs_port_init,
+};
+
static const struct udevice_id netc_blk_ctrl_match[] = {
- { .compatible = "nxp,imx95-netc-blk-ctrl" },
+ { .compatible = "nxp,imx95-netc-blk-ctrl", .data = (ulong)&imx95_devinfo },
+ { .compatible = "nxp,imx94-netc-blk-ctrl", .data = (ulong)&imx94_devinfo },
{},
};
static int netc_blk_ctrl_probe(struct udevice *dev)
{
struct netc_blk_ctrl *priv = dev_get_priv(dev);
+ struct netc_devinfo *devinfo = (struct netc_devinfo *)dev_get_driver_data(dev);
struct clk *ipg_clk;
fdt_addr_t regs;
int err;
@@ -318,10 +635,12 @@ static int netc_blk_ctrl_probe(struct udevice *dev)
priv->netcmix = (void __iomem *)regs;
- err = imx95_netcmix_init(dev);
- if (err) {
- dev_err(dev, "Initializing NETCMIX failed\n");
- return err;
+ if (devinfo->netcmix_init) {
+ err = devinfo->netcmix_init(dev);
+ if (err) {
+ dev_err(dev, "Initializing NETCMIX failed\n");
+ return err;
+ }
}
err = netc_ierb_init(dev);
@@ -333,6 +652,9 @@ static int netc_blk_ctrl_probe(struct udevice *dev)
if (netc_prb_check_error(priv) < 0)
dev_warn(dev, "The current IERB configuration is invalid\n");
+ netc_bc = priv;
+ netc_di = devinfo;
+
return 0;
}
--
2.43.0
^ permalink raw reply related [flat|nested] 17+ messages in thread* Re: [PATCH 08/10] net: fsl_enetc: Add i.MX94 support to NETC block control driver
2025-09-23 11:11 ` [PATCH 08/10] net: fsl_enetc: Add i.MX94 support to NETC block control driver Alice Guo (OSS)
@ 2025-10-11 9:39 ` Ye Li
0 siblings, 0 replies; 17+ messages in thread
From: Ye Li @ 2025-10-11 9:39 UTC (permalink / raw)
To: Alice Guo (OSS), Marek Vasut, Tom Rini, Stefano Babic,
Fabio Estevam, NXP i.MX U-Boot Team, Alice Guo, Lukasz Majewski,
Mattijs Korpershoek, Joe Hershberger, Ramon Fried
Cc: u-boot, Ye Li, Peng Fan, Jacky Bai
On 9/23/2025 7:11 PM, Alice Guo (OSS) wrote:
> From: Ye Li <ye.li@nxp.com>
>
> Extend the NETC block control driver to support the i.MX94 SoC.
>
> Acked-by: Peng Fan <peng.fan@nxp.com>
> Reviewed-by: Jacky Bai <ping.bai@nxp.com>
> Signed-off-by: Ye Li <ye.li@nxp.com>
> Signed-off-by: Alice Guo <alice.guo@nxp.com>
> ---
> drivers/net/Kconfig | 5 +-
> drivers/net/fsl_enetc_netc_blk_ctrl.c | 338 +++++++++++++++++++++++++++++++++-
> 2 files changed, 333 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
> index d1cb69f85ad..4ad226bea4f 100644
> --- a/drivers/net/Kconfig
> +++ b/drivers/net/Kconfig
> @@ -1002,8 +1002,9 @@ config FSL_ENETC
>
> config FSL_ENETC_NETC_BLK_CTRL
> bool "NXP ENETC NETC blocks control driver"
> - depends on FSL_ENETC && IMX95
> - default y if IMX95
> + depends on FSL_ENETC
> + depends on IMX95 || IMX94
> + default y if IMX95 || IMX94
> help
> This driver configures Integrated Endpoint Register Block (IERB) and
> Privileged Register Block (PRB) of NETC. For i.MX platforms, it also
> diff --git a/drivers/net/fsl_enetc_netc_blk_ctrl.c b/drivers/net/fsl_enetc_netc_blk_ctrl.c
> index 46b68d3d8a4..2d705c61ecd 100644
> --- a/drivers/net/fsl_enetc_netc_blk_ctrl.c
> +++ b/drivers/net/fsl_enetc_netc_blk_ctrl.c
> @@ -43,6 +43,19 @@
> #define PCS_PROT_SFI BIT(4)
> #define PCS_PROT_10G_SXGMII BIT(6)
>
> +#define IMX94_MISC_SOC_CONTROL 0x0
> +#define SEL_XPCS_1 BIT(1)
> +#define IMX94_XPCS_PORT_0 0x0
> +#define IMX94_XPCS_PORT_1 0x1
> +
> +#define IMX94_EXT_PIN_CONTROL 0x10
> +#define MAC2_MAC3_SEL BIT(1)
> +
> +#define IMX94_CFG_LINK_PCS_PROT(a) (0x14 + (a) * 4)
> +#define IMX94_NETC_LINK_CFG(a) (0x4c + (a) * 4)
> +#define NETC_LINK_CFG_MII_PROT GENMASK(3, 0)
> +#define NETC_LINK_CFG_IO_VAR GENMASK(19, 16)
> +
> /* NETC privileged register block register */
> #define PRB_NETCRR 0x100
> #define NETCRR_SR BIT(0)
> @@ -55,6 +68,7 @@
> /* NETC integrated endpoint register block register */
> #define IERB_EMDIOFAUXR 0x344
> #define IERB_T0FAUXR 0x444
> +#define IERB_ETBCR(a) (0x300c + 0x100 * (a))
> #define IERB_EFAUXR(a) (0x3044 + 0x100 * (a))
> #define IERB_VFAUXR(a) (0x4004 + 0x40 * (a))
> #define FAUXR_LDID GENMASK(3, 0)
> @@ -64,6 +78,26 @@
> #define IMX95_ENETC1_BUS_DEVFN 0x40
> #define IMX95_ENETC2_BUS_DEVFN 0x80
>
> +#define IMX94_ENETC3_BUS_DEVFN 0x0
> +#define IMX94_TIMER0_BUS_DEVFN 0x1
> +#define IMX94_SWITCH_BUS_DEVFN 0x2
> +#define IMX94_ENETC0_BUS_DEVFN 0x100
> +#define IMX94_TIMER1_BUS_DEVFN 0x101
> +#define IMX94_ENETC1_BUS_DEVFN 0x140
> +#define IMX94_ENETC2_BUS_DEVFN 0x180
> +#define IMX94_TIMER2_BUS_DEVFN 0x181
> +#define IMX94_ENETC0_LINK 3
> +#define IMX94_ENETC1_LINK 4
> +#define IMX94_ENETC2_LINK 5
> +#define IMX94_ENETC0_OFFSET 0
> +#define IMX94_ENETC1_OFFSET 1
> +#define IMX94_ENETC2_OFFSET 2
> +#define IMX94_SWITCH_PORT2 2
> +#define IMX94_SWITCH_CPU_PORT 3
> +#define IMX94_TIMER0_ID 0
> +#define IMX94_TIMER1_ID 1
> +#define IMX94_TIMER2_ID 2
> +
> /* Flags for different platforms */
> #define NETC_HAS_NETCMIX BIT(0)
>
> @@ -73,6 +107,15 @@ struct netc_blk_ctrl {
> void __iomem *netcmix;
> };
>
> +struct netc_devinfo {
> + int (*netcmix_init)(struct udevice *dev);
> + int (*ierb_init)(struct udevice *dev);
> + void (*xpcs_port_init)(struct netc_blk_ctrl *priv, int port);
> +};
> +
> +static struct netc_blk_ctrl *netc_bc;
> +static struct netc_devinfo *netc_di;
> +
> static void netc_reg_write(void __iomem *base, u32 offset, u32 val)
> {
> writel(val, base + offset);
> @@ -183,6 +226,150 @@ static int imx95_netcmix_init(struct udevice *dev)
> return 0;
> }
>
> +static int imx94_enetc_get_link_num(ofnode np)
> +{
> + int bus_devfn;
> +
> + bus_devfn = netc_of_pci_get_bus_devfn(np);
> + if (bus_devfn < 0)
> + return -EINVAL;
> +
> + /* Parse ENETC link number */
> + switch (bus_devfn) {
> + case IMX94_ENETC0_BUS_DEVFN:
> + return IMX94_ENETC0_LINK;
> + case IMX94_ENETC1_BUS_DEVFN:
> + return IMX94_ENETC1_LINK;
> + case IMX94_ENETC2_BUS_DEVFN:
> + return IMX94_ENETC2_LINK;
> + default:
> + return -EINVAL;
> + }
> +}
> +
> +static int imx94_link_config(struct netc_blk_ctrl *priv,
> + ofnode np, int link_id)
> +{
> + phy_interface_t interface;
> + int mii_proto;
> + u32 val;
> +
> + interface = ofnode_read_phy_mode(np);
> + if (interface == -1)
> + return -EINVAL;
> +
> + mii_proto = netc_get_link_mii_protocol(interface);
> + if (mii_proto < 0)
> + return -EINVAL;
> +
> + val = mii_proto & NETC_LINK_CFG_MII_PROT;
> + if (mii_proto == MII_PROT_SERIAL) {
> + int pcs_proto = PCS_PROT_1G_SGMII;
> +
> + if (pcs_proto == PHY_INTERFACE_MODE_2500BASEX)
> + pcs_proto = PCS_PROT_2500M_SGMII;
It is dead code here. We already have a fix for it. Please combine the
fix into the patch.
Best regards,
Ye Li> +
> + netc_reg_write(priv->netcmix, IMX94_CFG_LINK_PCS_PROT(link_id),
> + pcs_proto);
> + val = u32_replace_bits(val, IO_VAR_16FF_16G_SERDES,
> + NETC_LINK_CFG_IO_VAR);
> + }
> +
> + netc_reg_write(priv->netcmix, IMX94_NETC_LINK_CFG(link_id), val);
> +
> + if (link_id == IMX94_ENETC0_LINK) {
> + val = netc_reg_read(priv->netcmix, IMX94_EXT_PIN_CONTROL);
> + val |= MAC2_MAC3_SEL;
> + netc_reg_write(priv->netcmix, IMX94_EXT_PIN_CONTROL, val);
> + }
> +
> + return 0;
> +}
> +
> +static int imx94_enetc_link_config(struct netc_blk_ctrl *priv,
> + ofnode np, bool *enetc0_en)
> +{
> + int link_id;
> +
> + link_id = imx94_enetc_get_link_num(np);
> + if (link_id < 0)
> + return -EINVAL;
> +
> + if (link_id == IMX94_ENETC0_LINK)
> + *enetc0_en = true;
> +
> + return imx94_link_config(priv, np, link_id);
> +}
> +
> +static int imx94_switch_link_config(struct netc_blk_ctrl *priv,
> + ofnode np, bool *swp2_en)
> +{
> + ofnode ports, child;
> + int port_id, err = 0;
> +
> + ports = ofnode_find_subnode(np, "ports");
> + if (!ofnode_valid(ports))
> + ports = ofnode_find_subnode(np, "ethernet-ports");
> + if (!ofnode_valid(ports))
> + return -ENODEV;
> +
> + ofnode_for_each_subnode(child, ports) {
> + if (ofnode_read_u32(child, "reg", &port_id) < 0) {
> + err = -ENODEV;
> + goto end;
> + }
> +
> + if (port_id == IMX94_SWITCH_CPU_PORT)
> + continue;
> +
> + if (port_id == IMX94_SWITCH_PORT2)
> + *swp2_en = true;
> +
> + err = imx94_link_config(priv, child, port_id);
> + if (err)
> + goto end;
> + }
> +
> +end:
> + return err;
> +}
> +
> +static int imx94_netcmix_init(struct udevice *dev)
> +{
> + struct netc_blk_ctrl *priv = dev_get_priv(dev);
> + ofnode child, gchild;
> + bool enetc0_en = false, swp2_en = false;
> + int err;
> +
> + dev_for_each_subnode(child, dev) {
> + if (!ofnode_is_enabled(child))
> + continue;
> +
> + ofnode_for_each_subnode(gchild, child) {
> + if (!ofnode_is_enabled(gchild))
> + continue;
> +
> + if (ofnode_device_is_compatible(gchild, "pci1131,e101")) {
> + err = imx94_enetc_link_config(priv, gchild, &enetc0_en);
> + if (err)
> + return err;
> + } else if (ofnode_device_is_compatible(gchild, "pci1131,eef2")) {
> + err = imx94_switch_link_config(priv, gchild, &swp2_en);
> + if (err)
> + return err;
> + }
> + }
> + }
> +
> + if (enetc0_en && swp2_en) {
> + dev_err(dev, "Cannot enable swp2 and enetc0 at the same time\n");
> +
> + return -EINVAL;
> + }
> +
> + return 0;
> +}
> +
> static bool netc_ierb_is_locked(struct netc_blk_ctrl *priv)
> {
> return !!(netc_reg_read(priv->prb, PRB_NETCRR) & NETCRR_LOCK);
> @@ -238,9 +425,99 @@ static int imx95_ierb_init(struct udevice *dev)
> return 0;
> }
>
> +static int imx94_enetc_get_enetc_offset(ofnode np)
> +{
> + int bus_devfn;
> +
> + bus_devfn = netc_of_pci_get_bus_devfn(np);
> + if (bus_devfn < 0)
> + return -EINVAL;
> +
> + /* Parse ENETC offset */
> + switch (bus_devfn) {
> + case IMX94_ENETC0_BUS_DEVFN:
> + return IMX94_ENETC0_OFFSET;
> + case IMX94_ENETC1_BUS_DEVFN:
> + return IMX94_ENETC1_OFFSET;
> + case IMX94_ENETC2_BUS_DEVFN:
> + return IMX94_ENETC2_OFFSET;
> + default:
> + return -EINVAL;
> + }
> +}
> +
> +static int imx94_enetc_get_timer_id(ofnode np)
> +{
> + int bus_devfn;
> +
> + bus_devfn = netc_of_pci_get_bus_devfn(np);
> + if (bus_devfn < 0)
> + return -EINVAL;
> +
> + /* Parse ENETC PTP timer ID */
> + switch (bus_devfn) {
> + case IMX94_TIMER0_BUS_DEVFN:
> + return IMX94_TIMER0_ID;
> + case IMX94_TIMER1_BUS_DEVFN:
> + return IMX94_TIMER1_ID;
> + case IMX94_TIMER2_BUS_DEVFN:
> + return IMX94_TIMER2_ID;
> + default:
> + return -EINVAL;
> + }
> +}
> +
> +static int imx94_enetc_update_tid(struct netc_blk_ctrl *priv, ofnode pf_np)
> +{
> + ofnode timer_np;
> + int offset, tid;
> +
> + offset = imx94_enetc_get_enetc_offset(pf_np);
> + if (offset < 0) {
> + printf("Find unknown PF node.\n");
> + return offset;
> + }
> +
> + timer_np = ofnode_parse_phandle(pf_np, "nxp,ptp-timer", 0);
> + if (!ofnode_valid(timer_np)) {
> + /*
> + * If nxp,ptp-timer is not set, the first timer of the bus
> + * where enetc is located will be used as the default timer.
> + */
> + tid = IMX94_TIMER1_ID;
> + goto update_reg;
> + }
> +
> + tid = imx94_enetc_get_timer_id(timer_np);
> + if (tid < 0) {
> + printf("Incorrect bus/devfn of ptp-timer.\n");
> + return tid;
> + }
> +
> +update_reg:
> + netc_reg_write(priv->ierb, IERB_ETBCR(offset), tid);
> +
> + return 0;
> +}
> +
> +static int imx94_ierb_init(struct udevice *dev)
> +{
> + struct netc_blk_ctrl *priv = dev_get_priv(dev);
> + ofnode bus_np, pf_np;
> + int ret = 0;
> +
> + dev_for_each_subnode(bus_np, dev)
> + ofnode_for_each_subnode(pf_np, bus_np)
> + if (ofnode_device_is_compatible(pf_np, "pci1131,e101"))
> + ret = imx94_enetc_update_tid(priv, pf_np);
> +
> + return ret;
> +}
> +
> static int netc_ierb_init(struct udevice *dev)
> {
> struct netc_blk_ctrl *priv = dev_get_priv(dev);
> + struct netc_devinfo *devinfo = (struct netc_devinfo *)dev_get_driver_data(dev);
> int err;
>
> if (netc_ierb_is_locked(priv)) {
> @@ -251,9 +528,11 @@ static int netc_ierb_init(struct udevice *dev)
> }
> }
>
> - err = imx95_ierb_init(dev);
> - if (err)
> - return err;
> + if (devinfo->ierb_init) {
> + err = devinfo->ierb_init(dev);
> + if (err)
> + return err;
> + }
>
> err = netc_lock_ierb(priv);
> if (err) {
> @@ -264,6 +543,31 @@ static int netc_ierb_init(struct udevice *dev)
> return 0;
> }
>
> +static void imx94_netc_xpcs_port_init(struct netc_blk_ctrl *priv, int port)
> +{
> + u32 val;
> +
> + val = netc_reg_read(priv->netcmix, IMX94_MISC_SOC_CONTROL);
> + if (port == IMX94_XPCS_PORT_1)
> + val |= SEL_XPCS_1;
> + else
> + val &= ~SEL_XPCS_1;
> + netc_reg_write(priv->netcmix, IMX94_MISC_SOC_CONTROL, val);
> +}
> +
> +void netc_xpcs_port_init(int port)
> +{
> + struct netc_blk_ctrl *priv = netc_bc;
> + struct netc_devinfo *devinfo;
> +
> + if (!priv)
> + return;
> +
> + devinfo = netc_di;
> + if (devinfo->xpcs_port_init)
> + devinfo->xpcs_port_init(priv, port);
> +}
> +
> static int netc_prb_check_error(struct netc_blk_ctrl *priv)
> {
> if (netc_reg_read(priv->prb, PRB_NETCSR) & NETCSR_ERROR)
> @@ -272,14 +576,27 @@ static int netc_prb_check_error(struct netc_blk_ctrl *priv)
> return 0;
> }
>
> +static const struct netc_devinfo imx95_devinfo = {
> + .netcmix_init = imx95_netcmix_init,
> + .ierb_init = imx95_ierb_init,
> +};
> +
> +static const struct netc_devinfo imx94_devinfo = {
> + .netcmix_init = imx94_netcmix_init,
> + .ierb_init = imx94_ierb_init,
> + .xpcs_port_init = imx94_netc_xpcs_port_init,
> +};
> +
> static const struct udevice_id netc_blk_ctrl_match[] = {
> - { .compatible = "nxp,imx95-netc-blk-ctrl" },
> + { .compatible = "nxp,imx95-netc-blk-ctrl", .data = (ulong)&imx95_devinfo },
> + { .compatible = "nxp,imx94-netc-blk-ctrl", .data = (ulong)&imx94_devinfo },
> {},
> };
>
> static int netc_blk_ctrl_probe(struct udevice *dev)
> {
> struct netc_blk_ctrl *priv = dev_get_priv(dev);
> + struct netc_devinfo *devinfo = (struct netc_devinfo *)dev_get_driver_data(dev);
> struct clk *ipg_clk;
> fdt_addr_t regs;
> int err;
> @@ -318,10 +635,12 @@ static int netc_blk_ctrl_probe(struct udevice *dev)
>
> priv->netcmix = (void __iomem *)regs;
>
> - err = imx95_netcmix_init(dev);
> - if (err) {
> - dev_err(dev, "Initializing NETCMIX failed\n");
> - return err;
> + if (devinfo->netcmix_init) {
> + err = devinfo->netcmix_init(dev);
> + if (err) {
> + dev_err(dev, "Initializing NETCMIX failed\n");
> + return err;
> + }
> }
>
> err = netc_ierb_init(dev);
> @@ -333,6 +652,9 @@ static int netc_blk_ctrl_probe(struct udevice *dev)
> if (netc_prb_check_error(priv) < 0)
> dev_warn(dev, "The current IERB configuration is invalid\n");
>
> + netc_bc = priv;
> + netc_di = devinfo;
> +
> return 0;
> }
>
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 09/10] net: fsl_enetc_mdio: Add support for phy-supply property
2025-09-23 11:11 [PATCH 00/10] Enable USB and ENETC on i.MX943 EVK Alice Guo (OSS)
` (7 preceding siblings ...)
2025-09-23 11:11 ` [PATCH 08/10] net: fsl_enetc: Add i.MX94 support to NETC block control driver Alice Guo (OSS)
@ 2025-09-23 11:11 ` Alice Guo (OSS)
2025-09-23 11:11 ` [PATCH 10/10] imx943_evk: Enable ENETC1 and ENETC2 Alice Guo (OSS)
2025-10-07 11:23 ` [PATCH 00/10] Enable USB and ENETC on i.MX943 EVK Fabio Estevam
10 siblings, 0 replies; 17+ messages in thread
From: Alice Guo (OSS) @ 2025-09-23 11:11 UTC (permalink / raw)
To: Marek Vasut, Tom Rini, Stefano Babic, Fabio Estevam,
NXP i.MX U-Boot Team, Alice Guo, Lukasz Majewski,
Mattijs Korpershoek, Joe Hershberger, Ramon Fried
Cc: u-boot, Ye Li, Peng Fan, Jacky Bai
From: Ye Li <ye.li@nxp.com>
Add support for the optional 'phy-supply' property in the ENETC MDIO
driver. This allows the driver to enable and manage the PHY's power
supply via the regulator framework when specified in device tree.
Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Alice Guo <alice.guo@nxp.com>
---
drivers/net/fsl_enetc_mdio.c | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/drivers/net/fsl_enetc_mdio.c b/drivers/net/fsl_enetc_mdio.c
index c1d491f2c5a..3d76d92a62a 100644
--- a/drivers/net/fsl_enetc_mdio.c
+++ b/drivers/net/fsl_enetc_mdio.c
@@ -11,6 +11,8 @@
#include <asm/io.h>
#include <asm/processor.h>
#include <miiphy.h>
+#include <linux/delay.h>
+#include <power/regulator.h>
#include "fsl_enetc.h"
@@ -135,6 +137,8 @@ static int enetc_mdio_probe(struct udevice *dev)
struct pci_child_plat *pplat = dev_get_parent_plat(dev);
struct enetc_mdio_priv *priv = dev_get_priv(dev);
u16 cmd = PCI_COMMAND_MEMORY;
+ int ret;
+ struct udevice *supply = NULL;
priv->regs_base = dm_pci_map_bar(dev, PCI_BASE_ADDRESS_0, 0, 0, PCI_REGION_TYPE, 0);
if (!priv->regs_base) {
@@ -144,6 +148,27 @@ static int enetc_mdio_probe(struct udevice *dev)
priv->regs_base += ENETC_MDIO_BASE;
+ if (CONFIG_IS_ENABLED(DM_REGULATOR)) {
+ ret = device_get_supply_regulator(dev, "phy-supply",
+ &supply);
+ if (ret && ret != -ENOENT) {
+ printf("%s: device_get_supply_regulator failed: %d\n",
+ __func__, ret);
+ return ret;
+ }
+
+ if (supply) {
+ regulator_set_enable(supply, false);
+ mdelay(100);
+
+ ret = regulator_set_enable_if_allowed(supply, true);
+ if (ret) {
+ printf("%s: Error enabling phy supply\n", dev->name);
+ return ret;
+ }
+ }
+ }
+
if (pplat->vendor == PCI_VENDOR_ID_PHILIPS) /* i.MX95 */
cmd |= PCI_COMMAND_MASTER;
--
2.43.0
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH 10/10] imx943_evk: Enable ENETC1 and ENETC2
2025-09-23 11:11 [PATCH 00/10] Enable USB and ENETC on i.MX943 EVK Alice Guo (OSS)
` (8 preceding siblings ...)
2025-09-23 11:11 ` [PATCH 09/10] net: fsl_enetc_mdio: Add support for phy-supply property Alice Guo (OSS)
@ 2025-09-23 11:11 ` Alice Guo (OSS)
2025-10-07 11:23 ` [PATCH 00/10] Enable USB and ENETC on i.MX943 EVK Fabio Estevam
10 siblings, 0 replies; 17+ messages in thread
From: Alice Guo (OSS) @ 2025-09-23 11:11 UTC (permalink / raw)
To: Marek Vasut, Tom Rini, Stefano Babic, Fabio Estevam,
NXP i.MX U-Boot Team, Alice Guo, Lukasz Majewski,
Mattijs Korpershoek, Joe Hershberger, Ramon Fried
Cc: u-boot, Ye Li, Peng Fan, Jacky Bai
From: Alice Guo <alice.guo@nxp.com>
With this patch, both ENETC1 and ENETC2 are functional on the i.MX943
EVK board and can be used for networking.
Signed-off-by: Alice Guo <alice.guo@nxp.com>
---
arch/arm/dts/imx943-evk-u-boot.dtsi | 149 ++++++++++++++++++++++++++++++++
arch/arm/dts/imx943-u-boot.dtsi | 166 ++++++++++++++++++++++++++++++++++++
configs/imx943_evk_defconfig | 13 +++
3 files changed, 328 insertions(+)
diff --git a/arch/arm/dts/imx943-evk-u-boot.dtsi b/arch/arm/dts/imx943-evk-u-boot.dtsi
index 3995176f090..528b3b02a3f 100644
--- a/arch/arm/dts/imx943-evk-u-boot.dtsi
+++ b/arch/arm/dts/imx943-evk-u-boot.dtsi
@@ -5,10 +5,109 @@
#include "imx943-u-boot.dtsi"
+&enetc1 {
+ clocks = <&scmi_clk IMX94_CLK_MAC4>;
+ clock-names = "enet_ref_clk";
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_eth3>;
+ phy-handle = <ðphy5>;
+ phy-mode = "rgmii-id";
+ status = "okay";
+};
+
+&enetc2 {
+ clocks = <&scmi_clk IMX94_CLK_MAC5>;
+ clock-names = "enet_ref_clk";
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_eth4>;
+ phy-handle = <ðphy6>;
+ phy-mode = "rgmii-id";
+ status = "okay";
+};
+
+&lpi2c3 {
+ clock-frequency = <400000>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_lpi2c3>;
+ status = "okay";
+
+ pca9548_i2c3: i2c-mux@77 {
+ compatible = "nxp,pca9548";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <0x77>;
+
+ i2c@5 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <5>;
+
+ pcal6416_i2c3_u171: gpio@21 {
+ compatible = "nxp,pcal6416";
+ reg = <0x21>;
+ gpio-controller;
+ #gpio-cells = <2>;
+
+ ethphy2-on-hog {
+ gpio-hog;
+ gpios = <2 GPIO_ACTIVE_HIGH>;
+ output-high;
+ };
+
+ ethphy3-on-hog {
+ gpio-hog;
+ gpios = <3 GPIO_ACTIVE_HIGH>;
+ output-high;
+ };
+
+ ethphy4-on-hog {
+ gpio-hog;
+ gpios = <4 GPIO_ACTIVE_HIGH>;
+ output-high;
+ };
+
+ lvds-en-hog {
+ gpio-hog;
+ gpios = <9 GPIO_ACTIVE_HIGH>;
+ output-high;
+ };
+ };
+ };
+ };
+};
+
&lpuart1 {
bootph-pre-ram;
};
+&netc_blk_ctrl {
+ assigned-clocks = <&scmi_clk IMX94_CLK_MAC2>,
+ <&scmi_clk IMX94_CLK_MAC4>,
+ <&scmi_clk IMX94_CLK_MAC5>;
+ assigned-clock-parents = <&scmi_clk IMX94_CLK_SYSPLL1_PFD0>,
+ <&scmi_clk IMX94_CLK_SYSPLL1_PFD0>,
+ <&scmi_clk IMX94_CLK_SYSPLL1_PFD0>;
+ assigned-clock-rates = <250000000>, <250000000>, <250000000>;
+ status = "okay";
+};
+
+&netc_emdio {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_emdio>;
+ phy-supply = <®_gpy_en>;
+ status = "okay";
+
+ ethphy5: ethernet-phy@6 {
+ reg = <0x6>;
+ realtek,clkout-disable;
+ };
+
+ ethphy6: ethernet-phy@7 {
+ reg = <0x7>;
+ realtek,clkout-disable;
+ };
+};
+
®_usdhc2_vmmc {
bootph-pre-ram;
};
@@ -58,6 +157,56 @@
status = "disabled";
};
+&scmi_iomuxc {
+ pinctrl_emdio: emdiogrp {
+ fsl,pins = <
+ IMX94_PAD_ETH4_MDC_GPIO1__NETC_EMDC 0x57e
+ IMX94_PAD_ETH4_MDIO_GPIO2__NETC_EMDIO 0x97e
+ >;
+ };
+
+ pinctrl_eth3: eth3grp {
+ fsl,pins = <
+ IMX94_PAD_ETH3_TXD3__NETC_PINMUX_ETH3_TXD3 0x57e
+ IMX94_PAD_ETH3_TXD2__NETC_PINMUX_ETH3_TXD2 0x57e
+ IMX94_PAD_ETH3_TXD1__NETC_PINMUX_ETH3_TXD1 0x57e
+ IMX94_PAD_ETH3_TXD0__NETC_PINMUX_ETH3_TXD0 0x57e
+ IMX94_PAD_ETH3_TX_CTL__NETC_PINMUX_ETH3_TX_CTL 0x57e
+ IMX94_PAD_ETH3_TX_CLK__NETC_PINMUX_ETH3_TX_CLK 0x5fe
+ IMX94_PAD_ETH3_RX_CTL__NETC_PINMUX_ETH3_RX_CTL 0x57e
+ IMX94_PAD_ETH3_RX_CLK__NETC_PINMUX_ETH3_RX_CLK 0x5fe
+ IMX94_PAD_ETH3_RXD0__NETC_PINMUX_ETH3_RXD0 0x57e
+ IMX94_PAD_ETH3_RXD1__NETC_PINMUX_ETH3_RXD1 0x57e
+ IMX94_PAD_ETH3_RXD2__NETC_PINMUX_ETH3_RXD2 0x57e
+ IMX94_PAD_ETH3_RXD3__NETC_PINMUX_ETH3_RXD3 0x57e
+ >;
+ };
+
+ pinctrl_eth4: eth4grp {
+ fsl,pins = <
+ IMX94_PAD_ETH4_TXD3__NETC_PINMUX_ETH4_TXD3 0x57e
+ IMX94_PAD_ETH4_TXD2__NETC_PINMUX_ETH4_TXD2 0x57e
+ IMX94_PAD_ETH4_TXD1__NETC_PINMUX_ETH4_TXD1 0x57e
+ IMX94_PAD_ETH4_TXD0__NETC_PINMUX_ETH4_TXD0 0x57e
+ IMX94_PAD_ETH4_TX_CTL__NETC_PINMUX_ETH4_TX_CTL 0x57e
+ IMX94_PAD_ETH4_TX_CLK__NETC_PINMUX_ETH4_TX_CLK 0x5fe
+ IMX94_PAD_ETH4_RX_CTL__NETC_PINMUX_ETH4_RX_CTL 0x57e
+ IMX94_PAD_ETH4_RX_CLK__NETC_PINMUX_ETH4_RX_CLK 0x5fe
+ IMX94_PAD_ETH4_RXD0__NETC_PINMUX_ETH4_RXD0 0x57e
+ IMX94_PAD_ETH4_RXD1__NETC_PINMUX_ETH4_RXD1 0x57e
+ IMX94_PAD_ETH4_RXD2__NETC_PINMUX_ETH4_RXD2 0x57e
+ IMX94_PAD_ETH4_RXD3__NETC_PINMUX_ETH4_RXD3 0x57e
+ >;
+ };
+
+ pinctrl_lpi2c3: lpi2c3grp {
+ fsl,pins = <
+ IMX94_PAD_GPIO_IO16__LPI2C3_SDA 0x40000b9e
+ IMX94_PAD_GPIO_IO17__LPI2C3_SCL 0x40000b9e
+ >;
+ };
+};
+
&pinctrl_reg_usdhc2_vmmc {
bootph-pre-ram;
};
diff --git a/arch/arm/dts/imx943-u-boot.dtsi b/arch/arm/dts/imx943-u-boot.dtsi
index 8c89b8be04b..2b93ba9a38b 100644
--- a/arch/arm/dts/imx943-u-boot.dtsi
+++ b/arch/arm/dts/imx943-u-boot.dtsi
@@ -84,6 +84,25 @@
};
};
+ reg_gpy_stby: regulator-gpy-stby {
+ compatible = "regulator-fixed";
+ regulator-name = "gpy-stby";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ gpio = <&pcal6416_i2c3_u171 5 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ };
+
+ reg_gpy_en: regulator-gpy-en {
+ compatible = "regulator-fixed";
+ regulator-name = "gpy-en";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ vin-supply = <®_gpy_stby>;
+ gpio = <&pcal6416_i2c3_u171 6 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ };
+
usbphynop: usbphynop {
compatible = "usb-nop-xceiv";
clocks = <&scmi_clk IMX94_CLK_HSIO>;
@@ -260,6 +279,153 @@
#index-cells = <1>;
};
+ netc_blk_ctrl: system-controller@4ceb0000 {
+ compatible = "nxp,imx94-netc-blk-ctrl";
+ reg = <0x0 0x4ceb0000 0x0 0x10000>,
+ <0x0 0x4cec0000 0x0 0x10000>,
+ <0x0 0x4c810000 0x0 0x7C>;
+ reg-names = "ierb", "prb", "netcmix";
+ #address-cells = <2>;
+ #size-cells = <2>;
+ ranges;
+ power-domains = <&scmi_devpd IMX94_PD_NETC>;
+ status = "disabled";
+
+ netc_bus0: pcie@4ca00000 {
+ compatible = "pci-host-ecam-generic";
+ reg = <0x0 0x4ca00000 0x0 0x100000>;
+ #address-cells = <3>;
+ #size-cells = <2>;
+ device_type = "pci";
+ linux,pci-domain = <0>;
+ bus-range = <0x0 0x0>;
+ /* Switch BAR0 - non-prefetchable memory */
+ ranges = <0x02000000 0x0 0x4cc00000 0x0 0x4cc00000 0x0 0x80000
+ /* ENETC 3 and Timer 0 BAR0 - non-prefetchable memory */
+ 0x02000000 0x0 0x4cd40000 0x0 0x4cd40000 0x0 0x60000
+ /* Switch and Timer 0 BAR2 - prefetchable memory */
+ 0x42000000 0x0 0x4ce00000 0x0 0x4ce00000 0x0 0x20000
+ /* ENETC 3 VF0-2 BAR0 - non-prefetchable memory */
+ 0x02000000 0x0 0x4ce50000 0x0 0x4ce50000 0x0 0x30000
+ /* ENETC 3 VF0-2 BAR2 - prefetchable memory */
+ 0x42000000 0x0 0x4ce80000 0x0 0x4ce80000 0x0 0x30000>;
+
+ enetc3: ethernet@0,0 {
+ compatible = "pci1131,e110";
+ reg = <0x0 0 0 0 0>;
+ phy-mode = "internal";
+ status = "disabled";
+
+ fixed-link {
+ speed = <2500>;
+ full-duplex;
+ pause;
+ };
+ };
+
+ netc_timer0: ethernet@0,1 {
+ compatible = "pci1131,ee02";
+ reg = <0x100 0 0 0 0>;
+ status = "disabled";
+ };
+
+ netc_switch: ethernet-switch@0,2 {
+ compatible = "pci1131,eef2", "nxp,imx943-netc-switch";
+ reg = <0x200 0 0 0 0>;
+ status = "disabled";
+
+ netc_switch_ports: ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ /* External ports */
+ netc_switch_port0: port@0 {
+ reg = <0>;
+ status = "disabled";
+ };
+
+ netc_switch_port1: port@1 {
+ reg = <1>;
+ status = "disabled";
+ };
+
+ netc_switch_port2: port@2 {
+ reg = <2>;
+ status = "disabled";
+ };
+
+ /* Internal port, a.k.a management port */
+ netc_switch_port3: port@3 {
+ reg = <3>;
+ phy-mode = "internal";
+ ethernet = <&enetc3>;
+ status = "disabled";
+
+ fixed-link {
+ speed = <2500>;
+ full-duplex;
+ pause;
+ };
+ };
+ };
+ };
+ };
+
+ netc_bus1: pcie@4cb00000 {
+ compatible = "pci-host-ecam-generic";
+ reg = <0x0 0x4cb00000 0x0 0x100000>;
+ #address-cells = <3>;
+ #size-cells = <2>;
+ device_type = "pci";
+ linux,pci-domain = <1>;
+ bus-range = <0x1 0x1>;
+ /* ENETC 0-2 BAR0 - non-prefetchable memory */
+ ranges = <0x02000000 0x0 0x4cC80000 0x0 0x4cc80000 0x0 0xc0000
+ /* Timer 1-2 and EMDIO BAR0 - non-prefetchable memory */
+ 0x02000000 0x0 0x4cda0000 0x0 0x4cda0000 0x0 0x60000
+ /* Timer 1-2 and EMDIO BAR2 - prefetchable memory */
+ 0x42000000 0x0 0x4ce20000 0x0 0x4ce20000 0x0 0x30000>;
+
+ enetc0: ethernet@0,0 {
+ compatible = "pci1131,e101";
+ reg = <0x10000 0 0 0 0>;
+ status = "disabled";
+ };
+
+ netc_timer1: ethernet@0,1 {
+ compatible = "pci1131,ee02";
+ reg = <0x10100 0 0 0 0>;
+ status = "disabled";
+ };
+
+ enetc1: ethernet@8,0 {
+ compatible = "pci1131,e101";
+ reg = <0x14000 0 0 0 0>;
+ status = "disabled";
+ };
+
+ enetc2: ethernet@10,0 {
+ compatible = "pci1131,e101";
+ reg = <0x18000 0 0 0 0>;
+ status = "disabled";
+ };
+
+ netc_timer2: ethernet@10,1 {
+ compatible = "pci1131,ee02";
+ reg = <0x18100 0 0 0 0>;
+ status = "disabled";
+ };
+
+ netc_emdio: mdio@18,0 {
+ compatible = "pci1131,ee00";
+ reg = <0x1c000 0 0 0 0>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
+ };
+ };
+ };
+
elemu1: mailbox@47530000 {
compatible = "fsl,imx93-mu-s4";
reg = <0x0 0x47530000 0x0 0x10000>;
diff --git a/configs/imx943_evk_defconfig b/configs/imx943_evk_defconfig
index e4fcf2eb576..39b616e266e 100644
--- a/configs/imx943_evk_defconfig
+++ b/configs/imx943_evk_defconfig
@@ -39,6 +39,7 @@ CONFIG_SYS_CBSIZE=2048
CONFIG_SYS_PBSIZE=2074
CONFIG_BOARD_EARLY_INIT_F=y
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
@@ -83,6 +84,8 @@ CONFIG_ENV_OVERWRITE=y
CONFIG_ENV_IS_NOWHERE=y
CONFIG_ENV_IS_IN_MMC=y
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
+CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_SYS_RX_ETH_BUFFER=8
CONFIG_SPL_DM=y
CONFIG_SPL_DM_SEQ_ALIAS=y
CONFIG_REGMAP=y
@@ -97,9 +100,19 @@ CONFIG_SPL_CLK_SCMI=y
CONFIG_SPL_FIRMWARE=y
# CONFIG_SCMI_AGENT_SMCCC is not set
CONFIG_IMX_RGPIO2P=y
+CONFIG_DM_PCA953X=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_BOOT=y
CONFIG_FSL_USDHC=y
+CONFIG_PHYLIB=y
+CONFIG_PHY_REALTEK=y
+CONFIG_DM_MDIO=y
+CONFIG_FSL_ENETC=y
+CONFIG_PCIE_ECAM_GENERIC=y
CONFIG_SPL_PHY=y
CONFIG_SPL_PHY_IMX8MQ_USB=y
CONFIG_PINCTRL=y
--
2.43.0
^ permalink raw reply related [flat|nested] 17+ messages in thread* Re: [PATCH 00/10] Enable USB and ENETC on i.MX943 EVK
2025-09-23 11:11 [PATCH 00/10] Enable USB and ENETC on i.MX943 EVK Alice Guo (OSS)
` (9 preceding siblings ...)
2025-09-23 11:11 ` [PATCH 10/10] imx943_evk: Enable ENETC1 and ENETC2 Alice Guo (OSS)
@ 2025-10-07 11:23 ` Fabio Estevam
2025-10-07 11:27 ` Marek Vasut
10 siblings, 1 reply; 17+ messages in thread
From: Fabio Estevam @ 2025-10-07 11:23 UTC (permalink / raw)
To: Alice Guo (OSS), Marek Vasut
Cc: Marek Vasut, Tom Rini, Stefano Babic, NXP i.MX U-Boot Team,
Alice Guo, Lukasz Majewski, Mattijs Korpershoek, Joe Hershberger,
Ramon Fried, u-boot, Ye Li, Peng Fan, Jacky Bai, Frank Li
Hi Marek,
On Tue, Sep 23, 2025 at 8:12 AM Alice Guo (OSS) <alice.guo@oss.nxp.com> wrote:
>
> Changes for v1:
> - Adding USB2 and USB3 device tree nodes with required PHY and
> regulator support.
> - Enabling ENETC1 and ENETC2.
> - Updating Kconfig and DTSI files to support these interfaces.
>
> This series depends on "imx: add i.MX94 support".
Could you please help review the USB parts of this series?
Thanks
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: [PATCH 00/10] Enable USB and ENETC on i.MX943 EVK
2025-10-07 11:23 ` [PATCH 00/10] Enable USB and ENETC on i.MX943 EVK Fabio Estevam
@ 2025-10-07 11:27 ` Marek Vasut
2025-10-09 22:42 ` Fabio Estevam
0 siblings, 1 reply; 17+ messages in thread
From: Marek Vasut @ 2025-10-07 11:27 UTC (permalink / raw)
To: Fabio Estevam, Alice Guo (OSS)
Cc: Tom Rini, Stefano Babic, NXP i.MX U-Boot Team, Alice Guo,
Lukasz Majewski, Mattijs Korpershoek, Joe Hershberger,
Ramon Fried, u-boot, Ye Li, Peng Fan, Jacky Bai, Frank Li
On 10/7/25 1:23 PM, Fabio Estevam wrote:
Hello Fabio,
>> Changes for v1:
>> - Adding USB2 and USB3 device tree nodes with required PHY and
>> regulator support.
>> - Enabling ENETC1 and ENETC2.
>> - Updating Kconfig and DTSI files to support these interfaces.
>>
>> This series depends on "imx: add i.MX94 support".
>
> Could you please help review the USB parts of this series?
I don't think I ever received the entire series, can Alice please resend
it and CC me on ALL the patches ?
Thank you
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 00/10] Enable USB and ENETC on i.MX943 EVK
2025-10-07 11:27 ` Marek Vasut
@ 2025-10-09 22:42 ` Fabio Estevam
2025-10-10 14:22 ` Mattijs Korpershoek
0 siblings, 1 reply; 17+ messages in thread
From: Fabio Estevam @ 2025-10-09 22:42 UTC (permalink / raw)
To: Alice Guo (OSS)
Cc: Tom Rini, Stefano Babic, NXP i.MX U-Boot Team, Alice Guo,
Lukasz Majewski, Mattijs Korpershoek, Joe Hershberger,
Ramon Fried, u-boot, Ye Li, Peng Fan, Jacky Bai, Frank Li,
Marek Vasut
Hi Alice,
On Tue, Oct 7, 2025 at 8:27 AM Marek Vasut <marek.vasut@mailbox.org> wrote:
> I don't think I ever received the entire series, can Alice please resend
> it and CC me on ALL the patches ?
Please resend the series with Marek on Cc on all the patches.
Thanks
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 00/10] Enable USB and ENETC on i.MX943 EVK
2025-10-09 22:42 ` Fabio Estevam
@ 2025-10-10 14:22 ` Mattijs Korpershoek
0 siblings, 0 replies; 17+ messages in thread
From: Mattijs Korpershoek @ 2025-10-10 14:22 UTC (permalink / raw)
To: Marek Vasut
Cc: Tom Rini, Stefano Babic, NXP i.MX U-Boot Team, Alice Guo,
Lukasz Majewski, Mattijs Korpershoek, Joe Hershberger,
Ramon Fried, u-boot, Ye Li, Peng Fan, Jacky Bai, Frank Li,
Fabio Estevam, Alice Guo (OSS)
On Thu, Oct 09, 2025 at 19:42, Fabio Estevam <festevam@gmail.com> wrote:
> Hi Alice,
>
> On Tue, Oct 7, 2025 at 8:27 AM Marek Vasut <marek.vasut@mailbox.org> wrote:
>
>> I don't think I ever received the entire series, can Alice please resend
>> it and CC me on ALL the patches ?
>
> Please resend the series with Marek on Cc on all the patches.
Hi Marek,
I checked the series and it looks like your denx.de email is CC'd on the
whole series: Marek Vasut <marex@denx.de>.
This is also what's seen on lore:
http://lore.kernel.org/r/20250923-usbnetc-v1-0-507cddbe7214@oss.nxp.com
If that one is no longer valid, maybe we can consider updating
MAINTAINERS?
It's still listed for the USB entry.
>
> Thanks
^ permalink raw reply [flat|nested] 17+ messages in thread