當前位置:首頁 » 幣種行情 » 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

熱點內容
區塊鏈演講ppt模版 發布:2024-04-28 18:49:20 瀏覽:526
電信合約機怎麼還錢 發布:2024-04-28 18:45:42 瀏覽:557
合約期怎麼銷卡 發布:2024-04-28 18:44:16 瀏覽:219
雲儲幣挖礦怎麼樣 發布:2024-04-28 18:32:53 瀏覽:41
流放之路挖礦需要什麼屬性 發布:2024-04-28 18:32:10 瀏覽:299
usdt提到冷錢包 發布:2024-04-28 17:36:56 瀏覽:554
挖礦一般用什麼內存條 發布:2024-04-28 17:24:32 瀏覽:229
trx4搭配nb4遙控器 發布:2024-04-28 16:50:43 瀏覽:242
比特幣合約平台提現 發布:2024-04-28 16:46:53 瀏覽:876
福特汽車區塊鏈 發布:2024-04-28 16:35:14 瀏覽:443