DESK-XZ7-L/Peripherals/Ethernet

From DAVE Developer's Wiki
Jump to: navigation, search
History
Issue Date Notes
2024/01/23 DESK-XZ7-L-1.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 BORA, BORA Xpress and BORA Lite:

From bora.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
[    0.588523] macb e000b000.ethernet eth0: Cadence GEM rev 0x00020118 at 0xe000b000 irq 37 (00:50:c2:1e:af:e0)
...
[    3.538025] macb e000b000.ethernet eth0: PHY [e000b000.ethernet-ffffffff:07] driver [Micrel KSZ9031 Gigabit PHY] (irq=POLL)
[    3.538044] macb e000b000.ethernet eth0: configuring for phy/rgmii-id link mode

Cable connection:

...
...
[    7.698004] macb e000b000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
[    7.698035] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

Check the interface with ifconfig[edit | edit source]

root@bora:~# ifconfig eth0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.89  netmask 255.255.255.0  broadcast 0.0.0.0
        inet6 fe80::250:c2ff:fe1e:afe0  prefixlen 64  scopeid 0x20<link>
        ether 00:50:c2:1e:af:e0  txqueuelen 1000  (Ethernet)
        RX packets 1141  bytes 62918 (61.4 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 45  bytes 4892 (4.7 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 37  base 0xb000

Test with iperf3[edit | edit source]

root@bora:~# iperf3 -t 5 -c 192.168.0.167
Connecting to host 192.168.0.167, port 5201
[  5] local 192.168.0.89 port 33028 connected to 192.168.0.167 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  63.0 MBytes   527 Mbits/sec    0    427 KBytes
[  5]   1.00-2.02   sec  88.3 MBytes   727 Mbits/sec    0    655 KBytes
[  5]   2.02-3.01   sec  87.0 MBytes   735 Mbits/sec    1    522 KBytes
[  5]   3.01-4.01   sec  80.5 MBytes   675 Mbits/sec    0    602 KBytes
[  5]   4.01-5.00   sec  76.9 MBytes   651 Mbits/sec    0    636 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-5.00   sec   396 MBytes   663 Mbits/sec    1             sender
[  5]   0.00-5.58   sec   396 MBytes   595 Mbits/sec                  receiver

iperf Done.
root@bora:~#