Micrel KSZ8081RNA not probed on MDIO

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Micrel KSZ8081RNA not probed on MDIO

2,616 Views
florian_germain
Contributor II

Hello,

We have developped a custom board using IMX6SX and based on sabresd board.

This board use a Micrel KSZ8081 PHY connectet on RGMII1 and using ENET1_MDIO and ENET1_MDC.

The PHY is detected in uboot and i load kernel and device tree by tftp.

But when the kernel is started, the PHY is not detected by the kernel, so rootfs boot on NFS crash.

My device tree for fec is :

&fec1 {
  pinctrl-names = "default";
  pinctrl-0 = <&pinctrl_enet1>;
  phy-supply = <&reg_enet_3v3>;
  phy-mode = "rmii";
  phy-handle = <&ethphy1>;
  status = "okay";  
  phy-reset-gpios = <&gpio2 1 GPIO_ACTIVE_LOW>; /* ENET1_CRS */
  pinctrl-assert-gpios = <&gpio4 16 GPIO_ACTIVE_HIGH>;
  managed;

  mdio {
    #address-cells = <1>;
    #size-cells = <0>;

    reset-delay-us = <100>;

    ethphy1: ethernet-phy@0 {
    compatible = "micrel,ksz8081";
    device_type = "ethernet-phy";
    reg = <0>;
    };
  };
};

I added a trace in the fuction mdiobus_read and check that 32 @ are asked.

At this time nothing happend on the MDIO/MDC and so, bus response is 0xFFFF.

I don't find a solution for several days. Anyone has an idea ?

Best regards,

Labels (2)
Tags (4)
0 Kudos
4 Replies

2,226 Views
florian_germain
Contributor II

It seems that the kernel perform two different call to of_mdiobus_register_phy().

The first time to scan "Fixed MDIO Bus" and the second time to scan "fec_enet_mii_bus".

The first time, nothing happend on the MDIO, so all register read return 0xFFFF.

The second time, i can see that bus scan is not performed because bus->phy_mask is to 0xFFFFFF.

If a comment this line the MDIO is well read even if the driver is not well recognized.

Anayone has an idea why phy_mask is 0xFFFFFFFF ?

Regards,

0 Kudos

2,226 Views
joanxie
NXP TechSupport
NXP TechSupport

do you mind sharing your log file? did set the new phy register in the kernel?i.mx6ul uses KSZ8081, you can refer to the kernel source code of imx6ul

0 Kudos

2,226 Views
florian_germain
Contributor II

The problem is solved, my device tree was wrong. It was not necessary to add this in the device tree: 

mdio {
    #address-cells = <1>;
    #size-cells = <0>;

    reset-delay-us = <100>;

    ethphy1: ethernet-phy@0 {
    compatible = "micrel,ksz8081";
    device_type = "ethernet-phy";
    reg = <0>;
    };

PHY is automaticcaly detected.

Best regards,

0 Kudos

1,474 Views
triedgetech
Contributor III

hey dude, so uhm, what do you have in your ****.dts regarding PHY KSZ8081?

I'm also using a custom PCB board, and I have KSZ8091 though, but it's the same to 8081, they share same datasheet.

By default, the SOC module pico pi imx8m mini uses AR8031, and I think imx8mm-pico.dtsi is included into the main imx8mm.dtsi dtsi file when I build kernel using make menuconfig method.

 

0 Kudos