Saltar al contenido principal

14. Uso de Ethernet

14.1 Introducción a Ethernet​

La serie de productos ArmSoM utiliza principalmente dos chips Ethernet:

  • RTL8211F-CG
  • RTL8125B

14.2 Chip RTL8211F-CG​

El ArmSoM-AIM7 de la serie ArmSoM utiliza el chip RTL8211F-CG Gigabit Ethernet.

14.2.1 Conductor​

controladores/net/ethernet/stmicro/stmmac/*

14.2.2 Configuración del nodo DTS​

Configuración común a nivel de chip kernel/arch/arm64/boot/dts/rockchip/rk3588.dtsi

Expandir código/comandos completos y salida (original completo)
gmac0: ethernet@fe1b0000 {
compatible = "rockchip,rk3588-gmac", "snps,dwmac-4.20a";
reg = <0x0 0xfe1b0000 0x0 0x10000>;
interrupts = <GIC_SPI 227 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 226 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "macirq", "eth_wake_irq";
rockchip,grf = <&sys_grf>;
rockchip,php_grf = <&php_grf>;
clocks = <&cru CLK_GMAC_125M>, <&cru CLK_GMAC_50M>,
<&cru PCLK_GMAC0>, <&cru ACLK_GMAC0>,
<&cru CLK_GMAC0_PTP_REF>;
clock-names = "stmmaceth", "clk_mac_ref",
"pclk_mac", "aclk_mac",
"ptp_ref";
resets = <&cru SRST_A_GMAC0>;
reset-names = "stmmaceth";
power-domains = <&power RK3588_PD_GMAC>;

snps,mixed-burst;
snps,tso;

snps,axi-config = <&gmac0_stmmac_axi_setup>;
snps,mtl-rx-config = <&gmac0_mtl_rx_setup>;
snps,mtl-tx-config = <&gmac0_mtl_tx_setup>;
status = "disabled";

mdio0: mdio {
compatible = "snps,dwmac-mdio";
#address-cells = <0x1>;
#size-cells = <0x0>;
};

gmac0_stmmac_axi_setup: stmmac-axi-config {
snps,wr_osr_lmt = <4>;
snps,rd_osr_lmt = <8>;
snps,blen = <0 0 0 0 16 8 4>;
};

gmac0_mtl_rx_setup: rx-queues-config {
snps,rx-queues-to-use = <1>;
queue0 {};
};

gmac0_mtl_tx_setup: tx-queues-config {
snps,tx-queues-to-use = <1>;
queue0 {};
};
};

kernel\arch\arm64\boot\dts\rockchip\rk3588-armsom-aim7.dts

Expandir código/comandos completos y salida (original completo)
&gmac0 {
/* Use rgmii-rxid mode to disable rx delay inside Soc */
phy-mode = "rgmii-rxid";
clock_in_out = "output";

snps,reset-gpio = <&gpio2 RK_PB4 GPIO_ACTIVE_LOW>;
snps,reset-active-low;
/* Reset time is 20ms, 100ms for rtl8211f */
snps,reset-delays-us = <0 20000 100000>;

pinctrl-names = "default";
pinctrl-0 = <&gmac0_miim
&gmac0_tx_bus2
&gmac0_rx_bus2
&gmac0_rgmii_clk
&gmac0_rgmii_bus>;

tx_delay = <0x43>;
/* rx_delay = <0x3f>; */

phy-handle = <&rgmii_phy>;
status = "okay";
};

&mdio0 {
rgmii_phy: phy@1 {
compatible = "ethernet-phy-ieee802.3-c22";
reg = <0x1>;
};
};

14.3 Chip RTL8125B​

  • En la serie ArmSoM, ArmSoM-Sige7 y ArmSoM-W3 utilizan el chip controlador de red RTL8125B.
  • RTL8125B es un chip controlador de red PCIE a RJ45. Durante la depuración de bajo nivel, solo es necesario configurar el PCIE.

14.3.1 Configuración del nodo DTS​

  • kernel\arch\arm64\boot\dts\rockchip\rk3588-armsom-sige7.dts
&pcie2x1l0 {
reset-gpios = <&gpio4 RK_PA5 GPIO_ACTIVE_HIGH>;
rockchip,init-delay-ms = <100>;
status = "okay";
};

&pcie2x1l2 {
reset-gpios = <&gpio3 RK_PB0 GPIO_ACTIVE_HIGH>;
rockchip,init-delay-ms = <100>;
status = "okay";
};

