Skip to content

Initialize the console as early as possible

Xiang W opensbi 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest0 of 4 patches 0 repliesNew

Patches in v1 No applies recorded yet

None of the 4 patches the cover letter announces are in this archive.

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] Initialize the console as early as possible

? 2024-06-21???? 17:37 +0530?Anup Patel???

Quoted 28 lines · On Thu, Jun 6, 2024 at 2:47?PM Xiang W <[email protected]> wrote:
Quoted 5 lines

Initializing the console as early as possible can output more useful information. This series of patches is used to initialize the console as early as possible.

Quoted 8 lines

This series of patches is based on a previous patch
http://lists.infradead.org/pipermail/opensbi/2024-May/006960.html

Xiang W (4):
? include: sbi_utils: fixup fdt_get_address
? lib: sbi: Add domains_init to sbi_console_device ? lib: utils/serial: add domains_init for 8250 ? lib: sbi: Initialize the console as early as possible

The problem with this series is that it is changing the order of platform callback in coldboot path because sbi_scratch_init, sbi_heap_init, and sbi_domain_init should always be the first things done in the coldboot path.

Instead, I suggest the following:
1) Update generic platform to call generic_console_init() ???? from generic_early_init() in coldboot path and don't ???? provide the console_init() callback.
2) Update all other platform to do similar thing as #1
3) Drop sbi_console_init(), sbi_platform_console_init() and ??? console_init() callback.

Quoted 4 lines

For prints before sbi_platform_early_init(), the sbi_console.c can implement a small circular buffer which is flushed whenever some driver sets a console device.

If there is a buffer to cache the earlier print, I think it is possible not to move the console initialization forward. But we need to try to call console_init to output the contents of the buffer when an error occurs.

Regards,
Xiang W

Quoted 15 lines
Quoted 7 lines
?include/sbi/sbi_console.h?????????? |? 3 +++
?include/sbi_utils/fdt/fdt_helper.h? |? 4 +++-
?include/sbi_utils/serial/uart8250.h |? 1 +
?lib/sbi/sbi_domain.c??????????????? | 10 ++++++++++
?lib/sbi/sbi_init.c????????????????? |? 8 ++++----
?lib/utils/serial/uart8250.c???????? | 28 +++++++++++++++++++---------
Quoted 5 lines

?6 files changed, 40 insertions(+), 14 deletions(-)

--
2.43.0

Regards,
Anup