Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions components/drivers/include/rtdevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,9 @@ extern "C" {
#endif /* RT_USING_DM */
#endif /* RT_USING_I2C */

#ifdef RT_USING_PHY
#if defined(RT_USING_PHY) || defined(RT_USING_PHY_V2)
#include "drivers/phy.h"
#endif /* RT_USING_PHY */
#endif /* RT_USING_PHY || RT_USING_PHY_V2 */

#ifdef RT_USING_SDIO
#include "drivers/dev_mmcsd_core.h"
Expand Down
8 changes: 6 additions & 2 deletions components/drivers/phy/Kconfig
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
config RT_USING_PHY
menuconfig RT_USING_PHY
bool "Using ethernet phy device drivers"
default n

config RT_USING_PHY_V2
menuconfig RT_USING_PHY_V2
bool "Using phy device and mii bus v2"
depends on !RT_USING_PHY
default n

if RT_USING_DM && RT_USING_PHY_V2
osource "$(SOC_DM_PHY_DIR)/Kconfig"
endif
7 changes: 4 additions & 3 deletions components/drivers/phy/general.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,22 +172,23 @@ int rt_genphy_update_link(struct rt_phy_device *phydev)
!(mii_reg & RT_BMSR_ANEGCOMPLETE))
{
int i = 0;
rt_kprintf("Waiting for PHY auto negotiation to complete");
LOG_I("Waiting for PHY auto negotiation to complete");
while (!(mii_reg & RT_BMSR_ANEGCOMPLETE))
{

if (i > (RT_PHY_ANEG_TIMEOUT))
{
LOG_E(" TIMEOUT !\n");
LOG_E(" TIMEOUT!");
phydev->link = 0;
return -ETIMEDOUT;
}

mii_reg = rt_phy_read(phydev, RT_MDIO_DEVAD_NONE, RT_MII_BMSR);

rt_thread_delay(100);
i += 100;
}
LOG_D(" done\n");
LOG_D(" Done");
phydev->link = 1;
} else {
mii_reg = rt_phy_read(phydev, RT_MDIO_DEVAD_NONE, RT_MII_BMSR);
Expand Down
2 changes: 1 addition & 1 deletion components/drivers/phy/ofw.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include <rtdevice.h>
#include <stdio.h>
#define DBG_TAG "rtdm.phy"
#define DBG_LVL DBG_INFO
#define DBG_LVL DBG_LOG
#include <rtdbg.h>
#include "ofw.h"

Expand Down