[U-Boot,v2,3/8] POST: make env test flags fetching optional

Submitted by Valentin Longchamp on Sept. 1, 2011, 3:39 p.m.

Details

Message ID 1314891567-6476-4-git-send-email-valentin.longchamp@keymile.com
State Superseded
Headers show

Commit Message

Valentin Longchamp Sept. 1, 2011, 3:39 p.m.
Some boards have the environment variables defined in a slow EEPROM. post_run
accesses these environment variables to define which tests have to be run (in
post_get_flags). This is very slow before the code relocation on some boards
with a slow I2C EEPROM for environement variables.

This patch adds a config option to skip the fetching of the test flags in the
environment variables. The test flags assigned to the tests then only are the
ones statically defined for the test in post/tests.c.

Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
---
 post/post.c |   20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)

Comments

Mike Frysinger Sept. 1, 2011, 10:12 p.m.
On Thursday, September 01, 2011 11:39:22 Valentin Longchamp wrote:
> Some boards have the environment variables defined in a slow EEPROM.
> post_run accesses these environment variables to define which tests have
> to be run (in post_get_flags). This is very slow before the code
> relocation on some boards with a slow I2C EEPROM for environement
> variables.
> 
> This patch adds a config option to skip the fetching of the test flags in
> the environment variables. The test flags assigned to the tests then only
> are the ones statically defined for the test in post/tests.c.

Acked-by: Mike Frysinger <vapier@gentoo.org>
-mike

Patch hide | download patch | download mbox

diff --git a/post/post.c b/post/post.c
index 03c521f..8b2cb3c 100644
--- a/post/post.c
+++ b/post/post.c
@@ -170,7 +170,8 @@  static void post_bootmode_test_off (void)
 	post_word_store (word);
 }
 
-static void post_get_flags (int *test_flags)
+#ifndef CONFIG_POST_SKIP_ENV_FLAGS
+static void post_get_env_flags(int *test_flags)
 {
 	int  flag[] = {  POST_POWERON,   POST_NORMAL,   POST_SLOWTEST,
 			 POST_CRITICAL };
@@ -183,10 +184,6 @@  static void post_get_flags (int *test_flags)
 	int last;
 	int i, j;
 
-	for (j = 0; j < post_list_size; j++) {
-		test_flags[j] = post_list[j].flags;
-	}
-
 	for (i = 0; i < varnum; i++) {
 		if (getenv_f(var[i], list, sizeof (list)) <= 0)
 			continue;
@@ -224,6 +221,19 @@  static void post_get_flags (int *test_flags)
 			name = s + 1;
 		}
 	}
+}
+#endif
+
+static void post_get_flags(int *test_flags)
+{
+	int j;
+
+	for (j = 0; j < post_list_size; j++)
+		test_flags[j] = post_list[j].flags;
+
+#ifndef CONFIG_POST_SKIP_ENV_FLAGS
+	post_get_env_flags(test_flags);
+#endif
 
 	for (j = 0; j < post_list_size; j++) {
 		if (test_flags[j] & POST_POWERON) {