[Concept,v2,00/16] console: Refactor in preparation for the pager

Message ID 20250825162727.3185381-1-sjg@u-boot.org
Headers
Series console: Refactor in preparation for the pager |

Message

Simon Glass Aug. 25, 2025, 4:27 p.m. UTC
  From: Simon Glass <sjg@chromium.org>

This series tidies up a few small things the serial and console areas:

- Move detection of serial-console size to the serial module
- Provide a Kconfig to disable serial detection
- Fix some missing driver-model flags in stdio devices
- Move console docs into the main documentation

This series is marked v2 since some of the patches were sent in any
earlier series. With various tweaks that series grew too large to be
sent as a single series.

Changes in v2:
- Add new patch to provide a way to tell if the video is visible
- Add new patch to move environment handling lower in the file
- Add new patch to refactor handling of the result in on_console()

Simon Glass (16):
  bdinfo: Show the serial device
  video: Mark the vidconsole as a driver model stdio device
  video: Mark keyboards as driver model stdio devices
  serial: Generalise the code to check the terminal size
  serial: Cache the terminal size
  sandbox: Add a function to detect terminal connection
  sandbox: Provide a way to tell if the video is visible
  post: Include config.h in the header
  cli: Avoid sending ANSI characters to a non-terminal
  console: Update coninfo to use sdev instead of dev
  console: Update conio command to show uclass
  console: Move environment handling lower in the file
  console: Refactor handling of the result in on_console()
  doc: Remove obsolete text in README.console
  doc: Move console docs to rST
  doc: Tidy up the console docs a little

 arch/sandbox/cpu/os.c             |   5 +
 arch/sandbox/cpu/start.c          |   4 +
 arch/sandbox/cpu/state.c          |  14 +++
 arch/sandbox/include/asm/state.h  |  15 +++
 cmd/Kconfig                       |   8 ++
 cmd/bdinfo.c                      |   3 +-
 cmd/console.c                     |  45 ++++++---
 common/cli.c                      |   3 +-
 common/console.c                  | 130 ++++++++++++-------------
 doc/README.console                | 100 -------------------
 doc/usage/console.rst             |  62 ++++++++++++
 doc/usage/index.rst               |   1 +
 drivers/input/keyboard-uclass.c   |   2 +-
 drivers/serial/Kconfig            |  15 +++
 drivers/serial/serial-uclass.c    | 156 ++++++++++++++++++++++++++++++
 drivers/video/vidconsole-uclass.c |   2 +-
 include/os.h                      |   8 ++
 include/post.h                    |   2 +
 include/serial.h                  |  63 ++++++++++++
 include/video.h                   |  21 ++++
 lib/efi_loader/efi_console.c      | 124 +-----------------------
 test/cmd/bdinfo.c                 |   4 +-
 22 files changed, 484 insertions(+), 303 deletions(-)
 delete mode 100644 doc/README.console
 create mode 100644 doc/usage/console.rst