diff mbox series

[RFC,v4,11/28] global_data.h: add GD_FLG_HUSH_OLD_PARSER flag.

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

Commit Message

Francis Laniel June 16, 2022, 10:31 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(+)
diff mbox series

Patch

diff --git a/common/cli.c b/common/cli.c
index a7e3d84b68..ef967f4f9e 100644
--- a/common/cli.c
+++ b/common/cli.c
@@ -239,6 +239,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 805a6fd679..97c0de6398 100644
--- a/include/asm-generic/global_data.h
+++ b/include/asm-generic/global_data.h
@@ -635,6 +635,10 @@  enum gd_flags {
 	 * @GD_FLG_SMP_READY: SMP initialization is complete
 	 */
 	GD_FLG_SMP_READY = 0x80000,
+	/**
+	 * @GD_FLG_HUSH_OLD_PARSER: Use hush old parser.
+	 */
+	GD_FLG_HUSH_OLD_PARSER = 0x100000,
 };
 
 #endif /* __ASSEMBLY__ */