ZYNQ PS端双MAC,MDIO共用,eth0正常,eth1不通

此为转帖,原文:https://forums.xilinx.com/t5/Embedded-Linux/Dual-Marvell-88e1512-PHY-Ethernet-problem-Xilinx-LInux/td-p/682660/highlight/false/page/3

目前已经验证正常,Mark一下!!!

 

Patch files attached. Patch is applicable ONLY to the 2016.1 kernel.

Do as follows:

1. checkout, patch, and build 2016.1 kernel

$ git clone --branch xilinx-v2016.1 --depth 1 https://github.com/Xilinx/linux-xlnx.git
$ cd linux-xlnx
$ git apply 0001-net-macb-Add-MDIO-driver-for-accessing-multiple-PHY-.patch
$ git apply 0002-Documentation-devictree-Add-macb-mdio-bindings.patch
$ make ARCH=arm xilinx_zynq_defconfig
$ make ARCH=arm UIMAGE_LOADADDR=0x8000 uImage

2. modify your device tree file as follows:

2a. Add mdio in the top level:

Note:modify the phy reg to match your design.

 / {
    cpus {
        cpu@0 {
            operating-points = <666666 1000000 333333 1000000>;
        };
    };
    chosen {
        bootargs = "console=ttyPS0,115200";
        stdout-path = "serial0:115200n8";
    };
    aliases {
        ethernet0 = &gem0;
        ethernet1 = &gem1;
        serial0 = &uart0;
        serial1 = &uart1;
        spi0 = &qspi;
    };
    memory {
        device_type = "memory";
        reg = <0x0 0x40000000>;
    };
    mdio {
         compatible = "cdns,macb-mdio";
         reg = <0xe000b000 0x1000>;
         clocks = <&clkc 30>, <&clkc 30>, <&clkc 13>;
         clock-names = "pclk", "hclk", "tx_clk";
         #address-cells = <1>;
         #size-cells = <0>;
         phy0: phy@0 {
              compatible = "marvell";
              device_type = "ethernet-phy";
              reg = <
0>;
        } ;
            phy1: phy@1 {
                 compatible = "marvell";
                 device_type = "ethernet-phy";
                 reg = <
1>;
              } ;
       };
};

2b. Add the phy handle to the gem sections:

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

3. Build the device tree blob, and copy uImage and the .dtb file to your boot partition.

Here are the patch files.

0001-net-macb-Add-MDIO-driver-for-accessing-multiple-PHY-.patch ‏16 KB

0002-Documentation-devictree-Add-macb-mdio-bindings.patch ‏2 KB

  • 1
    点赞
  • 35
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值