Page MenuHomeFreeBSD

[mips/broadcom] Add CFE-based EARLY_PRINTF support.

Authored by landonf on Aug 14 2016, 11:28 PM.



This adds support for EARLY_PRINTF via the CFE console; the aim is to
provide a fix for the otherwise cyclic dependency between PMU detection
and console printf/DELAY:

  • We need to parse the bhnd(4) core table to determine the address (and type) of the PMU/PLL registers and calculate the CPU clock frequency.
  • The core table parsing code will emit a printf() if a parse error is hit.
  • Calling printf() without EARLY_PRINTF requires a working DELAY, which means we need the PMU.

Errors in core table parsing shouldn't happen, but lack of EARLY_PRINTF
makes debugging more difficult.

PMU detection hasn't been dropped in yet; the end-goal is to use the new
PMU code (D7492) to query the actual clockspeed as configured by the boot
loader (and in NVRAM), rather than assuming a fixed clock speed for a given
chip identifier.

Test Plan

Verified that 'printf' succeeds prior to cninit() on N16, N51, and
WGT634U hardware.

Diff Detail

rS FreeBSD src repository - subversion
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

landonf retitled this revision from to [mips/broadcom] Add CFE-based EARLY_PRINTF support..
landonf updated this object.
landonf edited the test plan for this revision. (Show Details)
landonf added reviewers: adrian, mizhka.
adrian edited edge metadata.
This revision is now accepted and ready to land.Aug 16 2016, 10:16 PM
This revision was automatically updated to reflect the committed changes.