2020-11-27 1:35 AM
Hi,
I am trying to use a STM32MP157C in combination with a lan9303 chip in mdio mode.
when booting I get an error that says:
LAN9303_MDIO: probe of stmmac-0:01 failed with error -22
This prevents the driver from being loaded succesfully.
I added the lan9303 according to the device tree bindings:
ðernet0 {
        status = "okay";
        pinctrl-0 = <ðernet0_rmii_pins_a>;
        pinctrl-1 = <ðernet0_rmii_pins_sleep_a>;
        pinctrl-names = "default", "sleep";
	phy-handle = <&switch>;
	phy-mode = "rmii";
	max-speed = <1000>;
 
	mdio0 {
		#address-cells = <1>;
		#size-cells = <0>;
		
 
 
 
			switch: switch-phy@1 {
					compatible = "smsc,lan9303-mdio";
					reg = <0>;
 
 
					ports {
						#address-cells = <1>;
						#size-cells = <0>;
 
						port@1 {
							reg = <0>;
							label = "cpu";
							ethernet = <ðernet0>;
							phy-mode = "rmii";
							fixed-link {
								full-duplex;
							};
						};
 
						port@2 { /* external port 1 */
							reg = <1>;
							label = "lan1";
						};
 
						port@3 { /* external port 2 */
							reg = <2>;
							label = "lan2";
						};
					};
				};
		};Does anybody know, what might cause this error?
Thanks.
2021-01-25 11:48 PM
Make sure you have checked this article from ST wiki: https://wiki.st.com/stm32mpu/wiki/Ethernet_overview.
Your port@1 configuration seems strange to me. You should get 3 external ports provided by your lan9303 chip and only mdio port to configure
your phy.
