Page MenuHomeFreeBSD

uart: Add a signal to compute rclk from baudrate
ClosedPublic

Authored by imp on Oct 11 2024, 9:53 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Dec 17, 3:21 AM
Unknown Object (File)
Nov 23 2024, 3:17 PM
Unknown Object (File)
Nov 23 2024, 3:40 AM
Unknown Object (File)
Nov 16 2024, 9:13 PM
Unknown Object (File)
Nov 10 2024, 10:45 PM
Unknown Object (File)
Nov 7 2024, 1:45 PM
Unknown Object (File)
Nov 7 2024, 1:41 PM
Unknown Object (File)
Nov 7 2024, 11:34 AM
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