diff --git a/boards/nxp/frdm_mcxn947/Kconfig.defconfig b/boards/nxp/frdm_mcxn947/Kconfig.defconfig new file mode 100644 index 00000000000..72cc76170b9 --- /dev/null +++ b/boards/nxp/frdm_mcxn947/Kconfig.defconfig @@ -0,0 +1,9 @@ +# Copyright 2024 NXP +# SPDX-License-Identifier: Apache-2.0 + +if BOARD_FRDM_MCXN947 + +config NET_L2_ETHERNET + default y if NETWORKING + +endif diff --git a/boards/nxp/frdm_mcxn947/board.c b/boards/nxp/frdm_mcxn947/board.c index 8016c4bc13a..5e798a39758 100644 --- a/boards/nxp/frdm_mcxn947/board.c +++ b/boards/nxp/frdm_mcxn947/board.c @@ -153,6 +153,15 @@ static int frdm_mcxn947_init(void) CLOCK_EnableClock(kCLOCK_Dac1); #endif +#if DT_NODE_HAS_STATUS(DT_NODELABEL(enet), okay) + CLOCK_AttachClk(kNONE_to_ENETRMII); + CLOCK_EnableClock(kCLOCK_Enet); + SYSCON0->PRESETCTRL2 = SYSCON_PRESETCTRL2_ENET_RST_MASK; + SYSCON0->PRESETCTRL2 &= ~SYSCON_PRESETCTRL2_ENET_RST_MASK; + /* rmii selection for this board */ + SYSCON->ENET_PHY_INTF_SEL = SYSCON_ENET_PHY_INTF_SEL_PHY_SEL(1); +#endif + /* Set SystemCoreClock variable. */ SystemCoreClock = CLOCK_INIT_CORE_CLOCK; diff --git a/boards/nxp/frdm_mcxn947/doc/index.rst b/boards/nxp/frdm_mcxn947/doc/index.rst index 04acb21ec3a..ee65714f14e 100644 --- a/boards/nxp/frdm_mcxn947/doc/index.rst +++ b/boards/nxp/frdm_mcxn947/doc/index.rst @@ -74,6 +74,8 @@ The FRDM-MCXN947 board configuration supports the following hardware features: +-----------+------------+-------------------------------------+ | DAC | on-chip | dac | +-----------+------------+-------------------------------------+ +| ENET QOS | on-chip | ethernet | ++-----------+------------+-------------------------------------+ Targets available ================== diff --git a/boards/nxp/frdm_mcxn947/frdm_mcxn947-pinctrl.dtsi b/boards/nxp/frdm_mcxn947/frdm_mcxn947-pinctrl.dtsi index c827d12a8ae..3bd948c668c 100644 --- a/boards/nxp/frdm_mcxn947/frdm_mcxn947-pinctrl.dtsi +++ b/boards/nxp/frdm_mcxn947/frdm_mcxn947-pinctrl.dtsi @@ -69,4 +69,26 @@ slew-rate = "fast"; }; }; + + pinmux_enet_qos: pinmux_enet_qos { + mdio_group { + pinmux = , + ; + slew-rate = "fast"; + drive-strength = "low"; + input-enable; + }; + mac_group { + pinmux = , + , + , + , + , + , + ; + slew-rate = "fast"; + drive-strength = "low"; + input-enable; + }; + }; }; diff --git a/boards/nxp/frdm_mcxn947/frdm_mcxn947.dtsi b/boards/nxp/frdm_mcxn947/frdm_mcxn947.dtsi index f14bd8bdb24..3b95bc74351 100644 --- a/boards/nxp/frdm_mcxn947/frdm_mcxn947.dtsi +++ b/boards/nxp/frdm_mcxn947/frdm_mcxn947.dtsi @@ -143,3 +143,22 @@ pinctrl-0 = <&pinmux_dac0>; pinctrl-names = "default"; }; + +&enet { + pinctrl-0 = <&pinmux_enet_qos>; + pinctrl-names = "default"; +}; + +&enet_mac { + phy-connection-type = "rmii"; + zephyr,random-mac-address; + phy-handle = <&phy>; +}; + +&enet_mdio { + phy: ethernet-phy@0 { + compatible = "ethernet-phy"; + reg = <0>; + status = "okay"; + }; +}; diff --git a/boards/nxp/frdm_mcxn947/frdm_mcxn947_mcxn947_cpu0.dts b/boards/nxp/frdm_mcxn947/frdm_mcxn947_mcxn947_cpu0.dts index ff31063f694..ba08325ae0a 100644 --- a/boards/nxp/frdm_mcxn947/frdm_mcxn947_mcxn947_cpu0.dts +++ b/boards/nxp/frdm_mcxn947/frdm_mcxn947_mcxn947_cpu0.dts @@ -104,3 +104,15 @@ &dac0 { status = "okay"; }; + +&enet { + status = "okay"; +}; + +&enet_mac { + status = "okay"; +}; + +&enet_mdio { + status = "okay"; +};