The STMicroelectronics STM32MP15 CPU has one 10/100/1000 Ethernet MAC.

On the ConnectCore MP15 Development Kit:

  • The Ethernet port is connected to a 10/100/1000 Marvell 88E1512-A0-NNP2I000 PHY.

The MAC address and serial number of the SOM are encoded in the data matrix on the SOM label.

Kernel configuration

You can manage the Ethernet driver and PHY device support through the following kernel configuration options:

  • STM32 Ethernet controller (DWMAC) (CONFIG_DWMAC_STM32)

  • PHY device support for Marvell (88E1XXX) (CONFIG_MARVELL_PHY)

These options are enabled as built-in on the default ConnectCore MP15 kernel configuration file.

Kernel driver

The drivers for the Ethernet interface are located at:

File Description

drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c

DWMAC driver

drivers/net/phy/marvell.c

Driver for Marvel PHY 88E1XXX

Device tree bindings and customization

The STM32MP15 Ethernet interface device tree binding is documented at Documentation/devicetree/bindings/net/stm32-dwmac.yaml. The Ethernet interface is defined in the STM32MP15 CPU and ConnectCore MP15 Development Kit device tree files.

Example: DWMAC on ConnectCore MP15 Development Kit

Definition of the DWMAC

STM32MP15 device tree
ethernet0: ethernet@5800a000 {
	compatible = "st,stm32mp1-dwmac", "snps,dwmac-4.20a";
	reg = <0x5800a000 0x2000>;
	reg-names = "stmmaceth";
	interrupts-extended = <&intc GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH>,
			      <&exti 70 IRQ_TYPE_LEVEL_HIGH>;
	interrupt-names = "macirq",
			  "eth_wake_irq";
	clock-names = "stmmaceth",
		"mac-clk-tx",
		"mac-clk-rx",
		"eth-ck",
		"ptp_ref",
		"ethstp";
	clocks = <&rcc ETHMAC>,
		 <&rcc ETHTX>,
		 <&rcc ETHRX>,
		 <&rcc ETHCK_K>,
		 <&rcc ETHPTP_K>,
		 <&rcc ETHSTP>;
	st,syscon = <&syscfg 0x4>;
	snps,mixed-burst;
	snps,pbl = <2>;
	snps,en-tx-lpi-clockgating;
	snps,axi-config = <&stmmac_axi_config_0>;
	snps,tso;
	status = "disabled";
	power-domains = <&pd_core>;

	stmmac_axi_config_0: stmmac-axi-config {
		snps,wr_osr_lmt = <0x7>;
		snps,rd_osr_lmt = <0x7>;
		snps,blen = <0 0 0 0 16 8 4>;
	};
};

IOMUX configuration

ConnectCore MP15 Development Kit device tree
ccmp15_ethernet0_rgmii_pins: rgmii-1 {
	pins1 {
		pinmux = <STM32_PINMUX('G', 5, AF11)>, /* ETH_RGMII_CLK125 */
			 <STM32_PINMUX('G', 4, AF11)>, /* ETH_RGMII_GTX_CLK */
			 <STM32_PINMUX('G', 13, AF11)>, /* ETH_RGMII_TXD0 */
			 <STM32_PINMUX('G', 14, AF11)>, /* ETH_RGMII_TXD1 */
			 <STM32_PINMUX('C', 2, AF11)>, /* ETH_RGMII_TXD2 */
			 <STM32_PINMUX('E', 2, AF11)>, /* ETH_RGMII_TXD3 */
			 <STM32_PINMUX('B', 11, AF11)>, /* ETH_RGMII_TX_CTL */
			 <STM32_PINMUX('C', 1, AF11)>; /* ETH_MDC */
		bias-disable;
		drive-push-pull;
		slew-rate = <2>;
	};
	pins2 {
		pinmux = <STM32_PINMUX('A', 2, AF11)>; /* ETH_MDIO */
		bias-disable;
		drive-push-pull;
		slew-rate = <0>;
	};
	pins3 {
		pinmux = <STM32_PINMUX('C', 4, AF11)>, /* ETH_RGMII_RXD0 */
			 <STM32_PINMUX('C', 5, AF11)>, /* ETH_RGMII_RXD1 */
			 <STM32_PINMUX('H', 6, AF11)>, /* ETH_RGMII_RXD2 */
			 <STM32_PINMUX('H', 7, AF11)>, /* ETH_RGMII_RXD3 */
			 <STM32_PINMUX('A', 1, AF11)>, /* ETH_RGMII_RX_CLK */
			 <STM32_PINMUX('A', 7, AF11)>; /* ETH_RGMII_RX_CTL */
		bias-disable;
	};
};

Ethernet enabling and PHY parameters

ConnectCore MP15 Development Kit device tree
/* 10/100/1000 Ethernet */
&ethernet0 {
	status = "okay";
	pinctrl-0 = <&{pfm_slug}_ethernet0_rgmii_pins>;
	pinctrl-1 = <&{pfm_slug}_ethernet0_rgmii_sleep_pins>;
	pinctrl-names = "default", "sleep";
	phy-mode = "rgmii-id";
	max-speed = <1000>;
	phy-handle = <&phy0>;
	phy-supply = <&reg_3v3_eth_pwr>;

	mdio0 {
		#address-cells = <1>;
		#size-cells = <0>;
		compatible = "snps,dwmac-mdio";

		phy0: ethernet-phy@0 {
			reg = <0>;
			compatible = "ethernet-phy-id0141.0dd0"; /* PHY ID for Marvell 88E1512 */
			reset-gpios = <&gpiog 0 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
			reset-assert-us = <1000>;
			reset-deassert-us = <2000>;
		};
	};
};

MAC addresses

The MAC address of the STM32MP15 Ethernet interface is programmed in the U-Boot environment (variable ethaddr) on the ConnectCore MP15 NAND. The MAC address of the Ethernet interface is also printed on the module label. U-Boot writes the MAC address in the ethaddr environment variable into its respective device tree ethernet0 node under the local-mac-address property. For more information, see Environment variables.

Ethernet user space usage

In the Linux system, the Ethernet interface is known as ethX where X is a number, starting at 0, that indicates the interface index. The Ethernet (DWMAC) driver exposes device data through the sysfs at /sys/class/net/ethX. You can use NetworkManager to configure Ethernet settings such as IP and netmask.