【问题标题】:macb ff0e0000.ethernet eth0: Could not attach to PHYmacb ff0e0000.ethernet eth0:无法连接到 PHY
【发布时间】:2017-10-24 09:38:58
【问题描述】:

在 Zynq Ultrascale+(板 ZCU102 rev 1)上启动基于 Linux 的操作系统并按照here 中所述配置内核,具有由 Vivado SDK 2017.2 自动生成的设备树,如下所示:

    gem0: ethernet@ff0b0000 {
        compatible = "cdns,zynqmp-gem";
        status = "disabled";
        interrupt-parent = <0x4>;
        interrupts = <0x0 0x39 0x4 0x0 0x39 0x4>;
        reg = <0x0 0xff0b0000 0x0 0x1000>;
        clock-names = "pclk", "tx_clk", "hclk";
        #address-cells = <0x1>;
        #size-cells = <0x0>;
        #stream-id-cells = <0x1>;
        iommus = <0x8 0x874>;
        power-domains = <0xd>;
        clocks = <0x3 0x2d 0x3 0x2d 0x3 0x31>;
    };

    gem1: ethernet@ff0c0000 {
        compatible = "cdns,zynqmp-gem";
        status = "disabled";
        interrupt-parent = <0x4>;
        interrupts = <0x0 0x3b 0x4 0x0 0x3b 0x4>;
        reg = <0x0 0xff0c0000 0x0 0x1000>;
        clock-names = "pclk", "tx_clk", "hclk";
        #address-cells = <0x1>;
        #size-cells = <0x0>;
        #stream-id-cells = <0x1>;
        iommus = <0x8 0x875>;
        power-domains = <0xe>;
        clocks = <0x3 0x2e 0x3 0x2e 0x3 0x32>;
    };

    gem2: ethernet@ff0d0000 {
        compatible = "cdns,zynqmp-gem";
        status = "disabled";
        interrupt-parent = <0x4>;
        interrupts = <0x0 0x3d 0x4 0x0 0x3d 0x4>;
        reg = <0x0 0xff0d0000 0x0 0x1000>;
        clock-names = "pclk", "tx_clk", "hclk";
        #address-cells = <0x1>;
        #size-cells = <0x0>;
        #stream-id-cells = <0x1>;
        iommus = <0x8 0x876>;
        power-domains = <0xf>;
        clocks = <0x3 0x2f 0x3 0x2f 0x3 0x33>;
    };

    gem3: ethernet@ff0e0000 {
        compatible = "cdns,zynqmp-gem";
        status = "okay";
        interrupt-parent = <0x4>;
        interrupts = <0x0 0x3f 0x4 0x0 0x3f 0x4>;
        reg = <0x0 0xff0e0000 0x0 0x1000>;
        clock-names = "pclk", "hclk", "tx_clk", "rx_clk";
        #address-cells = <0x1>;
        #size-cells = <0x0>;
        #stream-id-cells = <0x1>;
        iommus = <0x8 0x877>;
        power-domains = <0x10>;
        clocks = <0x3 0x1f 0x3 0x34 0x3 0x30 0x3 0x34>;
        phy-mode = "rgmii-id";
        xlnx,ptp-enet-clock = <0x0>;
    };

启动时,内核消息之一是:

macb ff0e0000.ethernet eth0: Could not attach to PHY

如果你执行:

ifconfig -a

shell提示:

root@linaro-developer:~# ifconfig -a
can0: flags=128<NOARP>  mtu 16
        unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 10  (UNSPEC)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 11  

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1  (Local Loopback)
        RX packets 6  bytes 372 (372.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 6  bytes 372 (372.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

sit0: flags=128<NOARP>  mtu 1480
        sit  txqueuelen 1  (IPv6-in-IPv4)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

不存在 eth。有关如何解决该问题的建议?

【问题讨论】:

    标签: linux linux-kernel xilinx device-tree vivado


    【解决方案1】:

    找到解决方案:

    需要在system-top.dts(Vivado自动生成)中添加“zcu102-revb.dtsi”文件,如下:

    /*
     * CAUTION: This file is automatically generated by Xilinx.
     * Version:  
     * Today is: Wed Sep 13 12:25:12 2017
    */
    
    
    /dts-v1/;
    /include/ "zynqmp.dtsi"
    /include/ "zynqmp-clk-ccf.dtsi"
    /include/ "zcu102-revb.dtsi"
    /include/ "pl.dtsi"
    /include/ "pcw.dtsi"
    
    ....etc....
    

    请注意,该文件可以在“xilinx-zcu102-zu9-es2-rev1.0-2017.2”包中找到(找到它here, in the Xilinx webpage)。

    也可以在“linux-xlnx/arch/arm64/boot/dts/xilinx/”文件夹的内核linux源文件中找到它。

    随着新设备树生成,可以使用eth0和内核提示:

    macb ff0e0000.ethernet eth0: Cadence GEM rev 0x50070106 at 0xff0e0000 irq 31 (00:0a:35:03:77:52)
    

    另外,我刚刚在Xilinx forum 中发布了答案。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-05-27
      • 2021-06-14
      • 2015-04-26
      • 1970-01-01
      • 2014-10-16
      • 1970-01-01
      相关资源
      最近更新 更多