Use lan9303 in mdio mode on STM32MP157
Hi,
I am trying to use the lan9303 chip in mdio managed mode on a stm32mp157-based board.
I configured the Device tree according to https://kernel.googlesource.com/pub/scm/linux/kernel/git/next/linux-next/+/refs/heads/akpm-base/Documentation/devicetree/bindings/net/dsa/lan9303.txt
and my .dts file looks like this:
#include "stm32mp157.dtsi"
#include "stm32mp15xc.dtsi"
#include "stm32mp15-qsmp.dtsi"
/ {
model = "Ka-Ro electronics GmbH QSMP-1570 module on HSW board v1";
compatible = "karo,stm32mp157c-qsmp-1570", "st,stm32mp157";
};
&gpu {
status = "okay";
};
ðernet0 {
status = "okay";
pinctrl-0 = <ðernet0_rmii_pins_a>;
pinctrl-1 = <ðernet0_rmii_pins_sleep_a>;
pinctrl-names = "default", "sleep";
phy-mode = "rmii";
max-speed = <1000>;
phy-handle = <&switch>;
mdio0 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "snps,dwmac-mdio";
switch: switch-phy@0 {
compatible = "smsc,lan9303-mdio";
reg = <0>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
label = "cpu";
ethernet = <ðernet0>;
};
port@1 { /* external port 1 */
reg = <1>;
label = "lan1";
};
port@2 { /* external port 2 */
reg = <2>;
label = "lan2";
};
};
};
};
};On boot the kernel recognizes the lan9303 driver and the ports lan1 and lan2 but fails to find a PHY. I will attach the output.
The ethernet node in the flattened device tree looks like this:
ethernet@5800a000 {
compatible = "st,stm32mp1-dwmac", "snps,dwmac-4.20a";
reg = <0x5800a000 0x00002000>;
reg-names = "stmmaceth";
interrupts = <0x00000000 0x0000003d 0x00000004>;
interrupt-names = "macirq";
clock-names = "stmmaceth", "mac-clk-tx", "mac-clk-rx", "eth-ck", "ethstp";
clocks = <0x00000004 0x00000069 0x00000004 0x00000067 0x00000004 0x00000068 0x00000004 0x0 000007b 0x00000004 0x00000070>;
st,syscon = <0x00000003 0x00000004>;
snps,mixed-burst;
snps,pbl = <0x00000002>;
snps,en-tx-lpi-clockgating;
snps,axi-config = <0x00000028>;
snps,tso;
status = "okay";
pinctrl-names = "default", "sleep";
pinctrl-0 = <0x00000029>;
pinctrl-1 = <0x0000002a>;
phy-handle = <0x0000002b>;
phy-mode = "rmii";
max-speed = <0x000003e8>;
phandle = <0x0000002d>;
mdio0 {
#address-cells = <0x00000001>;
#size-cells = <0x00000000>;
compatible = "snps,dwmac-mdio";
reset-gpios = <0x0000002c 0x00000004 0x00000001>;
reset-delay-us = <0x00002710>;
post-reset-delay-us = <0x000003e8>;
ethernet-phy@3 {
compatible = "ethernet-phy-id0022.1622";
reg = <0x00000003>;
interrupt-parent = <0x0000002c>;
interrupts = <0x00000009 0x00000002>;
rxd0-skew-ps = <0x000001aa>;
rxd1-skew-ps = <0x000001a9>;
rxd2-skew-ps = <0x000001a3>;
rxd3-skew-ps = <0x0000018e>;
txd0-skew-ps = <0x0000013d>;
txd1-skew-ps = <0x0000013c>;
txd2-skew-ps = <0x0000015b>;
txd3-skew-ps = <0x0000018b>;
txen-skew-ps = <0x000001b3>;
rxdv-skew-ps = <0x00000198>;
rxc-skew-ps = <0x00000384>;
txc-skew-ps = <0x0000076c>;
};
switch-phy@0 {
compatible = "smsc,lan9303-mdio";
reg = <0x00000000>;
phandle = <0x0000002b>;
ports {
#address-cells = <0x00000001>;
#size-cells = <0x00000000>;
port@0 {
reg = <0x00000000>;
label = "cpu";
ethernet = <0x0000002d>;
};
port@1 {
reg = <0x00000001>;
label = "lan1";
};
port@2 {
reg = <0x00000002>;
label = "lan2";
};
};
};
};
};I checked all the Pin connections and everything seems to be ok.
Does anybody have any experience with the lan9303 Chip in mdio-managed mode?
Thanks in advance
