Fixed bug 3570335.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4724 35acf78f-673a-0410-8e92-d51de3d6d3f4
master
gdisirio 2012-09-29 08:26:05 +00:00
parent 2f34399361
commit bc0373893f
3 changed files with 15 additions and 0 deletions

View File

@ -306,8 +306,10 @@ void mac_lld_start(MACDriver *macp) {
/* ISR vector enabled.*/ /* ISR vector enabled.*/
nvicEnableVector(ETH_IRQn, CORTEX_PRIORITY_MASK(STM32_ETH1_IRQ_PRIORITY)); nvicEnableVector(ETH_IRQn, CORTEX_PRIORITY_MASK(STM32_ETH1_IRQ_PRIORITY));
#if STM32_ETH1_CHANGE_PHY_STATE
/* PHY in power up mode.*/ /* PHY in power up mode.*/
mii_write(macp, MII_BMCR, mii_read(macp, MII_BMCR) & ~BMCR_PDOWN); mii_write(macp, MII_BMCR, mii_read(macp, MII_BMCR) & ~BMCR_PDOWN);
#endif
/* MAC configuration.*/ /* MAC configuration.*/
ETH->MACFFR = 0; ETH->MACFFR = 0;
@ -361,8 +363,10 @@ void mac_lld_start(MACDriver *macp) {
void mac_lld_stop(MACDriver *macp) { void mac_lld_stop(MACDriver *macp) {
if (macp->state != MAC_STOP) { if (macp->state != MAC_STOP) {
#if STM32_ETH1_CHANGE_PHY_STATE
/* PHY in power down mode until the driver will be restarted.*/ /* PHY in power down mode until the driver will be restarted.*/
mii_write(macp, MII_BMCR, mii_read(macp, MII_BMCR) | BMCR_PDOWN); mii_write(macp, MII_BMCR, mii_read(macp, MII_BMCR) | BMCR_PDOWN);
#endif
/* MAC and DMA stopped.*/ /* MAC and DMA stopped.*/
ETH->MACCR = 0; ETH->MACCR = 0;

View File

@ -154,6 +154,13 @@
#define STM32_MAC_PHY_TIMEOUT 100 #define STM32_MAC_PHY_TIMEOUT 100
#endif #endif
/**
* @brief Change the PHY power state inside the driver.
*/
#if !defined(STM32_ETH1_CHANGE_PHY_STATE) || defined(__DOXYGEN__)
#define STM32_ETH1_CHANGE_PHY_STATE TRUE
#endif
/** /**
* @brief ETHD1 interrupt priority level setting. * @brief ETHD1 interrupt priority level setting.
*/ */

View File

@ -83,6 +83,8 @@
***************************************************************************** *****************************************************************************
*** 2.5.1 *** *** 2.5.1 ***
- FIX: Fixed Ethernet PHY power down scheme prevents using LAN8720A (bug
3570335).
- FIX: Fixed FatFS won't compile with _FS_REENTRANT enabled (bug 3570135) - FIX: Fixed FatFS won't compile with _FS_REENTRANT enabled (bug 3570135)
(backported to 2.4.3). (backported to 2.4.3).
- FIX: Fixed mmc_spi.c won't compile due to misplaced declaration (bug - FIX: Fixed mmc_spi.c won't compile due to misplaced declaration (bug
@ -97,6 +99,8 @@
(backported to 2.4.3). (backported to 2.4.3).
- FIX: Fixed STM8L, cosmic compiler: c_lreg not saved (bug 3566342)(backported - FIX: Fixed STM8L, cosmic compiler: c_lreg not saved (bug 3566342)(backported
to 2.2.10 and 2.4.3). to 2.2.10 and 2.4.3).
- NEW: Added a new option STM32_ETH1_CHANGE_PHY_STATE to the STM32 MAC driver,
this change is connected to bug 3570335.
- NEW: Modified the CAN drivers to use the new event flags mechanism, the - NEW: Modified the CAN drivers to use the new event flags mechanism, the
previous flags handling has been removed. previous flags handling has been removed.
- NEW: Modified serial and serial_usb drivers to use the new event flags - NEW: Modified serial and serial_usb drivers to use the new event flags