DESK-XZU-L/Peripherals/Ethernet

From DAVE Developer's Wiki
Jump to: navigation, search
History
Issue Date Notes
2026/06/25 DESK-XZU-L-2.x.x release


Peripheral Ethernet[edit | edit source]

The ethernet interface 0 is made available through the gem0 interface, this interface should be initialized on the device tree.

Device tree configuration[edit | edit source]

Here below an example of device tree for ethernet interface 0 configuration used on standard DAVE's kit for the ONDA and ONDA Plus:

From onda.dtsi:

&gem0 {

    status = "okay";
    phy-mode = "rgmii-id";
    phy-handle = <&ethernet_phy>;

    ethernet_phy: ethernet-phy@7 {
        reg = <0x07>;
        device_type = "ethernet-phy";

        mdio {
            #address-cells = <1>;
            #size-cells = <0>;

            phy0: phy@7 {
                rxc-skew-ps = <0x744>;
                txc-skew-ps = <0x744>;
                micrel,led-mode = <0x01>;

                compatible = "micrel,ksz9031";
                device_type = "ethernet-phy";
                reg = <0x07>;
            };
        };
    };
};

Accessing the peripheral[edit | edit source]

Linux messages at boot time[edit | edit source]

  • eth0
[    2.512469] macb ff0e0000.ethernet eth0: Cadence GEM rev 0x50070106 at 0xff0e0000 irq 44 (9a:f9:8c:2e:ac:f5)
[    7.805154] macb ff0e0000.ethernet end0: renamed from eth0
[   15.589324] macb ff0e0000.ethernet end0: PHY [ff0e0000.ethernet-ffffffff:00] driver [Microchip LAN8841 Gigabit PHY] (irq=POLL)
[   15.589361] macb ff0e0000.ethernet end0: configuring for phy/rgmii-id link mode
[   15.590855] macb ff0e0000.ethernet: gem-ptp-timer ptp clock registered.

Cable connection:

...
...
[   19.688449] macb ff0e0000.ethernet end0: Link is Up - 1Gbps/Full - flow control off

Check the interface with ifconfig[edit | edit source]

root@onda:~# ifconfig
end0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.89  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::98f9:8cff:fe2e:acf5  prefixlen 64  scopeid 0x20<link>
        ether 9a:f9:8c:2e:ac:f5  txqueuelen 1000  (Ethernet)
        RX packets 155  bytes 10370 (10.1 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 312  bytes 24784 (24.2 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 44

Test with iperf3[edit | edit source]

root@onda:~# udhcpc -i end0
udhcpc: started, v1.36.1
Dropped protocol specifier '.udhcpc' from 'end0.udhcpc'. Using 'end0' (ifindex=4).
udhcpc: broadcasting discover
udhcpc: broadcasting select for 10.203.70.168, server 10.203.70.253
udhcpc: lease of 10.203.70.168 obtained from 10.203.70.253, lease time 36000
/etc/udhcpc.d/50default: Adding DNS 10.203.70.254
Dropped protocol specifier '.udhcpc' from 'end0.udhcpc'. Using 'end0' (ifindex=4).
root@onda:~#
root@onda:~# iperf3 -t 5 -c 10.203.70.16
Connecting to host 10.203.70.16, port 5201
[  5] local 10.203.70.168 port 52090 connected to 10.203.70.16 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec   114 MBytes   953 Mbits/sec    0    317 KBytes
[  5]   1.00-2.00   sec   112 MBytes   943 Mbits/sec    0    317 KBytes
[  5]   2.00-3.00   sec   112 MBytes   941 Mbits/sec    0    331 KBytes
[  5]   3.00-4.00   sec   112 MBytes   942 Mbits/sec    0    349 KBytes
[  5]   4.00-5.00   sec   112 MBytes   938 Mbits/sec    0    349 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-5.00   sec   562 MBytes   943 Mbits/sec    0             sender
[  5]   0.00-5.00   sec   561 MBytes   941 Mbits/sec                  receiver

iperf Done.
root@onda:~#