Page MenuHomeFreeBSD

uart: Add a signal to compute rclk from baudrate
ClosedPublic

Authored by imp on Fri, Oct 11, 9:53 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Oct 13, 2:55 AM
Unknown Object (File)
Sat, Oct 12, 8:29 PM
Subscribers
None

Details

Summary

With newer, more diverse hardware designs, the rclk can be
unknown. Currently deployed systems have no standard way to discover the
baud-clock generator frequency. However, sometimes we have a fairly good
idea that the firmware programmed the UART to be the baud rate that it's
telling us it's at. Create a way to instruct the uart class drivers to
compute the baud clock frequency the first time their init routines are
called. Usually the 'divisors' are relatively small, meaning we will
likely have a fairly large error (goes as 1 / (divisor + 1). However,
we also know that the baud-generator clock needs to be divided down
to the baud-rate +/- about 5% (so while the error could be large for
an arbitrary baud-clock, standard baud rates generally will give
an error of 5% or less).

Often, the console speed and the getty-configured speed are the same, so
this heuristic allows boot messages and login sessions to work.

Sponsored by: Netflix

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable