lwip: Add warning message for non-Marvell PHY handling
This patch informs users if the PHY present is not from Marvell. It adds a warning message for non-Marvell PHY cases to notify users to cross-check the initialization sequence. Signed-off-by: Anirudha Sarangi <anirudh@xilinx.com>
This commit is contained in:
parent
10bb0f7661
commit
62599d592a
2 changed files with 22 additions and 6 deletions
|
@ -106,10 +106,13 @@
|
|||
#define IEEE_PAUSE_MASK 0x0400
|
||||
#define IEEE_AUTONEG_ERROR_MASK 0x8000
|
||||
|
||||
#define PHY_DETECT_REG 1
|
||||
#define PHY_DETECT_MASK 0x1808
|
||||
#define PHY_R0_ISOLATE 0x0400
|
||||
#define PHY_MODEL_NUM_MASK 0x3F0
|
||||
#define PHY_R0_ISOLATE 0x0400
|
||||
#define PHY_MODEL_NUM_MASK 0x3F0
|
||||
#define PHY_DETECT_REG 1
|
||||
#define PHY_IDENTIFIER_1_REG 2
|
||||
#define PHY_DETECT_MASK 0x1808
|
||||
#define PHY_MARVELL_IDENTIFIER 0x0141
|
||||
|
||||
|
||||
/* Marvel PHY flags */
|
||||
#define MARVEL_PHY_IDENTIFIER 0x141
|
||||
|
@ -151,6 +154,11 @@ static int detect_phy(XAxiEthernet *xaxiemacp)
|
|||
/* Found a valid PHY address */
|
||||
LWIP_DEBUGF(NETIF_DEBUG, ("XAxiEthernet detect_phy: PHY detected at address %d.\r\n", phy_addr));
|
||||
LWIP_DEBUGF(NETIF_DEBUG, ("XAxiEthernet detect_phy: PHY detected.\r\n"));
|
||||
XAxiEthernet_PhyRead(xaxiemacp, phy_addr, PHY_IDENTIFIER_1_REG,
|
||||
&phy_reg);
|
||||
if (phy_reg != PHY_MARVELL_IDENTIFIER) {
|
||||
xil_printf("WARNING: Not a Marvell Ethernet PHY. Please verify the initialization sequence\r\n");
|
||||
}
|
||||
return phy_addr;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -147,8 +147,10 @@
|
|||
#define IEEE_PAUSE_MASK 0x0400
|
||||
#define IEEE_AUTONEG_ERROR_MASK 0x8000
|
||||
|
||||
#define PHY_DETECT_REG 1
|
||||
#define PHY_DETECT_MASK 0x1808
|
||||
#define PHY_DETECT_REG 1
|
||||
#define PHY_IDENTIFIER_1_REG 2
|
||||
#define PHY_DETECT_MASK 0x1808
|
||||
#define PHY_MARVELL_IDENTIFIER 0x0141
|
||||
|
||||
#define XEMACPS_GMII2RGMII_SPEED1000_FD 0x140
|
||||
#define XEMACPS_GMII2RGMII_SPEED100_FD 0x2100
|
||||
|
@ -287,6 +289,12 @@ void detect_phy(XEmacPs *xemacpsp)
|
|||
phymapemac0[phy_addr] = TRUE;
|
||||
else
|
||||
phymapemac1[phy_addr] = TRUE;
|
||||
|
||||
XEmacPs_PhyRead(xemacpsp, phy_addr, PHY_IDENTIFIER_1_REG,
|
||||
&phy_reg);
|
||||
if (phy_reg != PHY_MARVELL_IDENTIFIER) {
|
||||
xil_printf("WARNING: Not a Marvell Ethernet PHY. Please verify the initialization sequence\r\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue