POST: typo fix
PATCH 1/1 POST: typo fix
From: Yuri Tikhonov <[email protected]>
--- post/tests.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
post/tests.c +1 -1
@@ -270,7 +270,7 @@ struct post_test post_list[] =#if CONFIG_POST &CFG_POST_BSPEC4 CONFIG_POST_BSPEC4,#endif -#if CONFIG_POST &CFG_POST_BSPEC4 +#if CONFIG_POST &CFG_POST_BSPEC5 CONFIG_POST_BSPEC5,#endif };
Signature · 1 line
1.5.4.2
PATCH 1/1 POST: OCM test added.
From: Yuri Tikhonov <[email protected]>
Added OCM test for post layer. This version runs before all other tests but still don't interrupt post sequence on failure.
--- include/post.h | 1 + post/cpu/ppc4xx/Makefile | 2 +- post/cpu/ppc4xx/ocm.c | 91 ++++++++++++++++++++++++++++++++++++++++++++++ post/tests.c | 13 +++++++ 4 files changed, 106 insertions(+), 1 deletions(-) create mode 100644 post/cpu/ppc4xx/ocm.c
include/post.h +1 -0
@@ -102,6 +102,7 @@ extern int post_hotkeys_pressed(void);#define CFG_POST_BSPEC3 0x00040000#define CFG_POST_BSPEC4 0x00080000#define CFG_POST_BSPEC5 0x00100000 +#define CFG_POST_OCM 0x00200000#endif /* CONFIG_POST */
post/cpu/ppc4xx/Makefile +1 -1
@@ -25,6 +25,6 @@ include $(OBJTREE)/include/autoconf.mk LIB = libpostppc4xx.a AOBJS-$(CONFIG_HAS_POST) += cache_4xx.o -COBJS-$(CONFIG_HAS_POST) += cache.o denali_ecc.o ether.o fpu.o spr.o uart.o watchdog.o +COBJS-$(CONFIG_HAS_POST) += cache.o denali_ecc.o ether.o fpu.o ocm.o spr.o uart.o watchdog.o include $(TOPDIR)/post/rules.mk
post/cpu/ppc4xx/ocm.c new file +89 -0
89 lines not on this page · raw message
post/tests.c +13 -0
@@ -29,6 +29,7 @@#include <post.h> +extern int ocm_post_test (int flags);extern int cache_post_test (int flags);extern int watchdog_post_test (int flags);extern int i2c_post_test (int flags);
@@ -60,6 +61,18 @@ extern void sysmon_reloc (void);struct post_test post_list[] = { +#if CONFIG_POST & CFG_POST_OCM + { +"OCM test" , +"ocm" , +"This test checks on chip memory (OCM)." , +POST_ROM |POST_ALWAYS |POST_PREREL |POST_CRITICAL , + &ocm_post_test, +NULL , +NULL , +CFG_POST_OCM + }, +#endif #if CONFIG_POST & CFG_POST_CACHE {"Cache test" ,
Signature · 1 line
1.5.4.2
PATCH 1/1 lwmon5: enable OCM post test on lwmon5 board
From: Yuri Tikhonov <[email protected]>
--- include/configs/lwmon5.h | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)
include/configs/lwmon5.h +6 -0
@@ -88,15 +88,20 @@/* unused GPT0 COMP reg */ #define CFG_MEM_TOP_HIDE (4 << 10)/* don't use last 4kbytes */ /* 440EPx errata CHIP 11 */ +#define CFG_OCM_SIZE (16 << 10)/* Additional registers for watchdog timer post test */ #define CFG_WATCHDOG_TIME_ADDR (CFG_PERIPHERAL_BASE + GPT0_MASK2)#define CFG_WATCHDOG_FLAGS_ADDR (CFG_PERIPHERAL_BASE + GPT0_MASK1)#define CFG_DSPIC_TEST_ADDR CFG_WATCHDOG_FLAGS_ADDR +#define CFG_OCM_STATUS_ADDR CFG_WATCHDOG_FLAGS_ADDR#define CFG_WATCHDOG_MAGIC 0x12480000#define CFG_WATCHDOG_MAGIC_MASK 0xFFFF0000#define CFG_DSPIC_TEST_MASK 0x00000001 +#define CFG_OCM_STATUS_OK 0x00009A00 +#define CFG_OCM_STATUS_FAIL 0x0000A300 +#define CFG_OCM_STATUS_MASK 0x0000FF00/*----------------------------------------------------------------------- * Serial Port
@@ -162,6 +167,7 @@CFG_POST_FPU | \CFG_POST_I2C | \CFG_POST_MEMORY | \ +CFG_POST_OCM | \CFG_POST_RTC | \CFG_POST_SPR | \ CFG_POST_UART | \
Signature · 1 line
1.5.4.2
PATCH 1/1 POST: switch CFG_POST_OCM with CFG_POST_CODEC (workaround)
From: Yuri Tikhonov <[email protected]>
Switch OCM testid with codec one.The reason is that current implementation requeres POST_ROM testid to fit into lower 16 bits and codec test will never run with POST_ROM hopefully.
--- include/post.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
include/post.h +2 -2
@@ -94,7 +94,7 @@ extern int post_hotkeys_pressed(void);#define CFG_POST_SPR 0x00000400#define CFG_POST_SYSMON 0x00000800#define CFG_POST_DSP 0x00001000 -#define CFG_POST_CODEC 0x00002000 +#define CFG_POST_OCM 0x00002000#define CFG_POST_FPU 0x00004000#define CFG_POST_ECC 0x00008000#define CFG_POST_BSPEC1 0x00010000
@@ -102,7 +102,7 @@ extern int post_hotkeys_pressed(void);#define CFG_POST_BSPEC3 0x00040000#define CFG_POST_BSPEC4 0x00080000#define CFG_POST_BSPEC5 0x00100000 -#define CFG_POST_OCM 0x00200000 +#define CFG_POST_CODEC 0x00200000#endif /* CONFIG_POST */
Signature · 1 line
1.5.4.2
PATCH 1/1 POS: add POST_STOP flag
From: Yuri Tikhonov <[email protected]>
If test test marked as POST_STOP, don't run futher tests in case of test failure.
--- include/asm-arm/global_data.h | 1 + include/asm-avr32/global_data.h | 1 + include/asm-blackfin/global_data.h | 1 + include/asm-i386/global_data.h | 1 + include/asm-m68k/global_data.h | 1 + include/asm-microblaze/global_data.h | 1 + include/asm-mips/global_data.h | 1 + include/asm-nios/global_data.h | 1 + include/asm-nios2/global_data.h | 1 + include/asm-ppc/global_data.h | 1 + include/asm-sh/global_data.h | 1 + include/asm-sparc/global_data.h | 2 ++ include/post.h | 1 + post/post.c | 18 ++++++++++++++++-- 14 files changed, 30 insertions(+), 2 deletions(-)
include/asm-arm/global_data.h +1 -0
@@ -61,6 +61,7 @@ typedef struct global_data {#define GD_FLG_DEVINIT 0x00002/* Devices have been initialized */ #define GD_FLG_SILENT 0x00004/* Silent mode */ #define GD_FLG_POSTFAIL 0x00008/* Critical POST test failed */ +#define GD_FLG_POSTSTOP 0x00010/* POST seqeunce aborted */ #define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("r8")
include/asm-avr32/global_data.h +1 -0
@@ -52,6 +52,7 @@ typedef struct global_data {#define GD_FLG_DEVINIT 0x00002/* Devices have been initialized */ #define GD_FLG_SILENT 0x00004/* Silent mode */ #define GD_FLG_POSTFAIL 0x00008/* Critical POST test failed */ +#define GD_FLG_POSTSTOP 0x00010/* POST seqeunce aborted */ #define DECLARE_GLOBAL_DATA_PTR register gd_t *gd asm("r5")
include/asm-blackfin/global_data.h +1 -0
@@ -62,6 +62,7 @@ typedef struct global_data {#define GD_FLG_DEVINIT 0x00002/* Devices have been initialized */ #define GD_FLG_SILENT 0x00004/* Silent mode */ #define GD_FLG_POSTFAIL 0x00008/* Critical POST test failed */ +#define GD_FLG_POSTSTOP 0x00010/* POST seqeunce aborted */ #define DECLARE_GLOBAL_DATA_PTR register gd_t * volatile gd asm ("P5")
include/asm-i386/global_data.h +1 -0
@@ -55,6 +55,7 @@ typedef struct {#define GD_FLG_DEVINIT 0x00002/* Devices have been initialized */ #define GD_FLG_SILENT 0x00004/* Silent mode */ #define GD_FLG_POSTFAIL 0x00008/* Critical POST test failed */ +#define GD_FLG_POSTSTOP 0x00010/* POST seqeunce aborted */ extern gd_t *global_data;
include/asm-m68k/global_data.h +1 -0
@@ -73,6 +73,7 @@ typedef struct global_data {#define GD_FLG_DEVINIT 0x00002/* Devices have been initialized */ #define GD_FLG_SILENT 0x00004/* Silent mode */ #define GD_FLG_POSTFAIL 0x00008/* Critical POST test failed */ +#define GD_FLG_POSTSTOP 0x00010/* POST seqeunce aborted */ #if 0 extern gd_t *global_data;
include/asm-microblaze/global_data.h +1 -0
@@ -53,6 +53,7 @@ typedef struct global_data {#define GD_FLG_DEVINIT 0x00002/* Devices have been initialized */ #define GD_FLG_SILENT 0x00004/* Silent mode */ #define GD_FLG_POSTFAIL 0x00008/* Critical POST test failed */ +#define GD_FLG_POSTSTOP 0x00010/* POST seqeunce aborted */ #define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("r31")
include/asm-mips/global_data.h +1 -0
@@ -55,6 +55,7 @@ typedef struct global_data {#define GD_FLG_DEVINIT 0x00002/* Devices have been initialized */ #define GD_FLG_SILENT 0x00004/* Silent mode */ #define GD_FLG_POSTFAIL 0x00008/* Critical POST test failed */ +#define GD_FLG_POSTSTOP 0x00010/* POST seqeunce aborted */ #define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("k0")
include/asm-nios/global_data.h +1 -0
@@ -46,6 +46,7 @@ typedef struct global_data {#define GD_FLG_DEVINIT 0x00002/* Devices have been initialized */ #define GD_FLG_SILENT 0x00004/* Silent mode */ #define GD_FLG_POSTFAIL 0x00008/* Critical POST test failed */ +#define GD_FLG_POSTSTOP 0x00010/* POST seqeunce aborted */ #define DECLARE_GLOBAL_DATA_PTR register gd_t *gd asm ("%g7")
include/asm-nios2/global_data.h +1 -0
@@ -45,6 +45,7 @@ typedef struct global_data {#define GD_FLG_DEVINIT 0x00002/* Devices have been initialized */ #define GD_FLG_SILENT 0x00004/* Silent mode */ #define GD_FLG_POSTFAIL 0x00008/* Critical POST test failed */ +#define GD_FLG_POSTSTOP 0x00010/* POST seqeunce aborted */ #define DECLARE_GLOBAL_DATA_PTR register gd_t *gd asm ("r15")
include/asm-ppc/global_data.h +1 -0
@@ -168,6 +168,7 @@ typedef struct global_data {#define GD_FLG_DEVINIT 0x00002/* Devices have been initialized */ #define GD_FLG_SILENT 0x00004/* Silent mode */ #define GD_FLG_POSTFAIL 0x00008/* Critical POST test failed */ +#define GD_FLG_POSTSTOP 0x00010/* POST seqeunce aborted */ #if 1 #define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("r2")
include/asm-sh/global_data.h +1 -0
@@ -45,6 +45,7 @@ typedef struct global_data#define GD_FLG_DEVINIT 0x00002/* Devices have been initialized */ #define GD_FLG_SILENT 0x00004/* Silent mode */ #define GD_FLG_POSTFAIL 0x00008/* Critical POST test failed */ +#define GD_FLG_POSTSTOP 0x00010/* POST seqeunce aborted */ #define DECLARE_GLOBAL_DATA_PTR register gd_t *gd asm ("r13")
include/asm-sparc/global_data.h +2 -0
@@ -79,6 +79,8 @@ typedef struct global_data {#define GD_FLG_RELOC 0x00001/* Code was relocated to RAM */ #define GD_FLG_DEVINIT 0x00002/* Devices have been initialized */ #define GD_FLG_SILENT 0x00004/* Silent mode */ +#define GD_FLG_POSTFAIL 0x00008/* Critical POST test failed */ +#define GD_FLG_POSTSTOP 0x00010/* POST seqeunce aborted */ #define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("%g7")
include/post.h +1 -0
@@ -43,6 +43,7 @@#define POST_PREREL 0x1000/* test runs before relocation */ #define POST_CRITICAL 0x2000/* Use failbootcmd if test failed */ +#define POST_STOP 0x4000/* Interrupt POST sequence on fail */ #define POST_MEM (POST_RAM | POST_ROM)#define POST_ALWAYS (POST_NORMAL | \
post/post.c +15 -2
@@ -238,14 +238,20 @@ static int post_run_single (struct post_test *test,if (test_flags &POST_PREREL ) {if ((*test->test) (flags) ==0 )post_log_mark_succ ( test->testid ); -else if (test_flags &POST_CRITICAL ) - gd->flags |=GD_FLG_POSTFAIL ; +else { +if (test_flags &POST_CRITICAL ) + gd->flags |=GD_FLG_POSTFAIL ; +if (test_flags &POST_STOP ) + gd->flags |=GD_FLG_POSTSTOP ; + } }else {if ((*test->test) (flags) !=0 ) {post_log ("FAILED\n" );show_boot_progress (-32 );if (test_flags &POST_CRITICAL ) gd->flags |=GD_FLG_POSTFAIL ; +if (test_flags &POST_STOP ) + gd->flags |=GD_FLG_POSTSTOP ; }else post_log ("PASSED\n" );
@@ -271,6 +278,9 @@ int post_run (char *name, int flags)if (name ==NULL ) {unsigned int last; +if (gd->flags &GD_FLG_POSTSTOP ) +return 0 ; +if (post_bootmode_get (&last) &POST_POWERTEST ) {if (last &POST_FAIL_SAVE ) { last &= ~POST_FAIL_SAVE ;
@@ -285,6 +295,8 @@ int post_run (char *name, int flags) flags | POST_REBOOT, last);for (i = last +1 ; i < post_list_size; i++) { +if (gd->flags &GD_FLG_POSTSTOP ) +break ;post_run_single (post_list + i, test_flags[i], flags, i);
@@ -292,6 +304,8 @@ int post_run (char *name, int flags) } }else {for (i =0 ; i < post_list_size; i++) { +if (gd->flags &GD_FLG_POSTSTOP ) +break ;post_run_single (post_list + i, test_flags[i], flags, i);
Signature · 1 line
1.5.4.2
PATCH 1/1 POST: mark OCM test as POST_STOP
From: Yuri Tikhonov <[email protected]>
--- post/tests.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
post/tests.c +1 -1
@@ -66,7 +66,7 @@ struct post_test post_list[] ="OCM test" ,"ocm" ,"This test checks on chip memory (OCM)." , -POST_ROM |POST_ALWAYS |POST_PREREL |POST_CRITICAL , +POST_ROM |POST_ALWAYS |POST_PREREL |POST_CRITICAL |POST_STOP , &ocm_post_test,NULL , NULL,
Signature · 1 line
1.5.4.2
PATCH 1/1 POST: replace the LOGBUFF_INITIALIZED flag
From: Yuri Tikhonov <[email protected]>
This way we become able to utilize the full post_log_word for POST activities (overwise, POST ECC, which has 0x8000 ID, could be erroneously treated as started in post_output_backlog() even if there was actually no POST ECC run (because of OCM POST failure, for example).
--- common/cmd_log.c | 4 ++-- include/asm-arm/global_data.h | 1 + include/asm-avr32/global_data.h | 1 + include/asm-blackfin/global_data.h | 1 + include/asm-i386/global_data.h | 1 + include/asm-m68k/global_data.h | 1 + include/asm-microblaze/global_data.h | 1 + include/asm-mips/global_data.h | 1 + include/asm-nios/global_data.h | 1 + include/asm-nios2/global_data.h | 1 + include/asm-ppc/global_data.h | 1 + include/asm-sh/global_data.h | 1 + include/asm-sparc/global_data.h | 1 + include/logbuff.h | 2 -- 14 files changed, 14 insertions(+), 4 deletions(-)
common/cmd_log.c +2 -2
@@ -107,7 +107,7 @@ void logbuff_init_ptrs (void)if ((s =getenv ("loglevel" )) !=NULL ) console_loglevel = (int )simple_strtoul (s,NULL ,10 ); - gd->post_log_word |=LOGBUFF_INITIALIZED ; + gd->flags |=GD_FLG_LOGINIT ; }void logbuff_reset (void )
@@ -168,7 +168,7 @@ static void logbuff_puts (const char *s)void logbuff_log (char *msg) { -if ((gd->post_log_word &LOGBUFF_INITIALIZED )) { +if ((gd->flags &GD_FLG_LOGINIT )) {logbuff_printk (msg); }else {/* Can happen only for pre-relocated errors as logging */
include/asm-arm/global_data.h +1 -0
@@ -62,6 +62,7 @@ typedef struct global_data {#define GD_FLG_SILENT 0x00004/* Silent mode */ #define GD_FLG_POSTFAIL 0x00008/* Critical POST test failed */ #define GD_FLG_POSTSTOP 0x00010/* POST seqeunce aborted */ +#define GD_FLG_LOGINIT 0x00020/* Log Buffer has been initialized */ #define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("r8")
include/asm-avr32/global_data.h +1 -0
@@ -53,6 +53,7 @@ typedef struct global_data {#define GD_FLG_SILENT 0x00004/* Silent mode */ #define GD_FLG_POSTFAIL 0x00008/* Critical POST test failed */ #define GD_FLG_POSTSTOP 0x00010/* POST seqeunce aborted */ +#define GD_FLG_LOGINIT 0x00020/* Log Buf has been initialized */ #define DECLARE_GLOBAL_DATA_PTR register gd_t *gd asm("r5")
include/asm-blackfin/global_data.h +1 -0
@@ -63,6 +63,7 @@ typedef struct global_data {#define GD_FLG_SILENT 0x00004/* Silent mode */ #define GD_FLG_POSTFAIL 0x00008/* Critical POST test failed */ #define GD_FLG_POSTSTOP 0x00010/* POST seqeunce aborted */ +#define GD_FLG_LOGINIT 0x00020/* Log Buf has been initialized */ #define DECLARE_GLOBAL_DATA_PTR register gd_t * volatile gd asm ("P5")
include/asm-i386/global_data.h +1 -0
@@ -56,6 +56,7 @@ typedef struct {#define GD_FLG_SILENT 0x00004/* Silent mode */ #define GD_FLG_POSTFAIL 0x00008/* Critical POST test failed */ #define GD_FLG_POSTSTOP 0x00010/* POST seqeunce aborted */ +#define GD_FLG_LOGINIT 0x00020/* Log Buffer has been initialized */ extern gd_t *global_data;
include/asm-m68k/global_data.h +1 -0
@@ -74,6 +74,7 @@ typedef struct global_data {#define GD_FLG_SILENT 0x00004/* Silent mode */ #define GD_FLG_POSTFAIL 0x00008/* Critical POST test failed */ #define GD_FLG_POSTSTOP 0x00010/* POST seqeunce aborted */ +#define GD_FLG_LOGINIT 0x00020/* Log Buffer has been initialized */ #if 0 extern gd_t *global_data;
include/asm-microblaze/global_data.h +1 -0
@@ -54,6 +54,7 @@ typedef struct global_data {#define GD_FLG_SILENT 0x00004/* Silent mode */ #define GD_FLG_POSTFAIL 0x00008/* Critical POST test failed */ #define GD_FLG_POSTSTOP 0x00010/* POST seqeunce aborted */ +#define GD_FLG_LOGINIT 0x00020/* Log Buffer has been initialized */ #define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("r31")
include/asm-mips/global_data.h +1 -0
@@ -56,6 +56,7 @@ typedef struct global_data {#define GD_FLG_SILENT 0x00004/* Silent mode */ #define GD_FLG_POSTFAIL 0x00008/* Critical POST test failed */ #define GD_FLG_POSTSTOP 0x00010/* POST seqeunce aborted */ +#define GD_FLG_LOGINIT 0x00020/* Log Buf has been initialized */ #define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("k0")
include/asm-nios/global_data.h +1 -0
@@ -47,6 +47,7 @@ typedef struct global_data {#define GD_FLG_SILENT 0x00004/* Silent mode */ #define GD_FLG_POSTFAIL 0x00008/* Critical POST test failed */ #define GD_FLG_POSTSTOP 0x00010/* POST seqeunce aborted */ +#define GD_FLG_LOGINIT 0x00020/* Log Buffer has been initialized */ #define DECLARE_GLOBAL_DATA_PTR register gd_t *gd asm ("%g7")
include/asm-nios2/global_data.h +1 -0
@@ -46,6 +46,7 @@ typedef struct global_data {#define GD_FLG_SILENT 0x00004/* Silent mode */ #define GD_FLG_POSTFAIL 0x00008/* Critical POST test failed */ #define GD_FLG_POSTSTOP 0x00010/* POST seqeunce aborted */ +#define GD_FLG_LOGINIT 0x00020/* Log Buffer has been initialized */ #define DECLARE_GLOBAL_DATA_PTR register gd_t *gd asm ("r15")
include/asm-ppc/global_data.h +1 -0
@@ -169,6 +169,7 @@ typedef struct global_data {#define GD_FLG_SILENT 0x00004/* Silent mode */ #define GD_FLG_POSTFAIL 0x00008/* Critical POST test failed */ #define GD_FLG_POSTSTOP 0x00010/* POST seqeunce aborted */ +#define GD_FLG_LOGINIT 0x00020/* Log Buffer has been initialized */ #if 1 #define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("r2")
include/asm-sh/global_data.h +1 -0
@@ -46,6 +46,7 @@ typedef struct global_data#define GD_FLG_SILENT 0x00004/* Silent mode */ #define GD_FLG_POSTFAIL 0x00008/* Critical POST test failed */ #define GD_FLG_POSTSTOP 0x00010/* POST seqeunce aborted */ +#define GD_FLG_LOGINIT 0x00020/* Log Buffer has been initialized */ #define DECLARE_GLOBAL_DATA_PTR register gd_t *gd asm ("r13")
include/asm-sparc/global_data.h +1 -0
@@ -81,6 +81,7 @@ typedef struct global_data {#define GD_FLG_SILENT 0x00004/* Silent mode */ #define GD_FLG_POSTFAIL 0x00008/* Critical POST test failed */ #define GD_FLG_POSTSTOP 0x00010/* POST seqeunce aborted */ +#define GD_FLG_LOGINIT 0x00020/* Log Buffer has been initialized */ #define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("%g7")
include/logbuff.h +0 -2
@@ -31,8 +31,6 @@#define LOGBUFF_OVERHEAD (4096)/* Logbuffer overhead for extra info */ #define LOGBUFF_RESERVE (LOGBUFF_LEN+LOGBUFF_OVERHEAD) -#define LOGBUFF_INITIALIZED (1<<31) -/* The mapping used here has to be the same as in setup_ext_logbuff () in linux/kernel/printk */
Signature · 1 line
1.5.4.2
PATCH 1/1 POST: OCM test added.
In reply to Wolfgang DenkQuoted 32 lines · Wolfgang Denk
From: Yuri Tikhonov <[email protected]>
Added OCM test for post layer. This version runs before all other tests but still don't interrupt post sequence on failure.
Signed-off-by Ilya Yanok <[email protected]>Signed-off-by Yuri Tikhonov <[email protected]>--- include/post.h | 1 + post/cpu/ppc4xx/Makefile | 2 +- post/cpu/ppc4xx/ocm.c | 91 ++++++++++++++++++++++++++++++++++++++++++++++ post/tests.c | 13 +++++++ 4 files changed, 106 insertions(+), 1 deletions(-) create mode 100644 post/cpu/ppc4xx/ocm.cinclude/post.h +1
-0@@ -102,6 +102,7 @@ extern int post_hotkeys_pressed(void);#define CFG_POST_BSPEC3 0x00040000#define CFG_POST_BSPEC4 0x00080000#define CFG_POST_BSPEC5 0x00100000 +#define CFG_POST_OCM 0x00200000#endif /* CONFIG_POST */ post/cpu/ppc4xx/Makefile +0
-0
post/cpu/ppc4xx/Makefile include $(OBJTREE)/include/autoconf.mk · line 28
Quoted 5 lines
post/cpu/ppc4xx/Makefile +1
-1@@ -25,6 +25,6 @@ include $(OBJTREE)/include/autoconf.mk LIB = libpostppc4xx.a AOBJS-$(CONFIG_HAS_POST) += cache_4xx.o -COBJS-$(CONFIG_HAS_POST) += cache.o denali_ecc.o ether.o fpu.o spr.o uart.o watchdog.o +COBJS-$(CONFIG_HAS_POST) += cache.o denali_ecc.o ether.o fpu.o ocm.o spr.o uart.o watchdog.o
Too long please split it
Quoted 141 lines
post/cpu/ppc4xx/Makefile +0
-0include $(TOPDIR)/post/rules.mkpost/cpu/ppc4xx/ocm.c new file +89
-0@@ -0,0 +1,89 @@ +/* +* (C) Copyright 2008 Ilya Yanok, EmCraft Systems, yanok at emcraft.com +* +* Developed for DENX Software Engineering GmbH +* +* 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 <common.h> + +/* +* This test attempts to verify on-chip memory (OCM). Result is written +* to the scratch register and if test succeed it won't be run till next +* power on. +*/ + +#include <post.h> + +#include <asm/io.h> + +DECLARE_GLOBAL_DATA_PTR ; + +#define OCM_TEST_PATTERN1 0x55555555 +#define OCM_TEST_PATTERN2 0xAAAAAAAA + +#if CONFIG_POST &CFG_POST_OCM + +static uint ocm_status_read (void ) +{ +return in_be32 ((void *)CFG_OCM_STATUS_ADDR ) & +CFG_OCM_STATUS_MASK ; +} + +static void ocm_status_write (uint value) +{ +out_be32 ((void *)CFG_OCM_STATUS_ADDR , value | + (in_be32 ((void *)CFG_OCM_STATUS_ADDR ) & + ~CFG_OCM_STATUS_MASK )); +} + +static inline int ocm_test_word (uint value,uint *address) +{ +uint read_value; + + *address = value; +sync (); + read_value = *address; + +return (read_value != value); +} + +int ocm_post_test (int flags) +{ +uint old_value; +int ret =0 ; +uint *address = (uint *)CFG_OCM_BASE ; + +if (ocm_status_read () ==CFG_OCM_STATUS_OK ) +return 0 ; +for (; address < (uint *)(CFG_OCM_BASE +CFG_OCM_SIZE ); address++) { + old_value = *address; +if (ocm_test_word (OCM_TEST_PATTERN1 , address) || +ocm_test_word (OCM_TEST_PATTERN2 , address)) { + ret =1 ; + *address = old_value; +printf ("OCM POST failed at %p!\n" , address); +break ; + } + *address = old_value; + } +ocm_status_write (ret ?CFG_OCM_STATUS_FAIL :CFG_OCM_STATUS_OK ); +return ret; +} +#endif /* CONFIG_POST & CFG_POST_OCM */ post/tests.c +13
-0@@ -29,6 +29,7 @@#include <post.h> +extern int ocm_post_test (int flags);extern int cache_post_test (int flags);extern int watchdog_post_test (int flags);extern int i2c_post_test (int flags);@@ -60,6 +61,18 @@ extern void sysmon_reloc (void);struct post_test post_list[] = { +#if CONFIG_POST & CFG_POST_OCM + { +"OCM test" , +"ocm" , +"This test checks on chip memory (OCM)." , +POST_ROM |POST_ALWAYS |POST_PREREL |POST_CRITICAL , + &ocm_post_test, +NULL , +NULL , +CFG_POST_OCM + }, +#endif #if CONFIG_POST & CFG_POST_CACHE {"Cache test" ,Signature · 12 lines
1.5.4.2 ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone _______________________________________________ U-Boot-Users mailing list U-Boot-Users at lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users