From e816afe161790bb57edee3a0b57380fa71b35362 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 3 Jun 2015 19:47:10 -0600 Subject: [PATCH] LC17 Ethernet: Ignore 4-bit versin number when checking for PHY ID match --- arch/arm/src/lpc17xx/lpc17_ethernet.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/arm/src/lpc17xx/lpc17_ethernet.c b/arch/arm/src/lpc17xx/lpc17_ethernet.c index 90a0e13488..3fa7028a78 100644 --- a/arch/arm/src/lpc17xx/lpc17_ethernet.c +++ b/arch/arm/src/lpc17xx/lpc17_ethernet.c @@ -2688,12 +2688,18 @@ static inline int lpc17_phyinit(struct lpc17_driver_s *priv) phyreg = (unsigned int)lpc17_phyread(phyaddr, MII_PHYID1); nvdbg("Addr: %d PHY ID1: %04x\n", phyaddr, phyreg); + /* Compare OUI bits 3-18 */ + if (phyreg == LPC17_PHYID1) { phyreg = lpc17_phyread(phyaddr, MII_PHYID2); nvdbg("Addr: %d PHY ID2: %04x\n", phyaddr, phyreg); - if (phyreg == LPC17_PHYID2) + /* Compare OUI bits 19-24 and the 6-bit model number (ignoring the + * 4-bit revision number). + */ + + if ((phyreg & 0xfff0) == LPC17_PHYID2) { break; }