diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2012-09-29 08:26:05 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2012-09-29 08:26:05 +0000 |
commit | bc0373893f147f1f6e3155f04965ca06b9cbff18 (patch) | |
tree | b703314ef568a956ad53365781aa6db9e1a4809a /os/hal/platforms | |
parent | 2f343993616977cea20bccf20b5cd8fd4f04d5a9 (diff) | |
download | ChibiOS-bc0373893f147f1f6e3155f04965ca06b9cbff18.tar.gz ChibiOS-bc0373893f147f1f6e3155f04965ca06b9cbff18.tar.bz2 ChibiOS-bc0373893f147f1f6e3155f04965ca06b9cbff18.zip |
Fixed bug 3570335.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4724 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/platforms')
-rw-r--r-- | os/hal/platforms/STM32/mac_lld.c | 4 | ||||
-rw-r--r-- | os/hal/platforms/STM32/mac_lld.h | 7 |
2 files changed, 11 insertions, 0 deletions
diff --git a/os/hal/platforms/STM32/mac_lld.c b/os/hal/platforms/STM32/mac_lld.c index 2a91009c5..eb87d579d 100644 --- a/os/hal/platforms/STM32/mac_lld.c +++ b/os/hal/platforms/STM32/mac_lld.c @@ -306,8 +306,10 @@ void mac_lld_start(MACDriver *macp) { /* ISR vector enabled.*/
nvicEnableVector(ETH_IRQn, CORTEX_PRIORITY_MASK(STM32_ETH1_IRQ_PRIORITY));
+#if STM32_ETH1_CHANGE_PHY_STATE
/* PHY in power up mode.*/
mii_write(macp, MII_BMCR, mii_read(macp, MII_BMCR) & ~BMCR_PDOWN);
+#endif
/* MAC configuration.*/
ETH->MACFFR = 0;
@@ -361,8 +363,10 @@ void mac_lld_start(MACDriver *macp) { void mac_lld_stop(MACDriver *macp) {
if (macp->state != MAC_STOP) {
+#if STM32_ETH1_CHANGE_PHY_STATE
/* PHY in power down mode until the driver will be restarted.*/
mii_write(macp, MII_BMCR, mii_read(macp, MII_BMCR) | BMCR_PDOWN);
+#endif
/* MAC and DMA stopped.*/
ETH->MACCR = 0;
diff --git a/os/hal/platforms/STM32/mac_lld.h b/os/hal/platforms/STM32/mac_lld.h index 32ef3ba79..9709bcdb7 100644 --- a/os/hal/platforms/STM32/mac_lld.h +++ b/os/hal/platforms/STM32/mac_lld.h @@ -155,6 +155,13 @@ #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.
*/
#if !defined(STM32_ETH1_IRQ_PRIORITY) || defined(__DOXYGEN__)
|