当前位置:首页 » 币种行情 » am3354网口找不到eth1的phy

am3354网口找不到eth1的phy

发布时间: 2024-03-28 03:06:03

1. ZYNQ+linux网口调试笔记(3)PL-ETH

在ZYNQ上使用gigE Vision协议的网络接口相机。

第一步:调通PS侧网口GEM0(Xilinx BSP默认配好)。

第二步:调通PS侧网口GEM1(见前一篇文档:开发笔记(1))。

第三步:调通PL侧网口(本文阐述)。

第四步:在PL侧网口上验证Jumbo Frame特性,并在应用层适配gigE Vision协议。

根据《xapp1082》可知,PL侧的PHY支持1000Base-X和SGMII两种配置,这两种配置对应两种不同的PHY引脚接口(连接到MAC)。而我们的hdf文件使用的是1000Base-X的配置。

关于网口的Linux驱动,我们在官网找到一份资料: Xilinx Wiki - Zynq PL Ethernet 。资料很长,我们只看与我们相关的2.4.1 PL Ethernet BSP installation for 1000Base-X”这一章节就可以了。

首先导入FPGA设计同事提供的hdf文件:

在弹出的图形界面里,进入Subsystem AUTO Hardware Settings——Ethernet Settings——Primary Ethernet,确认可以看到PL侧网络设备axi_ethernet_0,说明hdf文件里已包含了必要的网口硬件信息:

上图中被选中的网口将成为Linux上的设备eth0。这里我们默认选择ps7_ethernet_0,即使用GEM0作为首选网口。

启用Xilinx AXI Ethernet驱动

进入Device Drivers -- Network device support – 选中Xilinx AXI Ethernet(以及Xilinx Ethernet GEM,这是PS侧网口的驱动)

进入Networking support – 选中 Random ethaddr if unset

进入Device Drivers -- Network device support -- PHY Device support and infrastructure – 启用Drivers for xilinx PHYs

进入~~~~Device Drivers -- DMA Engine Support -– 禁用~~~~Xilinx AXI DMAS Engine~~~ (对应的配置项名为 ~~ CONFIG_XILINX_DMA ~~~)

注意: Xilinx Wiki里对设备树节点的引用有误(&axi_ethernet),导致编译报错,应改为&axi_ethernet_0。

注:PL-ETH驱动所在路径:<project>/build/tmp/work-shared/plnx_arm/kernel-source/drivers/net/ethernet/xilinx/xilinx_axienet_main.c和xilinx_axienet_mdio.c。对应的内核配置项为CONFIG_NET_VENDOR_XILINX和CONFIG_XILINX_AXI_EMAC。

启用ethtool和tcpmp(调试用,非必须):

然后将生成的BOOT.BIN和image.ub拷贝到SD卡根目录下,将SD卡插入板子上,上电运行。

上电后,使用ifconfig eth1查看网口信息,观察MAC地址与设置的一致,且ifconfig eth1 192.168.1.11 up没有报错。

测试网络通路:ping PC是通的。说明网口工作正常。

Linux下eth1(即PL-ETH)的MAC地址有误

问题描述:

开机打印:

注意:

MAC地址是错的,驱动里解析出的是GEM0的MAC地址。

试验发现,即使在system-user.dtsi里不写local-mac-address,也照样解析出的是GEM0的MAC。

而将system-user.dtsi里的local-mac-address改名为pl-mac-address,并将驱动里解析的字符串也对应更改为pl-mac-address,则可以正确解析出来:

Passing MAC address to kernel via Device Tree Blob and U-Boot:

http://zedboard.org/content/passing-mac-address-kernel-device-tree-blob

通过更改u-boot环境变量和设备树,为每个板子设置一个独特的MAC地址:

https://www.xilinx.com/support/answers/53476.html

U-Boot里的环境变量ethaddr会覆盖掉设备树里pl-eth的local-mac-addr字段,从而影响Linux启动后的网卡MAC地址;

但U-Boot里的环境变量ipaddr不会对Linux启动后的配置产生任何影响。因为设备树里根本就没有关于IP地址的配置。