14.4 Prueba de Ethernet​

14.4.1 Vvista dirección IP​

1. ifconfig -a
2. ip addr

14.4.2 Prueba de conectividad​

armsom@armsom-sige7:/$ sudo ping -c 10 www.baidu.com
PING www.a.shifen.com (183.2.172.42) 56(84) bytes of data.
64 bytes from 183.2.172.42 (183.2.172.42): icmp_seq=1 ttl=52 time=8.40 ms
64 bytes from 183.2.172.42 (183.2.172.42): icmp_seq=2 ttl=52 time=8.17 ms
64 bytes from 183.2.172.42 (183.2.172.42): icmp_seq=3 ttl=52 time=7.81 ms
64 bytes from 183.2.172.42 (183.2.172.42): icmp_seq=4 ttl=52 time=8.38 ms
64 bytes from 183.2.172.42 (183.2.172.42): icmp_seq=5 ttl=52 time=10.1 ms
64 bytes from 183.2.172.42 (183.2.172.42): icmp_seq=6 ttl=52 time=8.59 ms
64 bytes from 183.2.172.42 (183.2.172.42): icmp_seq=7 ttl=52 time=8.62 ms
64 bytes from 183.2.172.42 (183.2.172.42): icmp_seq=8 ttl=52 time=8.89 ms
64 bytes from 183.2.172.42 (183.2.172.42): icmp_seq=9 ttl=52 time=8.70 ms
64 bytes from 183.2.172.42 (183.2.172.42): icmp_seq=10 ttl=52 time=8.81 ms

--- www.a.shifen.com ping statistics ---
10 packets transmitted, 10 received, 0% packet loss, time 9015ms
rtt min/avg/max/mdev = 7.806/8.644/10.086/0.568 ms

14.4.3 2.5Prueba de velocidad de red G​

iperf es una herramienta de prueba de rendimiento de la red que mide el ancho de banda de la red mediante la transmisión de datos entre dos computadoras. En este caso, armsom-w3 actúa como servidor iperf y armsom-sige7 actúa como cliente iperf. El servidor escucha en un puerto específico y el cliente iperf genera un flujo de datos de un tamaño específico y envía los datos al servidor a través del protocolo TCP o UDP. Los siguientes son los resultados de la prueba:

  • Cliente:
armsom@armsom-sige7:/$ sudo iperf -c 192.168.100.111 -t 10 -i 1
-------------------------------------------------------------
Client connecting to 192.168.100.111, TCP port 5001
TCP window size: 45.0 KByte (default)
-------------------------------------------------------------
[ 3] local 192.168.100.110 port 60564 connected with 192.168.100.111 port 5001
[ID] Interval Transfer Bandwidth
[ 3] 0.0000-1.0000 sec 275 MBytes 2.31 Gbits/sec
[ 3] 1.0000-2.0000 sec 281 MBytes 2.35 Gbits/sec
[ 3] 2.0000-3.0000 sec 278 MBytes 2.34 Gbits/sec
[ 3] 3.0000-4.0000 sec 280 MBytes 2.35 Gbits/sec
[ 3] 4.0000-5.0000 sec 279 MBytes 2.34 Gbits/sec
[ 3] 5.0000-6.0000 sec 279 MBytes 2.34 Gbits/sec
[ 3] 6.0000-7.0000 sec 276 MBytes 2.32 Gbits/sec
[ 3] 7.0000-8.0000 sec 282 MBytes 2.36 Gbits/sec
[ 3] 8.0000-9.0000 sec 279 MBytes 2.34 Gbits/sec
[ 3] 9.0000-10.0000 sec 278 MBytes 2.33 Gbits/sec
[ 3] 10.0000-10.0002 sec 256 KBytes 11.2 Gbits/sec
[ 3] 0.0000-10.0002 sec 2.72 GBytes 2.34 Gbits/sec
  • Servidor:
armsom@armsom-w3:/$ iperf -s
-------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 128 KByte (default)
-------------------------------------------------------------
[ 4] local 192.168.100.111 port 5001 connected with 192.168.100.110 port 60564
[ID] Interval Transfer Bandwidth
[ 4] 0.0000-10.0045 sec 2.72 GBytes 2.34 Gbits/sec

En los resultados de la prueba, el ancho de banda por segundo fluctúa aproximadamente entre 2.31 Gbits/seg y 2.36 Gbits/seg, siendo el ancho de banda promedio final de 2.34 Gbits/seg.

Contáctenos