public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] env: Setup GD_FLG_ENV_DEFAULT flag when default environment are used
@ 2016-05-30 14:11 Michal Simek
  2016-05-30 19:36 ` Alexander Graf
  2016-06-06 21:28 ` [U-Boot] " Tom Rini
  0 siblings, 2 replies; 10+ messages in thread
From: Michal Simek @ 2016-05-30 14:11 UTC (permalink / raw)
  To: u-boot

Setup flag when default environment are used to be able to
rewrite default distro boot variables based on SoC boot mode.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

I didn't find any way how to detect that default or saved variables are
used. I want to have a flag to be able to rewrite boot_targets variable
based on boot mode. Especially when SD boot mode is setup than SD should
be primary boot devices, etc.
When variables are saved boot_targets will be restored and SoC boot mode
will be ignored.
If you know better way how to do it, please let me know.

---
 common/env_common.c               | 1 +
 include/asm-generic/global_data.h | 1 +
 2 files changed, 2 insertions(+)

diff --git a/common/env_common.c b/common/env_common.c
index af59c72e1fd7..13db7dc3f755 100644
--- a/common/env_common.c
+++ b/common/env_common.c
@@ -123,6 +123,7 @@ void set_default_env(const char *s)
 		error("Environment import failed: errno = %d\n", errno);
 
 	gd->flags |= GD_FLG_ENV_READY;
+	gd->flags |= GD_FLG_ENV_DEFAULT;
 }
 
 
diff --git a/include/asm-generic/global_data.h b/include/asm-generic/global_data.h
index f2810a1bd75f..0abcbe4c0b3a 100644
--- a/include/asm-generic/global_data.h
+++ b/include/asm-generic/global_data.h
@@ -141,5 +141,6 @@ typedef struct global_data {
 #define GD_FLG_SPL_INIT		0x00400	/* spl_init() has been called	   */
 #define GD_FLG_SKIP_RELOC	0x00800	/* Don't relocate */
 #define GD_FLG_RECORD		0x01000	/* Record console */
+#define GD_FLG_ENV_DEFAULT	0x02000 /* Default variable flag */
 
 #endif /* __ASM_GENERIC_GBL_DATA_H */
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-06-06 21:34 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-30 14:11 [U-Boot] [PATCH] env: Setup GD_FLG_ENV_DEFAULT flag when default environment are used Michal Simek
2016-05-30 19:36 ` Alexander Graf
2016-05-31  5:04   ` Michal Simek
2016-05-31  6:39     ` Alexander Graf
2016-05-31  7:40       ` Michal Simek
2016-06-01 14:16         ` Alexander Graf
2016-06-01 14:21           ` Michal Simek
2016-06-01 14:24             ` Alexander Graf
2016-06-06 21:28 ` [U-Boot] " Tom Rini
2016-06-06 21:34   ` Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox