summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Herzmann <thomas.herzmann@keymile.com>2012-05-04 10:55:56 +0200
committerKim Phillips <kim.phillips@freescale.com>2012-06-15 17:12:51 -0500
commit95209b66846276d1d598f579ae2dcd1988c49a53 (patch)
tree8f4b741256841516be0025c8229b56c78c4d3a13
parent5758dd7633aead9ee4d0f453cef51f2acd3df3dc (diff)
downloadu-boot-imx-95209b66846276d1d598f579ae2dcd1988c49a53.zip
u-boot-imx-95209b66846276d1d598f579ae2dcd1988c49a53.tar.gz
u-boot-imx-95209b66846276d1d598f579ae2dcd1988c49a53.tar.bz2
powerpc/83xx: configure CONFIG_POST for kmcoge5ne
kmcoge5ne starts the post tests if the testpin on the board was enabled. Currently it does simply a memory test. Signed-off-by: Thomas Herzmann <thomas.herzmann@keymile.com> Signed-off-by: Holger Brunck <holger.brunck@keymile.com> Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
-rw-r--r--board/keymile/common/common.h6
-rw-r--r--board/keymile/km83xx/km83xx.c37
-rw-r--r--include/configs/km8360.h8
3 files changed, 50 insertions, 1 deletions
diff --git a/board/keymile/common/common.h b/board/keymile/common/common.h
index db117c7..f457aa3 100644
--- a/board/keymile/common/common.h
+++ b/board/keymile/common/common.h
@@ -32,7 +32,11 @@ struct km_bec_fpga {
unsigned char res1[3];
unsigned char bprth;
unsigned char bprtl;
- unsigned char res2[6];
+ unsigned char gprt3;
+ unsigned char gprt2;
+ unsigned char gprt1;
+ unsigned char gprt0;
+ unsigned char res2[2];
unsigned char prst;
unsigned char res3[0xfff0];
unsigned char pgy_id;
diff --git a/board/keymile/km83xx/km83xx.c b/board/keymile/km83xx/km83xx.c
index a889750..f05cdfd 100644
--- a/board/keymile/km83xx/km83xx.c
+++ b/board/keymile/km83xx/km83xx.c
@@ -27,6 +27,7 @@
#include <asm/processor.h>
#include <pci.h>
#include <libfdt.h>
+#include <post.h>
#include "../common/common.h"
@@ -288,3 +289,39 @@ int hush_init_var(void)
return 0;
}
#endif
+
+#if defined(CONFIG_POST)
+int post_hotkeys_pressed(void)
+{
+ int testpin = 0;
+ struct km_bec_fpga *base =
+ (struct km_bec_fpga *)CONFIG_SYS_KMBEC_FPGA_BASE;
+ int testpin_reg = in_8(&base->CONFIG_TESTPIN_REG);
+ testpin = (testpin_reg & CONFIG_TESTPIN_MASK) != 0;
+ debug("post_hotkeys_pressed: %d\n", !testpin);
+ return testpin;
+}
+
+ulong post_word_load(void)
+{
+ void* addr = (ulong *) (CPM_POST_WORD_ADDR);
+ debug("post_word_load 0x%08lX: 0x%08X\n", (ulong)addr, in_le32(addr));
+ return in_le32(addr);
+
+}
+void post_word_store(ulong value)
+{
+ void* addr = (ulong *) (CPM_POST_WORD_ADDR);
+ debug("post_word_store 0x%08lX: 0x%08lX\n", (ulong)addr, value);
+ out_le32(addr, value);
+}
+
+int arch_memory_test_prepare(u32 *vstart, u32 *size, phys_addr_t *phys_offset)
+{
+ *vstart = CONFIG_SYS_MEMTEST_START;
+ *size = CONFIG_SYS_MEMTEST_END - CONFIG_SYS_MEMTEST_START;
+ debug("arch_memory_test_prepare 0x%08X 0x%08X\n", *vstart, *size);
+
+ return 0;
+}
+#endif
diff --git a/include/configs/km8360.h b/include/configs/km8360.h
index 230b054..7631ab6 100644
--- a/include/configs/km8360.h
+++ b/include/configs/km8360.h
@@ -266,6 +266,14 @@
BATU_BL_256M |\
BATU_VS |\
BATU_VP)
+/* enable POST tests */
+#define CONFIG_POST (CONFIG_SYS_POST_MEMORY|CONFIG_SYS_POST_MEM_REGIONS)
+#define CONFIG_POST_EXTERNAL_WORD_FUNCS /* use own functions, not generic */
+#define CPM_POST_WORD_ADDR CONFIG_SYS_MEMTEST_END
+#define CONFIG_TESTPIN_REG gprt3 /* for kmcoge5ne */
+#define CONFIG_TESTPIN_MASK 0x20 /* for kmcoge5ne */
+#define CONFIG_CMD_DIAG /* so that testpin is inquired for POST test */
+
#else
#define CONFIG_SYS_IBAT6L (0)
#define CONFIG_SYS_IBAT6U (0)