Increase UART speed above 115200 for MB1+MB2+CBOOT+Kernel?

Hi,

We would like to increase the standard speed of the Xavier AGX debug UART which is initialized by MB1… we want to run the UART speed above 115200. We want to be able to boot quickly with the faster UART enabled and want to be able to use the faster UART speed when we are booted all the way into the Xavier kernel.

Ideally the speed would be around 1 megabaud, like 921600 or 460800. We are using Jetpack 4.4.1

Can this be done through some MB1 configuration file or similar? We want to see the entire boot sequence for MB1+MB2+cboot+kernel… just at high speed instead of 115200. The quality of the wires should not be an issue because the wiring is on a PCBA from Xavier to another chip and is shielded properly.

Thank you,

andy

hello andy.nicholas,

could you please refer to Topic 1069632, for the steps to set 8M baud-rate settings, as an example,
thanks

Hello. Thank you for the reply, but the linked topic does not seem to explain how to get MB1+MB2 to use the faster baud rate. I could probably change the baud rate inside CBOOT to the faster rate and we can change Linux to do the same.

We are interested in making the entire boot path faster, including all the bootloaders, not just the later pieces like the kernel.

Thank you.

I found this in the CBOOT sources. I’m guessing the baud rate for MB1+MB2 is not configurable and is fixed at 115200, also:

#include <tegrabl_timer.h>
#include <tegrabl_io.h>
#include <tegrabl_compiler.h>

/* FIXME: this needs to be configurable */
#define BAUD_RATE       115200
#define uart_readl(huart, reg) \
        NV_READ32(((uintptr_t)((huart)->base_addr) + (uint8_t)(UART_##reg##_0)));

./bootloader/partner/common/drivers/uart/tegrabl_uart.c

hello andy.nicholas,

may I know what’s your use-case, are you going to optimize boot time?
please also check developer guide, Kernel Boot Time Optimization for reference,
thanks

Our usage case was to observe and record more of the boot output when booting for system diagnosis when the Xavier has trouble booting. Simultaneously we wanted the Xavier to boot fast. We currently set the “Verbosity” for MB1 to zero (off) which limits what we can see. We find that if we set the Verbosity to 1 (critical) that most messages are disabled. Then limiting the output from the kernel by modifying cboot to emit “quiet loglevel=1” onto the kernel command-line removes 90% of the serial output and also boots fast.

It’s not ideal because we would still like to see the boot output, faster, but it’s the best we seem to be able to do right now since the entire bootloader chain of MB1+MB2+Trusty+CBOOT can’t be pre-set to the same baud rate, only 115200.

hello andy.nicholas,

may I know what’s your expectation about Xavier’s boot-up time?
thanks

The mechanism we use now boots to the beginning of cboot in about 1.0 seconds and to the end of cboot after about 1.6 seconds. Then booting through the Linux kernel we suppress the output using “quiet log-level=1” we get to user-mode in about 1.3 seconds for a total of about 3.0 seconds from cold boot to kernel user-mode (starting the filesystems). This is when there is very little UART output by setting the MB1 “Verbosity” setting to 1.

We would like to see most of the output from the kernel and most of the MB1+MB2+CBoot output and not have the time be much larger than 3.0 seconds. In our experience, using the UART at 115200 and emitting all of the boot text (verbosity=4 or 5 plus allowing Linux kernel output) can increase the time by another 5 seconds.

3 seconds is much better than 8 seconds for a boot time to get to Linux user-mode.

In our experience, when we completely disable the boot output by setting the MB1 “Verbosity” to zero (0) then we see a reduction of about another 0.8 seconds and are able to boot from cold-start to Linux user-mode in about 2.2 seconds. Your mileage may vary. Void where prohibited.

1 Like

hello andy.nicholas,

please access Xavier TRM and checking page-8005, [10.4.2.19 Baud Rate Generator] for more details of programming baud rate generator.

you may access CBoot sources and modify it as below.
$L4T_Sources/r32.5/Linux_for_Tegra/source/public/cboot/bootloader/partner/common/drivers/uart/tegrabl_uart.c

struct tegrabl_uart *tegrabl_uart_open(uint32_t instance)
{
        huart->baud_rate = BAUD_RATE;

in addition,
here’s commands you may try to configure baudrate in kernel level,
for example,
$ setserial /dev/ttyTHS1 baud_base 115200

1 Like

Thank you and we will try that soon. Perhaps we can create some kind of triggering mechanism which will recognize the CBOOT startup and discard any previously receive “garbled characters” from before the UART switchover. We can also suppress the amount of garbled output by setting the MB1 “Verbosity” to 1

Thank you,

andy