This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/DP83867CS: libphy chooses generic driver, no packets in/out of phy

Part Number: DP83867CS
Other Parts Discussed in Thread: TIDA-00204,

Tool/software: Linux

Hardware Information

  • PCB: Custom design, using Octavo Systems reference for OSD3358-SM
  • Ethernet Phy: DP83867CS in 3-supply mode (3V3, 2V5, 1V0) referencing TIDA-00204. No strap resistors, everything left open.
  • Linux Kernel: 4.14.108-ti-r108 (hand compiled), 4.14.71-ti-r80 (Beaglebone stock), and 4.19.50-ti-r20 (RCNEE Repos)
  • Stock device tree blob (for now, custom blobs don't do much.)

Issue

Both Linux and U-Boot can identify and interact with the PHY through MDIO -- though Linux does not correctly identify the driver, which is installed as a kernel module. The device can establish a link at 1 Gig, base 100, and base 10, which I forced thru mii-tool. The data and link lights also illuminate on the jack, which correspond to link establishment. Reading the registers, everything seems to be nominal and accurate per the datasheet. However, it seems no traffic goes in or out of the device. I've experimented with various device tree settings, but what concerns me is it appears the device has not received a single packet. On the other side, I've looked at wireshark, and see no packets either. Neither DHCP nor static settings work in u-boot, or in Linux. I have yet to probe the ethernet pins with an oscilloscope to check for output, or the RGMII interface to check for clock skew -- hopefully I will have that taken care of tomorrow.

Schematics


Relevant Boot Log Excerpts

I've added some commentary on a few lines.

[    0.000000] Booting Linux on physical CPU 0x0
[    0.642213] libphy: Fixed MDIO Bus: probed
[    0.695435] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6, bus freq 1000000
[    0.695454] davinci_mdio 4a101000.mdio: detected phy mask fffffffe <-- not sure if this is correct?
[    0.695864] MDIO: davinci_mdio: dt: updated phy_id[0] from phy_mask[fffffffe]
[    0.701543] libphy: 4a101000.mdio: probed
[    0.701566] davinci_mdio 4a101000.mdio: phy[0]: device 4a101000.mdio:00, driver unknown <-- should use DP83867 driver here
[    0.702558] cpsw 4a100000.ethernet: Detected MACID = 50:33:8b:0b:f5:75 <-- this is a Texas Instruments OUI, and matches the register values
[    0.702676] cpsw 4a100000.ethernet: initialized cpsw ale version 1.4
[    0.702687] cpsw 4a100000.ethernet: ALE Table size 1024
[    0.702747] cpsw 4a100000.ethernet: cpts: overflow check period 1250 (jiffies)
[    0.708971] am335x-phy-driver 47401300.usb-phy: 47401300.usb-phy supply vcc not found, using dummy regulator
[    0.711967] am335x-phy-driver 47401b00.usb-phy: 47401b00.usb-phy supply vcc not found, using dummy regulator
[    0.734780] cpuidle: enable-method property 'ti,am3352' found operations
[   11.032195] net eth0: initializing cpsw version 1.12 (0)
[   11.050752] Generic PHY 4a101000.mdio:00: attached PHY driver [Generic PHY] (mii_bus:phy_addr=4a101000.mdio:00, irq=POLL)
[   11.094158] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   11.988826] using random self ethernet address
[   11.988845] using random host ethernet address
[   12.065414] cpsw 4a100000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[   12.065489] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   12.218641] using random self ethernet address
[   12.218660] using random host ethernet address
[   12.442706] 8021q: adding VLAN 0 to HW filter on device eth0
...
[ 1575.135673] NETDEV WATCHDOG: eth0 (cpsw): transmit queue 0 timed out

The full log can be found here: https://pastebin.com/n58c0zf9

ethtool / mii-tool Output

root@beaglebone:~# ethtool eth0
Settings for eth0:
	Supported ports: [ TP AUI BNC MII FIBRE ]
	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
	Advertised link modes:  10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	                        1000baseT/Half 1000baseT/Full 
	Advertised pause frame use: No
	Advertised auto-negotiation: Yes
	Link partner advertised link modes:  10baseT/Half 10baseT/Full 
	                                     100baseT/Half 100baseT/Full 
	                                     1000baseT/Full 
	Link partner advertised pause frame use: Symmetric Receive-only
	Link partner advertised auto-negotiation: Yes
	Speed: 1000Mb/s
	Duplex: Full
	Port: MII
	PHYAD: 0
	Transceiver: internal
	Auto-negotiation: on
	Supports Wake-on: d
	Wake-on: d
	Current message level: 0x00000000 (0)
			       
	Link detected: yes
