Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F108594403
D47097.id144748.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D47097.id144748.diff
View Options
diff --git a/sys/dev/uart/uart_cpu_acpi.c b/sys/dev/uart/uart_cpu_acpi.c
--- a/sys/dev/uart/uart_cpu_acpi.c
+++ b/sys/dev/uart/uart_cpu_acpi.c
@@ -167,28 +167,47 @@
if (error != 0)
goto out;
- switch (spcr->BaudRate) {
- case 0:
- /* Special value; means "keep current value unchanged". */
- di->baudrate = 0;
- break;
- case 3:
- di->baudrate = 9600;
- break;
- case 4:
- di->baudrate = 19200;
- break;
- case 6:
- di->baudrate = 57600;
- break;
- case 7:
- di->baudrate = 115200;
- break;
- default:
- printf("SPCR has reserved BaudRate value: %d!\n",
- (int)spcr->BaudRate);
- goto out;
+ /*
+ * SPCR Rev 4 and newer allow a precise baudrate to be passed in for
+ * things like 1.5M or 2.0M. If we have that, then use that value,
+ * otherwise try to decode the older enumeration.
+ */
+ if (spcr->Header.Revision >= 4 && spcr->PreciseBaudrate != 0) {
+ di->baudrate = spcr->PreciseBaudrate;
}
+ else {
+ switch (spcr->BaudRate) {
+ case 0:
+ /* Special value; means "keep current value unchanged". */
+ di->baudrate = 0;
+ break;
+ case 3:
+ di->baudrate = 9600;
+ break;
+ case 4:
+ di->baudrate = 19200;
+ break;
+ case 6:
+ di->baudrate = 57600;
+ break;
+ case 7:
+ di->baudrate = 115200;
+ break;
+ default:
+ printf("SPCR has reserved BaudRate value: %d!\n",
+ (int)spcr->BaudRate);
+ goto out;
+ }
+ }
+
+ /*
+ * Rev 3 and newer can specify a rclk, use it if it's there. It's
+ * defined to be 0 when it's not known, and we've initialized rclk to 0
+ * in uart_cpu_acpi_init_devinfo, so we don't have to test for it.
+ */
+ if (spcr->Header.Revision >= 3)
+ di->bas.rclk = spcr->UartClkFreq;
+
/*
* If no rclk is set, then we will assume the BIOS has configured the
* hardware at the stated baudrate, so we can use it to guess the rclk
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Jan 27, 6:18 PM (5 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16203718
Default Alt Text
D47097.id144748.diff (1 KB)
Attached To
Mode
D47097: uart: Implement SPCR rev 3 and 4 for PreciseBaudrate and UartClkFreq
Attached
Detach File
Event Timeline
Log In to Comment