我正在使用EthernetAVB模块。我的董事会可以通过命令暂停
echo mem > /sys/power/state
但是当从暂停中恢复时,eth0不起作用。这种现象是:
Able ping loopback:$ ping 127.0.0.1 - >确定
PHY的电源关闭(断电)
无法ping邻居:$ ping 192.168.1.1 - >失败
我认为网络层(符合OSI模型)没问题,因为我可以ping环回。我认为问题发生在物理层,与:
有关PHY ic(我的电路板使用Micrel Phys ksz9031)
MDIO总线
最后一个是phy_dev
也许问题可以在以太网控制器上发生(我的情况是以太网AVB)
我试图禁用“暂停”PHY ic(ksz9031的电源) - 保持PHY唤醒。恢复后,指示led的电源为ON,但仍然无法ping其他邻居。 顺便说一下,我看到我的系统(以太网)在恢复后无法跳转到RUNNING状态。
以上是PM平台的工作方式。
更多详情:
PHY状态机状态:
DOWN: PHY device and driver are not ready for anything. probe() should be called if and only if the PHY is in this state, given that the PHY device exists.
- PHY driver probe function will, depending on the PHY, set the state to STARTING or READY
STARTING: PHY device is coming up, and the ethernet driver is not ready. PHY drivers may set this in the probe function. If they do, they are responsible for making sure the state is eventually set to indicate whether the PHY is UP or READY, depending on the state when the PHY is done starting up.
- PHY driver will set the state to READY
- start will set the state to PENDING
READY: PHY is ready to send and receive packets, but the controller is not. By default, PHYs which do not implement probe will be set to this state by phy_probe(). If the PHY driver knows the PHY is ready, and the PHY state is STARTING, then it sets this STATE.
- start will set the state to UP
PENDING: PHY device is coming up, but the ethernet driver is ready. phy_start will set this state if the PHY state is STARTING.
- PHY driver will set the state to UP when the PHY is ready
UP: The PHY and attached device are ready to do work. Interrupts should be started here.
- timer moves to AN
AN: The PHY is currently negotiating the link state. Link is therefore down for now. phy_timer will set this state when it detects the state is UP. config_aneg will set this state whenever called with phydev->autoneg set to AUTONEG_ENABLE.
- If autonegotiation finishes, but there's no link, it sets the state to NOLINK.
- If aneg finishes with link, it sets the state to RUNNING, and calls adjust_link
- If autonegotiation did not finish after an arbitrary amount of time, autonegotiation should be tried again if the PHY supports "magic" autonegotiation (back to AN)
- If it didn't finish, and no magic_aneg, move to FORCING.
NOLINK: PHY is up, but not currently plugged in.
- If the timer notes that the link comes back, we move to RUNNING
- config_aneg moves to AN
- phy_stop moves to HALTED
FORCING: PHY is being configured with forced settings
- if link is up, move to RUNNING
- If link is down, we drop to the next highest setting, and retry (FORCING) after a timeout
- phy_stop moves to HALTED
RUNNING: PHY is currently up, running, and possibly sending and/or receiving packets
- timer will set CHANGELINK if we're polling (this ensures the link state is polled every other cycle of this state machine, which makes it every other second)
- irq will set CHANGELINK
- config_aneg will set AN
- phy_stop moves to HALTED
CHANGELINK: PHY experienced a change in link state
- timer moves to RUNNING if link
- timer moves to NOLINK if the link is down
- phy_stop moves to HALTED
HALTED: PHY is up, but no polling or interrupts are done. Or PHY is in an error state.
- phy_start moves to RESUMING
RESUMING: PHY was halted, but now wants to run again.
- If we are forcing, or aneg is done, timer moves to RUNNING
- If aneg is not done, timer moves to AN
- phy_stop moves to HALTED
我提出了一些假设/假设:
暂停后,系统进入HALTED状态,但无法切换到RUNNING状态。
由于某种原因,系统进入DOWN状态,无法再次进入READY状态和UP状态。
感谢您的帮助。
答案 0 :(得分:-1)
至少在暂停状态恢复期间保持低于标准以解决问题。
o启用AVB-DMAC模式寄存器使用高速外设总线时钟(AVB-DMAC模块当前使用gPTP时钟从队列中读取/写入数据(尽力而为和网络控制)。
o在URAM中恢复描述符基址表(DBAT寄存器)。
o启用Best EffortQueuevàNetControl Queue的中断
o重新启动DMACvàE-MAC设备
o初始化PTP时钟驱动程序以为DMAC提供时钟
o启用所有队列的传输,以允许上层传输帧,但不会重新开始传输。
o重新启动PHY设备
o将设备标记为从系统附加并在需要时重新启动。