• 全志H616芯片 以太网模块初始化失败如何解决?


    1.【问题现象】

    执行ifconfig -a/ifconfig eth0/ifconfig eth0 up命令,找不到eth0设备,有如下类似打印:

    root@TinaLinux:/# ifconfig -a
    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:6480 errors:0 dropped:0 overruns:0 frame:0
              TX packets:6480 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1 
              RX bytes:505440 (493.5 KiB)  TX bytes:505440 (493.5 KiB)
    
    root@TinaLinux:/# 
    root@TinaLinux:/# ifconfig eth0
    ifconfig: eth0: error fetching interface information: Device not found
    root@TinaLinux:/# 
    root@TinaLinux:/# ifconfig eth0 up
    ifconfig: SIOCGIFFLAGS: No such device
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16

    2.【问题分析】

    以太网模块配置未生效或存在GPIO冲突

    3.【排查步骤】

    • 步骤1:抓取内核启动log,搜索"gmac"关键字段,检查gmac驱动是否probe成功;

    • 步骤2:若内核启动log显示probe失败,常见原因是GPIO资源冲突导致,有如下类似打印:

    sun50iw10p1-pinctrl pio: pin PH0 already requested by twi0; cannot claim for gmac0
    sun50iw10p1-pinctrl pio: pin-224 (gmac0) status -22
    sun50iw10p1-pinctrl pio: could not request pin 224 (PH0) from group PH0  on device pio
    sunxi-gmac gmac0: Error applying setting, reverse things back
    sunxi-gmac: probe of gmac0 failed with error -22
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 步骤3:若内核启动log无gmac相关打印,则需要确认以太网配置是否生效。

    4.【解决办法】

    4.1 GPIO冲突
    (1) 首先,结合内核启动log定位与哪个模块存在GPIO冲突,有如下类似打印:

    sun50iw10p1-pinctrl pio: pin PH0 already requested by twi0; cannot claim for gmac0
    
    • 1

    (2) 然后,确认该模块GPIO配置是否有误或者是否可以关闭该模块。

    4.2 以太网配置未生效
    (1) 首先,确认内核menuconfig以太网模块配置是否打开,路径及截图如下:

    menuconfig -> Device Drivers -> Network device support -> Ethernet driver support
    
    • 1

    在这里插入图片描述

    (2) 然后,确认board.dts/sys_config.fex中GMAC模块是否打开,board.dts配置示例如下:

    gmac0: eth@05020000{
        phy-mode = "rgmii";
        use_ephy25m = <1>;
        tx-delay = <7>;
        rx-delay = <0>;
        status = "okay";
    };
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7

    注:

    • status = “okay"代表打开该模块,status = “disabled"代表关闭该模块;

    • 确保PHY与GMAC之间物理接口与软件配置相匹配,对于RGMII接口phy-mode配置为"rgmii”,RMII接口phy-mode配置为"rmii”;
      © use_ephy25m=1代表PHY使用SOC内部EPHY_25M时钟,use_ephy25m=0或者不配置该参数,代表PHY不使用SOC内部EPHY_25M时钟,
      需外部挂载25M晶振为PHY提供时钟;

    原贴链接:https://bbs.aw-ol.com/topic/2582/
    资源获取、问题讨论可以到全志在线开发者社区进行:https://www.aw-ol.com
    全志及开发者最新动态可以关注全志在线微信公众号

  • 相关阅读:
    已解决 TypeError: Fetch argument None has invalid type <class ‘NoneType‘>
    nginx配置proxy_pass之后返回404问题及Nginx host相关变量说明
    3D大模型如何轻量化?试试HOOPS Communicator,轻松读取10G超大模型!
    基于微信小程序的宠物医院诊所小程序源码
    数字经济时代 企业的数据安全需要多维考虑
    mount命令应用和umount命令应用
    关于安卓实现通用权限库的封装
    .NET C#基础(9):资源释放 - 需要介入的资源管理
    【yolo系列:YOLOV7改进-添加EIOU,SIOU,AlphaIOU,FocalEIOU.】
    每章一篇博客带你拿下吉林大学JAVAEE期末(四:JDBC)
  • 原文地址:https://blog.csdn.net/weixin_43094346/article/details/127916707