diff mbox series

[RFC,v7,10/23] global_data.h: add GD_FLG_HUSH_OLD_PARSER flag

Message ID 20230330194716.23623-11-francis.laniel@amarulasolutions.com
State RFC
Delegated to: Tom Rini
Headers show
Series Modernize U-Boot shell | expand

Commit Message

Francis Laniel March 30, 2023, 7:46 p.m. UTC
This flag is used to indicate we are using the hush parser.

Signed-off-by: Francis Laniel <francis.laniel@amarulasolutions.com>
---
 common/cli.c                      | 2 ++
 include/asm-generic/global_data.h | 4 ++++
 2 files changed, 6 insertions(+)

Comments

Simon Glass April 1, 2023, 6:32 a.m. UTC | #1
On Fri, 31 Mar 2023 at 08:49, Francis Laniel
<francis.laniel@amarulasolutions.com> wrote:
>
> This flag is used to indicate we are using the hush parser.
>
> Signed-off-by: Francis Laniel <francis.laniel@amarulasolutions.com>
> ---
>  common/cli.c                      | 2 ++
>  include/asm-generic/global_data.h | 4 ++++
>  2 files changed, 6 insertions(+)

Reviewed-by: Simon Glass <sjg@chromium.org>
diff mbox series

Patch

diff --git a/common/cli.c b/common/cli.c
index 9451e6a142..5eef0cad8c 100644
--- a/common/cli.c
+++ b/common/cli.c
@@ -255,6 +255,8 @@  void cli_loop(void)
 void cli_init(void)
 {
 #ifdef CONFIG_HUSH_PARSER
+	if (!(gd->flags & GD_FLG_HUSH_OLD_PARSER))
+		gd->flags |= GD_FLG_HUSH_OLD_PARSER;
 	u_boot_hush_start();
 #endif
 
diff --git a/include/asm-generic/global_data.h b/include/asm-generic/global_data.h
index da17ac8cbc..d61aa4346d 100644
--- a/include/asm-generic/global_data.h
+++ b/include/asm-generic/global_data.h
@@ -650,6 +650,10 @@  enum gd_flags {
 	 * @GD_FLG_FDT_CHANGED: Device tree change has been detected by tests
 	 */
 	GD_FLG_FDT_CHANGED = 0x100000,
+	/**
+	 * @GD_FLG_HUSH_OLD_PARSER: Use hush old parser.
+	 */
+	GD_FLG_HUSH_OLD_PARSER = 0x200000,
 };
 
 #endif /* __ASSEMBLY__ */