This patch addes missing implementation of BHND_BUS_RESET_CORE function for BCMA. The reset procedure is very simple: enable reset mode, stop clocking, enable clocking & force clock gating, disable reset mode, stop clock gating.
Details
- Reviewers
landonf adrian - Commits
- rS308695: [BHND] correct spelling error in macro name
Tested on ASUS RT-N53 for enabling/reset USB core
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
In addition to inline comments, if you happen to feel like implementing the nearly identical bcma_suspend_core(), I wouldn't say no :-)
sys/dev/bhnd/bcma/bcma.c | ||
---|---|---|
220 ↗ | (On Diff #17758) | To ensure there are no pending operations prior to putting the core in reset, you should spin here for 300ms (in 10us intervals) waiting for resetstatus to clear. |
224 ↗ | (On Diff #17758) | After this 10us delay, you should spin waiting for resetstatus to clear; the resetctrl read-back shouldn't be necessary. |
229 ↗ | (On Diff #17758) | I'd recommend a slightly different order of operations that leaves the clock enabled/stable during reset (not that there's any documentation for any of this stuff ...).
|
sys/dev/bhnd/bhnd_core.h | ||
27 ↗ | (On Diff #17758) | These bcma-specific register offsets and bitflags are defined in bcma_dmp.h; can you switch to using those? The bhnd_core.h header is shared with siba(4), which has its own register offsets/layout, but uses most of the same flags (including core-specific flags). BCMA Offsets:
BCMA Flags:
|
I can't find BCMA_DMP_RC_RESET:
https://github.com/freebsd/freebsd/search?utf8=%E2%9C%93&q=BCMA_DMP_RC_RESET&type=Code
Is there a typo?
- usage of macros from bcma_dmp.h instead of new ones
- added status checks
Tested on Asus RT-N53 (USB core)
It looks like the earlier revision already went in r302106. I can just revisit this when I get back around to implementing the siba versions and the remaining bcma suspend code.