RK3568 开发板-安卓系统之以太网驱动调试(八)-安卓x86以太网

4.5 以太网驱动调试

4.5.1 RTL8211F调试

4.5.1.1 查看原理图, 获取配置信息

图1

RK3568 开发板-安卓系统之以太网驱动调试(八)-安卓x86以太网

图2

RK3568 开发板-安卓系统之以太网驱动调试(八)-安卓x86以太网

图3

RK3568 开发板-安卓系统之以太网驱动调试(八)-安卓x86以太网

图4

RK3568 开发板-安卓系统之以太网驱动调试(八)-安卓x86以太网 4.5.1.2 需要配置的信息如下

1、RTL8211F是挂载到gmac0上的

2、RTL8211F采用的是rk3568内部的时钟

3、RTL8211F的复位引脚是GPIO1_B0, 且是低电位有效

4、RTL8211F的地址是1

5、RTL8211F是工作在RGMII模式 4.5.1.3 RTL8211的完整配置&gmac0 { phy-mode = “rgmii”; clock_in_out = “output”; snps,reset-gpio = <&gpio1 RK_PB0 GPIO_ACTIVE_LOW>; snps,reset-active-low; /* Reset time is 20ms, 100ms for rtl8211f */ snps,reset-delays-us = <0 20000 100000>; assigned-clocks = <&cru SCLK_GMAC0_RX_TX>, <&cru SCLK_GMAC0>; assigned-clock-parents = <&cru SCLK_GMAC0_RGMII_SPEED>, <&cru CLK_MAC0_2TOP>; assigned-clock-rates = <0>, <125000000>; pinctrl-names = “default”; pinctrl-0 = <&gmac0_miim &gmac0_tx_bus2 &gmac0_rx_bus2 &gmac0_rgmii_clk &gmac0_rgmii_bus &gmac_rst>; tx_delay = <0x3c>; rx_delay = <0x2f>; phy-handle = <&rgmii_phy0>; status = “okay”; }; &mdio0 { rgmii_phy0: phy@1 { compatible = “ethernet-phy-ieee802.3-c22”; reg = <0x1>; }; };
<

4.5.2 YT8511C调试

4.5.2.1 查看原理图,获取配置信息

图5

RK3568 开发板-安卓系统之以太网驱动调试(八)-安卓x86以太网

图6

RK3568 开发板-安卓系统之以太网驱动调试(八)-安卓x86以太网 4.5.2.2 需要的配置信息如下

1、GMAC1用的是GMAC1_M1组的IO

2、复位引脚是GPIO3_B0

3、YT8511时钟是由晶振直接提供的,但又没有通过PY8511C给到rk3568, 所以即要用内部时钟,否则RK3568的内部phy就没有phy时钟了。

4、通过phy的地址为0b00100,即地址为4

5、YT8511C用的是RGMII接口 4.5.2.3 完整配置&gmac1 { phy-mode = “rgmii”; clock_in_out = “output”; snps,reset-gpio = <&gpio3 RK_PB0 GPIO_ACTIVE_LOW>; snps,reset-active-low; /* Reset time is 20ms, 100ms for rtl8211f */ snps,reset-delays-us = <0 20000 100000>; assigned-clocks = <&cru SCLK_GMAC1_RX_TX>, <&cru SCLK_GMAC1>; assigned-clock-parents = <&cru SCLK_GMAC1_RGMII_SPEED>, <&cru CLK_MAC1_2TOP>; assigned-clock-rates = <0>, <125000000>; pinctrl-names = “default”; pinctrl-0 = <&gmac1m1_miim &gmac1m1_tx_bus2 &gmac1m1_rx_bus2 &gmac1m1_rgmii_clk &gmac1m1_rgmii_bus &gmac1_rst>; tx_delay = <0x32>; rx_delay = <0x09>; phy-handle = <&rgmii_phy1>; status = “okay”; }; &mdio1 { rgmii_phy1: phy@4 { compatible = “ethernet-phy-ieee802.3-c22”; reg = <0x4>; }; };
<

4.5.3 以太网测试

