TI中文支持网
TI专业的中文技术问题搜集分享网站

自制am335x网络ping不通

大家好,我在移植u-boot到自制版,修改后网络ping不通。
root@am335x-evm:~# ping 172.16.90.205
PING 172.16.90.205 (172.16.90.205): 56 data bytes
^C
— 172.16.90.205 ping statistics
—20 packets transmitted, 0 packets received, 100% packet loss

修改内容:
cpsw_default: cpsw_default {
pinctrl-single,pins = <
/* Slave 1 */
AM33XX_IOPAD(0x914, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mii1_txen */
AM33XX_IOPAD(0x918, PIN_INPUT_PULLDOWN | MUX_MODE0) /* mii1_rxdv */
AM33XX_IOPAD(0x91c, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mii1_txd3 */
AM33XX_IOPAD(0x920, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mii1_txd2 */
AM33XX_IOPAD(0x924, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mii1_txd1 */
AM33XX_IOPAD(0x928, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mii1_txd0 */
AM33XX_IOPAD(0x92c, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mii1_txclk */
AM33XX_IOPAD(0x930, PIN_INPUT_PULLDOWN | MUX_MODE0) /* mii1_rxclk */
AM33XX_IOPAD(0x934, PIN_INPUT_PULLDOWN | MUX_MODE0) /* mii1_rxd3 */
AM33XX_IOPAD(0x938, PIN_INPUT_PULLDOWN | MUX_MODE0) /* mii1_rxd2 */
AM33XX_IOPAD(0x93c, PIN_INPUT_PULLDOWN | MUX_MODE0) /* mii1_rxd1 */
AM33XX_IOPAD(0x940, PIN_INPUT_PULLDOWN | MUX_MODE0) /* mii1_rxd0 */

&mac {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&cpsw_default>;
pinctrl-1 = <&cpsw_sleep>;
// dual_emac = <1>;
status = "okay";
};

&davinci_mdio {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&davinci_mdio_default>;
pinctrl-1 = <&davinci_mdio_sleep>;
status = "okay";
};

&cpsw_emac0 {
phy_id = <&davinci_mdio>, <0>;
phy-mode = "mii";
};

在u-boot中·输入mii命令得到以下结果:
=> mii info
PHY 0x00: OUI = 0x0885, Model = 0x22, Rev = 0x02, 10baseT, HDX

=> mdio list
ethernet@4a100000:
0 – Generic PHY <–> ethernet@4a100000

又使用ethtool命令,得到一下结果

root@am335x-evm:~# ethtool eth0
Settings for eth0:
Supported ports: [ TP MII ]
Supported link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Half 1000baseT/Full Supported pause frame use: Symmetric Receive-only
Supports auto-negotiation: Yes
Supported FEC modes: Not reported
Advertised link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Half 1000baseT/Full Advertised pause frame use: No
Advertised auto-negotiation: Yes
Advertised FEC modes: Not reported
Speed: 10Mb/s
Duplex: Half
Port: MII
PHYAD: 0
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: d
Wake-on: d
Current message level: 0x00000000 (0)
Link detected: no
root@am335x-evm:~# ethtool -S eth0
NIC statistics:
Good Rx Frames: 0
Broadcast Rx Frames: 0
Multicast Rx Frames: 0
Pause Rx Frames: 0
Rx CRC Errors: 0
Rx Align/Code Errors: 0
Oversize Rx Frames: 0
Rx Jabbers: 0
Undersize (Short) Rx Frames: 0
Rx Fragments: 0
Rx Octets: 0
Good Tx Frames: 0
Broadcast Tx Frames: 0
Multicast Tx Frames: 0
Pause Tx Frames: 0
Deferred Tx Frames: 0
Collisions: 0
Single Collision Tx Frames: 0
Multiple Collision Tx Frames: 0
Excessive Collisions: 0
Late Collisions: 0
Tx Underrun: 0
Carrier Sense Errors: 0
Tx Octets: 0
Rx + Tx 64 Octet Frames: 0
Rx + Tx 65-127 Octet Frames: 0
Rx + Tx 128-255 Octet Frames: 0
Rx + Tx 256-511 Octet Frames: 0
Rx + Tx 512-1023 Octet Frames: 0
Rx + Tx 1024-Up Octet Frames: 0
Net Octets: 0
Rx Start of Frame Overruns: 0
Rx Middle of Frame Overruns: 0
Rx DMA Overruns: 0
Rx DMA chan 0: head_enqueue: 1
Rx DMA chan 0: tail_enqueue: 127
Rx DMA chan 0: pad_enqueue: 0
Rx DMA chan 0: misqueued: 0
Rx DMA chan 0: desc_alloc_fail: 0
Rx DMA chan 0: pad_alloc_fail: 0
Rx DMA chan 0: runt_receive_buf: 0
Rx DMA chan 0: runt_transmit_bu: 0
Rx DMA chan 0: empty_dequeue: 0
Rx DMA chan 0: busy_dequeue: 0
Rx DMA chan 0: good_dequeue: 0
Rx DMA chan 0: requeue: 0
Rx DMA chan 0: teardown_dequeue: 0
Tx DMA chan 0: head_enqueue: 0
Tx DMA chan 0: tail_enqueue: 0
Tx DMA chan 0: pad_enqueue: 0
Tx DMA chan 0: misqueued: 0
Tx DMA chan 0: desc_alloc_fail: 0
Tx DMA chan 0: pad_alloc_fail: 0
Tx DMA chan 0: runt_receive_buf: 0
Tx DMA chan 0: runt_transmit_bu: 0
Tx DMA chan 0: empty_dequeue: 0
Tx DMA chan 0: busy_dequeue: 0
Tx DMA chan 0: good_dequeue: 0
Tx DMA chan 0: requeue: 0
Tx DMA chan 0: teardown_dequeue: 0

Shine:

请问网口灯有闪烁吗?
Link detected: no这个看上去网口没有link成功,先检查PHY那边的电路。

,

ZB_LAJI:

网口灯仅亮一个无闪烁,电路是没有问题的。

,

ZB_LAJI:

我有查找了一下启动信息看到以下内容,你看这是否有助于分析。.

………..

[ 1.150458] libphy: Fixed MDIO Bus: probed[ 1.222911] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6, bus freq 1000000[ 1.230620] davinci_mdio 4a101000.mdio: detected phy mask fffffffe[ 1.238193] libphy: 4a101000.mdio: probed[ 1.242248] davinci_mdio 4a101000.mdio: phy[0]: device 4a101000.mdio:00, driver Micrel KSZ9031 Gigabit PHY[ 1.253394] cpsw 4a100000.ethernet: No slave[1] phy_id, phy-handle, or fixed-link property[ 1.261716] cpsw 4a100000.ethernet: Detected MACID = 0c:b2:b7:a1:ed:65[ 1.268574] cpsw 4a100000.ethernet: initialized cpsw ale version 1.4[ 1.275053] cpsw 4a100000.ethernet: ALE Table size 1024[ 1.280351] cpsw 4a100000.ethernet: cpts: overflow check period 500 (jiffies)

……….

[ 11.835614] net eth0: initializing cpsw version 1.12 (0)[ OK ] Started Redis In-Memory Data Store.[ 12.097953] Micrel KSZ9031 Gigabit PHY 4a101000.mdio:00: attached PHY driver [Micrel KSZ9031 Gigabit PHY] (mii_bus:phy_addr=4a101000.mdio:00, irq=POLL) Starting Lightning Fast Webserver With Light System Requirements…

,

Shine:

请测量一下PHY clock是否正确?
另外,请参考下面的链接关于如何使能网口。
software-dl.ti.com/…/CPSW.html

,

ZB_LAJI:

你好,我测试了一下,发现MDC信号有问题,周期性输出时钟及拉高电平,即先输出1MHz频率时钟,接着输出一段高电平,然后又输出时钟,不断循环。

而我的硬件电路并没有问题,请问这个如何解决?

,

Shine:

请看一下pinmux有没有把MDC管脚配置MDIO_CLK功能?

赞(0)
未经允许不得转载:TI中文支持网 » 自制am335x网络ping不通
分享到: 更多 (0)