U-Boot Tests for ARM Architecture

Heinrich Schuchardt xypron.debian at gmx.de
Wed Jul 22 21:07:32 CEST 2020


On 22.07.20 00:28, Brownlie, Lewis wrote:
> Hello all,
>
> I am fairly new to U-Boot, and I want to perform memory and UART tests on the ARM-based NXP LX2160A Reference Design Board using U-Boot.  In doing research I discovered the POST tests, but it seems that these are intended for MPC823E-based boards.  Is it possible/feasible to use POST to perform my tests, or is there a better way?  (I am aware of the mtest command for memory but I would like to find something better, plus this doesn't help with UART.)
>
>
> I have done a little work on the POST code, so if using POST is a viable option, here are some questions I have regarding it:
>
> If I #define CONFIG_POST in include/configs/lx2160ardb.h and build U-Boot, I receive errors that _POST_WORD_ADDR is not defined.  In looking at include/post.h, it appears that to fix this I must have CONFIG_SYS_POST_WORD_ADDR defined in lx2160ardb.h with some value.  If I #define CONFIG_SYS_POST_WORD_ADDR 0x10 in lx2160ardb.h, where 0x10 is just some dummy value, U-Boot builds with no errors, but like I said it's just a dummy value and I know it can't be used.  I don't know what exactly _POST_WORD_ADDR and CONFIG_SYS_POST_WORD_ADDR do or what value I should use.  Am I going about this in the right way, and if so where should I get the value to use for CONFIG_SYS_POST_WORD_ADDR?
>
> FWIW, this piece of code found in include/post.h is what I'm mainly looking at:
>
> #ifndef CONFIG_POST_EXTERNAL_WORD_FUNCS
> #ifdef CONFIG_SYS_POST_WORD_ADDR
> #define _POST_WORD_ADDR      CONFIG_SYS_POST_WORD_ADDR
> #else
>
> #if defined(CONFIG_ARCH_MPC8360)
> #include <linux/immap_qe.h>
> #define _POST_WORD_ADDR      (CONFIG_SYS_IMMR + CPM_POST_WORD_ADDR)
>
> #elif defined (CONFIG_MPC85xx)
> #include <asm/immap_85xx.h>
> #define _POST_WORD_ADDR      (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_PIC_OFFSET + \
>                                                             offsetof(ccsr_pic_t, tfrr))
>
> #elif defined (CONFIG_MPC86xx)
> #include <asm/immap_86xx.h>
> #define _POST_WORD_ADDR      (CONFIG_SYS_IMMR + CONFIG_SYS_MPC86xx_PIC_OFFSET + \
>                                                             offsetof(ccsr_pic_t, tfrr))
> #endif
>
> #ifndef _POST_WORD_ADDR
> #error "_POST_WORD_ADDR currently not implemented for this platform!"
> #endif
> #endif /* CONFIG_SYS_POST_WORD_ADDR */
>
>
> Thank you :)
>
> -Lewis
>

post/drivers/memory.c looks rather generic so reusing it should be feasible.

post_word_load() and and post_word_store() retrieve and save a bitmask
with bits like POST_POWERDOWN that define what test should be run.

If CONFIG_POST_EXTERNAL_WORD_FUNCS is not defined
CONFIG_SYS_POST_WORD_ADDR defines a memory address that serves for
saving the bitmask. This should work fine if you have static RAM.

If you do not want to use a memory location for communication, you can
define your own post_word_load() and and post_word_store() functions. In
this case you need to define CONFIG_POST_EXTERNAL_WORD_FUNCS.

Concerning UART testing I am wondering if you mean the UART with the
console? What specifically do you want to test?

In test/py there are a lot of tests that you cat run on your board while
communicating over the UART. Do you really need a UART specific test?
See test/py/README.md.

Best regards

Heinrich


More information about the U-Boot mailing list