Commit 3d6c1fd6 authored by Declan Snyder's avatar Declan Snyder Committed by Carles Cufi
Browse files

boards: nxp: Support NXP ENET FRDM_K64F & RT11xx

Support NXP ENET on FRDM_K64F and rt11xx boards.
Document the experimental driver in all boards.

Signed-off-by: default avatarDeclan Snyder <declan.snyder@nxp.com>
parent 17a99367
Loading
Loading
Loading
Loading
+10 −0
Changes for boards/arm/frdm_k64f/doc/index.rst: 10 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -378,3 +378,13 @@ of pyocd commands:

.. _OpenSDA Serial and Debug Adapter:
   https://www.nxp.com/design/microcontrollers-developer-resources/ides-for-kinetis-mcus/opensda-serial-and-debug-adapter:OPENSDA#FRDM-K64F

Experimental ENET Driver
========================

Current default ethernet driver is eth_mcux, with binding `nxp,kinetis-ethernet`. There is a new
driver with binding `nxp,enet`, which is experimental and undergoing development, but will have
enhanced capability, such as not hardcoding code for only one phy in the driver like eth_mcux.

To build for this EVK with the new driver, include the experimental overlay to west build with
the option `-DEXTRA_DTC_OVERLAY_FILE=nxp,enet-experimental.overlay`.
+108 −0
Changes for boards/arm/frdm_k64f/dts/nxp,enet-experimental.overlay: 108 added lines, 0 removed lines.
Original line number Diff line number Diff line
/*
 * Copyright 2023 NXP
 *
 * Experimental ENET binding overlay
 */

/ {
	soc {
		/delete-node/ ethernet@400c0000;

		enet: ethernet@400c0000 {
			compatible = "nxp,enet";
			reg = <0x400c0000 0x620>;
			clocks = <&sim KINETIS_SIM_ENET_CLK 0 0>;
			enet_mac: ethernet {
				compatible = "nxp,enet-mac";
				interrupts = <83 0>, <84 0>, <85 0>;
				interrupt-names = "TX", "RX", "ERR";
				nxp,mdio = <&enet_mdio>;
				nxp,ptp-clock = <&enet_ptp_clock>;
				phy-connection-type = "rmii";
				status = "disabled";
			};
			enet_mdio: mdio {
				compatible = "nxp,enet-mdio";
				status = "disabled";
				#address-cells = <1>;
				#size-cells = <0>;
			};
			enet_ptp_clock: ptp_clock {
				compatible = "nxp,enet-ptp-clock";
				interrupts = <82 0>;
				interrupt-names = "IEEE1588_TMR";
				status = "disabled";
			};
		};
	};
};

&enet_mac {
	status = "okay";
	pinctrl-0 = <&pinmux_enet>;
	pinctrl-names = "default";
	phy-handle = <&phy>;
};


&enet_mdio {
	status = "okay";
	pinctrl-0 = <&pinmux_enet_mdio>;
	pinctrl-names = "default";
	phy: phy@0 {
		compatible = "microchip,ksz8081";
		reg = <0>;
		status = "okay";
		mc,interface-type = "rmii-25MHz";
	};
};

&enet_ptp_clock {
	status = "okay";
	pinctrl-0 = <&pinmux_ptp>;
	pinctrl-names = "default";
};

&pinctrl {
	/delete-node/ ptp_default;
	/delete-node/ enet_default;

	pinmux_enet: pinmux_enet {
		group1 {
			pinmux = <RMII0_RXER_PTA5>,
				<RMII0_RXD1_PTA12>,
				<RMII0_RXD0_PTA13>,
				<RMII0_CRS_DV_PTA14>,
				<RMII0_TXEN_PTA15>,
				<RMII0_TXD0_PTA16>,
				<RMII0_TXD1_PTA17>;
			drive-strength = "low";
			slew-rate = "fast";
		};
	};

	pinmux_enet_mdio: pinmux_enet_mdio {
		group0 {
			pinmux = <RMII0_MDIO_PTB0>;
			drive-strength = "low";
			drive-open-drain;
			bias-pull-up;
			slew-rate = "fast";
		};
		group1 {
			pinmux = <RMII0_MDC_PTB1>;
			drive-strength = "low";
			slew-rate = "fast";
		};
	};

	pinmux_ptp: pinmux_ptp {
		group0 {
			pinmux = <ENET0_1588_TMR0_PTC16>,
				<ENET0_1588_TMR1_PTC17>,
				<ENET0_1588_TMR2_PTC18>;
			drive-strength = "low";
			slew-rate = "fast";
		};
	};
};
+10 −0
Changes for boards/arm/mimxrt1160_evk/doc/index.rst: 10 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -354,3 +354,13 @@ should see the following message in the terminal:

.. _AN13264:
   https://www.nxp.com/docs/en/application-note/AN13264.pdf

Experimental ENET Driver
========================

