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

login
register
mail settings
Submitter Valentin Longchamp
Date Aug. 3, 2011, 12:37 p.m.
Message ID <1312375027-27693-9-git-send-email-valentin.longchamp@keymile.com>
Download mbox | patch
Permalink /patch/108151/
State Superseded
Headers show

Comments

Valentin Longchamp - Aug. 3, 2011, 12:37 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>
---
 board/keymile/km_arm/km_arm.c |   11 +++++++++++
 include/configs/km/km_arm.h   |    8 ++++++++
 2 files changed, 19 insertions(+), 0 deletions(-)
Sergei Shtylyov - Aug. 4, 2011, 10:36 a.m.
Hello.

On 03-08-2011 16:37, Valentin Longchamp 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>
> ---
>   board/keymile/km_arm/km_arm.c |   11 +++++++++++
>   include/configs/km/km_arm.h   |    8 ++++++++
>   2 files changed, 19 insertions(+), 0 deletions(-)

> diff --git a/board/keymile/km_arm/km_arm.c b/board/keymile/km_arm/km_arm.c
> index a8f2b23..f12c730 100644
> --- a/board/keymile/km_arm/km_arm.c
> +++ b/board/keymile/km_arm/km_arm.c
> @@ -448,6 +448,17 @@ int get_scl(void)
>   }
>   #endif
>
> +#if defined(CONFIG_POST)
> +
> +#define KM_POST_EN_L   44
> +
> +int post_hotkeys_pressed(void)
> +{
> +	int val = kw_gpio_get_value(KM_POST_EN_L);
> +	return !val;

    WHy not just:

	return !kw_gpio_get_value(KM_POST_EN_L);

WBR, Sergei
Valentin Longchamp - Aug. 15, 2011, 9:11 a.m.
On 08/04/2011 12:36 PM, Sergei Shtylyov wrote:
> On 03-08-2011 16:37, Valentin Longchamp wrote:
> 
>>
>> +#if defined(CONFIG_POST)
>> +
>> +#define KM_POST_EN_L   44
>> +
>> +int post_hotkeys_pressed(void)
>> +{
>> +    int val = kw_gpio_get_value(KM_POST_EN_L);
>> +    return !val;
> 
>    WHy not just:
> 
>     return !kw_gpio_get_value(KM_POST_EN_L);
> 
> WBR, Sergei

Yeah, you are right. I will change it for the next version of the series.

Patch

diff --git a/board/keymile/km_arm/km_arm.c b/board/keymile/km_arm/km_arm.c
index a8f2b23..f12c730 100644
--- a/board/keymile/km_arm/km_arm.c
+++ b/board/keymile/km_arm/km_arm.c
@@ -448,6 +448,17 @@  int get_scl(void)
 }
 #endif
 
+#if defined(CONFIG_POST)
+
+#define KM_POST_EN_L   44
+
+int post_hotkeys_pressed(void)
+{
+	int val = kw_gpio_get_value(KM_POST_EN_L);
+	return !val;
+}
+#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..64ab140 100644
--- a/include/configs/km/km_arm.h
+++ b/include/configs/km/km_arm.h
@@ -271,4 +271,12 @@  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_CMD_DIAG
+
+/* we take the address after the bootcounter */
+#define CONFIG_SYS_POST_WORD_ADDR ((gd->ram_size) - BOOTCOUNT_ADDR + 4)
+
 #endif /* _CONFIG_KM_ARM_H */