Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102036811
D47077.id144681.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
978 B
Referenced Files
None
Subscribers
None
D47077.id144681.diff
View Options
diff --git a/sys/dev/uart/uart_dev_pl011.c b/sys/dev/uart/uart_dev_pl011.c
--- a/sys/dev/uart/uart_dev_pl011.c
+++ b/sys/dev/uart/uart_dev_pl011.c
@@ -231,6 +231,24 @@
__uart_setreg(bas, UART_IFLS, FIFO_IFLS_BITS);
__uart_setreg(bas, UART_CR, ctrl);
+
+ /*
+ * Loader tells us to infer the rclk when it sets xo to 0 in
+ * hw.uart.console. The APCI SPCR code does likewise. We know the
+ * baudrate was set by the firmware, so calculate rclk from baudrate and
+ * the divisor register. If 'div' is actually 0, the resulting 0 value
+ * will have us fall back to other rclk methods. This method should be
+ * good to 5% or better because the error in baud rates needs to be
+ * below this for devices to communicate.
+ */
+ if (bas->rclk == 0 && baudrate > 0 && bas->rclk_guess) {
+ uint32_t div;
+
+ div = ((__uart_getreg(bas, UART_IBRD) & ~3) << 6) |
+ (__uart_getreg(bas, UART_FBRD) & 0x3f);
+ bas->rclk = (div * baudrate) / 4;
+ }
+
}
static void
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 7, 7:48 PM (9 h, 14 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
13961031
Default Alt Text
D47077.id144681.diff (978 B)
Attached To
Mode
D47077: uart/pl011: Add support for computing rclk
Attached
Detach File
Event Timeline
Log In to Comment