[U-Boot] [SPEAr Fixes PATCH 09/11] spear: Add POST memory support

Vipin Kumar vipin.kumar at st.com
Fri Nov 2 18:39:51 CET 2012


The xloader had a basic pattern read/write test with in itself. With the source
upgrading to SPL, it is now more convenient to use the Power On Self Test for
memory supported by u-boot.

This patch adds the support for memory POST test.

Signed-off-by: Vipin Kumar <vipin.kumar at st.com>
---
 arch/arm/cpu/arm926ejs/spear/cpu.c | 30 ++++++++++++++++++++++++++++++
 include/configs/spear.h            |  2 ++
 2 files changed, 32 insertions(+)

diff --git a/arch/arm/cpu/arm926ejs/spear/cpu.c b/arch/arm/cpu/arm926ejs/spear/cpu.c
index f03b2bb..d7608b2 100644
--- a/arch/arm/cpu/arm926ejs/spear/cpu.c
+++ b/arch/arm/cpu/arm926ejs/spear/cpu.c
@@ -120,3 +120,33 @@ int print_cpuinfo(void)
 	return 0;
 }
 #endif
+
+#ifdef CONFIG_POST
+int arch_memory_test_prepare(u32 *vstart, u32 *size, phys_addr_t *phys_offset)
+{
+	/*
+	 * Run the POST test on 64 MB memory starting from CONFIG_SYS_LOAD_ADDR
+	 * The assumption here is that the DDR present on board is >= 128MB.
+	 *
+	 * The test runs before relocation (after the code copy has taken
+	 * place), so it can not touch either before or after relocation areas
+	 * of U-boot
+	 *
+	 * DDR usage
+	 * <--------->|<---------------- / --------------->|<---------->
+	 *   U-boot		Area to be used for		U-boot
+	 *   before		POST test			after
+	 *   relocation						relocation
+	 */
+
+	*vstart = CONFIG_SYS_LOAD_ADDR;
+	*size = 64 << 20;
+
+	return 0;
+}
+
+void arch_memory_failure_handle(void)
+{
+	hang();
+}
+#endif
diff --git a/include/configs/spear.h b/include/configs/spear.h
index 3a73811..a8ddf54 100644
--- a/include/configs/spear.h
+++ b/include/configs/spear.h
@@ -154,6 +154,8 @@
 /* Miscellaneous configurable options */
 #define CONFIG_ARCH_CPU_INIT
 #define CONFIG_DISPLAY_CPUINFO
+#define CONFIG_POST				CONFIG_SYS_POST_MEMORY
+#define CONFIG_SYS_POST_WORD_ADDR		0x0
 
 #define CONFIG_OF_LIBFDT
 #define CONFIG_CMDLINE_TAG
-- 
1.7.11.4



More information about the U-Boot mailing list