* [U-Boot] [PATCH 0/8 RFC] POST: support for km_arm and mem_regions test definition
@ 2011-08-03 12:36 Valentin Longchamp
2011-08-03 12:37 ` [U-Boot] [PATCH 1/8] POST/arm: adaptations needed for POST on ARM to work Valentin Longchamp
` (7 more replies)
0 siblings, 8 replies; 26+ messages in thread
From: Valentin Longchamp @ 2011-08-03 12:36 UTC (permalink / raw)
To: u-boot
This series adds support for POST on the km_arm boards. These boards use a jumper
to run some self-tests at the board power-up. There are some adaptations for POST
to run on the ARM architecture.
This series defines a new mem_regions POST test. This test also takes place before
relocation, but it only tests some regions of the RAM so that it is quicker.
Valentin Longchamp (8):
POST/arm: adaptations needed for POST on ARM to work
POST: add post_log_res field for post results in global data
POST: make env test flags fetching optional
POST: drivers/memory.c coding style cleanup
POST: add new memory regions test
POST/km_arm: add POST memory tests infrastructure
km_arm: change CONFIG_SYS_TEXT_BASE to end of RAM
km_arm: enable POST for these boards
arch/arm/include/asm/global_data.h | 5 +
arch/arm/lib/board.c | 2 +
arch/blackfin/include/asm/global_data.h | 1 +
arch/nios2/include/asm/global_data.h | 1 +
arch/powerpc/include/asm/global_data.h | 1 +
arch/sparc/include/asm/global_data.h | 1 +
board/keymile/km_arm/km_arm.c | 11 ++
include/configs/km/km_arm.h | 10 ++-
include/post.h | 7 ++
post/board/km_arm/Makefile | 29 +++++
post/board/km_arm/memory.c | 37 +++++++
post/drivers/memory.c | 171 +++++++++++++++++++------------
post/post.c | 29 ++++--
post/tests.c | 14 +++
14 files changed, 244 insertions(+), 75 deletions(-)
create mode 100644 post/board/km_arm/Makefile
create mode 100644 post/board/km_arm/memory.c
^ permalink raw reply [flat|nested] 26+ messages in thread
* [U-Boot] [PATCH 1/8] POST/arm: adaptations needed for POST on ARM to work
2011-08-03 12:36 [U-Boot] [PATCH 0/8 RFC] POST: support for km_arm and mem_regions test definition Valentin Longchamp
@ 2011-08-03 12:37 ` Valentin Longchamp
2011-08-14 19:07 ` Mike Frysinger
2011-08-03 12:37 ` [U-Boot] [PATCH 2/8] POST: add post_log_res field for post results in global data Valentin Longchamp
` (6 subsequent siblings)
7 siblings, 1 reply; 26+ messages in thread
From: Valentin Longchamp @ 2011-08-03 12:37 UTC (permalink / raw)
To: u-boot
For post to run on ARM, 3 things are needed:
- post_log_word to be defined in gd
- a post.h include in arch/arm/lib/board.c
- most ARM boards will set POST_WORD in RAM, so we need gd->ram, and
thus DECLARE_GLOBAL_DATA_PTR is needed in post.h
Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
---
arch/arm/include/asm/global_data.h | 4 ++++
arch/arm/lib/board.c | 2 ++
include/post.h | 6 ++++++
3 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/arch/arm/include/asm/global_data.h b/arch/arm/include/asm/global_data.h
index 4fc51fd..b2c336a 100644
--- a/arch/arm/include/asm/global_data.h
+++ b/arch/arm/include/asm/global_data.h
@@ -75,6 +75,10 @@ typedef struct global_data {
#endif
void **jt; /* jump table */
char env_buf[32]; /* buffer for getenv() before reloc. */
+#if defined(CONFIG_POST) || defined(CONFIG_LOGBUFFER)
+ unsigned long post_log_word; /* Record POST activities */
+ unsigned long post_init_f_time; /* When post_init_f started */
+#endif
} gd_t;
/*
diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
index 90709d0..db8abac 100644
--- a/arch/arm/lib/board.c
+++ b/arch/arm/lib/board.c
@@ -48,6 +48,8 @@
#include <nand.h>
#include <onenand_uboot.h>
#include <mmc.h>
+#include <post.h>
+#include <logbuff.h>
#ifdef CONFIG_BITBANGMII
#include <miiphy.h>
diff --git a/include/post.h b/include/post.h
index 3f259b7..0801956 100644
--- a/include/post.h
+++ b/include/post.h
@@ -76,6 +76,12 @@
#endif
#endif /* CONFIG_SYS_POST_WORD_ADDR */
+/*
+ * some ARM implementations have to use gd->ram_size, since POST_WORD is
+ * defined in RAM
+ */
+DECLARE_GLOBAL_DATA_PTR;
+
static inline ulong post_word_load (void)
{
return in_le32((volatile void *)(_POST_WORD_ADDR));
--
1.7.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [U-Boot] [PATCH 2/8] POST: add post_log_res field for post results in global data
2011-08-03 12:36 [U-Boot] [PATCH 0/8 RFC] POST: support for km_arm and mem_regions test definition Valentin Longchamp
2011-08-03 12:37 ` [U-Boot] [PATCH 1/8] POST/arm: adaptations needed for POST on ARM to work Valentin Longchamp
@ 2011-08-03 12:37 ` Valentin Longchamp
2011-08-18 10:39 ` Marek Vasut
2011-08-03 12:37 ` [U-Boot] [PATCH 3/8] POST: make env test flags fetching optional Valentin Longchamp
` (5 subsequent siblings)
7 siblings, 1 reply; 26+ messages in thread
From: Valentin Longchamp @ 2011-08-03 12:37 UTC (permalink / raw)
To: u-boot
The current post_log_word in global data is currently split into 2x
16 bits: half for the test start, half for the test success.
Since we alredy have more than 16 POST tests defined and more could
be defined, this may result in an overflow and the post_output_backlog
would not work for the tests defined further of these 16 positions.
An additional field is added to global data so that we can now support up
to 32 (depending of architecture) tests. The post_log_word is only used
to record the start of the test and the new field post_log_res for the
test success (or failure). The post_output_backlog is for this change
also adapted.
Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
---
arch/arm/include/asm/global_data.h | 1 +
arch/blackfin/include/asm/global_data.h | 1 +
arch/nios2/include/asm/global_data.h | 1 +
arch/powerpc/include/asm/global_data.h | 1 +
arch/sparc/include/asm/global_data.h | 1 +
post/post.c | 9 +++++----
6 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/arch/arm/include/asm/global_data.h b/arch/arm/include/asm/global_data.h
index b2c336a..14b9255 100644
--- a/arch/arm/include/asm/global_data.h
+++ b/arch/arm/include/asm/global_data.h
@@ -77,6 +77,7 @@ typedef struct global_data {
char env_buf[32]; /* buffer for getenv() before reloc. */
#if defined(CONFIG_POST) || defined(CONFIG_LOGBUFFER)
unsigned long post_log_word; /* Record POST activities */
+ unsigned long post_log_res; /* success of POST test */
unsigned long post_init_f_time; /* When post_init_f started */
#endif
} gd_t;
diff --git a/arch/blackfin/include/asm/global_data.h b/arch/blackfin/include/asm/global_data.h
index eba5e93..62cd631 100644
--- a/arch/blackfin/include/asm/global_data.h
+++ b/arch/blackfin/include/asm/global_data.h
@@ -50,6 +50,7 @@ typedef struct global_data {
unsigned long env_valid; /* Checksum of Environment valid? */
#if defined(CONFIG_POST) || defined(CONFIG_LOGBUFFER)
unsigned long post_log_word; /* Record POST activities */
+ unsigned long post_log_res; /* success of POST test */
unsigned long post_init_f_time; /* When post_init_f started */
#endif
diff --git a/arch/nios2/include/asm/global_data.h b/arch/nios2/include/asm/global_data.h
index 2c4a719..1f0bbe8 100644
--- a/arch/nios2/include/asm/global_data.h
+++ b/arch/nios2/include/asm/global_data.h
@@ -34,6 +34,7 @@ typedef struct global_data {
unsigned long env_valid; /* Checksum of Environment valid */
#if defined(CONFIG_POST) || defined(CONFIG_LOGBUFFER)
unsigned long post_log_word; /* Record POST activities */
+ unsigned long post_log_res; /* success of POST test */
unsigned long post_init_f_time; /* When post_init_f started */
#endif
void **jt; /* Standalone app jump table */
diff --git a/arch/powerpc/include/asm/global_data.h b/arch/powerpc/include/asm/global_data.h
index a33ca2f..fbfe8c0 100644
--- a/arch/powerpc/include/asm/global_data.h
+++ b/arch/powerpc/include/asm/global_data.h
@@ -160,6 +160,7 @@ typedef struct global_data {
#endif
#if defined(CONFIG_POST) || defined(CONFIG_LOGBUFFER)
unsigned long post_log_word; /* Record POST activities */
+ unsigned long post_log_res; /* success of POST test */
unsigned long post_init_f_time; /* When post_init_f started */
#endif
#ifdef CONFIG_BOARD_TYPES
diff --git a/arch/sparc/include/asm/global_data.h b/arch/sparc/include/asm/global_data.h
index 9b14674..4b62250 100644
--- a/arch/sparc/include/asm/global_data.h
+++ b/arch/sparc/include/asm/global_data.h
@@ -58,6 +58,7 @@ typedef struct global_data {
#endif
#if defined(CONFIG_POST) || defined(CONFIG_LOGBUFFER)
unsigned long post_log_word; /* Record POST activities */
+ unsigned long post_log_res; /* success of POST test */
unsigned long post_init_f_time; /* When post_init_f started */
#endif
#ifdef CONFIG_BOARD_TYPES
diff --git a/post/post.c b/post/post.c
index 852d6a5..61acf8d 100644
--- a/post/post.c
+++ b/post/post.c
@@ -121,6 +121,7 @@ void post_bootmode_init (void)
/* Reset activity record */
gd->post_log_word = 0;
+ gd->post_log_res = 0;
}
int post_bootmode_get (unsigned int *last_test)
@@ -144,12 +145,12 @@ int post_bootmode_get (unsigned int *last_test)
/* POST tests run before relocation only mark status bits .... */
static void post_log_mark_start ( unsigned long testid )
{
- gd->post_log_word |= (testid)<<16;
+ gd->post_log_word |= testid;
}
static void post_log_mark_succ ( unsigned long testid )
{
- gd->post_log_word |= testid;
+ gd->post_log_res |= testid;
}
/* ... and the messages are output once we are relocated */
@@ -158,9 +159,9 @@ void post_output_backlog ( void )
int j;
for (j = 0; j < post_list_size; j++) {
- if (gd->post_log_word & (post_list[j].testid<<16)) {
+ if (gd->post_log_word & (post_list[j].testid)) {
post_log ("POST %s ", post_list[j].cmd);
- if (gd->post_log_word & post_list[j].testid)
+ if (gd->post_log_res & post_list[j].testid)
post_log ("PASSED\n");
else {
post_log ("FAILED\n");
--
1.7.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [U-Boot] [PATCH 3/8] POST: make env test flags fetching optional
2011-08-03 12:36 [U-Boot] [PATCH 0/8 RFC] POST: support for km_arm and mem_regions test definition Valentin Longchamp
2011-08-03 12:37 ` [U-Boot] [PATCH 1/8] POST/arm: adaptations needed for POST on ARM to work Valentin Longchamp
2011-08-03 12:37 ` [U-Boot] [PATCH 2/8] POST: add post_log_res field for post results in global data Valentin Longchamp
@ 2011-08-03 12:37 ` Valentin Longchamp
2011-08-03 12:37 ` [U-Boot] [PATCH 4/8] POST: drivers/memory.c coding style cleanup Valentin Longchamp
` (4 subsequent siblings)
7 siblings, 0 replies; 26+ messages in thread
From: Valentin Longchamp @ 2011-08-03 12:37 UTC (permalink / raw)
To: u-boot
Some boards have the environment variables defined in a slow EEPROM. post_run
accesses these environment variables to define which tests have to be run (in
post_get_flags). This is very slow before the code relocation on some boards
with a slow I2C EEPROM for environement variables.
This patch adds a config option to skip the fetching of the test flags in the
environment variables. The test flags assigned to the tests then only are the
ones statically defined for the test in post/tests.c.
Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
---
post/post.c | 20 +++++++++++++++-----
1 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/post/post.c b/post/post.c
index 61acf8d..1ee0a29 100644
--- a/post/post.c
+++ b/post/post.c
@@ -191,7 +191,8 @@ static void post_bootmode_test_off (void)
post_word_store (word);
}
-static void post_get_flags (int *test_flags)
+#ifndef CONFIG_POST_SKIP_ENV_FLAGS
+static void post_get_env_flags(int *test_flags)
{
int flag[] = { POST_POWERON, POST_NORMAL, POST_SLOWTEST,
POST_CRITICAL };
@@ -204,10 +205,6 @@ static void post_get_flags (int *test_flags)
int last;
int i, j;
- for (j = 0; j < post_list_size; j++) {
- test_flags[j] = post_list[j].flags;
- }
-
for (i = 0; i < varnum; i++) {
if (getenv_f(var[i], list, sizeof (list)) <= 0)
continue;
@@ -245,6 +242,19 @@ static void post_get_flags (int *test_flags)
name = s + 1;
}
}
+}
+#endif
+
+static void post_get_flags(int *test_flags)
+{
+ int j;
+
+ for (j = 0; j < post_list_size; j++)
+ test_flags[j] = post_list[j].flags;
+
+#ifndef CONFIG_POST_SKIP_ENV_FLAGS
+ post_get_env_flags(test_flags);
+#endif
for (j = 0; j < post_list_size; j++) {
if (test_flags[j] & POST_POWERON) {
--
1.7.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [U-Boot] [PATCH 4/8] POST: drivers/memory.c coding style cleanup
2011-08-03 12:36 [U-Boot] [PATCH 0/8 RFC] POST: support for km_arm and mem_regions test definition Valentin Longchamp
` (2 preceding siblings ...)
2011-08-03 12:37 ` [U-Boot] [PATCH 3/8] POST: make env test flags fetching optional Valentin Longchamp
@ 2011-08-03 12:37 ` Valentin Longchamp
2011-08-14 19:14 ` Mike Frysinger
2011-08-03 12:37 ` [U-Boot] [PATCH 5/8] POST: add new memory regions test Valentin Longchamp
` (3 subsequent siblings)
7 siblings, 1 reply; 26+ messages in thread
From: Valentin Longchamp @ 2011-08-03 12:37 UTC (permalink / raw)
To: u-boot
This is needed for a further patch adding a new memory test.
Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
---
post/drivers/memory.c | 113 +++++++++++++++++++++++++------------------------
1 files changed, 57 insertions(+), 56 deletions(-)
diff --git a/post/drivers/memory.c b/post/drivers/memory.c
index c2b711e..69c5dbe 100644
--- a/post/drivers/memory.c
+++ b/post/drivers/memory.c
@@ -250,7 +250,7 @@ static int memory_post_dataline(unsigned long long * pmem)
hi = (temp64>>32) & 0xffffffff;
lo = temp64 & 0xffffffff;
- post_log ("Memory (date line) error at %08x, "
+ post_log("Memory (date line) error at %08x, "
"wrote %08x%08x, read %08x%08x !\n",
pmem, pathi, patlo, hi, lo);
ret = -1;
@@ -281,7 +281,7 @@ static int memory_post_addrline(ulong *testaddr, ulong *base, ulong size)
}
#endif
if(readback == *testaddr) {
- post_log ("Memory (address line) error at %08x<->%08x, "
+ post_log("Memory (address line) error at %08x<->%08x, "
"XOR value %08x !\n",
testaddr, target, xor);
ret = -1;
@@ -291,7 +291,7 @@ static int memory_post_addrline(ulong *testaddr, ulong *base, ulong size)
return ret;
}
-static int memory_post_test1 (unsigned long start,
+static int memory_post_test1(unsigned long start,
unsigned long size,
unsigned long val)
{
@@ -303,13 +303,13 @@ static int memory_post_test1 (unsigned long start,
for (i = 0; i < size / sizeof (ulong); i++) {
mem[i] = val;
if (i % 1024 == 0)
- WATCHDOG_RESET ();
+ WATCHDOG_RESET();
}
- for (i = 0; i < size / sizeof (ulong) && ret == 0; i++) {
+ for (i = 0; i < size / sizeof (ulong) && !ret; i++) {
readback = mem[i];
if (readback != val) {
- post_log ("Memory error at %08x, "
+ post_log("Memory error at %08x, "
"wrote %08x, read %08x !\n",
mem + i, val, readback);
@@ -317,13 +317,13 @@ static int memory_post_test1 (unsigned long start,
break;
}
if (i % 1024 == 0)
- WATCHDOG_RESET ();
+ WATCHDOG_RESET();
}
return ret;
}
-static int memory_post_test2 (unsigned long start, unsigned long size)
+static int memory_post_test2(unsigned long start, unsigned long size)
{
unsigned long i;
ulong *mem = (ulong *) start;
@@ -333,13 +333,13 @@ static int memory_post_test2 (unsigned long start, unsigned long size)
for (i = 0; i < size / sizeof (ulong); i++) {
mem[i] = 1 << (i % 32);
if (i % 1024 == 0)
- WATCHDOG_RESET ();
+ WATCHDOG_RESET();
}
- for (i = 0; i < size / sizeof (ulong) && ret == 0; i++) {
+ for (i = 0; i < size / sizeof (ulong) && !ret; i++) {
readback = mem[i];
if (readback != (1 << (i % 32))) {
- post_log ("Memory error at %08x, "
+ post_log("Memory error at %08x, "
"wrote %08x, read %08x !\n",
mem + i, 1 << (i % 32), readback);
@@ -347,13 +347,13 @@ static int memory_post_test2 (unsigned long start, unsigned long size)
break;
}
if (i % 1024 == 0)
- WATCHDOG_RESET ();
+ WATCHDOG_RESET();
}
return ret;
}
-static int memory_post_test3 (unsigned long start, unsigned long size)
+static int memory_post_test3(unsigned long start, unsigned long size)
{
unsigned long i;
ulong *mem = (ulong *) start;
@@ -363,13 +363,13 @@ static int memory_post_test3 (unsigned long start, unsigned long size)
for (i = 0; i < size / sizeof (ulong); i++) {
mem[i] = i;
if (i % 1024 == 0)
- WATCHDOG_RESET ();
+ WATCHDOG_RESET();
}
- for (i = 0; i < size / sizeof (ulong) && ret == 0; i++) {
+ for (i = 0; i < size / sizeof (ulong) && !ret; i++) {
readback = mem[i];
if (readback != i) {
- post_log ("Memory error at %08x, "
+ post_log("Memory error at %08x, "
"wrote %08x, read %08x !\n",
mem + i, i, readback);
@@ -377,13 +377,13 @@ static int memory_post_test3 (unsigned long start, unsigned long size)
break;
}
if (i % 1024 == 0)
- WATCHDOG_RESET ();
+ WATCHDOG_RESET();
}
return ret;
}
-static int memory_post_test4 (unsigned long start, unsigned long size)
+static int memory_post_test4(unsigned long start, unsigned long size)
{
unsigned long i;
ulong *mem = (ulong *) start;
@@ -393,13 +393,13 @@ static int memory_post_test4 (unsigned long start, unsigned long size)
for (i = 0; i < size / sizeof (ulong); i++) {
mem[i] = ~i;
if (i % 1024 == 0)
- WATCHDOG_RESET ();
+ WATCHDOG_RESET();
}
- for (i = 0; i < size / sizeof (ulong) && ret == 0; i++) {
+ for (i = 0; i < size / sizeof (ulong) && !ret; i++) {
readback = mem[i];
if (readback != ~i) {
- post_log ("Memory error at %08x, "
+ post_log("Memory error@%08x, "
"wrote %08x, read %08x !\n",
mem + i, ~i, readback);
@@ -407,47 +407,48 @@ static int memory_post_test4 (unsigned long start, unsigned long size)
break;
}
if (i % 1024 == 0)
- WATCHDOG_RESET ();
+ WATCHDOG_RESET();
}
return ret;
}
-static int memory_post_tests (unsigned long start, unsigned long size)
+static int memory_post_tests(unsigned long start, unsigned long size)
{
int ret = 0;
- if (ret == 0)
- ret = memory_post_dataline ((unsigned long long *)start);
- WATCHDOG_RESET ();
- if (ret == 0)
- ret = memory_post_addrline ((ulong *)start, (ulong *)start, size);
- WATCHDOG_RESET ();
- if (ret == 0)
- ret = memory_post_addrline ((ulong *)(start + size - 8),
+ if (!ret)
+ ret = memory_post_dataline((unsigned long long *)start);
+ WATCHDOG_RESET();
+ if (!ret)
+ ret = memory_post_addrline((ulong *)start, (ulong *)start,
+ size);
+ WATCHDOG_RESET();
+ if (!ret)
+ ret = memory_post_addrline((ulong *)(start + size - 8),
(ulong *)start, size);
- WATCHDOG_RESET ();
- if (ret == 0)
- ret = memory_post_test1 (start, size, 0x00000000);
- WATCHDOG_RESET ();
- if (ret == 0)
- ret = memory_post_test1 (start, size, 0xffffffff);
- WATCHDOG_RESET ();
- if (ret == 0)
- ret = memory_post_test1 (start, size, 0x55555555);
- WATCHDOG_RESET ();
- if (ret == 0)
- ret = memory_post_test1 (start, size, 0xaaaaaaaa);
- WATCHDOG_RESET ();
- if (ret == 0)
- ret = memory_post_test2 (start, size);
- WATCHDOG_RESET ();
- if (ret == 0)
- ret = memory_post_test3 (start, size);
- WATCHDOG_RESET ();
- if (ret == 0)
- ret = memory_post_test4 (start, size);
- WATCHDOG_RESET ();
+ WATCHDOG_RESET();
+ if (!ret)
+ ret = memory_post_test1(start, size, 0x00000000);
+ WATCHDOG_RESET();
+ if (!ret)
+ ret = memory_post_test1(start, size, 0xffffffff);
+ WATCHDOG_RESET();
+ if (!ret)
+ ret = memory_post_test1(start, size, 0x55555555);
+ WATCHDOG_RESET();
+ if (!ret)
+ ret = memory_post_test1(start, size, 0xaaaaaaaa);
+ WATCHDOG_RESET();
+ if (!ret)
+ ret = memory_post_test2(start, size);
+ WATCHDOG_RESET();
+ if (!ret)
+ ret = memory_post_test3(start, size);
+ WATCHDOG_RESET();
+ if (!ret)
+ ret = memory_post_test4(start, size);
+ WATCHDOG_RESET();
return ret;
}
@@ -502,11 +503,11 @@ int memory_post_test(int flags)
ret = memory_post_tests(vstart, memsize);
} else { /* POST_NORMAL */
unsigned long i;
- for (i = 0; i < (memsize >> 20) && ret == 0; i++) {
- if (ret == 0)
+ for (i = 0; i < (memsize >> 20) && !ret; i++) {
+ if (!ret)
ret = memory_post_tests(vstart +
(i << 20), 0x800);
- if (ret == 0)
+ if (!ret)
ret = memory_post_tests(vstart +
(i << 20) + 0xff800, 0x800);
}
--
1.7.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [U-Boot] [PATCH 5/8] POST: add new memory regions test
2011-08-03 12:36 [U-Boot] [PATCH 0/8 RFC] POST: support for km_arm and mem_regions test definition Valentin Longchamp
` (3 preceding siblings ...)
2011-08-03 12:37 ` [U-Boot] [PATCH 4/8] POST: drivers/memory.c coding style cleanup Valentin Longchamp
@ 2011-08-03 12:37 ` Valentin Longchamp
2011-08-03 12:37 ` [U-Boot] [PATCH 6/8] POST/km_arm: add POST memory tests infrastructure Valentin Longchamp
` (2 subsequent siblings)
7 siblings, 0 replies; 26+ messages in thread
From: Valentin Longchamp @ 2011-08-03 12:37 UTC (permalink / raw)
To: u-boot
This test is similar to the actual POST memory test but quicker and
far less complete. It checks the address and data lines and then only
tests some regularly placed sub regions of the RAM.
This can be useful when we want to test the RAM but we do not have enough
time to run the full memory test.
The POST memory test code was rearranged in order to avoid code duplication
between the two tests but the memory test functionnality remains the same.
Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
---
include/post.h | 1 +
post/drivers/memory.c | 78 +++++++++++++++++++++++++++++++++++++------------
post/tests.c | 14 +++++++++
3 files changed, 74 insertions(+), 19 deletions(-)
diff --git a/include/post.h b/include/post.h
index 0801956..e13d320 100644
--- a/include/post.h
+++ b/include/post.h
@@ -193,6 +193,7 @@ extern int post_hotkeys_pressed(void);
#define CONFIG_SYS_POST_CODEC 0x00200000
#define CONFIG_SYS_POST_COPROC 0x00400000
#define CONFIG_SYS_POST_FLASH 0x00800000
+#define CONFIG_SYS_POST_MEM_REGIONS 0x01000000
#endif /* CONFIG_POST */
diff --git a/post/drivers/memory.c b/post/drivers/memory.c
index 69c5dbe..69973c0 100644
--- a/post/drivers/memory.c
+++ b/post/drivers/memory.c
@@ -153,7 +153,7 @@
#include <post.h>
#include <watchdog.h>
-#if CONFIG_POST & CONFIG_SYS_POST_MEMORY
+#if CONFIG_POST & (CONFIG_SYS_POST_MEMORY | CONFIG_SYS_POST_MEM_REGIONS)
DECLARE_GLOBAL_DATA_PTR;
@@ -413,23 +413,29 @@ static int memory_post_test4(unsigned long start, unsigned long size)
return ret;
}
-static int memory_post_tests(unsigned long start, unsigned long size)
+static int memory_post_test_lines(unsigned long start, unsigned long size)
{
int ret = 0;
- if (!ret)
- ret = memory_post_dataline((unsigned long long *)start);
+ ret = memory_post_dataline((unsigned long long *)start);
WATCHDOG_RESET();
if (!ret)
ret = memory_post_addrline((ulong *)start, (ulong *)start,
- size);
+ size);
WATCHDOG_RESET();
if (!ret)
- ret = memory_post_addrline((ulong *)(start + size - 8),
- (ulong *)start, size);
+ ret = memory_post_addrline((ulong *)(start+size-8),
+ (ulong *)start, size);
WATCHDOG_RESET();
- if (!ret)
- ret = memory_post_test1(start, size, 0x00000000);
+
+ return ret;
+}
+
+static int memory_post_test_patterns(unsigned long start, unsigned long size)
+{
+ int ret = 0;
+
+ ret = memory_post_test1(start, size, 0x00000000);
WATCHDOG_RESET();
if (!ret)
ret = memory_post_test1(start, size, 0xffffffff);
@@ -453,6 +459,33 @@ static int memory_post_tests(unsigned long start, unsigned long size)
return ret;
}
+static int memory_post_test_regions(unsigned long start, unsigned long size)
+{
+ unsigned long i;
+ int ret = 0;
+
+ for (i = 0; i < (size >> 20) && (!ret); i++) {
+ if (!ret)
+ ret = memory_post_test_patterns(i << 20, 0x800);
+ if (!ret)
+ ret = memory_post_test_patterns((i << 20) + 0xff800,
+ 0x800);
+ }
+
+ return ret;
+}
+
+static int memory_post_tests(unsigned long start, unsigned long size)
+{
+ int ret = 0;
+
+ ret = memory_post_test_lines(start, size);
+ if (!ret)
+ ret = memory_post_test_patterns(start, size);
+
+ return ret;
+}
+
/*
* !! this is only valid, if you have contiguous memory banks !!
*/
@@ -490,6 +523,21 @@ void arch_memory_failure_handle(void)
return;
}
+int memory_regions_post_test(int flags)
+{
+ int ret = 0;
+ phys_addr_t phys_offset = 0;
+ u32 memsize, vstart;
+
+ arch_memory_test_prepare(&vstart, &memsize, &phys_offset);
+
+ ret = memory_post_test_lines(vstart, memsize);
+ if (!ret)
+ ret = memory_post_test_regions(vstart, memsize);
+
+ return ret;
+}
+
int memory_post_test(int flags)
{
int ret = 0;
@@ -502,15 +550,7 @@ int memory_post_test(int flags)
if (flags & POST_SLOWTEST) {
ret = memory_post_tests(vstart, memsize);
} else { /* POST_NORMAL */
- unsigned long i;
- for (i = 0; i < (memsize >> 20) && !ret; i++) {
- if (!ret)
- ret = memory_post_tests(vstart +
- (i << 20), 0x800);
- if (!ret)
- ret = memory_post_tests(vstart +
- (i << 20) + 0xff800, 0x800);
- }
+ ret = memory_post_test_regions(vstart, memsize);
}
} while (!ret &&
!arch_memory_test_advance(&vstart, &memsize, &phys_offset));
@@ -522,4 +562,4 @@ int memory_post_test(int flags)
return ret;
}
-#endif /* CONFIG_POST & CONFIG_SYS_POST_MEMORY */
+#endif /* CONFIG_POST&(CONFIG_SYS_POST_MEMORY|CONFIG_SYS_POST_MEM_REGIONS) */
diff --git a/post/tests.c b/post/tests.c
index bfb9cb5..c3f4d9c 100644
--- a/post/tests.c
+++ b/post/tests.c
@@ -55,6 +55,7 @@ extern int fpga_post_test (int flags);
extern int lwmon5_watchdog_post_test(int flags);
extern int sysmon1_post_test(int flags);
extern int coprocessor_post_test(int flags);
+extern int memory_regions_post_test(int flags);
extern int sysmon_init_f (void);
@@ -316,6 +317,19 @@ struct post_test post_list[] =
CONFIG_SYS_POST_FLASH
},
#endif
+#if CONFIG_POST & CONFIG_SYS_POST_MEM_REGIONS
+ {
+ "Memory regions test",
+ "mem_regions",
+ "This test checks regularly placed regions of the RAM.",
+ POST_ROM | POST_SLOWTEST | POST_PREREL,
+ &memory_regions_post_test,
+ NULL,
+ NULL,
+ CONFIG_SYS_POST_MEM_REGIONS
+ },
+#endif
+
};
unsigned int post_list_size = ARRAY_SIZE(post_list);
--
1.7.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [U-Boot] [PATCH 6/8] POST/km_arm: add POST memory tests infrastructure
2011-08-03 12:36 [U-Boot] [PATCH 0/8 RFC] POST: support for km_arm and mem_regions test definition Valentin Longchamp
` (4 preceding siblings ...)
2011-08-03 12:37 ` [U-Boot] [PATCH 5/8] POST: add new memory regions test Valentin Longchamp
@ 2011-08-03 12:37 ` Valentin Longchamp
2011-08-14 19:49 ` Mike Frysinger
2011-08-03 12:37 ` [U-Boot] [PATCH 7/8] km_arm: change CONFIG_SYS_TEXT_BASE to end of RAM Valentin Longchamp
2011-08-03 12:37 ` [U-Boot] [PATCH 8/8] km_arm: enable POST for these boards Valentin Longchamp
7 siblings, 1 reply; 26+ messages in thread
From: Valentin Longchamp @ 2011-08-03 12:37 UTC (permalink / raw)
To: u-boot
This patch adds a board support for km_arm in the POST framework.
It consists of a memory test configuration with the redefinition of
the arch_memory_test_prepare function.
Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
---
post/board/km_arm/Makefile | 29 +++++++++++++++++++++++++++++
post/board/km_arm/memory.c | 37 +++++++++++++++++++++++++++++++++++++
2 files changed, 66 insertions(+), 0 deletions(-)
create mode 100644 post/board/km_arm/Makefile
create mode 100644 post/board/km_arm/memory.c
diff --git a/post/board/km_arm/Makefile b/post/board/km_arm/Makefile
new file mode 100644
index 0000000..6e8a494
--- /dev/null
+++ b/post/board/km_arm/Makefile
@@ -0,0 +1,29 @@
+#
+# (C) Copyright 2002-2006
+# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+include $(OBJTREE)/include/autoconf.mk
+
+LIB = libpostkm_arm.o
+
+COBJS-$(CONFIG_HAS_POST) += memory.o
+
+include $(TOPDIR)/post/rules.mk
diff --git a/post/board/km_arm/memory.c b/post/board/km_arm/memory.c
new file mode 100644
index 0000000..dc466a6
--- /dev/null
+++ b/post/board/km_arm/memory.c
@@ -0,0 +1,37 @@
+/*
+ * (C) Copyright 2011
+ * Valentin Longchamp, Keymile AG Bern, <valentin.longchamp@keymile.com>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301 USA
+ */
+
+#include <common.h>
+#include <post.h>
+
+int arch_memory_test_prepare(u32 *vstart, u32 *size, phys_addr_t *phys_offset)
+{
+ bd_t *bd = gd->bd;
+
+ *vstart = CONFIG_SYS_SDRAM_BASE;
+
+ /* we go up to relocation plus a 1 MB margin */
+ *size = CONFIG_SYS_TEXT_BASE - (1<<20);
+
+ return 0;
+}
--
1.7.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [U-Boot] [PATCH 7/8] km_arm: change CONFIG_SYS_TEXT_BASE to end of RAM
2011-08-03 12:36 [U-Boot] [PATCH 0/8 RFC] POST: support for km_arm and mem_regions test definition Valentin Longchamp
` (5 preceding siblings ...)
2011-08-03 12:37 ` [U-Boot] [PATCH 6/8] POST/km_arm: add POST memory tests infrastructure Valentin Longchamp
@ 2011-08-03 12:37 ` Valentin Longchamp
2011-08-03 12:37 ` [U-Boot] [PATCH 8/8] km_arm: enable POST for these boards Valentin Longchamp
7 siblings, 0 replies; 26+ messages in thread
From: Valentin Longchamp @ 2011-08-03 12:37 UTC (permalink / raw)
To: u-boot
This allows to test a larger part of the RAM in the memory tests.
Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
---
include/configs/km/km_arm.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/configs/km/km_arm.h b/include/configs/km/km_arm.h
index b1243ad..54c13ce 100644
--- a/include/configs/km/km_arm.h
+++ b/include/configs/km/km_arm.h
@@ -54,7 +54,7 @@
#include "asm/arch/config.h"
-#define CONFIG_SYS_TEXT_BASE 0x04000000 /* code address after reloc */
+#define CONFIG_SYS_TEXT_BASE 0x07d00000 /* code address after reloc */
#define CONFIG_SYS_MEMTEST_START 0x00400000 /* 4M */
#define CONFIG_SYS_MEMTEST_END 0x007fffff /*(_8M -1) */
#define CONFIG_SYS_LOAD_ADDR 0x00800000 /* default load adr- 8M */
--
1.7.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [U-Boot] [PATCH 8/8] km_arm: enable POST for these boards
2011-08-03 12:36 [U-Boot] [PATCH 0/8 RFC] POST: support for km_arm and mem_regions test definition Valentin Longchamp
` (6 preceding siblings ...)
2011-08-03 12:37 ` [U-Boot] [PATCH 7/8] km_arm: change CONFIG_SYS_TEXT_BASE to end of RAM Valentin Longchamp
@ 2011-08-03 12:37 ` Valentin Longchamp
2011-08-04 10:36 ` Sergei Shtylyov
7 siblings, 1 reply; 26+ messages in thread
From: Valentin Longchamp @ 2011-08-03 12:37 UTC (permalink / raw)
To: u-boot
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;
+}
+#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 */
--
1.7.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [U-Boot] [PATCH 8/8] km_arm: enable POST for these boards
2011-08-03 12:37 ` [U-Boot] [PATCH 8/8] km_arm: enable POST for these boards Valentin Longchamp
@ 2011-08-04 10:36 ` Sergei Shtylyov
2011-08-15 9:11 ` Valentin Longchamp
0 siblings, 1 reply; 26+ messages in thread
From: Sergei Shtylyov @ 2011-08-04 10:36 UTC (permalink / raw)
To: u-boot
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
^ permalink raw reply [flat|nested] 26+ messages in thread
* [U-Boot] [PATCH 1/8] POST/arm: adaptations needed for POST on ARM to work
2011-08-03 12:37 ` [U-Boot] [PATCH 1/8] POST/arm: adaptations needed for POST on ARM to work Valentin Longchamp
@ 2011-08-14 19:07 ` Mike Frysinger
2011-08-15 9:09 ` Valentin Longchamp
0 siblings, 1 reply; 26+ messages in thread
From: Mike Frysinger @ 2011-08-14 19:07 UTC (permalink / raw)
To: u-boot
On Wednesday, August 03, 2011 08:37:00 Valentin Longchamp wrote:
> --- a/include/post.h
> +++ b/include/post.h
>
> +/*
> + * some ARM implementations have to use gd->ram_size, since POST_WORD is
> + * defined in RAM
> + */
> +DECLARE_GLOBAL_DATA_PTR;
i'm not sure about this. no other header has been allowed to do this in the
past, and i dont think we should start now.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110814/42854d03/attachment.pgp
^ permalink raw reply [flat|nested] 26+ messages in thread
* [U-Boot] [PATCH 4/8] POST: drivers/memory.c coding style cleanup
2011-08-03 12:37 ` [U-Boot] [PATCH 4/8] POST: drivers/memory.c coding style cleanup Valentin Longchamp
@ 2011-08-14 19:14 ` Mike Frysinger
0 siblings, 0 replies; 26+ messages in thread
From: Mike Frysinger @ 2011-08-14 19:14 UTC (permalink / raw)
To: u-boot
Acked-by: Mike Frysinger <vapier@gentoo.org>
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110814/ea5cf477/attachment.pgp
^ permalink raw reply [flat|nested] 26+ messages in thread
* [U-Boot] [PATCH 6/8] POST/km_arm: add POST memory tests infrastructure
2011-08-03 12:37 ` [U-Boot] [PATCH 6/8] POST/km_arm: add POST memory tests infrastructure Valentin Longchamp
@ 2011-08-14 19:49 ` Mike Frysinger
2011-08-15 9:10 ` Valentin Longchamp
2011-08-18 10:44 ` Marek Vasut
0 siblings, 2 replies; 26+ messages in thread
From: Mike Frysinger @ 2011-08-14 19:49 UTC (permalink / raw)
To: u-boot
On Wednesday, August 03, 2011 08:37:05 Valentin Longchamp wrote:
> This patch adds a board support for km_arm in the POST framework.
> It consists of a memory test configuration with the redefinition of
> the arch_memory_test_prepare function.
>
> Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
> Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
> ---
> post/board/km_arm/Makefile | 29 +++++++++++++++++++++++++++++
> post/board/km_arm/memory.c | 37 +++++++++++++++++++++++++++++++++++++
i'm not sure post/board/<board>/ is something we want to continue. putting
the post logic into your normal board/<board>/ dir works fine. might i
suggest board/km_arm/post.c ...
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110814/54e1ead2/attachment.pgp
^ permalink raw reply [flat|nested] 26+ messages in thread
* [U-Boot] [PATCH 1/8] POST/arm: adaptations needed for POST on ARM to work
2011-08-14 19:07 ` Mike Frysinger
@ 2011-08-15 9:09 ` Valentin Longchamp
2011-08-16 18:03 ` Mike Frysinger
0 siblings, 1 reply; 26+ messages in thread
From: Valentin Longchamp @ 2011-08-15 9:09 UTC (permalink / raw)
To: u-boot
On 08/14/2011 09:07 PM, Mike Frysinger wrote:
> On Wednesday, August 03, 2011 08:37:00 Valentin Longchamp wrote:
>> --- a/include/post.h
>> +++ b/include/post.h
>>
>> +/*
>> + * some ARM implementations have to use gd->ram_size, since POST_WORD is
>> + * defined in RAM
>> + */
>> +DECLARE_GLOBAL_DATA_PTR;
>
> i'm not sure about this. no other header has been allowed to do this in the
> past, and i dont think we should start now.
> -mike
OK. Then we should move the post_word_load and post_word_store function to
post/post.c. Would this be accepted ?
--
Valentin Longchamp
Embedded Software Engineer
Hardware and Chip Integration
______________________________________
KEYMILE AG
Schwarzenburgstr. 73
CH-3097 Liebefeld
Phone +41 31 377 1318
Fax +41 31 377 1212
valentin.longchamp at keymile.com
www.keymile.com
______________________________________
KEYMILE: A Specialist as a Partner
^ permalink raw reply [flat|nested] 26+ messages in thread
* [U-Boot] [PATCH 6/8] POST/km_arm: add POST memory tests infrastructure
2011-08-14 19:49 ` Mike Frysinger
@ 2011-08-15 9:10 ` Valentin Longchamp
2011-08-18 10:44 ` Marek Vasut
1 sibling, 0 replies; 26+ messages in thread
From: Valentin Longchamp @ 2011-08-15 9:10 UTC (permalink / raw)
To: u-boot
On 08/14/2011 09:49 PM, Mike Frysinger wrote:
> On Wednesday, August 03, 2011 08:37:05 Valentin Longchamp wrote:
>> This patch adds a board support for km_arm in the POST framework.
>> It consists of a memory test configuration with the redefinition of
>> the arch_memory_test_prepare function.
>>
>> Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
>> Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
>> ---
>> post/board/km_arm/Makefile | 29 +++++++++++++++++++++++++++++
>> post/board/km_arm/memory.c | 37 +++++++++++++++++++++++++++++++++++++
>
> i'm not sure post/board/<board>/ is something we want to continue. putting
> the post logic into your normal board/<board>/ dir works fine. might i
> suggest board/km_arm/post.c ...
> -mike
Fine for me, I will change it for the next version of the series.
--
Valentin Longchamp
Embedded Software Engineer
Hardware and Chip Integration
______________________________________
KEYMILE AG
Schwarzenburgstr. 73
CH-3097 Liebefeld
Phone +41 31 377 1318
Fax +41 31 377 1212
valentin.longchamp at keymile.com
www.keymile.com
______________________________________
KEYMILE: A Specialist as a Partner
^ permalink raw reply [flat|nested] 26+ messages in thread
* [U-Boot] [PATCH 8/8] km_arm: enable POST for these boards
2011-08-04 10:36 ` Sergei Shtylyov
@ 2011-08-15 9:11 ` Valentin Longchamp
0 siblings, 0 replies; 26+ messages in thread
From: Valentin Longchamp @ 2011-08-15 9:11 UTC (permalink / raw)
To: u-boot
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.
--
Valentin Longchamp
Embedded Software Engineer
Hardware and Chip Integration
______________________________________
KEYMILE AG
Schwarzenburgstr. 73
CH-3097 Liebefeld
Phone +41 31 377 1318
Fax +41 31 377 1212
valentin.longchamp at keymile.com
www.keymile.com
______________________________________
KEYMILE: A Specialist as a Partner
^ permalink raw reply [flat|nested] 26+ messages in thread
* [U-Boot] [PATCH 1/8] POST/arm: adaptations needed for POST on ARM to work
2011-08-15 9:09 ` Valentin Longchamp
@ 2011-08-16 18:03 ` Mike Frysinger
2011-08-18 10:07 ` Marek Vasut
0 siblings, 1 reply; 26+ messages in thread
From: Mike Frysinger @ 2011-08-16 18:03 UTC (permalink / raw)
To: u-boot
On Monday, August 15, 2011 05:09:42 Valentin Longchamp wrote:
> On 08/14/2011 09:07 PM, Mike Frysinger wrote:
> > On Wednesday, August 03, 2011 08:37:00 Valentin Longchamp wrote:
> >> --- a/include/post.h
> >> +++ b/include/post.h
> >>
> >> +/*
> >> + * some ARM implementations have to use gd->ram_size, since POST_WORD
> >> is + * defined in RAM
> >> + */
> >> +DECLARE_GLOBAL_DATA_PTR;
> >
> > i'm not sure about this. no other header has been allowed to do this in
> > the past, and i dont think we should start now.
>
> OK. Then we should move the post_word_load and post_word_store function to
> post/post.c. Would this be accepted ?
that would add overhead that most people dont need. i guess the only other
option would be to add a CONFIG_POST_EXTERNAL_WORD_FUNCS and then post.h would
just define the two funcs as externs. it'd be up to the board porters to
define them however they want.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110816/73142da2/attachment.pgp
^ permalink raw reply [flat|nested] 26+ messages in thread
* [U-Boot] [PATCH 1/8] POST/arm: adaptations needed for POST on ARM to work
2011-08-16 18:03 ` Mike Frysinger
@ 2011-08-18 10:07 ` Marek Vasut
2011-08-18 14:31 ` Mike Frysinger
0 siblings, 1 reply; 26+ messages in thread
From: Marek Vasut @ 2011-08-18 10:07 UTC (permalink / raw)
To: u-boot
On Tuesday, August 16, 2011 08:03:54 PM Mike Frysinger wrote:
> On Monday, August 15, 2011 05:09:42 Valentin Longchamp wrote:
> > On 08/14/2011 09:07 PM, Mike Frysinger wrote:
> > > On Wednesday, August 03, 2011 08:37:00 Valentin Longchamp wrote:
> > >> --- a/include/post.h
> > >> +++ b/include/post.h
> > >>
> > >> +/*
> > >> + * some ARM implementations have to use gd->ram_size, since POST_WORD
> > >> is + * defined in RAM
> > >> + */
> > >> +DECLARE_GLOBAL_DATA_PTR;
> > >
> > > i'm not sure about this. no other header has been allowed to do this
> > > in the past, and i dont think we should start now.
> >
> > OK. Then we should move the post_word_load and post_word_store function
> > to post/post.c. Would this be accepted ?
>
> that would add overhead that most people dont need. i guess the only other
> option would be to add a CONFIG_POST_EXTERNAL_WORD_FUNCS and then post.h
> would just define the two funcs as externs. it'd be up to the board
> porters to define them however they want.
> -mike
We don't want externs. Why would moving it into post.c introduce any overhead ?
^ permalink raw reply [flat|nested] 26+ messages in thread
* [U-Boot] [PATCH 2/8] POST: add post_log_res field for post results in global data
2011-08-03 12:37 ` [U-Boot] [PATCH 2/8] POST: add post_log_res field for post results in global data Valentin Longchamp
@ 2011-08-18 10:39 ` Marek Vasut
2011-08-18 11:00 ` Valentin Longchamp
0 siblings, 1 reply; 26+ messages in thread
From: Marek Vasut @ 2011-08-18 10:39 UTC (permalink / raw)
To: u-boot
On Wednesday, August 03, 2011 02:37:01 PM Valentin Longchamp wrote:
> The current post_log_word in global data is currently split into 2x
> 16 bits: half for the test start, half for the test success.
> Since we alredy have more than 16 POST tests defined and more could
> be defined, this may result in an overflow and the post_output_backlog
> would not work for the tests defined further of these 16 positions.
>
> An additional field is added to global data so that we can now support up
> to 32 (depending of architecture) tests. The post_log_word is only used
> to record the start of the test and the new field post_log_res for the
> test success (or failure). The post_output_backlog is for this change
> also adapted.
>
> Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
[...]
> @@ -144,12 +145,12 @@ int post_bootmode_get (unsigned int *last_test)
> /* POST tests run before relocation only mark status bits .... */
> static void post_log_mark_start ( unsigned long testid )
> {
> - gd->post_log_word |= (testid)<<16;
> + gd->post_log_word |= testid;
I think you can just assign it if you changed the meaning. Still, what if we
will have more than 32 tests?
> }
>
> static void post_log_mark_succ ( unsigned long testid )
> {
> - gd->post_log_word |= testid;
> + gd->post_log_res |= testid;
> }
^ permalink raw reply [flat|nested] 26+ messages in thread
* [U-Boot] [PATCH 6/8] POST/km_arm: add POST memory tests infrastructure
2011-08-14 19:49 ` Mike Frysinger
2011-08-15 9:10 ` Valentin Longchamp
@ 2011-08-18 10:44 ` Marek Vasut
2011-09-02 15:25 ` Mike Frysinger
1 sibling, 1 reply; 26+ messages in thread
From: Marek Vasut @ 2011-08-18 10:44 UTC (permalink / raw)
To: u-boot
On Sunday, August 14, 2011 09:49:27 PM Mike Frysinger wrote:
> On Wednesday, August 03, 2011 08:37:05 Valentin Longchamp wrote:
> > This patch adds a board support for km_arm in the POST framework.
> > It consists of a memory test configuration with the redefinition of
> > the arch_memory_test_prepare function.
> >
> > Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
> > Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
> > ---
> >
> > post/board/km_arm/Makefile | 29 +++++++++++++++++++++++++++++
> > post/board/km_arm/memory.c | 37 +++++++++++++++++++++++++++++++++++++
>
> i'm not sure post/board/<board>/ is something we want to continue. putting
> the post logic into your normal board/<board>/ dir works fine. might i
> suggest board/km_arm/post.c ...
> -mike
post/board/... seems fine to me actually ... there might be more post tests for
the board so poluting usual board directory would be stupid.
^ permalink raw reply [flat|nested] 26+ messages in thread
* [U-Boot] [PATCH 2/8] POST: add post_log_res field for post results in global data
2011-08-18 10:39 ` Marek Vasut
@ 2011-08-18 11:00 ` Valentin Longchamp
2011-08-18 12:56 ` Marek Vasut
0 siblings, 1 reply; 26+ messages in thread
From: Valentin Longchamp @ 2011-08-18 11:00 UTC (permalink / raw)
To: u-boot
On 08/18/2011 12:39 PM, Marek Vasut wrote:
> On Wednesday, August 03, 2011 02:37:01 PM Valentin Longchamp wrote:
>> The current post_log_word in global data is currently split into 2x
>> 16 bits: half for the test start, half for the test success.
>> Since we alredy have more than 16 POST tests defined and more could
>> be defined, this may result in an overflow and the post_output_backlog
>> would not work for the tests defined further of these 16 positions.
>>
>> An additional field is added to global data so that we can now support up
>> to 32 (depending of architecture) tests. The post_log_word is only used
>> to record the start of the test and the new field post_log_res for the
>> test success (or failure). The post_output_backlog is for this change
>> also adapted.
>>
>> Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
>
> [...]
>
>> @@ -144,12 +145,12 @@ int post_bootmode_get (unsigned int *last_test)
>> /* POST tests run before relocation only mark status bits .... */
>> static void post_log_mark_start ( unsigned long testid )
>> {
>> - gd->post_log_word |= (testid)<<16;
>> + gd->post_log_word |= testid;
>
> I think you can just assign it if you changed the meaning. Still, what if we
> will have more than 32 tests?
>
Yes, this will not work anymore when we have more than 32 tests. But we already
have more than 16 tests so there was already a flaw. This at least corrects this
flaw.
The problem is that this has to stay in the global_data that has to remain
small, so a u32 for bit setting has the great advantage of being small.
--
Valentin Longchamp
Embedded Software Engineer
Hardware and Chip Integration
______________________________________
KEYMILE AG
Schwarzenburgstr. 73
CH-3097 Liebefeld
Phone +41 31 377 1318
Fax +41 31 377 1212
valentin.longchamp at keymile.com
www.keymile.com
______________________________________
KEYMILE: A Specialist as a Partner
^ permalink raw reply [flat|nested] 26+ messages in thread
* [U-Boot] [PATCH 2/8] POST: add post_log_res field for post results in global data
2011-08-18 11:00 ` Valentin Longchamp
@ 2011-08-18 12:56 ` Marek Vasut
0 siblings, 0 replies; 26+ messages in thread
From: Marek Vasut @ 2011-08-18 12:56 UTC (permalink / raw)
To: u-boot
On Thursday, August 18, 2011 01:00:21 PM Valentin Longchamp wrote:
> On 08/18/2011 12:39 PM, Marek Vasut wrote:
> > On Wednesday, August 03, 2011 02:37:01 PM Valentin Longchamp wrote:
> >> The current post_log_word in global data is currently split into 2x
> >> 16 bits: half for the test start, half for the test success.
> >> Since we alredy have more than 16 POST tests defined and more could
> >> be defined, this may result in an overflow and the post_output_backlog
> >> would not work for the tests defined further of these 16 positions.
> >>
> >> An additional field is added to global data so that we can now support
> >> up to 32 (depending of architecture) tests. The post_log_word is only
> >> used to record the start of the test and the new field post_log_res for
> >> the test success (or failure). The post_output_backlog is for this
> >> change also adapted.
> >>
> >> Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
> >
> > [...]
> >
> >> @@ -144,12 +145,12 @@ int post_bootmode_get (unsigned int *last_test)
> >>
> >> /* POST tests run before relocation only mark status bits .... */
> >> static void post_log_mark_start ( unsigned long testid )
> >> {
> >>
> >> - gd->post_log_word |= (testid)<<16;
> >> + gd->post_log_word |= testid;
> >
> > I think you can just assign it if you changed the meaning. Still, what if
> > we will have more than 32 tests?
>
> Yes, this will not work anymore when we have more than 32 tests. But we
> already have more than 16 tests so there was already a flaw. This at least
> corrects this flaw.
>
> The problem is that this has to stay in the global_data that has to remain
> small, so a u32 for bit setting has the great advantage of being small.
I'd love to see a more competent test framework which would run in later stages
of boot. That'll remove the huge load of tests that's on the POST framework.
Detlev, any suggestions ? ;-)
^ permalink raw reply [flat|nested] 26+ messages in thread
* [U-Boot] [PATCH 1/8] POST/arm: adaptations needed for POST on ARM to work
2011-08-18 10:07 ` Marek Vasut
@ 2011-08-18 14:31 ` Mike Frysinger
2011-08-18 17:01 ` Marek Vasut
0 siblings, 1 reply; 26+ messages in thread
From: Mike Frysinger @ 2011-08-18 14:31 UTC (permalink / raw)
To: u-boot
On Thursday, August 18, 2011 06:07:06 Marek Vasut wrote:
> On Tuesday, August 16, 2011 08:03:54 PM Mike Frysinger wrote:
> > On Monday, August 15, 2011 05:09:42 Valentin Longchamp wrote:
> > > On 08/14/2011 09:07 PM, Mike Frysinger wrote:
> > > > On Wednesday, August 03, 2011 08:37:00 Valentin Longchamp wrote:
> > > >> --- a/include/post.h
> > > >> +++ b/include/post.h
> > > >>
> > > >> +/*
> > > >> + * some ARM implementations have to use gd->ram_size, since
> > > >> POST_WORD is + * defined in RAM
> > > >> + */
> > > >> +DECLARE_GLOBAL_DATA_PTR;
> > > >
> > > > i'm not sure about this. no other header has been allowed to do this
> > > > in the past, and i dont think we should start now.
> > >
> > > OK. Then we should move the post_word_load and post_word_store function
> > > to post/post.c. Would this be accepted ?
> >
> > that would add overhead that most people dont need. i guess the only
> > other option would be to add a CONFIG_POST_EXTERNAL_WORD_FUNCS and then
> > post.h would just define the two funcs as externs. it'd be up to the
> > board porters to define them however they want.
>
> We don't want externs. Why would moving it into post.c introduce any
> overhead ?
because the current code expands into a single memory read/write for many
arches. moving it into post.c already means making it into an extern and now
people have to call an external function instead of inlining the memory
access.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110818/694883a9/attachment.pgp
^ permalink raw reply [flat|nested] 26+ messages in thread
* [U-Boot] [PATCH 1/8] POST/arm: adaptations needed for POST on ARM to work
2011-08-18 14:31 ` Mike Frysinger
@ 2011-08-18 17:01 ` Marek Vasut
2011-08-18 17:42 ` Mike Frysinger
0 siblings, 1 reply; 26+ messages in thread
From: Marek Vasut @ 2011-08-18 17:01 UTC (permalink / raw)
To: u-boot
On Thursday, August 18, 2011 04:31:09 PM Mike Frysinger wrote:
> On Thursday, August 18, 2011 06:07:06 Marek Vasut wrote:
> > On Tuesday, August 16, 2011 08:03:54 PM Mike Frysinger wrote:
> > > On Monday, August 15, 2011 05:09:42 Valentin Longchamp wrote:
> > > > On 08/14/2011 09:07 PM, Mike Frysinger wrote:
> > > > > On Wednesday, August 03, 2011 08:37:00 Valentin Longchamp wrote:
> > > > >> --- a/include/post.h
> > > > >> +++ b/include/post.h
> > > > >>
> > > > >> +/*
> > > > >> + * some ARM implementations have to use gd->ram_size, since
> > > > >> POST_WORD is + * defined in RAM
> > > > >> + */
> > > > >> +DECLARE_GLOBAL_DATA_PTR;
> > > > >
> > > > > i'm not sure about this. no other header has been allowed to do
> > > > > this in the past, and i dont think we should start now.
> > > >
> > > > OK. Then we should move the post_word_load and post_word_store
> > > > function to post/post.c. Would this be accepted ?
> > >
> > > that would add overhead that most people dont need. i guess the only
> > > other option would be to add a CONFIG_POST_EXTERNAL_WORD_FUNCS and then
> > > post.h would just define the two funcs as externs. it'd be up to the
> > > board porters to define them however they want.
> >
> > We don't want externs. Why would moving it into post.c introduce any
> > overhead ?
>
> because the current code expands into a single memory read/write for many
> arches. moving it into post.c already means making it into an extern and
> now people have to call an external function instead of inlining the
> memory access.
I don't think I follow you here ... why won't you be able to inline that stuff if
it's in post.c ?
> -mike
^ permalink raw reply [flat|nested] 26+ messages in thread
* [U-Boot] [PATCH 1/8] POST/arm: adaptations needed for POST on ARM to work
2011-08-18 17:01 ` Marek Vasut
@ 2011-08-18 17:42 ` Mike Frysinger
0 siblings, 0 replies; 26+ messages in thread
From: Mike Frysinger @ 2011-08-18 17:42 UTC (permalink / raw)
To: u-boot
On Thursday, August 18, 2011 13:01:56 Marek Vasut wrote:
> On Thursday, August 18, 2011 04:31:09 PM Mike Frysinger wrote:
> > On Thursday, August 18, 2011 06:07:06 Marek Vasut wrote:
> > > On Tuesday, August 16, 2011 08:03:54 PM Mike Frysinger wrote:
> > > > On Monday, August 15, 2011 05:09:42 Valentin Longchamp wrote:
> > > > > On 08/14/2011 09:07 PM, Mike Frysinger wrote:
> > > > > > On Wednesday, August 03, 2011 08:37:00 Valentin Longchamp wrote:
> > > > > >> --- a/include/post.h
> > > > > >> +++ b/include/post.h
> > > > > >>
> > > > > >> +/*
> > > > > >> + * some ARM implementations have to use gd->ram_size, since
> > > > > >> POST_WORD is + * defined in RAM
> > > > > >> + */
> > > > > >> +DECLARE_GLOBAL_DATA_PTR;
> > > > > >
> > > > > > i'm not sure about this. no other header has been allowed to do
> > > > > > this in the past, and i dont think we should start now.
> > > > >
> > > > > OK. Then we should move the post_word_load and post_word_store
> > > > > function to post/post.c. Would this be accepted ?
> > > >
> > > > that would add overhead that most people dont need. i guess the only
> > > > other option would be to add a CONFIG_POST_EXTERNAL_WORD_FUNCS and
> > > > then post.h would just define the two funcs as externs. it'd be up
> > > > to the board porters to define them however they want.
> > >
> > > We don't want externs. Why would moving it into post.c introduce any
> > > overhead ?
> >
> > because the current code expands into a single memory read/write for many
> > arches. moving it into post.c already means making it into an extern and
> > now people have to call an external function instead of inlining the
> > memory access.
>
> I don't think I follow you here ... why won't you be able to inline that
> stuff if it's in post.c ?
grep the tree. post.c isnt the only consumer of these funcs.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110818/0f474f10/attachment.pgp
^ permalink raw reply [flat|nested] 26+ messages in thread
* [U-Boot] [PATCH 6/8] POST/km_arm: add POST memory tests infrastructure
2011-08-18 10:44 ` Marek Vasut
@ 2011-09-02 15:25 ` Mike Frysinger
0 siblings, 0 replies; 26+ messages in thread
From: Mike Frysinger @ 2011-09-02 15:25 UTC (permalink / raw)
To: u-boot
On Thursday, August 18, 2011 06:44:34 Marek Vasut wrote:
> On Sunday, August 14, 2011 09:49:27 PM Mike Frysinger wrote:
> > On Wednesday, August 03, 2011 08:37:05 Valentin Longchamp wrote:
> > > This patch adds a board support for km_arm in the POST framework.
> > > It consists of a memory test configuration with the redefinition of
> > > the arch_memory_test_prepare function.
> > >
> > > Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
> > > Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
> > > ---
> > >
> > > post/board/km_arm/Makefile | 29 +++++++++++++++++++++++++++++
> > > post/board/km_arm/memory.c | 37
> > > +++++++++++++++++++++++++++++++++++++
> >
> > i'm not sure post/board/<board>/ is something we want to continue.
> > putting the post logic into your normal board/<board>/ dir works fine.
> > might i suggest board/km_arm/post.c ...
>
> post/board/... seems fine to me actually ... there might be more post tests
> for the board so poluting usual board directory would be stupid.
no it wouldnt. post tests that are board specific belong in the board
specific location: board/<board>/. creating a mirror of that existing
hierarchy is stupid, and most board dirs have very few files, so there really
isn't all that much to clutter up in the first place.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110902/50dd8add/attachment.pgp
^ permalink raw reply [flat|nested] 26+ messages in thread
end of thread, other threads:[~2011-09-02 15:25 UTC | newest]
Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-03 12:36 [U-Boot] [PATCH 0/8 RFC] POST: support for km_arm and mem_regions test definition Valentin Longchamp
2011-08-03 12:37 ` [U-Boot] [PATCH 1/8] POST/arm: adaptations needed for POST on ARM to work Valentin Longchamp
2011-08-14 19:07 ` Mike Frysinger
2011-08-15 9:09 ` Valentin Longchamp
2011-08-16 18:03 ` Mike Frysinger
2011-08-18 10:07 ` Marek Vasut
2011-08-18 14:31 ` Mike Frysinger
2011-08-18 17:01 ` Marek Vasut
2011-08-18 17:42 ` Mike Frysinger
2011-08-03 12:37 ` [U-Boot] [PATCH 2/8] POST: add post_log_res field for post results in global data Valentin Longchamp
2011-08-18 10:39 ` Marek Vasut
2011-08-18 11:00 ` Valentin Longchamp
2011-08-18 12:56 ` Marek Vasut
2011-08-03 12:37 ` [U-Boot] [PATCH 3/8] POST: make env test flags fetching optional Valentin Longchamp
2011-08-03 12:37 ` [U-Boot] [PATCH 4/8] POST: drivers/memory.c coding style cleanup Valentin Longchamp
2011-08-14 19:14 ` Mike Frysinger
2011-08-03 12:37 ` [U-Boot] [PATCH 5/8] POST: add new memory regions test Valentin Longchamp
2011-08-03 12:37 ` [U-Boot] [PATCH 6/8] POST/km_arm: add POST memory tests infrastructure Valentin Longchamp
2011-08-14 19:49 ` Mike Frysinger
2011-08-15 9:10 ` Valentin Longchamp
2011-08-18 10:44 ` Marek Vasut
2011-09-02 15:25 ` Mike Frysinger
2011-08-03 12:37 ` [U-Boot] [PATCH 7/8] km_arm: change CONFIG_SYS_TEXT_BASE to end of RAM Valentin Longchamp
2011-08-03 12:37 ` [U-Boot] [PATCH 8/8] km_arm: enable POST for these boards Valentin Longchamp
2011-08-04 10:36 ` Sergei Shtylyov
2011-08-15 9:11 ` Valentin Longchamp
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.