phy-mode怎么会是sgmii?查了下官方的提供的BSP里,也是“sgmii”。说明这个没问题。具体原因不清楚。

@TODO: 设备树里的中断号的顺序如何影响功能?

为何读出来的IRQ号不对呢?这是因为这里读到的不是硬件的中断号,而是经过系统映射之后的软件IRQ number。两者不具有线性关系。

关于中断号的疑问:

Linux上的网口eth0、eth1的顺序,似乎是按照phy地址从小到大来排布的。

Xilinx xapp1082-zynq-eth.pdf (v5.0) July 16, 2018

https://www.xilinx.com/support/documentation/application_notes/xapp1082-zynq-eth.pdf

Xilinx Wiki - Zynq PL Ethernet:

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18841633/Zynq+PL+Ethernet

Xilinx Wiki - Linux Drivers:

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18841873/Linux+Drivers

Xilinx Wiki - Linux Drivers - Macb Driver:

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18841740/Macb+Driver

Xilinx Wiki - Zynq Ethernet Performance:

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18841743/Zynq+Ethernet+Performance

查到关于Jumbo frame MTU的定义,当前值为9000,可否改大一些?

驱动源码里关于jumbo frame的说明:

设置MTU为9000,发现ping包最大长度只能设为ping 192.168.1.10 -s 1472

https://lore.kernel.org/patchwork/patch/939535/

【完】

2. 请教am335x 双网口配置的问题

,自己做的板子 双网口,broadcom50610 phy芯片,在 sdk-07.00.00.00之前的版本中,即3.2内核中,使用都正常,在新版本(linux 3.12.10)中怎么配置都有问题,请教各位大侠!
从外面ping 板子显示:
From 192.168.10.105 icmp_seq=1 Destination Host Unreachable
From 192.168.10.105 icmp_seq=2 Destination Host Unreachable
From 192.168.10.105 icmp_seq=3 Destination Host Unreachable
From 192.168.10.105 icmp_seq=5 Destination Host Unreachable
From 192.168.10.105 icmp_seq=6 Destination Host Unreachable
From 192.168.10.105 icmp_seq=7 Destination Host Unreachable
From 192.168.10.105 icmp_seq=9 Destination Host Unreachable
From 192.168.10.105 icmp_seq=10 Destination Host Unreachable

启动信息
U-Boot SPL 2013.10-00189-g78d8ebd-dirty (Sep 30 2014 - 17:24:57)
Could not probe the EEPROM; something fundamentally wrong on the I2C bus.
Could not get board ID.
reading args
spl: error reading image args, err - -1
reading u-boot.img
reading u-boot.img

