A20-SOM204-EVB: Ethernet doesn't work

Started by fchk, May 01, 2022, 07:27:20 PM

Previous topic - Next topic

fchk

I've got an A20-SOM204-EVB with A20-SOM204-1Gs16Me16G-MC Rev.C and the image A20-OLinuXino-bullseye-base-20220413-094751.img installed to the SPI/EMMC.

I've got serious problems with Ethernet.

1. Gigabit Ethernet
The SOM should have two Ethernet ports. ifconfig -a only shows an eth0, but not an eth1. The right RJ45 port next to the VGA does not work at all.

2. Megabit Ethernet
This port (next to the HDMI) seems to work but has strange behaviours.

The board detects a link.

root@a20-olinuxino:~# ethtool eth0
Settings for eth0:
        Supported ports: [ TP    MII ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/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
        Advertised pause frame use: No
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
        Link partner advertised link modes:  10baseT/Half 10baseT/Full
                                             100baseT/Half 100baseT/Full
        Link partner advertised pause frame use: No
        Link partner advertised auto-negotiation: Yes
        Link partner advertised FEC modes: Not reported
        Speed: 100Mb/s
        Duplex: Full
        Auto-negotiation: on
        Port: MII
        PHYAD: 1
        Transceiver: external
        Current message level: 0x00000000 (0)
        Link detected: yes


DHCP works:

root@a20-olinuxino:~# ifconfig eth0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether 76:77:ca:dd:2f:ad  txqueuelen 1000  (Ethernet)
        RX packets 195  bytes 39501 (38.5 KiB)
        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
        device interrupt 37  base 0x6000

root@a20-olinuxino:~# dhclient eth0
root@a20-olinuxino:~# ifconfig eth0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.235.242  netmask 255.255.255.0  broadcast 192.168.235.255
        ether 76:77:ca:dd:2f:ad  txqueuelen 1000  (Ethernet)
        RX packets 382  bytes 76806 (75.0 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 17  bytes 2759 (2.6 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 37  base 0x6000

root@a20-olinuxino:~# netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         192.168.235.2   0.0.0.0         UG        0 0          0 eth0
192.168.235.0   0.0.0.0         255.255.255.0   U         0 0          0 eth0


But no ping and no connection whatsoever, not from the EVB, not to the EVB:


root@a20-olinuxino:~# ping 192.168.235.2
PING 192.168.235.2 (192.168.235.2) 56(84) bytes of data.
From 192.168.235.242 icmp_seq=1 Destination Host Unreachable
From 192.168.235.242 icmp_seq=5 Destination Host Unreachable
From 192.168.235.242 icmp_seq=8 Destination Host Unreachable
^C
--- 192.168.235.2 ping statistics ---
12 packets transmitted, 0 received, +3 errors, 100% packet loss, time 11250ms


iptables are empty


root@a20-olinuxino:~# iptables -L

Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination


tcpdump -i eth0 shows no incoming packets.

What is wrong?

Other things to notice:

1. Where does the MAC address from? 76:77:ca:dd:2f:ad is a locally administred one, not something issued by IEEE or from Allwinner. U-Boot shows a different MAC 30:1f:9a:d0:2d:3e.

2. There are error messages in dmesg. It seems that there are errors in the device tree.

[    1.081274] sun4i-pinctrl 1c20800.pinctrl: supply vcc-pb not found, using dummy regulator
[    1.100618] sun4i-pinctrl 1c20800.pinctrl: supply vcc-pg not found, using dummy regulator
[    1.105068] sun4i-pinctrl 1c20800.pinctrl: supply vcc-pi not found, using dummy regulator
[    1.259464] sun4i-pinctrl 1c20800.pinctrl: supply vcc-pc not found, using dummy regulator
[    1.284927] sun4i-pinctrl 1c20800.pinctrl: supply vcc-ph not found, using dummy regulator
[    1.331291] sun4i-pinctrl 1c20800.pinctrl: supply vcc-pf not found, using dummy regulator
[   12.828907] sun4i-pinctrl 1c20800.pinctrl: pin PH20 already requested by c0b000.ethernet; cannot claim for 1c2bc00.can
[   12.839853] sun4i-pinctrl 1c20800.pinctrl: pin-244 (1c2bc00.can) status -22
[   12.846973] sun4i-pinctrl 1c20800.pinctrl: could not request pin 244 (PH20) from group PH20 on device 1c20800.pinctrl

3. Everything works with an USB-Ethernet adapter.

My questions:
1. What is wrong the the Megabit port?
2. How can I enable the Gigabit port?

Frank-Christian Krügel

LubOlimex

You can use either the Megabit or the Gigabit port. Not both simultaneously. This is mentioned in the FAQ section at the bottom of the product page here:

https://www.olimex.com/Products/SOM204/A20/A20-SOM204/

QuoteWe haven't been able to get both Ethernet ports working at the same time ourselves. For the moment we believe that it is not possible to have them working simultaneously. The Allwinner documentation made us believe that it is possible but after a lot of testing we concluded that the documentation is missing to mention some hidden multiplexing. For the moment, you can have either the GbE or the MbE working at a time, you can run script to switch between one or the other.

You should be able to enable one or the other via the olinuxino-overlay command inside Linux.

MAC is generated during production and stored in the EEPROM. The EEPROM structure can be found here: https://github.com/OLIMEX/OLINUXINO/blob/master/SOFTWARE/A20/A20-eeprom-contents/Olimex-A20-EEPROM-October-2019.pdf - it can be edited via I2C. There are some tools in u-boot that allow for its modification. Stop the boot and type "olinuxino" to see available commands.
Technical support and documentation manager at Olimex

fchk

Ok, I switched over to Gigabit Ethernet, and all problems went away. Thanks.

Frank-Christian