[PATCH v1 2/4] board: nuvoton: update console environment variable

Tom Rini trini at konsulko.com
Wed Nov 8 14:28:57 CET 2023


On Wed, Nov 08, 2023 at 08:40:25AM +0800, Jim Liu wrote:

> If CONFIG_SYS_SKIP_UART_INIT is enabled, calculate the
> current baud rate and update the "console" environment
> variable.
> 
> Signed-off-by: Jim Liu <JJLIU0 at nuvoton.com>
> ---
>  board/nuvoton/arbel_evb/Kconfig |  1 +
>  board/nuvoton/common/Kconfig    |  9 +++++
>  board/nuvoton/common/Makefile   |  1 +
>  board/nuvoton/common/common.c   | 71 +++++++++++++++++++++++++++++++++
>  board/nuvoton/common/common.h   | 11 +++++
>  board/nuvoton/poleg_evb/Kconfig |  1 +
>  6 files changed, 94 insertions(+)
>  create mode 100644 board/nuvoton/common/Kconfig
>  create mode 100644 board/nuvoton/common/Makefile
>  create mode 100644 board/nuvoton/common/common.c
>  create mode 100644 board/nuvoton/common/common.h

Please:
- Don't include <common.h> in code, and audit the rest of the includes
  in your new file
- Don't name the new file common.c (and common.h) but instead something
  about UART, and then only build it with your new CONFIG option
  enabled, so you don't need a build-time check in the function itself.

Also:
[snip]
> +int board_set_console(void)

This function only ever return 0, make it void?

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20231108/f626e2e0/attachment.sig>


More information about the U-Boot mailing list