Page MenuHomeFreeBSD

awg: Move MAC soft reset around to avoid soft reset timeout
ClosedPublic

Authored by kevans on Jan 15 2019, 2:50 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Mar 26, 4:57 PM
Unknown Object (File)
Jan 28 2024, 7:39 AM
Unknown Object (File)
Jan 12 2024, 11:19 PM
Unknown Object (File)
Jan 4 2024, 5:25 AM
Unknown Object (File)
Dec 23 2023, 12:48 AM
Unknown Object (File)
Nov 26 2023, 5:14 PM
Unknown Object (File)
Nov 21 2023, 7:26 AM
Unknown Object (File)
Nov 8 2023, 8:39 PM
Subscribers

Details

Summary

From NetBSD: Since the MAC can get stuck in reset state with no link, ignore reset timeouts and continue with
initializing the device.

Fixes "soft reset timeout" issue at boot with no network cable plugged in.

awg_init may be called multiple times throughout normal interface usage, so the tx/rx descriptor base address registers must be written after each MAC reset and are moved as such.

This problem has been observed on FreeBSD, H3/H2+ devices with an internal phy (includes OrangePi R1, OrangePi One at least).

Obtained from: NetBSD

Test Plan

Test w/ OrangePi R1 as well as other boards not previously experiencing any issues.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Jan 15 2019, 3:29 AM
sys/arm/allwinner/if_awg.c
798 ↗(On Diff #52847)

Is this really needed ?
I don't really see how moving dma setup here change things.

sys/arm/allwinner/if_awg.c
798 ↗(On Diff #52847)

Right, I kind of suspect it's not critical, but I didn't put much time into thinking about it since it was in jmcneill's commit and I think there's good value in staying relatively in-sync

Remove unrelated DMA change

This revision now requires review to proceed.Jan 15 2019, 2:53 PM
This revision is now accepted and ready to land.Jan 15 2019, 3:02 PM

Further testing reveals that awg doesn't consistently work without the removed DMA change. I don't know much about network drivers, but I suspect awg_init is being called multiple times and the soft reset wipes out EMAC_{TX,RX}_DMA_LIST. They aren't being reset in this path, only on attach.

kevans edited the summary of this revision. (Show Details)

Restore the original version; awg_init will be called as an interface is down'd and up'd throughout the course of normal usage that the MAC reset will wipe out these registers. Otherwise, you end up with a not-actually-stable awg interface.

This revision now requires review to proceed.Jan 15 2019, 9:35 PM

Restore the original version; awg_init will be called as an interface is down'd and up'd throughout the course of normal usage that the MAC reset will wipe out these registers. Otherwise, you end up with a not-actually-stable awg interface.

Ah ok, make sense now.
Thanks.

This revision is now accepted and ready to land.Jan 16 2019, 7:19 AM
This revision was automatically updated to reflect the committed changes.