20240613解决飞凌的OK3588-C的核心板的适配以太网RTL8211F-CG

20240613解决飞凌的OK3588-C的核心板的适配以太网RTL8211F-CG
2024/6/13 16:58


缘起:对于飞凌的OK3588-C的核心板,参照飞凌的底板/开发板。
ETH0空接,ETH1由RTL8211FSI-CG【20¥】更换为RTL8211F-CG【4¥】。
都是千兆网卡,八成是成本的原因。^_

&gmac0 {
    /* Use rgmii-rxid mode to disable rx delay inside Soc */
    phy-mode = "rgmii-rxid";
    clock_in_out = "output";

    snps,reset-gpio = <&gpio0 RK_PB0 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 = <0x44>;
    /* rx_delay = <0x4f>; */

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


修改成为:
&gmac0 {
    /* Use rgmii-rxid mode to disable rx delay inside Soc */
    phy-mode = "rgmii-rxid";
    clock_in_out = "output";

    snps,reset-gpio = <&gpio0 RK_PB0 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 = <0x44>;
    /* rx_delay = <0x4f>; */

    phy-handle = <&rgmii_phy0>;
    status = "disabled";
};

&gmac1 {
    /* Use rgmii-rxid mode to disable rx delay inside Soc */
    phy-mode = "rgmii-rxid";
    clock_in_out = "output";

    snps,reset-gpio = <&gpio1 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 = <&gmac1_miim
             &gmac1_tx_bus2
             &gmac1_rx_bus2
             &gmac1_rgmii_clk
             &gmac1_rgmii_bus>;

    tx_delay = <0x44>;
    /* rx_delay = <0x4f>; */

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


测试步骤:
台式机/笔记本电脑可以通过WIFI上外网。但是不要再192.168.0.X网段。
由于飞凌的OK3588-C的核心板启动之后,默认IP地址配置为192.168.0.232。
在台式机的以太网卡/笔记本电脑如果没有以太网卡,可以接USB转RJ45网卡。

台式机的IP地址参考配置为:
192.168.0.8
255.255.255.0


Microsoft Windows [版本 10.0.22621.3296]
(c) Microsoft Corporation。保留所有权利。

C:\Users\QQ>ipconfig

Windows IP 配置


无线局域网适配器 本地连接* 1:

   媒体状态  . . . . . . . . . . . . : 媒体已断开连接
   连接特定的 DNS 后缀 . . . . . . . :

无线局域网适配器 本地连接* 2:

   媒体状态  . . . . . . . . . . . . : 媒体已断开连接
   连接特定的 DNS 后缀 . . . . . . . :

无线局域网适配器 WLAN:

   连接特定的 DNS 后缀 . . . . . . . :
   本地链接 IPv6 地址. . . . . . . . : fe80::1a87:11f5:2a01:fb0d%11
   IPv4 地址 . . . . . . . . . . . . : 192.168.3.97
   子网掩码  . . . . . . . . . . . . : 255.255.255.0
   默认网关. . . . . . . . . . . . . : 192.168.3.1

以太网适配器 以太网:

   连接特定的 DNS 后缀 . . . . . . . :
   本地链接 IPv6 地址. . . . . . . . : fe80::acf:748:65e2:32a6%16
   IPv4 地址 . . . . . . . . . . . . : 192.168.0.88
   子网掩码  . . . . . . . . . . . . : 255.255.255.0

   默认网关. . . . . . . . . . . . . :

以太网适配器 蓝牙网络连接:

   媒体状态  . . . . . . . . . . . . : 媒体已断开连接
   连接特定的 DNS 后缀 . . . . . . . :

C:\Users\QQ>


root@ok3588:/# ifconfig
eth0      Link encap:Ethernet  HWaddr 2E:FD:E8:A3:28:CB  
          inet addr:192.168.0.232  Bcast:0.0.0.0  Mask:255.255.255.0

          inet6 addr: fe80::2cfd:e8ff:fea3:28cb/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:38 errors:0 dropped:0 overruns:0 frame:0
          TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:3490 (3.4 KiB)  TX bytes:936 (936.0 B)
          Interrupt:79 

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:127 errors:0 dropped:0 overruns:0 frame:0
          TX packets:127 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:337918 (329.9 KiB)  TX bytes:337918 (329.9 KiB)

root@ok3588:/# 
root@ok3588:/# cd /etc/network/
root@ok3588:/etc/network# 
root@ok3588:/etc/network# ls -l
total 28
drwxr-xr-x 2 root root 4096 Mar  9  2023 if-down.d
drwxr-xr-x 2 root root 4096 Mar  9  2023 if-post-down.d
drwxr-xr-x 2 root root 4096 Mar  9  2023 if-pre-up.d
drwxr-xr-x 2 root root 4096 Mar  9  2023 if-up.d
-rw-r--r-- 1 root root  130 Jan  1 08:05 interfaces
-rw-r--r-- 1 root root  130 Jan  1 08:06 interfaces.bak1
-rwxr-xr-x 1 root root  846 Mar  9  2023 nfs_check
root@ok3588:/etc/network# cat interfaces
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.0.232
netmask 255.255.255.0
gateway 192.168.0.1

root@ok3588:/etc/network#


IP地址配置:
笔记本电脑:
192.168.3.97  WIFI上外网
192.168.0.88  USB转RJ以太网,指定静态IP地址。

开发板:
192.168.0.232  刷机之后飞凌指定的静态IP地址。


互PING的LOG:
开发板PING笔记本电脑:
root@ok3588:/etc/network# 
root@ok3588:/etc/network# 
root@ok3588:/etc/network# ping 192.168.0.88
PING 192.168.0.88 (192.168.0.88) 56(84) bytes of data.
64 bytes from 192.168.0.88: icmp_seq=1 ttl=128 time=1.16 ms
64 bytes from 192.168.0.88: icmp_seq=2 ttl=128 time=1.07 ms
64 bytes from 192.168.0.88: icmp_seq=3 ttl=128 time=1.16 ms
64 bytes from 192.168.0.88: icmp_seq=4 ttl=128 time=1.19 ms
64 bytes from 192.168.0.88: icmp_seq=5 ttl=128 time=1.16 ms
64 bytes from 192.168.0.88: icmp_seq=6 ttl=128 time=1.15 ms
64 bytes from 192.168.0.88: icmp_seq=7 ttl=128 time=1.16 ms
64 bytes from 192.168.0.88: icmp_seq=8 ttl=128 time=1.21 ms
64 bytes from 192.168.0.88: icmp_seq=9 ttl=128 time=1.13 ms
64 bytes from 192.168.0.88: icmp_seq=10 ttl=128 time=1.17 ms
64 bytes from 192.168.0.88: icmp_seq=11 ttl=128 time=1.29 ms
64 bytes from 192.168.0.88: icmp_seq=12 ttl=128 time=1.24 ms
64 bytes from 192.168.0.88: icmp_seq=13 ttl=128 time=1.23 ms
64 bytes from 192.168.0.88: icmp_seq=14 ttl=128 time=1.17 ms
64 bytes from 192.168.0.88: icmp_seq=15 ttl=128 time=1.22 ms
64 bytes from 192.168.0.88: icmp_seq=16 ttl=128 time=1.16 ms
64 bytes from 192.168.0.88: icmp_seq=17 ttl=128 time=1.15 ms
64 bytes from 192.168.0.88: icmp_seq=18 ttl=128 time=1.15 ms
64 bytes from 192.168.0.88: icmp_seq=19 ttl=128 time=1.30 ms
64 bytes from 192.168.0.88: icmp_seq=20 ttl=128 time=1.21 ms
64 bytes from 192.168.0.88: icmp_seq=21 ttl=128 time=1.20 ms
64 bytes from 192.168.0.88: icmp_seq=22 ttl=128 time=1.23 ms
64 bytes from 192.168.0.88: icmp_seq=23 ttl=128 time=1.22 ms
64 bytes from 192.168.0.88: icmp_seq=24 ttl=128 time=1.17 ms
64 bytes from 192.168.0.88: icmp_seq=25 ttl=128 time=1.19 ms
64 bytes from 192.168.0.88: icmp_seq=26 ttl=128 time=1.17 ms
64 bytes from 192.168.0.88: icmp_seq=27 ttl=128 time=1.24 ms
64 bytes from 192.168.0.88: icmp_seq=28 ttl=128 time=1.24 ms
64 bytes from 192.168.0.88: icmp_seq=29 ttl=128 time=1.18 ms
64 bytes from 192.168.0.88: icmp_seq=30 ttl=128 time=1.21 ms
64 bytes from 192.168.0.88: icmp_seq=31 ttl=128 time=1.25 ms
64 bytes from 192.168.0.88: icmp_seq=32 ttl=128 time=1.08 ms
64 bytes from 192.168.0.88: icmp_seq=33 ttl=128 time=1.28 ms
64 bytes from 192.168.0.88: icmp_seq=34 ttl=128 time=1.19 ms
64 bytes from 192.168.0.88: icmp_seq=35 ttl=128 time=1.16 ms
64 bytes from 192.168.0.88: icmp_seq=36 ttl=128 time=1.15 ms
64 bytes from 192.168.0.88: icmp_seq=37 ttl=128 time=1.26 ms
64 bytes from 192.168.0.88: icmp_seq=38 ttl=128 time=1.27 ms
64 bytes from 192.168.0.88: icmp_seq=39 ttl=128 time=1.22 ms
64 bytes from 192.168.0.88: icmp_seq=40 ttl=128 time=1.22 ms
64 bytes from 192.168.0.88: icmp_seq=41 ttl=128 time=1.17 ms
64 bytes from 192.168.0.88: icmp_seq=42 ttl=128 time=1.14 ms
64 bytes from 192.168.0.88: icmp_seq=43 ttl=128 time=1.11 ms
64 bytes from 192.168.0.88: icmp_seq=44 ttl=128 time=1.18 ms
64 bytes from 192.168.0.88: icmp_seq=45 ttl=128 time=1.21 ms
64 bytes from 192.168.0.88: icmp_seq=46 ttl=128 time=1.24 ms
64 bytes from 192.168.0.88: icmp_seq=47 ttl=128 time=1.19 ms
64 bytes from 192.168.0.88: icmp_seq=48 ttl=128 time=1.26 ms
64 bytes from 192.168.0.88: icmp_seq=49 ttl=128 time=1.14 ms
64 bytes from 192.168.0.88: icmp_seq=50 ttl=128 time=1.11 ms
64 bytes from 192.168.0.88: icmp_seq=51 ttl=128 time=1.10 ms
64 bytes from 192.168.0.88: icmp_seq=52 ttl=128 time=1.26 ms
64 bytes from 192.168.0.88: icmp_seq=53 ttl=128 time=1.14 ms
64 bytes from 192.168.0.88: icmp_seq=54 ttl=128 time=1.18 ms
^C
--- 192.168.0.88 ping statistics ---
54 packets transmitted, 54 received, 0% packet loss, time 53097ms
rtt min/avg/max/mdev = 1.068/1.188/1.300/0.051 ms
root@ok3588:/etc/network# 


笔记本电脑PING开发板:
Microsoft Windows [版本 10.0.22621.3296]
(c) Microsoft Corporation。保留所有权利。

C:\Users\QQ>ping 192.168.0.232

正在 Ping 192.168.0.232 具有 32 字节的数据:
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64

192.168.0.232 的 Ping 统计信息:
    数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
    最短 = 1ms,最长 = 1ms,平均 = 1ms

C:\Users\QQ>ping 192.168.0.232 -n 1000

正在 Ping 192.168.0.232 具有 32 字节的数据:
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.0.232 的回复: 字节=32 时间=1ms TTL=64

192.168.0.232 的 Ping 统计信息:
    数据包: 已发送 = 68,已接收 = 68,丢失 = 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
    最短 = 1ms,最长 = 1ms,平均 = 1ms
Control-C
^C
C:\Users\QQ>

参考资料:
百度:RTL8211F-CG 没有25M 时钟
RTL8211F-CG 晶振异常
RTL8211FSI-CG
RK3588 RTL8112 没有时钟


https://www.bilibili.com/read/cv24247728/
RK3588 编解码盒子 之 RTL8211FS-CG光口调试

3.1.4 调试
打开IO调试命令
CONFIG_DEVMEM=y

3.1.5 操作寄存器
find /sys -name phy_registers //先找到以太网寄存器的配置节点并进入所在目录
echo 31 0xdc0 >phy_registers //切换到PHY的PAGE 0xdc0
cat phy_registers //读取当前PAGE寄存器的值,核对PHYID1,PHYID2是否正确来确认寄存器是否正确
echo 0 0x value >phy_registers //改写PAGE0第0个寄存器的值为需要的value
cat phy_registers //读取值检查是否修改成功
echo 31 0 > phy_registers //切回到PAGE0寄存器!!!!重要,一定写完要切回来才会生效 作者:armsom开源硬件 https://www.bilibili.com/read/cv24247728/ 出处:bilibili


https://blog.csdn.net/yls199234/article/details/137047804
RTL8211FSI-CG千兆PHY芯片硬件调试——磁珠导致的芯片工作异常


https://zhuanlan.zhihu.com/p/668435075
RTL8211EG硬件问题解决办法


https://blog.csdn.net/qq_43092637/article/details/126133189
Atlas200关于RTL8211FSI和YT8521SH千兆以太PHY调试心得


https://blog.csdn.net/niewei120/article/details/126520561
RTL8211E网口芯片在Uboot下调试问题


http://bbs.witech.com.cn/article-1230-1.html
关于PHY芯片RTL8211FS(I)-CG


https://www.sohu.com/a/722348649_121495387
RK3588 接口电路的PCB设计建议

  • 7
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值