From patchwork Fri Sep 2 14:59:06 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Valentin Longchamp X-Patchwork-Id: 113154 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 73DE0B6F6F for ; Sat, 3 Sep 2011 01:00:42 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7D1B528196; Fri, 2 Sep 2011 17:00:06 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LumiBdBnuMCH; Fri, 2 Sep 2011 17:00:06 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BEDEB281DE; Fri, 2 Sep 2011 16:59:27 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B3D1A281BF for ; Fri, 2 Sep 2011 16:59:22 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0Jd9dV2bg3JE for ; Fri, 2 Sep 2011 16:59:21 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail.ch.keymile.com (mail.ch.keymile.com [193.17.201.103]) by theia.denx.de (Postfix) with SMTP id 1F02F28190 for ; Fri, 2 Sep 2011 16:59:14 +0200 (CEST) Received: from SRVCHBER1212.ch.keymile.net ([172.31.32.9]) by eSafe SMTP Relay 1314887018; Fri, 02 Sep 2011 16:48:22 +0200 Received: from chber1-10533x.ch.keymile.net ([172.31.40.3]) by SRVCHBER1212.ch.keymile.net with Microsoft SMTPSVC(6.0.3790.4675); Fri, 2 Sep 2011 16:59:12 +0200 From: Valentin Longchamp To: u-boot@lists.denx.de Date: Fri, 2 Sep 2011 16:59:06 +0200 Message-Id: <1314975550-15766-5-git-send-email-valentin.longchamp@keymile.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1314975550-15766-1-git-send-email-valentin.longchamp@keymile.com> References: <1314975550-15766-1-git-send-email-valentin.longchamp@keymile.com> X-OriginalArrivalTime: 02 Sep 2011 14:59:12.0548 (UTC) FILETIME=[E0393E40:01CC6980] X-ESAFE-STATUS: Mail allowed X-ESAFE-DETAILS: Cc: Valentin Longchamp , Holger Brunck Subject: [U-Boot] [PATCH v3 4/8] POST: make env test flags fetching optional X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de 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 Signed-off-by: Holger Brunck Acked-by: Mike Frysinger --- post/post.c | 20 +++++++++++++++----- 1 files changed, 15 insertions(+), 5 deletions(-) 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) {