您尚未登录。

楼主 # 2024-06-13 17:16:19

why1canhbjack
会员
注册时间: 2023-02-13
已发帖子: 20
积分: 35

移植st官方内核到野火mp157开发板上网口无法自动获取ip

移植st官方的en.SOURCES-stm32mp1-openstlinux-5-4-dunfell-mp1-20-06-24.tar到开发板上,设备树参考野火的设备树进行修改,通过网线将网口直接连接电脑使用静态ip设置能够ping通,然后将网口接到路由器,使用dhcpc命令获取动态ip无法获取ip,请问有知道怎么解决吗?

开关eth0会报如下错误:
root@lubancat:~# ifconfig eth0 down
[   91.649324] [dhd] CFG80211-ERROR) wl_cfg80211_netdev_notifier_call : wdev null. Do nothing
[   91.656553] stm32-dwmac 5800a000.ethernet eth0: Link is Down
[   91.672475] [dhd] CFG80211-ERROR) wl_cfg80211_netdev_notifier_call : wdev null. Do nothing
root@lubancat:~# ifconfig eth0 up
[  108.589301] [dhd] CFG80211-ERROR) wl_cfg80211_netdev_notifier_call : wdev null. Do nothing
[  108.597533] stm32-dwmac 5800a000.ethernet eth0: PHY [stmmac-0:01] driver [RTL8211F Gigabit Ethernet]
[  108.620796] dwmac4: Master AXI performs any burst length
[  108.624688] stm32-dwmac 5800a000.ethernet eth0: No Safety Features support found
[  108.632229] stm32-dwmac 5800a000.ethernet eth0: IEEE 1588-2008 Advanced Timestamp supported
[  108.641048] stm32-dwmac 5800a000.ethernet eth0: registered PTP clock
[  108.646857] stm32-dwmac 5800a000.ethernet eth0: configuring for phy/rgmii-id link mode
[  108.660790] [dhd] CFG80211-ERROR) wl_cfg80211_netdev_notifier_call : wdev null. Do nothing
root@lubancat:~# [  111.772307] stm32-dwmac 5800a000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[  111.779364] [dhd] CFG80211-ERROR) wl_cfg80211_netdev_notifier_call : wdev null. Do nothing

动态获取ip一直是这样:
root@lubancat:~# udhcpc -i eth0
udhcpc: started, v1.30.1
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover

使用静态IP ping电脑是没问题的
root@lubancat:~# ifconfig
eth0: flags=-28605<UP,BROADCAST,RUNNING,MULTICAST,DYNAMIC>  mtu 1500
        inet 192.168.10.2  netmask 255.255.255.0  broadcast 192.168.10.255
        ether 3e:ab:3b:fb:f4:91  txqueuelen 1000  (Ethernet)
        RX packets 291  bytes 29201 (28.5 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 27  bytes 5532 (5.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 45 

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 140  bytes 9672 (9.4 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 140  bytes 9672 (9.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
root@lubancat:~# ping 192.168.10.10
PING 192.168.10.10 (192.168.10.10) 56(84) bytes of data.
64 bytes from 192.168.10.10: icmp_seq=1 ttl=128 time=0.777 ms
64 bytes from 192.168.10.10: icmp_seq=2 ttl=128 time=0.462 ms
64 bytes from 192.168.10.10: icmp_seq=3 ttl=128 time=0.327 ms
^C
--- 192.168.10.10 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 31ms
rtt min/avg/max/mdev = 0.327/0.522/0.777/0.188 ms
root@lubancat:~#

感觉像设备树还是驱动没移植成功

连上wifi执行udhcpc命令是能动态获取ip的,证明动态获取ip相关配置应该是没问题的
[root@star-mp157]:~$ ifconfig
lo        Link encapocal Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          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 (0.0 B)  TX bytes:0 (0.0 B)

wlan0     Link encap:Ethernet  HWaddr 94:A1:A2:69:C4:50 
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:254 (254.0 B)  TX bytes:248 (248.0 B)

[root@star-mp157]:~$ udhcpc -i wlan0
udhcpc: started, v1.31.1
udhcpc: sending discover
udhcpc: sending select for 192.168.137.83
udhcpc: lease of 192.168.137.83 obtained, lease time 604800
deleting routers
adding dns 192.168.137.1
[root@star-mp157]:~$

但获取eth0的动态ip就是不成功,是设备还是驱动需要修改?有大佬知道吗?
[root@star-mp157]:~$ udhcpc -i eth0
udhcpc: started, v1.31.1
[   49.832857] [dhd] CFG80211-ERROR) wl_cfg80211_netdev_notifier_call : wdev null. Do nothing
[   49.840959] stm32-dwmac 5800a000.ethernet eth0: PHY [stmmac-0:01] driver [RTL8211F Gigabit Ethernet]
[   49.860348] dwmac4: Master AXI performs any burst length
[   49.864234] stm32-dwmac 5800a000.ethernet eth0: No Safety Features support found
[   49.872056] stm32-dwmac 5800a000.ethernet eth0: IEEE 1588-2008 Advanced Timestamp supported
[   49.880558] stm32-dwmac 5800a000.ethernet eth0: registered PTP clock
[   49.886381] stm32-dwmac 5800a000.ethernet eth0: configuring for phy/rgmii-id link mode
[   49.895610] [dhd] CFG80211-ERROR) wl_cfg80211_netdev_notifier_call : wdev null. Do nothing
[   49.902976] [dhd] CFG80211-ERROR) wl_cfg80211_netdev_notifier_call : wdev null. Do nothing
[   49.912397] stm32-dwmac 5800a000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[   49.919453] [dhd] CFG80211-ERROR) wl_cfg80211_netdev_notifier_call : wdev null. Do nothing
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
^C
[root@star-mp157]:~$ ifconfig
eth0      Link encap:Ethernet  HWaddr 5E:65:81:5C:65:AB 
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:1026 (1.0 KiB)
          Interrupt:45

