diff options
author | Michael Walle <michael@walle.cc> | 2022-08-23 11:30:17 +0200 |
---|---|---|
committer | Peng Fan <peng.fan@nxp.com> | 2022-09-06 09:10:41 +0800 |
commit | 865176417afdbe96153b71080900b86f776c3a6b (patch) | |
tree | d1808188c2c9de74ee8f7ea1e40e4cc0537c4967 /board | |
parent | 9f461171238e1c32ae99e7485f4dd81247470505 (diff) | |
download | u-boot-865176417afdbe96153b71080900b86f776c3a6b.tar.gz u-boot-865176417afdbe96153b71080900b86f776c3a6b.tar.bz2 u-boot-865176417afdbe96153b71080900b86f776c3a6b.zip |
board: sl28: support dynamic prompts
Depending on the boot source, set different CLI prompts. This will help
the user to figure out in which mode the bootloader was started. There
are two special modes: failsafe and SDHC boot.
Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Diffstat (limited to 'board')
-rw-r--r-- | board/kontron/sl28/sl28.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/board/kontron/sl28/sl28.c b/board/kontron/sl28/sl28.c index 54719cc01c..0576b3eae4 100644 --- a/board/kontron/sl28/sl28.c +++ b/board/kontron/sl28/sl28.c @@ -126,8 +126,28 @@ static void stop_recovery_watchdog(void) wdt_stop(dev); } +static void sl28_set_prompt(void) +{ + enum boot_source src = sl28_boot_source(); + + switch (src) { + case BOOT_SOURCE_SPI: + env_set("PS1", "[FAILSAFE] => "); + break; + case BOOT_SOURCE_SDHC: + env_set("PS1", "[SDHC] => "); + break; + default: + env_set("PS1", NULL); + break; + } +} + int fsl_board_late_init(void) { + if (IS_ENABLED(CONFIG_CMDLINE_PS_SUPPORT)) + sl28_set_prompt(); + /* * Usually, the after a board reset, the watchdog is enabled by * default. This is to supervise the bootloader boot-up. Therefore, |