All of lore.kernel.org
 help / color / mirror / Atom feed
From: Valentin Longchamp <valentin.longchamp@keymile.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 2/8] POST: add post_log_res field for post results in global data
Date: Thu,  1 Sep 2011 17:39:21 +0200	[thread overview]
Message-ID: <1314891567-6476-3-git-send-email-valentin.longchamp@keymile.com> (raw)
In-Reply-To: <1314891567-6476-1-git-send-email-valentin.longchamp@keymile.com>

The current post_log_word in global data is currently split into 2x
16 bits: half for the test start, half for the test success.
Since we alredy have more than 16 POST tests defined and more could
be defined, this may result in an overflow and the post_output_backlog
would not work for the tests defined further of these 16 positions.

An additional field is added to global data so that we can now support up
to 32 (depending of architecture) tests. The post_log_word is only used
to record the start of the test and the new field post_log_res for the
test success (or failure). The post_output_backlog is for this change
also adapted.

Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
---
 arch/arm/include/asm/global_data.h      |    1 +
 arch/blackfin/include/asm/global_data.h |    1 +
 arch/nios2/include/asm/global_data.h    |    1 +
 arch/powerpc/include/asm/global_data.h  |    1 +
 arch/sparc/include/asm/global_data.h    |    1 +
 post/post.c                             |    9 +++++----
 6 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/arch/arm/include/asm/global_data.h b/arch/arm/include/asm/global_data.h
index 4ab17ae..efcf652 100644
--- a/arch/arm/include/asm/global_data.h
+++ b/arch/arm/include/asm/global_data.h
@@ -77,6 +77,7 @@ typedef	struct	global_data {
 	char		env_buf[32];	/* buffer for getenv() before reloc. */
 #if defined(CONFIG_POST) || defined(CONFIG_LOGBUFFER)
 	unsigned long	post_log_word; /* Record POST activities */
+	unsigned long	post_log_res; /* success of POST test */
 	unsigned long	post_init_f_time; /* When post_init_f started */
 #endif
 } gd_t;
diff --git a/arch/blackfin/include/asm/global_data.h b/arch/blackfin/include/asm/global_data.h
index eba5e93..62cd631 100644
--- a/arch/blackfin/include/asm/global_data.h
+++ b/arch/blackfin/include/asm/global_data.h
@@ -50,6 +50,7 @@ typedef struct global_data {
 	unsigned long env_valid;	/* Checksum of Environment valid? */
 #if defined(CONFIG_POST) || defined(CONFIG_LOGBUFFER)
 	unsigned long post_log_word;	/* Record POST activities */
+	unsigned long post_log_res; 	/* success of POST test */
 	unsigned long post_init_f_time;	/* When post_init_f started */
 #endif
 
diff --git a/arch/nios2/include/asm/global_data.h b/arch/nios2/include/asm/global_data.h
index 2c4a719..1f0bbe8 100644
--- a/arch/nios2/include/asm/global_data.h
+++ b/arch/nios2/include/asm/global_data.h
@@ -34,6 +34,7 @@ typedef	struct	global_data {
 	unsigned long	env_valid;	/* Checksum of Environment valid */
 #if defined(CONFIG_POST) || defined(CONFIG_LOGBUFFER)
 	unsigned long	post_log_word;	/* Record POST activities */
+	unsigned long	post_log_res; /* success of POST test */
 	unsigned long	post_init_f_time; /* When post_init_f started */
 #endif
 	void		**jt;		/* Standalone app jump table */
diff --git a/arch/powerpc/include/asm/global_data.h b/arch/powerpc/include/asm/global_data.h
index a33ca2f..fbfe8c0 100644
--- a/arch/powerpc/include/asm/global_data.h
+++ b/arch/powerpc/include/asm/global_data.h
@@ -160,6 +160,7 @@ typedef	struct	global_data {
 #endif
 #if defined(CONFIG_POST) || defined(CONFIG_LOGBUFFER)
 	unsigned long	post_log_word;  /* Record POST activities */
+	unsigned long	post_log_res; /* success of POST test */
 	unsigned long	post_init_f_time;  /* When post_init_f started */
 #endif
 #ifdef CONFIG_BOARD_TYPES
diff --git a/arch/sparc/include/asm/global_data.h b/arch/sparc/include/asm/global_data.h
index 9b14674..4b62250 100644
--- a/arch/sparc/include/asm/global_data.h
+++ b/arch/sparc/include/asm/global_data.h
@@ -58,6 +58,7 @@ typedef struct global_data {
 #endif
 #if defined(CONFIG_POST) || defined(CONFIG_LOGBUFFER)
 	unsigned long post_log_word;	/* Record POST activities */
+	unsigned long post_log_res;	/* success of POST test */
 	unsigned long post_init_f_time;	/* When post_init_f started */
 #endif
 #ifdef CONFIG_BOARD_TYPES
diff --git a/post/post.c b/post/post.c
index 1b7f2aa..03c521f 100644
--- a/post/post.c
+++ b/post/post.c
@@ -100,6 +100,7 @@ void post_bootmode_init (void)
 
 	/* Reset activity record */
 	gd->post_log_word = 0;
+	gd->post_log_res = 0;
 }
 
 int post_bootmode_get (unsigned int *last_test)
@@ -123,12 +124,12 @@ int post_bootmode_get (unsigned int *last_test)
 /* POST tests run before relocation only mark status bits .... */
 static void post_log_mark_start ( unsigned long testid )
 {
-	gd->post_log_word |= (testid)<<16;
+	gd->post_log_word |= testid;
 }
 
 static void post_log_mark_succ ( unsigned long testid )
 {
-	gd->post_log_word |= testid;
+	gd->post_log_res |= testid;
 }
 
 /* ... and the messages are output once we are relocated */
@@ -137,9 +138,9 @@ void post_output_backlog ( void )
 	int j;
 
 	for (j = 0; j < post_list_size; j++) {
-		if (gd->post_log_word & (post_list[j].testid<<16)) {
+		if (gd->post_log_word & (post_list[j].testid)) {
 			post_log ("POST %s ", post_list[j].cmd);
-			if (gd->post_log_word & post_list[j].testid)
+			if (gd->post_log_res & post_list[j].testid)
 				post_log ("PASSED\n");
 			else {
 				post_log ("FAILED\n");
-- 
1.7.1

  parent reply	other threads:[~2011-09-01 15:39 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-01 15:39 [U-Boot] [PATCH v2 0/8] POST: support for km_arm and mem_regions test definition Valentin Longchamp
2011-09-01 15:39 ` [U-Boot] [PATCH v2 1/8] POST/arm: adaptations needed for POST on ARM to work Valentin Longchamp
2011-09-01 22:11   ` Mike Frysinger
2011-09-02 12:31     ` Valentin Longchamp
2011-09-01 15:39 ` Valentin Longchamp [this message]
2011-09-01 22:12   ` [U-Boot] [PATCH v2 2/8] POST: add post_log_res field for post results in global data Mike Frysinger
2011-09-01 22:35     ` Graeme Russ
2011-09-01 15:39 ` [U-Boot] [PATCH v2 3/8] POST: make env test flags fetching optional Valentin Longchamp
2011-09-01 22:12   ` Mike Frysinger
2011-09-01 15:39 ` [U-Boot] [PATCH v2 4/8] POST: drivers/memory.c coding style cleanup Valentin Longchamp
2011-09-01 15:39 ` [U-Boot] [PATCH v2 5/8] POST: add new memory regions test Valentin Longchamp
2011-09-01 22:09   ` Mike Frysinger
2011-09-01 15:39 ` [U-Boot] [PATCH v2 6/8] POST/km_arm: add POST memory tests infrastructure Valentin Longchamp
2011-09-01 22:10   ` Mike Frysinger
2011-09-02 12:39     ` Valentin Longchamp
2011-09-02 15:25       ` Mike Frysinger
2011-09-01 15:39 ` [U-Boot] [PATCH v2 7/8] km_arm: change CONFIG_SYS_TEXT_BASE to end of RAM Valentin Longchamp
2011-09-01 15:39 ` [U-Boot] [PATCH v2 8/8] km_arm: enable POST for these boards Valentin Longchamp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1314891567-6476-3-git-send-email-valentin.longchamp@keymile.com \
    --to=valentin.longchamp@keymile.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.