diff options
| author | Tom Rini <[email protected]> | 2023-12-13 16:02:38 -0500 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2023-12-13 18:39:06 -0500 |
| commit | 86f623dcf89c6037b34788650c42b02b501e6d27 (patch) | |
| tree | 504c8045e6505a08fa4a2ae6355a220d2d9dd98b /common | |
| parent | 9565771076c2d4b0193f1741b3990695ac33c1f3 (diff) | |
| parent | 229c4da6ca183b91f2ad928ecec47e073bce1b1a (diff) | |
Merge tag 'dm-next-13dec23' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm into next
minor improvements to test, acpi
updates for new PyPl release
Diffstat (limited to 'common')
| -rw-r--r-- | common/console.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/common/console.c b/common/console.c index 98c3ee6ca6b..1ffda49c87e 100644 --- a/common/console.c +++ b/common/console.c @@ -19,12 +19,15 @@ #include <stdio_dev.h> #include <exports.h> #include <env_internal.h> +#include <video_console.h> #include <watchdog.h> #include <asm/global_data.h> #include <linux/delay.h> DECLARE_GLOBAL_DATA_PTR; +#define CSI "\x1b[" + static int on_console(const char *name, const char *value, enum env_op op, int flags) { @@ -1010,6 +1013,34 @@ int console_init_f(void) return 0; } +int console_clear(void) +{ + /* + * Send clear screen and home + * + * FIXME(Heinrich Schuchardt <[email protected]>): This should go + * through an API and only be written to serial terminals, not video + * displays + */ + printf(CSI "2J" CSI "1;1H"); + if (IS_ENABLED(CONFIG_VIDEO_ANSI)) + return 0; + + if (IS_ENABLED(CONFIG_VIDEO)) { + struct udevice *dev; + int ret; + + ret = uclass_first_device_err(UCLASS_VIDEO_CONSOLE, &dev); + if (ret) + return ret; + ret = vidconsole_clear_and_reset(dev); + if (ret) + return ret; + } + + return 0; +} + static void stdio_print_current_devices(void) { char *stdinname, *stdoutname, *stderrname; |
