MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / FGmac_PhyAddrGet

Function FGmac_PhyAddrGet

bsp/ft2004/libraries/bsp/ft_gmac/ft_gmac_hw.c:95–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93}
94
95static s32 FGmac_PhyAddrGet(FGmac_Config_t *Config)
96{
97 u32 i = 0;
98 u32 phyId1;
99 u32 phyId2;
100 u8 flag = 0;
101
102 for (i = 0; i < 32; i++)
103 {
104 Config->PhyAddr = i;
105 FGmac_ReadPHYRegister(Config, PHY_ID1_REG_OFFSET, &phyId1);
106 FGmac_ReadPHYRegister(Config, PHY_ID2_REG_OFFSET, &phyId2);
107
108 if ((phyId2 & 0xffff) != 0xffff)
109 {
110 if ((0 == i) && (0x1c == phyId1) && ((phyId2 >> 10) == 0x32))
111 {
112 continue;
113 }
114 flag = 1;
115 break;
116 }
117 }
118 return (flag == 1) ? FST_SUCCESS : FST_FAILURE;
119}
120
121
122static void FGmac_MACAddressConfig(FGmac_Config_t *Config, u32 MacAddr, u8 *Addr)

Callers 2

FGmac_MACDMAInitFunction · 0.85
FGmac_InitializeHwFunction · 0.85

Calls 1

FGmac_ReadPHYRegisterFunction · 0.85

Tested by

no test coverage detected