ZHCADI5 December 2023 DP83869HM
以下部分旨在提供可用于調(diào)試驅(qū)動程序相關(guān)問題的常見終端命令。
$ dmesg | grep "mdio"
可能的輸出之一如下所示:
$ mdio_bus xxx.ethernet-x: MDIO device at address 8 is missing
該消息指示 PHY 未在 MDIO 總線上找到,這可能是由多個問題引起的。一種常見原因是器件樹缺失或不正確,但也可能是由于 PHY 無法正常工作或 SMI 連接不良。
一旦可以在 MDIO 總線上檢測到 PHY,另一個常見錯誤消息如下所示:
$ Generic PHY xxx.ethernet-x: attached PHY driver [Generic PHY]
該消息指示相應(yīng) PHY 的驅(qū)動程序文件未正確加載或根本不存在,并且加載到通用驅(qū)動程序中的 Linux 很可能無法與 PHY 配合使用。在這種情況下,請驗證驅(qū)動程序是否已成功編譯,是否是在構(gòu)建 Linux 時添加,以及驅(qū)動程序是否與所使用的 PHY 型號相匹配。
最后,可能顯示如下消息:
am65-cpsw-nuss 8000000.ethernet eth1: PHY [mdio_mux-0.1:03] driver [TI DP83869] (irq=POLL)
該消息顯示 PHY 已加載正確的驅(qū)動程序并成功檢測到。運行 ifconfig 驗證網(wǎng)絡(luò)接口是否存在。當(dāng) PHY 成功識別為網(wǎng)絡(luò)適配器時的示例 ifconfig 輸出:
root@am64xx-evm:~# ifconfig
eth0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether 34:08:e1:80:b5:f8 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth1: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether 70:ff:76:1e:9e:a6 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
loop txqueuelen 1000 (Local Loopback)
RX packets 90 bytes 6824 (6.6 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 90 bytes 6824 (6.6 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0