Commit 212a0cafad08b170d25a93dfd350b7ecdb033660
Committed by
Wolfgang Denk
1 parent
79843950b2
Exists in
master
and in
54 other branches
POST: make env test flags fetching optional
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>
Showing 1 changed file with 15 additions and 5 deletions Side-by-side Diff
post/post.c
... | ... | @@ -191,7 +191,8 @@ |
191 | 191 | post_word_store (word); |
192 | 192 | } |
193 | 193 | |
194 | -static void post_get_flags (int *test_flags) | |
194 | +#ifndef CONFIG_POST_SKIP_ENV_FLAGS | |
195 | +static void post_get_env_flags(int *test_flags) | |
195 | 196 | { |
196 | 197 | int flag[] = { POST_POWERON, POST_NORMAL, POST_SLOWTEST, |
197 | 198 | POST_CRITICAL }; |
... | ... | @@ -204,10 +205,6 @@ |
204 | 205 | int last; |
205 | 206 | int i, j; |
206 | 207 | |
207 | - for (j = 0; j < post_list_size; j++) { | |
208 | - test_flags[j] = post_list[j].flags; | |
209 | - } | |
210 | - | |
211 | 208 | for (i = 0; i < varnum; i++) { |
212 | 209 | if (getenv_f(var[i], list, sizeof (list)) <= 0) |
213 | 210 | continue; |
... | ... | @@ -245,6 +242,19 @@ |
245 | 242 | name = s + 1; |
246 | 243 | } |
247 | 244 | } |
245 | +} | |
246 | +#endif | |
247 | + | |
248 | +static void post_get_flags(int *test_flags) | |
249 | +{ | |
250 | + int j; | |
251 | + | |
252 | + for (j = 0; j < post_list_size; j++) | |
253 | + test_flags[j] = post_list[j].flags; | |
254 | + | |
255 | +#ifndef CONFIG_POST_SKIP_ENV_FLAGS | |
256 | + post_get_env_flags(test_flags); | |
257 | +#endif | |
248 | 258 | |
249 | 259 | for (j = 0; j < post_list_size; j++) { |
250 | 260 | if (test_flags[j] & POST_POWERON) { |