HomeFreeBSD

uart: Add a signal to compute rclk from baudrate

Description

uart: Add a signal to compute rclk from baudrate

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
Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D47072

Details

Provenance
impAuthored on Mon, Oct 14, 9:57 PM
Reviewer
andrew
Differential Revision
D47072: uart: Add a signal to compute rclk from baudrate
Parents
rG2be228603754: uart: Document the hw.uart.console string format.
Branches
Unknown
Tags
Unknown