关灯
请选择 进入手机版 | 继续访问电脑版
米联客uisrc 首页 2019版本 uisrc-lab-xlnx 查看内容
1

LINUX篇 基于debian9系统 CH23-LINUX下多路以太网实现

摘要: 23.1概述 本课程仅对具有多路以太网的开发板配套适用,如果只有1路以太网的跳过本章课程,或者购买我们的多路网卡实现本实验。23.2 FPGA BD工程本方案中使用AXI 1G/2.5G Ethernet Subsystem IP结合DMA IP实现PL以 ...

23.1概述

        本课程仅对具有多路以太网的开发板配套适用,如果只有1路以太网的跳过本章课程,或者购买我们的多路网卡实现本实验。

23.2  FPGA BD工程

本方案中使用AXI 1G/2.5G Ethernet Subsystem IP 结合DMA IP实现PL以太网。

编译完成后导入bit文件到SDK并且新建zynq_fsbl,以及设备树工程。

23.3 sytem-top.dts 设备树

自动产生的设备树不能直接使用需要修改后使用。

修改或者直接替换osrc-lab开发包中system-top.dts设备树

/dts-v1/;

/include/ "zynq-7000.dtsi"

 

/ {

model = "Zynq MZ7X Development Board";

compatible = "xlnx,zynq-MZ7X", "xlnx,zynq-7000";

 

aliases {

ethernet0 = &axi_ethernet_0;

ethernet1 = &axi_ethernet_1;

ethernet2 = &gem0;

serial0   = &uart1;

mmc0      = &sdhci0;

mmc1      = &sdhci1;

};

 

memory@0 {

device_type = "memory";

reg = <0x0 0x40000000>;

};

 

chosen {

bootargs = "";

stdout-path = "serial0:115200n8";

};

 

usb_phy0: phy0@e0002000 {

compatible = "ulpi-phy";

#phy-cells = <0>;

reg = <0xe0002000 0x1000>;

view-port = <0x0170>;

drv-vbus;

};

 

};

 

&clkc {

ps-clk-frequency = <33333333>;

};

 

/ {

cpus {

cpu@0 {

operating-points = <666666 1000000 333333 1000000>;

};

};

};

 

/ {

amba_pl: amba_pl {

#address-cells = <1>;

#size-cells = <1>;

compatible = "simple-bus";

ranges ;

axi_dma_0: dma@40400000 {

#dma-cells = <1>;

axistream-connected = <&axi_ethernet_0>;

axistream-control-connected = <&axi_ethernet_0>;

clock-names = "s_axi_lite_aclk";

clocks = <&clkc 15>;

compatible = "xlnx,eth-dma";

interrupt-names = "mm2s_introut", "s2mm_introut";

interrupt-parent = <&intc>;

interrupts = <0 29 4 0 30 4>;

reg = <0x40400000 0x10000>;

xlnx,include-dre ;

};

axi_dma_1: dma@40410000 {

#dma-cells = <1>;

axistream-connected = <&axi_ethernet_1>;

axistream-control-connected = <&axi_ethernet_1>;

clock-names = "s_axi_lite_aclk";

clocks = <&clkc 15>;

compatible = "xlnx,eth-dma";

interrupt-names = "mm2s_introut", "s2mm_introut";

interrupt-parent = <&intc>;

interrupts = <0 33 4 0 34 4>;

reg = <0x40410000 0x10000>;

xlnx,include-dre ;

};

axi_ethernet_0: ethernet@41000000 {

axistream-connected = <&axi_dma_0>;

axistream-control-connected = <&axi_dma_0>;

clock-frequency = <100000000>;

clock-names = "ref_clk";

clocks = <&clkc 0>;

compatible = "xlnx,axi-ethernet-1.00.a";

device_type = "network";

interrupt-names = "mac_irq", "interrupt";

interrupt-parent = <&intc>;

interrupts = <0 31 1 0 32 4>;

phy-mode = "rgmii";

reg = <0x41000000 0x40000>;

xlnx = <0x0>;

xlnx,axiliteclkrate = <0x0>;

xlnx,axisclkrate = <0x0>;

xlnx,clockselection = <0x0>;

xlnx,enableasyncsgmii = <0x0>;

xlnx,gt-type = <0x0>;

xlnx,gtinex = <0x0>;

xlnx,gtlocation = <0x0>;

xlnx,gtrefclksrc = <0x0>;

xlnx,include-dre ;

xlnx,instantiatebitslice0 = <0x0>;

xlnx,phy-type = <0x3>;

xlnx,phyaddr = <0x1>;

xlnx,rable = <0x0>;

xlnx,rxcsum = <0x0>;

xlnx,rxlane0-placement = <0x0>;

xlnx,rxlane1-placement = <0x0>;

xlnx,rxmem = <0x1000>;

xlnx,rxnibblebitslice0used = <0x0>;

xlnx,tx-in-upper-nibble = <0x1>;

xlnx,txcsum = <0x0>;

xlnx,txlane0-placement = <0x0>;

xlnx,txlane1-placement = <0x0>;

local-mac-address = [00 0a 35 00 00 00];

phy-handle = <&phy0>;

axi_ethernet_0_mdio: mdio {

#address-cells = <1>;

#size-cells = <0>;

phy0: phy@0 {

device_type = "ethernet-phy";

reg = <0x0>;

};

};

};

axi_ethernet_1: ethernet@41040000 {

axistream-connected = <&axi_dma_1>;

axistream-control-connected = <&axi_dma_1>;

clock-frequency = <100000000>;

clock-names = "ref_clk";

clocks = <&clkc 0>;

compatible = "xlnx,axi-ethernet-1.00.a";

device_type = "network";

interrupt-names = "mac_irq", "interrupt";

interrupt-parent = <&intc>;

interrupts = <0 35 1 0 36 4>;

phy-mode = "rgmii";

reg = <0x41040000 0x40000>;

xlnx = <0x0>;

xlnx,axiliteclkrate = <0x0>;

xlnx,axisclkrate = <0x0>;

xlnx,clockselection = <0x0>;

xlnx,enableasyncsgmii = <0x0>;

xlnx,gt-type = <0x0>;

xlnx,gtinex = <0x0>;

xlnx,gtlocation = <0x0>;

xlnx,gtrefclksrc = <0x0>;

xlnx,include-dre ;

xlnx,instantiatebitslice0 = <0x0>;

xlnx,phy-type = <0x3>;

xlnx,phyaddr = <0x1>;

xlnx,rable = <0x0>;

xlnx,rxcsum = <0x0>;

xlnx,rxlane0-placement = <0x0>;

xlnx,rxlane1-placement = <0x0>;

xlnx,rxmem = <0x1000>;

xlnx,rxnibblebitslice0used = <0x0>;

xlnx,tx-in-upper-nibble = <0x1>;

xlnx,txcsum = <0x0>;

xlnx,txlane0-placement = <0x0>;

xlnx,txlane1-placement = <0x0>;

local-mac-address = [00 0a 35 00 00 01];

phy-handle = <&phy1>;

axi_ethernet_1_mdio: mdio {

#address-cells = <1>;

#size-cells = <0>;

phy1: phy@1 {

device_type = "ethernet-phy";

reg = <0x1>;

};

};

};

};

};

 

 