lo        Link encapocal Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          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 (0.0 B)  TX bytes:0 (0.0 B)

[root@star-mp157]:~$

https://blog.csdn.net/u014170843/article/details/120158095 我看这里的移植步骤我都做了,而且都有相应的打印了,但dhcp就是死活不行

离线

楼主 #1 2024-06-14 17:57:45

why1canhbjack
会员
注册时间: 2023-02-13
已发帖子: 20
积分: 35

Re: 移植st官方内核到野火mp157开发板上网口无法自动获取ip

[root@star-mp157]:~$ ifconfig eth0 up
[   48.193921] [dhd] CFG80211-ERROR) wl_cfg80211_netdev_notifier_call : wdev null. Do nothing
[   48.201977] stm32-dwmac 5800a000.ethernet eth0: PHY [stmmac-0:01] driver [RTL8211F Gigabit Ethernet]
[   48.221835] dwmac4: Master AXI performs any burst length
[   48.225722] stm32-dwmac 5800a000.ethernet eth0: No Safety Features support found
[   48.233230] stm32-dwmac 5800a000.ethernet eth0: IEEE 1588-2008 Advanced Timestamp supported
[   48.241952] stm32-dwmac 5800a000.ethernet eth0: registered PTP clock
[   48.247857] stm32-dwmac 5800a000.ethernet eth0: configuring for phy/rgmii-id link mode
[   48.257055] [dhd] CFG80211-ERROR) wl_cfg80211_netdev_notifier_call : wdev null. Do nothing
[   48.264728] [dhd] CFG80211-ERROR) wl_cfg80211_netdev_notifier_call : wdev null. Do nothing
[root@star-mp157]:~$ [   52.412118] stm32-dwmac 5800a000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
[   52.419342] [dhd] CFG80211-ERROR) wl_cfg80211_netdev_notifier_call : wdev null. Do nothing

[root@star-mp157]:~$ udhcpc -i eth0
udhcpc: started, v1.31.1
udhcpc: sending discover
udhcpc: sending select for 192.168.22.76
udhcpc: lease of 192.168.22.76 obtained, lease time 7200
deleting routers
adding dns 192.168.25.2
adding dns 202.96.128.166


修改设备树将千兆改成百兆之后能够成功获取ip,感觉是配置千兆的时候哪里出问题了,目前就算百兆能执行udhcpc,但千兆不行,有大佬能指点下吗?

离线

#2 2024-07-24 13:52:22

leifeng
会员
注册时间: 2019-10-21
已发帖子: 14
积分: 14

Re: 移植st官方内核到野火mp157开发板上网口无法自动获取ip

这种一般是千兆PHY没有配置好或者pcb布线的问题,需要调整tx_delay或者rx_delay

离线

楼主 #3 2024-07-25 09:03:35

why1canhbjack
会员
注册时间: 2023-02-13
已发帖子: 20
积分: 35

Re: 移植st官方内核到野火mp157开发板上网口无法自动获取ip

leifeng 说:

这种一般是千兆PHY没有配置好或者pcb布线的问题,需要调整tx_delay或者rx_delay

用的是野火的板子,用原来的固件是没问题的,所以首先排除PCB等硬件问题

离线

楼主 #4 2024-07-25 10:08:26

why1canhbjack
会员
注册时间: 2023-02-13
已发帖子: 20
积分: 35

Re: 移植st官方内核到野火mp157开发板上网口无法自动获取ip

leifeng 说:

这种一般是千兆PHY没有配置好或者pcb布线的问题,需要调整tx_delay或者rx_delay

问题解决了,也不是phy配置的问题,是uboot的网卡的设备树pin脚有一个没配好,不知道为什么会影响到kernel,kernel的设备树是没问题的,估计是uboot的引脚没释放吧,改了之后就没问题了

离线

#5 2024-07-26 11:22:50

leifeng
会员
注册时间: 2019-10-21
已发帖子: 14
积分: 14

Re: 移植st官方内核到野火mp157开发板上网口无法自动获取ip

@why1canhbjack
可能是,uboot和内核驱动是不同的

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn