Bug 234055 - PL011 UART driver unable to change baudrate when booted via u-boot
Summary: PL011 UART driver unable to change baudrate when booted via u-boot
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: arm (show other bugs)
Version: CURRENT
Hardware: arm64 Any
: --- Affects Some People
Assignee: freebsd-arm (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-16 12:17 UTC by Jorge Schrauwen
Modified: 2022-06-27 15:19 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jorge Schrauwen 2018-12-16 12:17:54 UTC
After a long few months trying to figure this out...

It looks like the PL011 UART driver is unable to set a baudrate when booted via u-boot. My understanding of the code is poor but it looks like it only works for x86 BIOS/EFI booted systems.

This seems like something that might be useful for people running HAT's on raspberry pi's or other ARM boards.

Currently the baudrate can be set using u-boot by adding

init_baudrate="9600" to /boot/msdos/config.txt but it FreeBSD is unable to change it. 

It would be nice to have baudrate setting implemented eventually... but at least now there is a ticket for other people having this problem.
Comment 1 Matt Jacobson 2021-05-24 07:00:58 UTC
Just for posterity, IIUC it looks like the right line to add to config.txt is actually:

init_uart_baud=9600

This is actually a feature of the Raspberry Pi booter, and it's (somewhat) documented here: <https://www.raspberrypi.org/documentation/configuration/config-txt/boot.md>.

I agree it's unfortunate that the UART is not configurable from within the OS itself!
Comment 2 Jorge Schrauwen 2021-05-24 08:27:50 UTC
Interesting, worth a try if I ever upgrade that device to FreeBSD 13.
It's... rather out of reach on the roof currently.

I currently have it working by having a custom uboot that actually sets it up at 9600.

Also if you want to use it for anything else than a serial console you also need to tell FreeBSD to not spawn the OS console.

Ditching the custom uboot would certainly be welcome.