&gem0 {

status = "okay";

phy-mode = "rgmii-id";

phy-handle = <eernet_phy>;

 

ethernet_phy: ethernet-phy@0 {

reg = <0>;

device_type = "ethernet-phy";

};

};

 

&gpio0 {

emio-gpio-width = <64>;

gpio-mask-high = <0x0>;

gpio-mask-low = <0x5600>;

};

 

&intc {

num_cpus = <2>;

num_interrupts = <96>;

};

 

&qspi {

u-boot,dm-pre-reloc;

status = "okay";

is-dual = <0>;

num-cs = <1>;

flash@0 {

compatible = "n25q128a11";

reg = <0x0>;

spi-tx-bus-width = <4>;

spi-rx-bus-width = <4>;

spi-max-frequency = <125000000>;

};

};

 

&sdhci0 {

u-boot,dm-pre-reloc;

status = "okay";

xlnx,has-cd = <0x1>;

xlnx,has-power = <0x0>;

xlnx,has-wp = <0x0>;

};

 

&sdhci1 {

status = "okay";

xlnx,has-cd = <0x0>;

xlnx,has-power = <0x0>;

xlnx,has-wp = <0x0>;

};

 

&uart1 {

u-boot,dm-pre-reloc;

status = "okay";

};

 

&usb0 {

status = "okay";

dr_mode = "host";

usb-phy = <&usb_phy0>;

};

 

23.编译

1、进入如下路径

2、执行source settings64.sh

3、执行get_hw_description.sh更新bit 和zynq_fsbl.elf

4、执行make_uboot.sh

5、执行make_kernel.sh

6、执行create_image.sh

7、准备好TF卡,插入电脑,连接TF卡,运行make_parted.sh进行烧录。

8>输入sdb。

9>输入y。

10>执行deploy_image.sh。

11>退出TF卡,插入开发板,连接串口,电脑启动串口工具,系统正常启动。

22.5 测试结果

测试的时候要求每个网口的IP不再同一个网段

输入 osrc

输入 root

进入系统后

输入sudo su

输入 root

进入管理员模式

把网线插入到网口0(PS-LAN)

把电脑和开发板地址都设置到同一网段

把网线插入到网口1(PL-LANA)

把网线插入到网口2(PL-LANB)

2

路过

雷人

握手

鲜花

鸡蛋

刚表态过的朋友 (2 人)

说点什么...

已有1条评论

最新评论...

归零者2020-6-29 19:57引用

不错

查看全部评论(1)

本文作者
2019-10-10 15:15
  • 6
    粉丝
  • 1142
    阅读
  • 1
    回复
资讯幻灯片
热门评论
热门专题
排行榜

关注我们:微信公众号

官方微信

官方微信

客服热线:

0519-80699907

公司地址:常州溧阳市天目云谷3号楼北楼2楼

运营中心:常州溧阳市天目云谷3号楼北楼2楼

邮编:213300 Email:270682667#qq.com

Copyright   ©2019-2026  米联客uisrc内容版权归©UISRC.COM技术支持:UISRC.COM  备案号:苏ICP备19046771号