Fixed bug #606.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8032 35acf78f-673a-0410-8e92-d51de3d6d3f4master
parent
f1b303a997
commit
02a30eeeac
|
@ -123,22 +123,20 @@ static void mii_find_phy(MACDriver *macp) {
|
|||
uint32_t i;
|
||||
|
||||
#if STM32_MAC_PHY_TIMEOUT > 0
|
||||
rtcnt_t start = chSysGetRealtimeCounterX();
|
||||
rtcnt_t timeout = start + MS2RTC(STM32_HCLK,STM32_MAC_PHY_TIMEOUT);
|
||||
rtcnt_t time = start;
|
||||
while (chSysIsCounterWithinX(time, start, timeout)) {
|
||||
unsigned n = STM32_MAC_PHY_TIMEOUT;
|
||||
do {
|
||||
#endif
|
||||
for (i = 0; i < 31; i++) {
|
||||
macp->phyaddr = i << 11;
|
||||
ETH->MACMIIDR = (i << 6) | MACMIIDR_CR;
|
||||
if ((mii_read(macp, MII_PHYSID1) == (BOARD_PHY_ID >> 16)) &&
|
||||
((mii_read(macp, MII_PHYSID2) & 0xFFF0) == (BOARD_PHY_ID & 0xFFF0))) {
|
||||
for (i = 0U; i < 31U; i++) {
|
||||
macp->phyaddr = i << 11U;
|
||||
ETH->MACMIIDR = (i << 6U) | MACMIIDR_CR;
|
||||
if ((mii_read(macp, MII_PHYSID1) == (BOARD_PHY_ID >> 16U)) &&
|
||||
((mii_read(macp, MII_PHYSID2) & 0xFFF0U) == (BOARD_PHY_ID & 0xFFF0U))) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
#if STM32_MAC_PHY_TIMEOUT > 0
|
||||
time = chSysGetRealtimeCounterX();
|
||||
}
|
||||
n--;
|
||||
} while (n > 0U);
|
||||
#endif
|
||||
/* Wrong or defective board.*/
|
||||
osalSysHalt("MAC failure");
|
||||
|
|
|
@ -144,12 +144,11 @@
|
|||
|
||||
/**
|
||||
* @brief PHY detection timeout.
|
||||
* @details Timeout, in milliseconds, for PHY address detection, if a PHY
|
||||
* is not detected within the timeout then the driver halts during
|
||||
* initialization. This setting applies only if the PHY address is
|
||||
* not explicitly set in the board header file using
|
||||
* @p BOARD_PHY_ADDRESS. A zero value disables the timeout and a
|
||||
* single search path is performed.
|
||||
* @details Timeout for PHY address detection, the scan for a PHY is performed
|
||||
* the specified number of times before invoking the failure handler.
|
||||
* This setting applies only if the PHY address is not explicitly
|
||||
* set in the board header file using @p BOARD_PHY_ADDRESS. A zero
|
||||
* value disables the timeout and a single search is performed.
|
||||
*/
|
||||
#if !defined(STM32_MAC_PHY_TIMEOUT) || defined(__DOXYGEN__)
|
||||
#define STM32_MAC_PHY_TIMEOUT 100
|
||||
|
|
|
@ -80,6 +80,7 @@
|
|||
- NIL: Added INTC priorities check to the e200z port.
|
||||
- RT: Added INTC priorities check to the e200z port.
|
||||
- HAL: Added support for extra DMA channels in STM32F072 devices.
|
||||
- HAL: Fixed dependency between STM32 MAC driver and RT (bug #606).
|
||||
- HAL: Fixed wrong macro names in STM32F0xx HAL driver (bug #605).
|
||||
- HAL: Fixed wrong check on ADC3 in STM32F3xx ADC driver (bug #604).
|
||||
- HAL: Fixed wrong macro names in STM32F3xx HAL driver (bug #603).
|
||||
|
|
Loading…
Reference in New Issue