h7: eth: add checks for PHYID in stm32_phyinit

Fixes bug where stm32_phyinit will succeed even when no PHY is connected. This is because there is no check that a PHY is actually communicating and returning data.

Update include/nuttx/net/mii.h

Co-authored-by: Xiang Xiao <xiaoxiang781216@gmail.com>
This commit is contained in:
Jacob Dahl 2025-02-04 14:19:08 -09:00 • committed by Alan C. Assis
parent e5388558a6
commit 3dcedd507b
2 changed files with 103 additions and 0 deletions

View file

@ -396,6 +396,13 @@
#define DP83840_PHYADDR_DUPLEX (1 << 7)
#define DP83840_PHYADDR_SPEED (1 << 6)
/* Davicom DM9161 **********************************************************/
/* DM9161 MII ID1/2 register bits */
#define MII_PHYID1_DM9161 0x0181
#define MII_PHYID2_DM9161 0xB800
/* National Semiconductor DP83848C ******************************************/
/* DP83848C MII ID1/2 register bits */