技术专栏
RK3568 开发板-安卓系统之以太网驱动调试(八)
4.5 以太网驱动调试
4.5.1 RTL8211F调试
4.5.1.1 查看原理图, 获取配置信息
图1
图2
图3
图4
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
图6
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:/ #
声明:本文内容由易百纳平台入驻作者撰写,文章观点仅代表作者本人,不代表易百纳立场。如有内容侵权或者其他问题,请联系本站进行删除。
红包
点赞
收藏
评论
打赏
- 分享
- 举报
评论
0个
手气红包
暂无数据
相关专栏
-
浏览量:18180次2022-09-30 16:51:48
-
浏览量:2645次2022-09-30 16:48:25
-
浏览量:4081次2022-10-11 10:48:08
-
浏览量:6597次2022-10-08 14:00:42
-
浏览量:7933次2022-10-13 19:26:04
-
浏览量:2760次2022-10-28 09:28:29
-
浏览量:9434次2022-10-12 09:28:15
-
浏览量:9733次2022-10-10 11:27:15
-
浏览量:4860次2022-10-14 08:34:42
-
浏览量:6600次2022-10-09 10:20:09
-
浏览量:4944次2022-09-30 16:40:59
-
浏览量:8184次2022-10-17 11:49:55
-
浏览量:11454次2022-10-18 09:33:58
-
浏览量:7518次2022-10-10 20:15:42
-
浏览量:2537次2022-09-30 16:46:03
-
浏览量:6002次2022-10-08 13:56:28
-
浏览量:8808次2022-06-11 10:47:27
-
浏览量:2950次2021-06-12 17:32:52
-
浏览量:2982次2021-06-15 09:44:15
置顶时间设置
结束时间
删除原因
-
广告/SPAM
-
恶意灌水
-
违规内容
-
文不对题
-
重复发帖
打赏作者
万万没想到
您的支持将鼓励我继续创作!
打赏金额:
¥1
¥5
¥10
¥50
¥100
支付方式:
微信支付
打赏成功!
感谢您的打赏,如若您也想被打赏,可前往 发表专栏 哦~
举报反馈
举报类型
- 内容涉黄/赌/毒
- 内容侵权/抄袭
- 政治相关
- 涉嫌广告
- 侮辱谩骂
- 其他
详细说明
审核成功
发布时间设置
发布时间:
请选择发布时间设置
是否关联周任务-专栏模块
审核失败
失败原因
请选择失败原因
备注
请输入备注