[U-Boot] baud rate of the rockchip uart
Mark Kettenis
mark.kettenis at xs4all.nl
Mon Sep 23 12:27:35 UTC 2019
> From: Sérgio de Almeida Lenzi <nervoso at k1.com.br>
> Date: Sun, 22 Sep 2019 00:51:52 -0300
>
> Hello, I am trying to setup the baud rate of the rockchip uart from
> the file => arch/arm/mach-rockchip/rk3328-board-tpl.c line 59 -> 63,
> the baud rate is at insane 1,500,000 bps... that speed it too fast
> for small computers using serial port to communicate with the rock64
> SBC... I would like to set the baud rate at more "sane" values like
> 9600, 19200... or even 115200 bps
>
> Can some one point me what values must be written to the lcr and rbr
> of the chip to make it happen???
arch/arm/mach-rockchip/rk3328-board-tpl.c no longer exists in the
current u-boot master. There is now a arch/arm/mach-rockchip/tpl.c
that is shared between various Rockchip SoCs. That file calls
debug_uart_init() which end up calling _debug_uart_init() that will
set the baudrate acoording to the CONFIG_BAUDRATE variable. So you
can simply set CONFIG_BAUDRATE to the desired value in
configs/rock64-rk3328_defconfig. Note that you'll also need to build
TF-A with the appropriate baudrate setting, otherwise you will see
garbled output from TF-A (or no output at all)!
I agree that 1.5 Mbps isn't really usable as a serial console speed.
Many USB serial converters don't support that speed and it is way too
sensitive to line noise at those speeds. Unfortunately it appears to
be the default on all the newer Rockchip SoCs. For OpenBSD we always
build our firmwares with CONFIG_BAUDRATE=115200, which is the de-facto
standard form SBCs with ARM processors.
Cheers,
Mark
P.S. It appears that in arch/arm/mach-rockchip/rk3328/rk3328.c there
is still code that initializes the baudrate. But that code
shouldn't be necessary anymore.
More information about the U-Boot
mailing list