Micrel phy doesn't work on linux 4.19

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

Micrel phy doesn't work on linux 4.19

2,886 Views
c_laigle
Contributor I

Hello,

I'm trying to use a Micrel phy KSZ9031 on a linux 4.19. The phy is correctly detected on linux, the link shows up but no connection. The board is a custom board based on imx7d and the ethernet works correctly on linux 4.9 or 4.14 with the same configuration:

&fec1 {

   pinctrl-names = "default";
   pinctrl-0 = <&pinctrl_enet1>;
   assigned-clocks = <&clks IMX7D_ENET1_TIME_ROOT_SRC>,
         <&clks IMX7D_ENET1_TIME_ROOT_CLK>;
   assigned-clock-parents = <&clks IMX7D_PLL_ENET_MAIN_100M_CLK>;
   assigned-clock-rates = <0>, <100000000>;
   phy-mode = "rgmii";
   phy-handle = <&ethphy0>;
   fsl,magic-packet;
   status = "okay";

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

      ethphy0: ethernet-phy@0 {
         reg = <0>;
      };
   };
};

pinctrl_enet1: enet1grp {
   fsl,pins = <
   MX7D_PAD_GPIO1_IO10__ENET1_MDIO 0x3
   MX7D_PAD_GPIO1_IO11__ENET1_MDC 0x3
   MX7D_PAD_ENET1_RGMII_TXC__ENET1_RGMII_TXC 0x1
   MX7D_PAD_ENET1_RGMII_TD0__ENET1_RGMII_TD0 0x1
   MX7D_PAD_ENET1_RGMII_TD1__ENET1_RGMII_TD1 0x1
   MX7D_PAD_ENET1_RGMII_TD2__ENET1_RGMII_TD2 0x1
   MX7D_PAD_ENET1_RGMII_TD3__ENET1_RGMII_TD3 0x1
   MX7D_PAD_ENET1_RGMII_TX_CTL__ENET1_RGMII_TX_CTL 0x1
   MX7D_PAD_ENET1_RGMII_RXC__ENET1_RGMII_RXC 0x1
   MX7D_PAD_ENET1_RGMII_RD0__ENET1_RGMII_RD0 0x1
   MX7D_PAD_ENET1_RGMII_RD1__ENET1_RGMII_RD1 0x1
   MX7D_PAD_ENET1_RGMII_RD2__ENET1_RGMII_RD2 0x1
   MX7D_PAD_ENET1_RGMII_RD3__ENET1_RGMII_RD3 0x1
   MX7D_PAD_ENET1_RGMII_RX_CTL__ENET1_RGMII_RX_CTL 0x1
   >;
};

The boot log shows that the phy is detected:

[ 1.898167] fec 30be0000.ethernet: 30be0000.ethernet supply phy not found, using dummy regulator
[ 1.907398] fec 30be0000.ethernet: Linked as a consumer to regulator.0
[ 1.921704] fec 30be0000.ethernet (unnamed net_device) (uninitialized): Invalid MAC address: 00:00:00:00:00:00
[ 1.931842] fec 30be0000.ethernet (unnamed net_device) (uninitialized): Using random MAC address: 0e:d2:49:78:3f:1e
[ 1.954049] fec 30be0000.ethernet eth0: registered PHC device 0
[ 7.911964] Micrel KSZ9031 Gigabit PHY 30be0000.ethernet-1:00: attached PHY driver [Micrel KSZ9031 Gigabit PHY] (mii_bus:phy_addr=30be0000.ethernet-1:00, irq=POLL)
[ 12.091028] fec 30be0000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx

The ifconfig command gives the following result:

eth0       Link encap:Ethernet HWaddr 0E:D2:49:78:3F:1E
            inet6 addr: fe80::cd2:49ff:fe78:3f1e/64 Scope:Link
            UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
            RX packets:0 errors:0 dropped:0 overruns:0 frame:0
            TX packets:102 errors:0 dropped:0 overruns:0 carrier:0
            collisions:0 txqueuelen:1000
            RX bytes:0 (0.0 B) TX bytes:29333 (28.6 KiB)

When I set a static ip address, it doesn't work. I tried to pass a mac address from u-boot with setenv ethaddr 11:22:33:44:55:66 but it doesn't work.

Does someone have an idea why there's no connection?

Thank you,

Clément

Labels (4)
0 Kudos
Reply
2 Replies

2,209 Views
igorpadykov
NXP Employee
NXP Employee

Hi Clément

one can try to test it in uboot, use nxp imx_v2019.04_4.19.35_1.0.0

release from source.codeaurora.org

mx7dsabresd.c\mx7dsabresd\freescale\board - uboot-imx - i.MX U-Boot 

and check with oscilloscope clock ENET REF_CLK in function setup_fec().

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

2,209 Views
c_laigle
Contributor I

Hi Igor,

I didn't do the ethernet phy support on u-boot, is that necessary?

I finally modified the device tree, and with the following configuration it's works.

&fec1 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_enet1>; assigned-clocks = <&clks IMX7D_ENET_PHY_REF_ROOT_SRC>,     <&clks IMX7D_ENET_AXI_ROOT_SRC>,     <&clks IMX7D_ENET1_TIME_ROOT_SRC>,     <&clks IMX7D_ENET1_TIME_ROOT_CLK>,     <&clks IMX7D_ENET_AXI_ROOT_CLK>; assigned-clock-parents = <&clks IMX7D_PLL_ENET_MAIN_25M_CLK>,     <&clks IMX7D_PLL_ENET_MAIN_250M_CLK>,     <&clks IMX7D_PLL_ENET_MAIN_100M_CLK>; assigned-clock-rates = <0>, <0>, <0>, <100000000>, <250000000>; phy-mode = "rgmii"; phy-handle = <&ethphy0>; fsl,magic-packet; status = "okay"; mdio {  #address-cells = <1>;  #size-cells = <0>;  ethphy0: ethernet-phy@0 {   reg = <0>;  }; };};

But I don't understand why the old configuration doesn't work ....

If you have information to support the Micrel Ethernet phy in u-boot I am interested 

Thank you 

Clément

0 Kudos
Reply