]> git.sur5r.net Git - u-boot/commitdiff
km_arm: enable POST for these boards
authorValentin Longchamp <valentin.longchamp@keymile.com>
Mon, 12 Sep 2011 04:18:42 +0000 (04:18 +0000)
committerWolfgang Denk <wd@denx.de>
Wed, 5 Oct 2011 20:03:11 +0000 (22:03 +0200)
The current km_arm boards have a Power-On test jumper. When this
jumper is set, this triggers some Power-On tests on the board.

This patch enables the support of this jumper for starting the
memory_regions test when the jumper is set.

Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
Cc: Prafulla Wadaskar <prafulla@marvell.com>
board/keymile/km_arm/km_arm.c
include/configs/km/km_arm.h

index a8f2b2317aa45afbe83bfa6832e2fe20ec162498..67f158c1eb248086dbefba33eaffce51928c8f86 100644 (file)
@@ -448,6 +448,39 @@ int get_scl(void)
 }
 #endif
 
+#if defined(CONFIG_POST)
+
+#define KM_POST_EN_L   44
+#define POST_WORD_OFF  8
+
+int post_hotkeys_pressed(void)
+{
+       return !kw_gpio_get_value(KM_POST_EN_L);
+}
+
+ulong post_word_load(void)
+{
+       volatile void* addr = (void *) (gd->ram_size - BOOTCOUNT_ADDR + POST_WORD_OFF);
+       return in_le32(addr);
+
+}
+void post_word_store(ulong value)
+{
+       volatile void* addr = (void *) (gd->ram_size - BOOTCOUNT_ADDR + POST_WORD_OFF);
+       out_le32(addr, value);
+}
+
+int arch_memory_test_prepare(u32 *vstart, u32 *size, phys_addr_t *phys_offset)
+{
+       *vstart = CONFIG_SYS_SDRAM_BASE;
+
+       /* we go up to relocation plus a 1 MB margin */
+       *size = CONFIG_SYS_TEXT_BASE - (1<<20);
+
+       return 0;
+}
+#endif
+
 #if defined(CONFIG_SYS_EEPROM_WREN)
 int eeprom_write_enable(unsigned dev_addr, int state)
 {
index 71fe1499ed3e2382a3df7b9b675a6cceb0121eb6..8476eb77bb92bb5bdb65f176bf350429a145a505 100644 (file)
@@ -272,4 +272,10 @@ int get_scl(void);
 /* address for the bootcount (taken from end of RAM) */
 #define BOOTCOUNT_ADDR          (CONFIG_KM_RESERVED_PRAM)
 
+/* enable POST tests */
+#define CONFIG_POST    (CONFIG_SYS_POST_MEM_REGIONS)
+#define CONFIG_POST_SKIP_ENV_FLAGS
+#define CONFIG_POST_EXTERNAL_WORD_FUNCS
+#define CONFIG_CMD_DIAG
+
 #endif /* _CONFIG_KM_ARM_H */