root@beaglebone:~# 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: 32
     Tx DMA chan 0: tail_enqueue: 620
     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: 19
     Tx DMA chan 0: empty_dequeue: 27
     Tx DMA chan 0: busy_dequeue: 0
     Tx DMA chan 0: good_dequeue: 31
     Tx DMA chan 0: requeue: 4
     Tx DMA chan 0: teardown_dequeue: 508
root@beaglebone:~# mii-tool -vvv eth0 
Using SIOCGMIIPHY=0x8947
eth0: negotiated 1000baseT-FD flow-control, link ok
  registers for MII PHY 0: 
    1140 796d 2000 a231 01e1 cde1 006f 2001
    4006 0300 3800 0000 0000 0000 0000 3000
    5048 bf02 0000 1c40 29c7 0000 0000 0040
    6150 4444 0002 0000 0000 0000 0002 0000
  product info: vendor 08:00:28, model 35 rev 1
  basic mode:   autonegotiation enabled
  basic status: autonegotiation complete, link ok
  capabilities: 1000baseT-HD 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
  advertising:  1000baseT-HD 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
  link partner: 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
root@beaglebone:~/phytool# ./phytool print eth0/0
ieee-phy: id:0x2000a231

ieee-phy: reg:BMCR(0x00) val:0x1140
flags: -reset -loopback +aneg-enable -power-down -isolate -aneg-restart -collision-test
speed: 1000-full

ieee-phy: reg:BMSR(0x01) val:0x796d
capabilities: -100-b4 +100-f +100-h +10-f +10-h -100-t2-f -100-t2-h
flags: +ext-status +aneg-complete -remote-fault +aneg-capable +link -jabber +ext-register
root@beaglebone:~# ifconfig eth0
eth0: flags=-28605<UP,BROADCAST,RUNNING,MULTICAST,DYNAMIC> mtu 1500
inet 169.254.77.126 netmask 255.255.0.0 broadcast 169.254.255.255
inet6 fe80::5233:8bff:fe0b:f575 prefixlen 64 scopeid 0x20<link>
ether 50:33:8b:0b:f5:75 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 667 bytes 5961 (5.8 KiB)
TX errors 5 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 46

root@beaglebone:~# cat /sys/bus/mdio_bus/devices/4a101000.mdio\:00/phy_id
0x2000a231
xxx@~/src/ti-linux-kernel-dev/KERNEL/drivers/net/phy$ grep -Ri 0x2000a231
dp83867.c:#define DP83867_PHY_ID 0x2000a231
root@beaglebone:~# zcat /proc/config.gz | grep 83867
CONFIG_DP83867_PHY=m

Thank you in advance for your assistance.

  • More schematics, if they are relevant.

  • And a few more Linux outputs for good measure. (I forgot ifconfig.)

    root@beaglebone:~/phytool# ./phytool print eth0/0
    ieee-phy: id:0x2000a231
    
       ieee-phy: reg:BMCR(0x00) val:0x1140
          flags:          -reset -loopback +aneg-enable -power-down -isolate -aneg-restart -collision-test
          speed:          1000-full
    
       ieee-phy: reg:BMSR(0x01) val:0x796d
          capabilities:   -100-b4 +100-f +100-h +10-f +10-h -100-t2-f -100-t2-h
          flags:          +ext-status +aneg-complete -remote-fault +aneg-capable +link -jabber +ext-register
    root@beaglebone:~# ifconfig eth0
    eth0: flags=-28605<UP,BROADCAST,RUNNING,MULTICAST,DYNAMIC>  mtu 1500
            inet 169.254.77.126  netmask 255.255.0.0  broadcast 169.254.255.255
            inet6 fe80::5233:8bff:fe0b:f575  prefixlen 64  scopeid 0x20<link>
            ether 50:33:8b:0b:f5:75  txqueuelen 1000  (Ethernet)
            RX packets 0  bytes 0 (0.0 B)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 667  bytes 5961 (5.8 KiB)
            TX errors 5  dropped 0 overruns 0  carrier 0  collisions 0
            device interrupt 46  
    
    root@beaglebone:~# cat /sys/bus/mdio_bus/devices/4a101000.mdio\:00/phy_id 
    0x2000a231
    xxx@~/src/ti-linux-kernel-dev/KERNEL/drivers/net/phy$ grep -Ri 0x2000a231
    dp83867.c:#define DP83867_PHY_ID		0x2000a231
    root@beaglebone:~# zcat /proc/config.gz | grep 83867
    CONFIG_DP83867_PHY=m

  • Hi,

    RGMII needs data and clock to have skew of 2 ns. Have you taken care of it by configuring MAC or PHY or board routing ?

    Suggest you try the MAC loopback and see whether you are recieving the packets back ? You can refer to DP83867 Trouble shooting guide

    http://www.ti.com/lit/an/snla246a/snla246a.pdf

    Regards,

    Geet

  • Hi,

    I am closing this thread. Incase you have further queries, please open new thread and provide reference to this thread.

    Regards,

    Geet