Skip to content

Commit

Permalink
Merge pull request #450 from richardeoin/revert-eth-dma-reset
Browse files Browse the repository at this point in the history
Revert "Move ethernet DMA reset slightly earlier to eliminate freeze on h723"
  • Loading branch information
richardeoin authored Sep 12, 2023
2 parents a5b1b59 + fd567a9 commit 741e37c
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/ethernet/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -455,12 +455,6 @@ pub unsafe fn new_unchecked<const TD: usize, const RD: usize>(
// Ensure syscfg is enabled (for PMCR)
rcc.apb4enr.modify(|_, w| w.syscfgen().set_bit());

// Reset ETH_DMA - write 1 and wait for 0.
// On the H723, we have to do this before prec.enable()
// or the DMA will never come out of reset
eth_dma.dmamr.modify(|_, w| w.swr().set_bit());
while eth_dma.dmamr.read().swr().bit_is_set() {}

// AHB1 ETH1MACEN
prec.enable();

Expand All @@ -478,6 +472,10 @@ pub unsafe fn new_unchecked<const TD: usize, const RD: usize>(
//rcc.ahb1rstr.modify(|_, w| w.eth1macrst().clear_bit());

cortex_m::interrupt::free(|_cs| {
// reset ETH_DMA - write 1 and wait for 0
eth_dma.dmamr.modify(|_, w| w.swr().set_bit());
while eth_dma.dmamr.read().swr().bit_is_set() {}

// 200 MHz
eth_mac
.mac1ustcr
Expand Down

0 comments on commit 741e37c

Please sign in to comment.