zynq linux找不到网卡

背景

我遇到的应该是比较奇葩的情况,板子是zynq,我更新了内核之后发现系统里找不到网卡了,ifconfig -a 也没有,查看启动log,发现了

macb e000b000.ethernet: can't request region for resource [mem 0xe000b000-0xe000efff]
macb: probe of e000b000.ethernet failed with error -16

解决方法

  • 修改设备树。我现在是有这个板子(称为1号板子吧)的设备树,和另外一个zynq板子(2号板子)的设备树(xilinx sdk生成的),这两个板子芯片一样,但是板卡设计不一样。 对比了两个设备树源码的根节点 xxx1.dts 和 xxx2.dts,将xxx1.dts中的这一段注释掉
&gem0 {
    compatible = "cdns,gem";
    reg = <0xe000b000 0x4000>;
    status = "okay";
    interrupts = <0 22 4>;
    interrupt-parent = <&intc>;
    clocks = <&clkc 30>, <&clkc 30>, <&clkc 13>;
    clock-names = "pclk", "hclk", "tx_clk";
    phy-mode = "rgmii-id";
    phy-handle = <&phy0>;
    phy0: phy@0 {
        compatible = "atheros,ar8035";
        device_type = "ethernet-phy";
        reg = <0>;
    };
};

然后加上

&gem0 {
        local-mac-address = [00 0a 35 00 00 00];
        phy-mode = "rgmii-id";
        status = "okay";
        xlnx,ptp-enet-clock = <0x69f6bcb>;
};

之后,问题就解决了,可以找到网卡了,启动时的log打印了

macb e000b000.ethernet eth0: Cadence GEM rev 0x00020118 at 0xe000b000 irq 148 (00:0a:35:00:01:22)
macb e000b000.ethernet eth0: attached PHY driver [Atheros 8035 ethernet] (mii_bus:phy_addr=e000b000.etherne:00, irq=-1)

你可能感兴趣的:(zedboard,linux,一些嵌入式linux问题)