From 3c7d97c61e32d7ca023ff0c308fd52015f9abdd4 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 26 Feb 2012 11:30:50 +0000 Subject: [PATCH] STM32 Ethernet driver apparently working, it needs extensive testing. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3987 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/STM32/mac_lld.c | 8 ++++---- readme.txt | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/os/hal/platforms/STM32/mac_lld.c b/os/hal/platforms/STM32/mac_lld.c index 01eb1e4c3..236f96fc4 100644 --- a/os/hal/platforms/STM32/mac_lld.c +++ b/os/hal/platforms/STM32/mac_lld.c @@ -258,7 +258,7 @@ void mac_lld_init(void) { #endif /* PHY in power down mode until the driver will be started.*/ -// mii_write(ÐD1, MII_BMCR, mii_read(ÐD1, MII_BMCR) | BMCR_PDOWN); + mii_write(ÐD1, MII_BMCR, mii_read(ÐD1, MII_BMCR) | BMCR_PDOWN); /* MAC clocks stopped again.*/ rccDisableETH(FALSE); @@ -292,7 +292,7 @@ void mac_lld_start(MACDriver *macp) { nvicEnableVector(ETH_IRQn, CORTEX_PRIORITY_MASK(STM32_ETH1_IRQ_PRIORITY)); /* 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); /* MAC configuration.*/ ETH->MACFFR = 0; @@ -317,7 +317,7 @@ void mac_lld_start(MACDriver *macp) { /* Enabling required interrupt sources.*/ ETH->DMASR = ETH->DMASR; - ETH->DMAIER = ETH_DMAIER_RIE | ETH_DMAIER_TIE; + ETH->DMAIER = ETH_DMAIER_NISE | ETH_DMAIER_RIE | ETH_DMAIER_TIE; /* DMA general settings.*/ ETH->DMABMR = ETH_DMABMR_AAB | ETH_DMABMR_RDP_1Beat | ETH_DMABMR_PBL_1Beat; @@ -343,7 +343,7 @@ void mac_lld_stop(MACDriver *macp) { if (macp->state != MAC_STOP) { /* 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); /* MAC and DMA stopped.*/ ETH->MACCR = 0; diff --git a/readme.txt b/readme.txt index 3a4e91696..68a95ee40 100644 --- a/readme.txt +++ b/readme.txt @@ -106,6 +106,8 @@ Johnny Halfmoon). - NEW: Added handling of input 2 to the STM32 ICU driver (contributed by Fabio). +- NEW: STM32 Ethernet driver completed, only partially tested on STM32F107. + TODO: Extensive testing. - CHANGE: Macros icuGetWidthI() and icuGetPeriodI() renemed to icuGetWidth() and icuGetPeriod().