我想ping出多個以太網端口。 u-boot只支持單個以太網端口有固有限制嗎?u-boot可以支持多個以太網端口嗎?
2
A
回答
4
u-boot可以支持多個以太網端口嗎?
是的,在最近版本的U-Boot(至少回到2012.10)。
凸代碼是eth_current_changed()和eth_set_current()在淨/ eth.c。
u-boot僅支持單個以太網端口是否存在固有限制?
不,最新版本的U-Boot可以在板上支持多個以太網端口。
當多於一個以太網接口是可用的(如報導通過在啓動時「淨」設備列表,例如「網:macb0,gmac0,usb_ether」),環境變量ethact用於定義所選擇的以太網活動的界面。
使用printenv ethact
命令查看當前選擇。
使用setenv ethact <port name>
更改活動以太網端口。
U-Boot的網絡命令,如平和tftpboot的,將使用由ethact變量定義的以太網端口。這保留了舊版U-Boot的命令語法,無論可用端口的數量如何(例如,腳本不更改),語法都是一致的。
每個以太網端口分配自己的MAC地址,使用下面的環境變量:
ethaddr: Ethernet MAC address for first/only ethernet interface (= eth0 in Linux).
This variable can be set only once (usually during manufacturing of the board). U-Boot refuses to delete or overwrite this variable once it has been set.
eth1addr: Ethernet MAC address for second ethernet interface (= eth1 in Linux).
eth2addr: Ethernet MAC address for third ethernet interface (= eth2 in Linux).
顯然,你只能(容易)訪問一個端口的時間。
也只有一個靜態IP地址分配,即ipaddr環境變量。
(我不知道用一個端口通過DHCP獲得IP地址發生了什麼,然後主動端口被更改。)
U-Boot> printenv ethact
ethact=macb0
U-Boot> setenv ethact gmac0
U-Boot> ping 192.168.1.1
gmac0: PHY present at 7
gmac0: Starting autonegotiation...
gmac0: Autonegotiation complete
gmac0: link up, 1000Mbps full-duplex (lpa: 0x2800)
Using gmac0 device
host 192.168.1.1 is alive
U-Boot>
注意,也有一個輪值方案自動更改活動端口當端口關閉時:
U-Boot> printenv ethact
ethact=gmac0
U-Boot> ping 192.168.1.1
gmac0: PHY present at 7
gmac0: Starting autonegotiation...
gmac0: Autonegotiation timed out (status=0x7949)
gmac0: link down (status: 0x7949)
ERROR: Need valid 'usbnet_devaddr' to be set
at drivers/usb/gadget/ether.c:2362/usb_eth_init()
macb0: PHY present at 0
macb0:0 is connected to macb0. Reconnecting to macb0
macb0: Starting autonegotiation...
macb0: Autonegotiation timed out (status=0x7849)
macb0: link up, 100Mbps full-duplex (lpa: 0x41e1)
Using macb0 device
ping failed; host 192.168.1.1 is not alive
U-Boot> printenv ethact
ethact=macb0
U-Boot>
相關問題
- 1. Sinatra可以聽多個端口嗎?
- 2. Socket.io可以偵聽多個端口嗎?
- 3. Xtext語言服務器可以支持多個客戶端嗎?
- 4. PCI多端口以太網卡上有多少個mac地址?
- 5. gsoap客戶端多個以太網
- 6. 可以Struts支持HTML5嗎?
- 7. AgensGraph可以支持HA嗎?
- 8. 我可以選擇用於UDP通信的以太網端口嗎?
- 9. 從UDP端口接收以太網幀
- 10. 訪問以太網或USB端口
- 11. Apple TV上的以太網端口
- 12. 閃爍以太網端口指示燈
- 13. 限制以太網端口的帶寬
- 14. Wordpress Multisite可以支持數十個/數十萬個網站嗎?
- 15. SQL:單個OVER子句可以支持多個窗口函數嗎?
- 16. MEF可以使用不同的接口支持多個插件嗎?
- 17. Docker可以將多個容器端口映射到一個主機端口嗎?
- 18. 在一個端口上可以運行多個程序嗎?
- 19. py.test可以支持多個-k選項嗎?
- 20. Spring可以在classpath中支持多個messages.properties文件嗎?
- 21. Can Twilio可以支持40多個用戶的會議嗎?
- 22. GWT ValueListBox:它可以支持多個選擇嗎?
- 23. 一個Corda節點可以支持多方/帳號嗎?
- 24. 單個MySQL服務器可以支持多種編碼嗎?
- 25. 計算機可以支持多少個網絡連接?
- 26. 如何通過一個以太網端口連接到兩個以太網網絡?
- 27. 服務可以有多個端點嗎?
- 28. @ @接口可以有多個類嗎?
- 29. Arm-cortexA53可以支持OpenCL嗎?
- 30. ExtJS GridPanel可以支持列組嗎?
你可以顯示你正在使用的u-boot版本嗎?恐怕我正在處理更陳舊的事情。 – tarabyte
@tarabyte - U-Boot 2014.04。 – sawdust