[U-Boot] [PATCH v2 1/8] POST/arm: adaptations needed for POST on ARM to work

Valentin Longchamp valentin.longchamp at keymile.com
Thu Sep 1 17:39:20 CEST 2011


For post to run on ARM, 3 things are needed:
- post_log_word to be defined in gd
- a post.h include in arch/arm/lib/board.c
- most ARM boards will set POST_WORD in RAM, so we introduce a way
 to define post_word_load/store as externs in post.h that then can
 be defined in board specific files. This is done with the
 CONFIG_POST_EXTERNAL_WORD_FUNCS #define

Signed-off-by: Valentin Longchamp <valentin.longchamp at keymile.com>
Signed-off-by: Holger Brunck <holger.brunck at keymile.com>
Cc: Mike Frysinger <vapier at gentoo.org>
---
Changes for v2:
 - introduced CONFIG_POST_EXTERNAL_WORD_FUNCS
---
 arch/arm/include/asm/global_data.h |    4 ++++
 arch/arm/lib/board.c               |    2 ++
 include/post.h                     |    8 ++++++++
 3 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/arch/arm/include/asm/global_data.h b/arch/arm/include/asm/global_data.h
index ef9959e..4ab17ae 100644
--- a/arch/arm/include/asm/global_data.h
+++ b/arch/arm/include/asm/global_data.h
@@ -75,6 +75,10 @@ typedef	struct	global_data {
 #endif
 	void		**jt;		/* jump table */
 	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_init_f_time; /* When post_init_f started */
+#endif
 } gd_t;
 
 /*
diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
index 41ef492..f929acd 100644
--- a/arch/arm/lib/board.c
+++ b/arch/arm/lib/board.c
@@ -49,6 +49,8 @@
 #include <nand.h>
 #include <onenand_uboot.h>
 #include <mmc.h>
+#include <post.h>
+#include <logbuff.h>
 
 #ifdef CONFIG_BITBANGMII
 #include <miiphy.h>
diff --git a/include/post.h b/include/post.h
index bb3138d..d859f9f 100644
--- a/include/post.h
+++ b/include/post.h
@@ -33,6 +33,7 @@
 
 #if defined(CONFIG_POST) || defined(CONFIG_LOGBUFFER)
 
+#ifndef CONFIG_POST_EXTERNAL_WORD_FUNCS
 #ifdef CONFIG_SYS_POST_WORD_ADDR
 #define _POST_WORD_ADDR	CONFIG_SYS_POST_WORD_ADDR
 #else
@@ -85,6 +86,13 @@ static inline void post_word_store (ulong value)
 {
 	out_le32((volatile void *)(_POST_WORD_ADDR), value);
 }
+
+#else
+
+extern ulong post_word_load(void);
+extern void post_word_store(ulong value);
+
+#endif /* CONFIG_POST_EXTERNAL_WORD_FUNCS */
 #endif /* defined (CONFIG_POST) || defined(CONFIG_LOGBUFFER) */
 #endif /* __ASSEMBLY__ */
 
-- 
1.7.1



More information about the U-Boot mailing list