Current default ethernet driver is eth_mcux, with binding `nxp,kinetis-ethernet`. There is a new
driver with binding `nxp,enet`, which is experimental and undergoing development, but will have
enhanced capability, such as not hardcoding code for only one phy in the driver like eth_mcux.

To build for this EVK with the new driver, include the experimental overlay to west build with
the option `-DEXTRA_DTC_OVERLAY_FILE=nxp,enet-experimental.overlay`.
+123 −0
Changes for boards/arm/mimxrt1160_evk/dts/nxp,enet-experimental.overlay: 123 added lines, 0 removed lines.
Original line number Diff line number Diff line
/*
 * Copyright 2023 NXP
 *
 * Experimental ENET binding overlay
 */


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

		enet: ethernet@40424000 {
			compatible = "nxp,enet";
			reg = <0x40424000 0x628>;
			clocks = <&ccm IMX_CCM_ENET_CLK 0 0>;
			enet_mac: ethernet {
				compatible = "nxp,enet-mac";
				interrupts = <137 0>;
				interrupt-names = "COMMON";
				nxp,mdio = <&enet_mdio>;
				nxp,ptp-clock = <&enet_ptp_clock>;
				status = "disabled";
			};
			enet_mdio: mdio {
				compatible = "nxp,enet-mdio";
				status = "disabled";
				#address-cells = <1>;
				#size-cells = <0>;
			};
			enet_ptp_clock: ptp_clock {
				compatible = "nxp,enet-ptp-clock";
				interrupts = <138 0>;
				status = "disabled";
				clocks = <&ccm IMX_CCM_ENET_PLL 0 0>;
			};
		};
	};
};

&enet_mac {
	status = "okay";
	pinctrl-0 = <&pinmux_enet>;
	pinctrl-names = "default";
	phy-handle = <&phy>;
	phy-connection-type = "rmii";
};

&enet_mdio {
	status = "okay";
	pinctrl-0 = <&pinmux_enet_mdio>;
	pinctrl-names = "default";
	phy: phy@0 {
		compatible = "microchip,ksz8081";
		reg = <0>;
		status = "okay";
		mc,reset-gpio = <&gpio12 12 GPIO_ACTIVE_HIGH>;
		mc,interrupt-gpio = <&gpio9 11 GPIO_ACTIVE_HIGH>;
		mc,interface-type = "rmii";
	};
};

&enet_ptp_clock {
	status = "okay";
	pinctrl-0 = <&pinmux_ptp>;
	pinctrl-names = "default";
};



&pinctrl {
	/delete-node/ pinmux_ptp;
	/delete-node/ pinmux_enet;

	pinmux_enet: pinmux_enet {
		group0 {
			pinmux = <&iomuxc_gpio_ad_12_gpio9_io11>,
				<&iomuxc_gpio_disp_b2_08_enet_rx_en>,
				<&iomuxc_gpio_disp_b2_09_enet_rx_er>;
			drive-strength = "high";
			bias-pull-down;
			slew-rate = "fast";
		};
		group1 {
			pinmux = <&iomuxc_gpio_disp_b2_06_enet_rdata00>,
				<&iomuxc_gpio_disp_b2_07_enet_rdata01>;
			drive-strength = "high";
			bias-pull-down;
			slew-rate = "fast";
			input-enable;
		};
		group2 {
			pinmux = <&iomuxc_lpsr_gpio_lpsr_12_gpio12_io12>;
			drive-strength = "high";
			bias-pull-up;
			slew-rate = "fast";
		};
		group3 {
			pinmux = <&iomuxc_gpio_disp_b2_02_enet_tdata00>,
				<&iomuxc_gpio_disp_b2_03_enet_tdata01>,
				<&iomuxc_gpio_disp_b2_04_enet_tx_en>;
			drive-strength = "high";
			slew-rate = "fast";
		};
		group4 {
			pinmux = <&iomuxc_gpio_disp_b2_05_enet_ref_clk>;
			drive-strength = "high";
			slew-rate = "slow";
			input-enable;
		};
	};

	pinmux_enet_mdio: pinmux_enet_mdio {
		group0 {
			pinmux = <&iomuxc_gpio_ad_32_enet_mdc>,
				<&iomuxc_gpio_ad_33_enet_mdio>;
			drive-strength = "high";
			slew-rate = "fast";
		};
	};

	pinmux_ptp: pinmux_ptp {
	};
};
+10 −0
Changes for boards/arm/mimxrt1170_evk/doc/index.rst: 10 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -442,3 +442,13 @@ 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

Experimental ENET Driver
========================

Current default ethernet driver is eth_mcux, with binding `nxp,kinetis-ethernet`. There is a new
driver with binding `nxp,enet`, which is experimental and undergoing development, but will have
enhanced capability, such as not hardcoding code for only one phy in the driver like eth_mcux.

To build for this EVK with the new driver, include the experimental overlay to west build with
the option `-DEXTRA_DTC_OVERLAY_FILE=nxp,enet-experimental.overlay`.
Loading