BBG cpsw0 - attach returned 6

Tony Hain tony at tndh.net
Thu Feb 23 23:35:27 UTC 2017


The BBG phy works with the debian image on mmcsd1:
Linux beaglebone 4.4.9-ti-r25 #1 SMP Thu May 5 23:08:13 UTC 2016 armv7l
...
debian at beaglebone:~$ ifconfig
eth0      Link encap:Ethernet  HWaddr 88:4a:ea:f5:a2:0e
...
debian at beaglebone:~$ sudo ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=55 time=10.3 ms


But failed in    FreeBSD 12.0-CURRENT #0 r314118M: Wed Feb 22 22:49:19 PST
2017
BBG # dmesg|grep cpsw
cpswss0: <3-port Switch Ethernet Subsystem> mem
0x4a100000-0x4a1007ff,0x4a101200-0x4a1012ff irq 38,39,40,41 on simplebus0
cpswss0: CPSW SS Version 1.12 (0)
cpswss0: Initial queue size TX=128 RX=384
cpsw0: <Ethernet Switch Port> on cpswss0
cpsw0: Failed to read from PHY.
cpsw0: attaching PHYs failed
device_attach: cpsw0 attach returned 6

I used the BBG dts as the base since I didn't care about the HDMI, and the
loader.conf fdt_file points to the appropriate name, even though the files
are identical at this point:
# diff /boot/dtb/am335x-boneblack.dtb /boot/dtb/am335x-bonegreen.dtb
#
BBG # grep fdt /boot/loader.conf
#fdt_file="am335x-boneblack.dtb"
fdt_file="am335x-bonegreen.dtb"

BBB # grep fdt /boot/loader.conf
fdt_file="am335x-boneblack.dtb"
#fdt_file="am335x-bonegreen.dtb"

The BBB Ethernet works fine. 
BBB # dmesg|grep cpsw
cpswss0: <3-port Switch Ethernet Subsystem> mem
0x4a100000-0x4a1007ff,0x4a101200-0x4a1012ff irq 38,39,40,41 on simplebus0
cpswss0: CPSW SS Version 1.12 (0)
cpswss0: Initial queue size TX=128 RX=384
cpsw0: <Ethernet Switch Port> on cpswss0
miibus0: <MII bus> on cpsw0
cpsw0: Ethernet address: b0:d5:cc:fb:f6:c6
cpsw0: link state changed to DOWN
cpsw0: link state changed to UP
# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: icmp_seq=0 ttl=55 time=10.319 ms

     remote           refid      st t when poll reach   delay   offset
jitter
oPPS(0)          .PPS.            0 l   15   32  377   0.0000  -1.2604
0.0001
xNMEA(0)         .GPS.            0 l   54   64  377   0.0000 -50.4108
2.0103
*2001:470:xxxx:7 .GPS.            1 u   15   64  377   0.9646  -1.3970
0.9580
ntpd ntpsec-0.9.6+536 2017-02-22T20:26:50Z Last update: 2017-02-23T12:42:30
(16)


When I did the boot to debian on the BBG, I forgot to pull the sd card, and
debian's fsck trashed the mmcsd0 system partition. When I recopied it back I
forgot to change the loader.conf and rc.conf, and the cpsw device was
recognized:
BBG # dmesg|grep cpsw
cpswss0: <3-port Switch Ethernet Subsystem> mem
0x4a100000-0x4a1007ff,0x4a101200-0x4a1012ff irq 38,39,40,41 on simplebus0
cpswss0: CPSW SS Version 1.12 (0)
cpswss0: Initial queue size TX=128 RX=384
cpsw0: <Ethernet Switch Port> on cpswss0
miibus0: <MII bus> on cpsw0
cpsw0: Ethernet address: 88:4a:ea:f5:a2:0e
cpsw0: link state changed to DOWN
cpsw0: link state changed to UP

Just to make sure there was not something about the name I reset it back to
fdt_file=am335x-bonegreen.dtb and the correct rc.conf, and all is well.
# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: icmp_seq=0 ttl=55 time=10.790 ms

Appears to have been a transient issue, though it could have been some
hardware state that was cleared by the debian boot. But that doesn't make
sense given the number of power cycles. Is there something I should do to
further diagnose this issue if it occurs again? 

Tony




More information about the freebsd-arm mailing list