Skip to content

Commit 741e37c

Browse files
authored
Merge pull request #450 from richardeoin/revert-eth-dma-reset
Revert "Move ethernet DMA reset slightly earlier to eliminate freeze on h723"
2 parents a5b1b59 + fd567a9 commit 741e37c

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/ethernet/eth.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -455,12 +455,6 @@ pub unsafe fn new_unchecked<const TD: usize, const RD: usize>(
455455
// Ensure syscfg is enabled (for PMCR)
456456
rcc.apb4enr.modify(|_, w| w.syscfgen().set_bit());
457457

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

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

480474
cortex_m::interrupt::free(|_cs| {
475+
// reset ETH_DMA - write 1 and wait for 0
476+
eth_dma.dmamr.modify(|_, w| w.swr().set_bit());
477+
while eth_dma.dmamr.read().swr().bit_is_set() {}
478+
481479
// 200 MHz
482480
eth_mac
483481
.mac1ustcr

0 commit comments

Comments
 (0)