Page MenuHomeFreeBSD

ACPI SPCR: handle BaudRate=0

Authored by on Apr 14 2019, 10:20 PM.



The SPCR saga continues… (D19507, D19896)

Really fun commit in EDK2 for the Marvell Armada8k (e.g. MACCHIATObin):

The mcbin (and likely others) have a nonstandard uart clock. This means that the earlycon programming will incorrectly set the baud rate if it is specified. The way around this is to tell the kernel to continue using the preprogrammed baud rate. This is done by setting the baud to 0.

Our drivers (uart_dev_ns8250) do respect zero, but SPCR would error. Let's not error.

(Also, looks like Marvell has made a mess with access widths *on an 8250/16550*… W T F)

Diff Detail

rS FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

mw added a subscriber: mw.Apr 15 2019, 6:52 AM


FYI, I am checking edk2-platforms patch with its author, however this particular patch is IMO fine to land.

On the other hand I think we currently do not support HISI0031 _HID in the FreeBSD. We cannot hardcode acpi_compat_data for it, as only in mainline edk2-platforms, there are 3 platforms, that use different clock-frequency/reg-shift/reg-io-width values. I have a dirty patch adding support for it in sys/dev/uart/uart_dev_snps.c. If you have no objections, and I find time for it, I'll prepare a cleaner version for submission.

Best regards,

mw added a comment.Apr 15 2019, 3:25 PM

About the WTF part of your comment - I've just submitted restoring 32-bit RegisterBitWidth, so that part of controversy should be gone:,,,20,0,0,0::recentpostdate%2Fsticky,,,20,2,0,31189274

bcran accepted this revision as: bcran.Apr 24 2019, 10:48 PM
This revision is now accepted and ready to land.Apr 24 2019, 10:48 PM
imp accepted this revision.Apr 25 2019, 12:39 AM
This revision was automatically updated to reflect the committed changes.