Hi,
I am working on a custom board which is based on TI AM3351 (ZCE package) and the board has been booted up successfully with u-boot (version 1_2018.01-r0) by assuming it is a beaglebone black board.
The CPSW EMAC is configured with RGMII mode by configuring the pin_mux and the gmii_sel register in the board initialization code (board/ti/am335x/board.c).
The CPSW EMAC port 1 (cpsw_emac0) is connected to port 6 of the PHY (Marvell MV88E6176). The MDIO interface is enabled, and I am able to access the PHY/MII registers, and the PHY LAN ports are able to establish links (by auto-negotiation) with a gigabit network hub (1000Mbps and full-duplex)
When try to ping to a remote host, it failed with below error message,
=> setenv ipaddr 10.237.0.18
=> ping 10.237.0.17
ping failed: host 10.237.0.17 is not alive
By looking at the oscilloscope, there is always a 2.5MHz clock signal (data rate 10Mbps) from the RGMII1_TCLK, but there is no signals sent out from the RGMII1-TD0-3 and RCMII1_TCTL.
During ping, the CPSW driver (drivers/net/cpsw.c) is running on the CPSW subsystem and CPDMA is used to send out data to the EMAC. The EMAC RGMII interface operates with forced mode of operation by default, with the GIG, GMII_EN, and FULLDUPLEX bits in MACCONTROL register (0x4a100d84) set to 1. The TX_EN bit in the CPDMA TX_CONTROL register (0x4a100804) is also set to 1.
The ARP request packet is sent from the ping command and placed in the data buffer:
=> md 0x9ffec400
9ffec400: ffffffff 4530ffff d4d39c11 01000608 ......0E........
9ffec410: 04060008 45300100 d4d39c11 1200ed0a ......0E........
9ffec420: 00000000 ed0a0000 00001100 00000000 ................
9ffec430: 00000000 00000000 00000000 00000000 ................
The DMA buffer descriptor at address 0x4a102060 contains the address of the DMA buffer at address 0x9ffec400:
=> md 0x4a102060
4a102060: 00000000 9ffec400 0000003c d000003c ........<...<...
4a102070: 9ffec400 0000003c 4a102090 0f2e2446 ....<.... .JF$..
The address of the buffer descriptor is then written to the TX0_HDP register and the DMA engine should pick up the data in the data buffer pointed by the buffer descriptor and send it out to the CPSW EMAC. The update of network statistics can be seen in the debugging log below:
cpdma_submit: first packet enqueued
cpdma_submit: hdp: 0x4a100a00 buffer: 0x4a102060
cpdma_submit: later, hdp: 0x4a100a00 buffer: 0x0
cpdma_submit: CPDMA TX control: 0x1
cpdma_submit: mac_control: 0xa3
cpdma_submit: mac_status: 0x80000000
cpdma_submit: good tx frames: 0x9
cpdma_submit: broadcast tx frames: 0x9
cpdma_submit: multicast tx frames: 0x0
cpdma_submit: pause frames: 0x0
cpdma_submit: deferred tx frames: 0x0
cpdma_submit: collisions: 0x0
cpdma_submit: single collision tx frames: 0x0
cpdma_submit: multiple collisions tx frames: 0x0
cpdma_submit: excessive collisions: 0x0
cpdma_submit: late collisions: 0x0
cpdma_submit: tx underrun: 0x0
cpdma_submit: carrier sense error: 0x0
cpdma_submit: tx octets: 0x240
However, we are not seeing any signals from the RGMII1 TX data lines and RGMII1_TCTL.
One thing noticed is that, after the buffer descriptor value is written to the TX0_HDP register, the TX0_HDP register does not hold the value for long, it is reset to 0 shortly afterwards, besides, the MACSTATUS register is always at 0x80000000 which indicate the MAC is idle.
Any ideas what could be causing the problems?
Is there any tests I can run to verify the functionality of the CPSW EMAC?
I am using the generic CPSW driver, is there anything else I need to do for getting the RGMII TX interface to work properly?