This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
1. 硬件AM3354 ZCZ phy用的是lan8720 线路图如下:
2. 使用的sdk版本是6.0 pin配置如下:
static struct module_pin_mux rgmii1_pin_mux[] = {
{OFFSET(mii1_txen), MODE(1)},
{OFFSET(mii1_rxerr), MODE(1) | RXACTIVE},
{OFFSET(mii1_crs), MODE(1) | RXACTIVE},
{OFFSET(rmii1_refclk), MODE(0) },
{OFFSET(mii1_txd1), MODE(1)},
{OFFSET(mii1_txd0), MODE(1)},
{OFFSET(mii1_rxd1), MODE(1) | RXACTIVE},
{OFFSET(mii1_rxd0), MODE(1) | RXACTIVE},
{OFFSET(mdio_data), MODE(0) | RXACTIVE | PULLUP_EN},
{OFFSET(mdio_clk), MODE(0) | PULLUP_EN},
{-1},
};
3. 在./board/ti/am335x/Board.c 函数board_eth_init中
a. 修改为 writel(0x5, &cdev->miisel);
b. 修改为cpsw_slaves[0].phy_if = cpsw_slaves[1].phy_if = PHY_INTERFACE_MODE_RMII;
问题: 串口输出phy reset time out.
我跟踪了函数调用发现:
a. 在mdio读取phy_id时, 返回-1.
b. phy的寄存器0(Basic mode control register), 寄存器1(Basic mode status register)的值均为0xffff.
1.检查PHY的电源,是否正常供电;
2.检查PHY的时钟是否正常工作;
3.检查PHY的Reset pin是否处于工作模式,一直处于reset状态也是不能工作的;
4.检查软件中配置的PHY ID是否跟硬件匹配,多数的“phy的寄存器0(Basic mode control register), 寄存器1(Basic mode status register)的值均为0xffff”是因为ID不匹配导致的,代码如下:
static int cpsw_phy_init(struct eth_device *dev, struct cpsw_slave *slave)
{
struct cpsw_priv *priv = (struct cpsw_priv *)dev->priv;
struct phy_device *phydev;
u32 supported = (SUPPORTED_10baseT_Half |
SUPPORTED_10baseT_Full |
SUPPORTED_100baseT_Half |
SUPPORTED_100baseT_Full |
SUPPORTED_1000baseT_Full);
phydev = phy_connect(priv->bus,
CONFIG_PHY_ADDR,
dev,
slave->data->phy_if);
phydev->supported &= supported;
phydev->advertising = phydev->supported;
priv->phydev = phydev;
phy_config(phydev);
return 1;
}