4.5.3.1 查看是否有以太网节点rk3568_aybering:/ # ifconfig eth0 Link encap:Ethernet HWaddr ce:7e:e7:30:dd:5a Driver rk_gmac-dwmac UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 TX bytes:0 Interrupt:43 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope: Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 TX bytes:0 eth1 Link encap:Ethernet HWaddr ca:7e:e7:30:dd:5a Driver rk_gmac-dwmac UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 TX bytes:0 Interrupt:55 dummy0 Link encap:Ethernet HWaddr 6e:57:01:1d:92:d9 inet6 addr: fe80::6c57:1ff:fe1d:92d9/64 Scope: Link UP BROADCAST RUNNING NOARP MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:5 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 TX bytes:350 rk3568_aybering:/ #
<

可以看出,有两个以太网节点

4.5.3.2 测试eth0

将网线插入J17网口,等待一会后就会可以看到在状态栏(右上角)有以太网连接的图标<—->。执行命令查看IP地址和检查是否可以连网

rk3568_aybering:/ # ifconfig eth0 Link encap:Ethernet HWaddr ce:7e:e7:30:dd:5a Driver rk_gmac-dwmac inet addr:192.168.0.195 Bcast:192.168.0.255 Mask:255.255.255.0 inet6 addr: fe80::d0de:70e4:84a6:c09a/64 Scope: Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:10 errors:0 dropped:0 overruns:0 frame:0 TX packets:17 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:1376 TX bytes:2114 Interrupt:43 … rk3568_aybering:/ # ping www.baidu.com PING www.baidu.com (14.215.177.39) 56(84) bytes of data. 64 bytes from 14.215.177.39: icmp_seq=1 ttl=55 time=6.34 ms 64 bytes from 14.215.177.39: icmp_seq=2 ttl=55 time=6.41 ms 64 bytes from 14.215.177.39: icmp_seq=3 ttl=55 time=5.92 ms 64 bytes from 14.215.177.39: icmp_seq=4 ttl=55 time=6.40 ms ^C — www.baidu.com ping statistics — 4 packets transmitted, 4 received, 0% packet loss, time 3005ms rtt min/avg/max/mdev = 5.925/6.271/6.410/0.223 ms rk3568_aybering:/ #
<
4.5.3.3 测试eth1

将网线从J18网口拨下,插入J17网络接口,等待一会后就会可以看到在状态栏(右上角)有以太网连接的图标<—->。执行命令查看IP地址和检查是否可以连网

rk3568_aybering:/ # ifconfig … eth1 Link encap:Ethernet HWaddr ca:7e:e7:30:dd:5a Driver rk_gmac-dwmac inet addr:192.168.0.194 Bcast:192.168.0.255 Mask:255.255.255.0 inet6 addr: fe80::4a2f:fc05:f739:3fca/64 Scope: Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:33 errors:0 dropped:0 overruns:0 frame:0 TX packets:19 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:3689 TX bytes:2021 Interrupt:55 … rk3568_aybering:/ # ping www.baidu.com PING www.baidu.com (14.215.177.38) 56(84) bytes of data. 64 bytes from 14.215.177.38: icmp_seq=1 ttl=55 time=7.66 ms 64 bytes from 14.215.177.38: icmp_seq=2 ttl=55 time=7.52 ms 64 bytes from 14.215.177.38: icmp_seq=3 ttl=55 time=7.78 ms 64 bytes from 14.215.177.38: icmp_seq=4 ttl=55 time=7.24 ms 64 bytes from 14.215.177.38: icmp_seq=5 ttl=55 time=7.72 ms 64 bytes from 14.215.177.38: icmp_seq=6 ttl=55 time=7.84 ms ^C — www.baidu.com ping statistics — 6 packets transmitted, 6 received, 0% packet loss, time 5007ms rtt min/avg/max/mdev = 7.241/7.629/7.841/0.224 ms rk3568_aybering:/ #
<

免责声明:文章内容来自互联网,本站不对其真实性负责,也不承担任何法律责任,如有侵权等情况,请与本站联系删除。
转载请注明出处:RK3568 开发板-安卓系统之以太网驱动调试(八)-安卓x86以太网 https://www.yhzz.com.cn/a/9752.html

上一篇 2023-04-20 18:32:20
下一篇 2023-04-20 18:37:28

相关推荐

联系云恒

在线留言: 我要留言
客服热线:400-600-0310
工作时间:周一至周六,08:30-17:30,节假日休息。