U-Boot 2013.10-00189-g78d8ebd-dirty (Sep 30 2014 - 17:24:57)
I2C: ready
DRAM: 256 MiB
NAND: 0 MiB
MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
*** Error - No Valid Environment Area found
*** Warning - bad CRC, using default environment
Net: <ethaddr> not set. Validating first E-fuse MAC
Could not get PHY for cpsw: addr 18
cpsw, usb_ether
Hit any key to stop autoboot: 0
mmc0 is current device
Scanning mmc 0...
4117616 bytes read in 264 ms (14.9 MiB/s)
33206 bytes read in 24 ms (1.3 MiB/s)
mmc0 is current device
SD/MMC found on device 0
reading uEnv.txt
674 bytes read in 3 ms (218.8 KiB/s)
Loaded environment from uEnv.txt
Importing environment from mmc ...
Running uenvcmd ...
reading uImage
4097184 bytes read in 245 ms (15.9 MiB/s)
reading am335x-bone.dtb
35525 bytes read in 7 ms (4.8 MiB/s)
## Booting kernel from Legacy Image at 80200000 ...
Image Name: Linux-3.12.10-rt21-ti2013.12.01
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 4097120 Bytes = 3.9 MiB
Load Address: 80008000
Entry Point: 80008000
Verifying Checksum ... OK
## Flattened Device Tree blob at 80f80000
Booting using the fdt blob at 0x80f80000
Loading Kernel Image ... OK
Loading Device Tree to 8f320000, end 8f32bac4 ... OK
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 3.12.10-rt21-ti2013.12.01 (wu@robot) (gcc version 4.7.3 20130226 (prerelease) (crosstool-NG5
[ 0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c53c7d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] Machine: Generic AM33XX (Flattened Device Tree), model: TI AM335x BeagleBone
[ 0.000000] cma: CMA: reserved 24 MiB at 8d800000
[ 0.000000] Memory policy: ECC disabled, Data cache writeback
[ 0.000000] CPU: All CPU(s) started in SVC mode.
[ 0.000000] AM335X ES2.1 (sgx neon )
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 64256
[ 0.000000] Kernel command line: console=ttyO0,115200n8 root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait ip=off login=0
[ 0.000000] PID hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
[ 0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
[ 0.000000] Memory: 223500K/259072K available (5539K kernel code, 560K rwdata, 1812K rodata, 343K init, 252K bss, 355)
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
[ 0.000000] vmalloc : 0xd0800000 - 0xff000000 ( 744 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xd0000000 ( 256 MB)
[ 0.000000] pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
[ 0.000000] moles : 0xbf000000 - 0xbfe00000 ( 14 MB)
[ 0.000000] .text : 0xc0008000 - 0xc073604c (7353 kB)
[ 0.000000] .init : 0xc0737000 - 0xc078ce50 ( 344 kB)
[ 0.000000] .data : 0xc078e000 - 0xc081a0b0 ( 561 kB)
[ 0.000000] .bss : 0xc081a0bc - 0xc0859258 ( 253 kB)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] Preemptible hierarchical RCU implementation.
[ 0.000000] NR_IRQS:16 nr_irqs:16 16
[ 0.000000] IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrupts
[ 0.000000] Total of 128 interrupts on 1 active controller
[ 0.000000] OMAP clockevent source: timer2 at 24000000 Hz
[ 0.000000] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 178956ms
[ 0.000000] OMAP clocksource: timer1 at 24000000 Hz
[ 0.000000] Console: colour mmy device 80x30
[ 0.049750] Calibrating delay loop... 531.66 BogoMIPS (lpj=2658304)
[ 0.049756] pid_max: default: 32768 minimum: 301
[ 0.049889] Security Framework initialized
[ 0.049959] Mount-cache hash table entries: 512
[ 0.060644] CPU: Testing write buffer coherency: ok
[ 0.061016] Setting up static identity map for 0xc056e778 - 0xc056e7e8
[ 0.062837] devtmpfs: initialized
[ 0.066131] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
[ 0.132623] omap_hwmod: debugss: _wait_target_disable failed
[ 0.133605] pinctrl core: initialized pinctrl subsystem
[ 0.134950] regulator-mmy: no parameters
[ 0.137755] NET: Registered protocol family 16
[ 0.144127] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.148562] cpuidle: using governor ladder
[ 0.148587] cpuidle: using governor menu
[ 0.157218] platform mpu.1: FIXME: clock-name 'fck' DOES NOT exist in dt!
[ 0.159011] platform 49000000.edma: FIXME: clock-name 'fck' DOES NOT exist in dt!
[ 0.161122] OMAP GPIO hardware version 0.1
[ 0.175069] platform 56000000.sgx: FIXME: clock-name 'fck' DOES NOT exist in dt!
[ 0.179594] DSS not supported on this SoC
[ 0.179619] No ATAGs?
[ 0.179633] hw-breakpoint: debug architecture 0x4 unsupported.
[ 0.222412] bio: create slab <bio-0> at 0
[ 0.247076] edma-dma-engine edma-dma-engine.0: TI EDMA DMA engine driver
[ 0.248355] vmmcsd_fixed: 3300 mV
[ 0.249109] netpower_fixed: no parameters
[ 0.249875] netphyreset_fixed: no parameters
[ 0.250502] ledpower_fixed: no parameters
[ 0.254709] vgaarb: loaded
[ 0.256652] SCSI subsystem initialized
[ 0.258888] usbcore: registered new interface driver usbfs
[ 0.259186] usbcore: registered new interface driver hub
[ 0.259537] usbcore: registered new device driver usb
[ 0.261484] omap_i2c 44e0b000.i2c: could not find pctldev for node /pinmux@44e10800/pinmux_i2c0_pins, deferring probe
[ 0.261528] platform 44e0b000.i2c: Driver omap_i2c requests probe deferral
[ 0.262145] pps_core: LinuxPPS API ver. 1 registered
[ 0.262160] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <[email protected]>
[ 0.262402] PTP clock support registered
[ 0.265813] Switched to clocksource timer1
[ 0.298434] NET: Registered protocol family 2
[ 0.299255] TCP established hash table entries: 2048 (order: 2, 16384 bytes)
[ 0.299328] TCP bind hash table entries: 2048 (order: 3, 49152 bytes)
[ 0.299432] TCP: Hash tables configured (established 2048 bind 2048)
[ 0.299521] TCP: reno registered
[ 0.299542] UDP hash table entries: 256 (order: 2, 16384 bytes)
[ 0.299585] UDP-Lite hash table entries: 256 (order: 2, 16384 bytes)
[ 0.299962] NET: Registered protocol family 1
[ 0.300570] RPC: Registered named UNIX socket transport mole.
[ 0.300587] RPC: Registered udp transport mole.
[ 0.300598] RPC: Registered tcp transport mole.
[ 0.300608] RPC: Registered tcp NFSv4.1 backchannel transport mole.
[ 0.301972] NetWinder Floating Point Emulator V0.97 (double precision)
[ 0.302998] PM: Loading am335x-pm-firmware.bin
[ 0.450783] VFS: Disk quotas dquot_6.5.2
[ 0.451320] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[ 0.458107] NFS: Registering the id_resolver key type
[ 0.458254] Key type id_resolver registered
[ 0.458266] Key type id_legacy registered
[ 0.458326] jffs2: version 2.2. (NAND) (SUMMARY) © 2001-2006 Red Hat, Inc.
[ 0.460078] msgmni has been set to 484
[ 0.463299] NET: Registered protocol family 38
[ 0.463363] io scheler noop registered
[ 0.463374] io scheler deadline registered
[ 0.463926] io scheler cfq registered (default)
[ 0.467160] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568
[ 0.532731] Console: switching to colour frame buffer device 100x37
[ 0.542222] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[ 0.547071] 44e09000.serial: ttyO0 at MMIO 0x44e09000 (irq = 88, base_baud = 3000000) is a OMAP UART0
[ 1.178745] console [ttyO0] enabled
[ 1.185061] omap_rng 48310000.rng: OMAP Random Number Generator ver. 20
[ 1.209369] brd: mole loaded
[ 1.221541] loop: mole loaded
[ 1.232228] mtdoops: mtd device (mtddev=name/number) must be supplied
[ 1.244817] usbcore: registered new interface driver asix
[ 1.251238] usbcore: registered new interface driver ax88179_178a
[ 1.258060] usbcore: registered new interface driver cdc_ether
[ 1.264522] usbcore: registered new interface driver r815x
[ 1.271129] usbcore: registered new interface driver smsc95xx
[ 1.277784] usbcore: registered new interface driver net1080
[ 1.284092] usbcore: registered new interface driver cdc_subset
[ 1.290696] usbcore: registered new interface driver zaurus
[ 1.297222] usbcore: registered new interface driver cdc_ncm

热点内容
青铜时代数字货币 发布:2024-04-27 20:04:07 浏览:795
nbtc挖矿机价格 发布:2024-04-27 19:36:37 浏览:617
量子计算机威胁比特币 发布:2024-04-27 19:24:59 浏览:858
shib和akita的机制 发布:2024-04-27 19:11:46 浏览:580
husd怎么转化成usdt 发布:2024-04-27 19:06:55 浏览:466
笔记本晚上挖矿 发布:2024-04-27 19:02:58 浏览:212
还能卖usdt吗 发布:2024-04-27 18:46:15 浏览:8
ECO挖矿系统最新版 发布:2024-04-27 18:45:04 浏览:730
股票里的区块链是个什么东西 发布:2024-04-27 18:32:25 浏览:391
usdt降价了 发布:2024-04-27 18:20:31 浏览:483