Patchwork [U-Boot,v3,8/8] km_arm: enable POST for these boards

login
register
mail settings
Submitter Valentin Longchamp
Date Sept. 2, 2011, 2:59 p.m.
Message ID <1314975550-15766-9-git-send-email-valentin.longchamp@keymile.com>
Download mbox | patch
Permalink /patch/113153/
State Accepted
Headers show

Comments

Valentin Longchamp - Sept. 2, 2011, 2:59 p.m.
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>
---
Changes for v2:
 - adapted to CONFIG_POST_EXTERNAL_WORD_FUNCS
 - implemented suggestion from Sergei
Changes for v3:
 - moved arch_memory_test_prepare from post/board/km_arm to
   board/keymile/km_arm/km_arm.c
---
 board/keymile/km_arm/km_arm.c |   32 ++++++++++++++++++++++++++++++++
 include/configs/km/km_arm.h   |    6 ++++++
 2 files changed, 38 insertions(+), 0 deletions(-)
Wolfgang Denk - Oct. 21, 2011, 10:15 p.m.
Dear Valentin Longchamp,

In message <1314975550-15766-9-git-send-email-valentin.longchamp@keymile.com> you wrote:
> 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>
> ---
> Changes for v2:
>  - adapted to CONFIG_POST_EXTERNAL_WORD_FUNCS
>  - implemented suggestion from Sergei
> Changes for v3:
>  - moved arch_memory_test_prepare from post/board/km_arm to
>    board/keymile/km_arm/km_arm.c
> ---
>  board/keymile/km_arm/km_arm.c |   32 ++++++++++++++++++++++++++++++++
>  include/configs/km/km_arm.h   |    6 ++++++
>  2 files changed, 38 insertions(+), 0 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk
Holger Brunck - Oct. 24, 2011, 7:12 a.m.
Hi Wolfgang,

On 10/22/2011 12:15 AM, Wolfgang Denk wrote:
> Dear Valentin Longchamp,
> 
> In message <1314975550-15766-9-git-send-email-valentin.longchamp@keymile.com> you wrote:
>> 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>
>> ---
>> Changes for v2:
>>  - adapted to CONFIG_POST_EXTERNAL_WORD_FUNCS
>>  - implemented suggestion from Sergei
>> Changes for v3:
>>  - moved arch_memory_test_prepare from post/board/km_arm to
>>    board/keymile/km_arm/km_arm.c
>> ---
>>  board/keymile/km_arm/km_arm.c |   32 ++++++++++++++++++++++++++++++++
>>  include/configs/km/km_arm.h   |    6 ++++++
>>  2 files changed, 38 insertions(+), 0 deletions(-)
> 
> Applied, thanks.
> 

you already committed a v4 of this patch together with the patch serie. See:
http://lists.denx.de/pipermail/u-boot/2011-October/104061.html

So could you please revert this one? Because this breaks the board support for
all our arm based boards.

Best regards
Holger
Wolfgang Denk - Oct. 24, 2011, 7:16 p.m.
Dear Holger Brunck,

In message <4EA50FF4.5030105@keymile.com> you wrote:
> 
> you already committed a v4 of this patch together with the patch serie. See:
> http://lists.denx.de/pipermail/u-boot/2011-October/104061.html

Oops.  Sorry...

> So could you please revert this one? Because this breaks the board support for
> all our arm based boards.

Done.

Best regards,

Wolfgang Denk

Patch

diff --git a/board/keymile/km_arm/km_arm.c b/board/keymile/km_arm/km_arm.c
index 69f86f5..83e6736 100644
--- a/board/keymile/km_arm/km_arm.c
+++ b/board/keymile/km_arm/km_arm.c
@@ -483,6 +483,38 @@  int get_scl(void)
 }
 #endif
 
+#if defined(CONFIG_POST)
+
+#define KM_POST_EN_L   44
+
+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 + 4);
+	return in_le32(addr);
+
+}
+void post_word_store(ulong value)
+{
+	volatile void* addr = (void *) (gd->ram_size - BOOTCOUNT_ADDR + 4);
+	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)
 {
diff --git a/include/configs/km/km_arm.h b/include/configs/km/km_arm.h
index 54c13ce..82275a6 100644
--- a/include/configs/km/km_arm.h
+++ b/include/configs/km/km_arm.h
@@ -271,4 +271,10 @@  int get_scl(void);
 /* address for the bootcount (taken from end of RAM) */
 #define BOOTCOUNT_ADDR          (CONFIG_KM_RESERVED_PRAM)
 
+/* enable POST tests with log */
+#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 */