当前位置:网站首页>The connection of imx6 network port is unstable after power on
The connection of imx6 network port is unstable after power on
2022-04-23 18:15:00 【Talent、me】
chip :LAN8720A
problem : Network instability , After inserting the network cable , repeated link up,link down
fec 2188000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
fec 2188000.ethernet eth0: Link is Down
IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
fec 2188000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
fec 2188000.ethernet eth0: Link is Down
IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
General solution :
1、 If using CPU The internal clock is provided to LAN8720 Chip work , In the face of the above problems , It can be supplied to... By changing to an external crystal oscillator LAN8720.
2、 Adjust the power on timing of the reset pin , from fec_main.c In the document static void fec_reset_phy(struct platform_device *pdev) The function interface , Default delay 1ms,
On the Internet, most people say that the delay time can be increased .( I tested , The situation I encountered this time is not good )
From the device tree fec Add the following parameters to the network interface node :
phy-reset-gpios = <&gpio3 16 GPIO_ACTIVE_LOW>;
phy-reset-duration = <1>;
static void fec_reset_phy(struct platform_device *pdev)
{
int err;
int phy_reset;
int msec = 1;
struct device_node *np = pdev->dev.of_node;
if (!np)
return;
err = of_property_read_u32(np, "phy-reset-duration", &msec);
/* A sane reset duration should not be longer than 1s */
if (!err && msec > 1000)
msec = 1;
phy_reset = of_get_named_gpio(np, "phy-reset-gpios", 0);
if (!gpio_is_valid(phy_reset))
return;
err = devm_gpio_request_one(&pdev->dev, phy_reset,
GPIOF_OUT_INIT_LOW, "phy-reset");
if (err) {
dev_err(&pdev->dev, "failed to get phy-reset-gpios: %d\n", err);
return;
}
msleep(msec);
gpio_set_value(phy_reset, 1);
}
3、 Through the test with the hardware engineer , After the system is fully up , Put the chip reset The pin is pulled down again , Reset the hardware , Then it can run normally . So by printing information , Locate where you need to add a reset function .
static int fec_enet_mii_probe(struct net_device *ndev)
Add the following code
static void fec_enet_hyb_reset(void)
{
printk("%s:%d\n",__FUNCTION__,phy_reset);
msleep(1);
gpio_set_value(phy_reset, 0);
msleep(30);
gpio_set_value(phy_reset, 1);
}
static int resetCnt = 0;// Define a static global variable
static int fec_enet_mii_probe(struct net_device *ndev)
{
.......
if (resetCnt == 0) {
// Hardware reset only once
resetCnt++;
fec_enet_hyb_reset();
}
.......
}
版权声明
本文为[Talent、me]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210610470997.html
边栏推荐
- Stanford machine learning course summary
- What are the relationships and differences between threads and processes
- 【ACM】70. climb stairs
- Cells in rust share variable pointers
- A few lines of code teach you to crawl lol skin pictures
- Gson fastjason Jackson of object to JSON difference modifies the field name
- Serial port debugging tools cutecom and minicom
- MySQL_ 01_ Simple data retrieval
- word frequency count
- Vulnérabilité d'exécution de la commande de fond du panneau de commande JD - freefuck
猜你喜欢

Re expression régulière
![[UDS unified diagnostic service] IV. typical diagnostic service (6) - input / output control unit (0x2F)](/img/ae/cbfc01fbcc816915b1794a9d70247a.png)
[UDS unified diagnostic service] IV. typical diagnostic service (6) - input / output control unit (0x2F)

Dynamically add default fusing rules to feign client based on sentinel + Nacos

In win10 system, all programs run as administrator by default

Hard core parsing promise object (do you know these seven common APIs and seven key questions?)

Process management command

How to restore MySQL database after win10 system is reinstalled (mysql-8.0.26-winx64. Zip)

QT reading and writing XML files (including source code + comments)

The vivado project corresponding to the board is generated by TCL script

Qtablewidget usage explanation
随机推荐
7-21 wrong questions involve knowledge points.
Using transmittablethreadlocal to realize parameter cross thread transmission
Spark performance optimization guide
SQL database syntax learning notes
Feign requests the log to be printed uniformly
Log4j2 cross thread print traceid
硬核解析Promise对象(这七个必会的常用API和七个关键问题你都了解吗?)
【ACM】70. climb stairs
Rust: shared variable in thread pool
idea中安装YapiUpload 插件将api接口上传到yapi文档上
JD freefuck Jingdong HaoMao control panel background Command Execution Vulnerability
Arcpy adds fields and loop assignments to vector data
Re regular expression
Random number generation of C #
Error reported when running tensorboard: valueerror: duplicate plugins for name projector, solution
Resolve the error Max virtual memory areas VM max_ map_ count [65530] is too low, increase to at least [262144]
SSD硬盘SATA接口和M.2接口区别(详细)总结
[UDS unified diagnostic service] IV. typical diagnostic service (6) - input / output control unit (0x2F)
re正则表达式
【ACM】376. Swing sequence