I’ve noticed that something before loading the Linux kernel is using UART at a baud rate of 128000, while Linux operates at 115200. This discrepancy can make debugging challenging. Is it possible to configure both to use the same baud rate, either 115200 or 128000, for consistency in the debugging process?
@cwt
Yes, I also noticed that before uboot, fsbl and opensbi printed garbled code, and the USB to serial module of ch340 could not print correctly, but the USB to serial module of cp2102 was normal
I tried to load kernel and set kernel option to use console at 128000
diff -r fc539c72d8db u-boot-2021.10/drivers/serial/Kconfig
--- a/u-boot-2021.10/drivers/serial/Kconfig Thu Oct 19 19:03:39 2023 +0800
+++ b/u-boot-2021.10/drivers/serial/Kconfig Sun Oct 22 20:24:28 2023 +0700
@@ -6,7 +6,7 @@
config BAUDRATE
int "Default baudrate"
- default 115200
+ default 128000
help
Select a default baudrate, where "default" has a driver-specific
meaning of either setting the baudrate for the early debug UART
diff -r fc539c72d8db u-boot-2021.10/include/configs/cv180x-asic.h
--- a/u-boot-2021.10/include/configs/cv180x-asic.h Thu Oct 19 19:03:39 2023 +0800
+++ b/u-boot-2021.10/include/configs/cv180x-asic.h Sun Oct 22 20:24:28 2023 +0700
@@ -239,7 +239,7 @@
#define CONFIG_EXTRA_ENV_SETTINGS \
"netdev=eth0\0" \
"consoledev=" CONSOLEDEV \
- "baudrate=115200\0" \
+ "baudrate=128000\0" \
"uImage_addr=" __stringify(UIMAG_ADDR) "\0" \
"update_addr=" __stringify(UPDATE_ADDR) "\0" \
"mtdparts=" PARTS "\0" \
somehow it worked until the UART driver in the linux kernel kicked in, and reversed the baud rate back to 115200. Set baud rate in /etc/inittab
for console to 128000 was failed, and rendered unusable console, then I try to set baud rate manually with stty, it said:
# stty -F /dev/console 128000
stty: invalid argument '128000'
Or should we lower the baud rate of uboot, fsbl and opensbi to 115200 instead?