U-Boot POST Memory Test

Brownlie, Lewis Lewis.Brownlie at Honeywell.com
Mon Aug 3 20:24:14 CEST 2020

Hello all,

I am working on enabling a POST-based memory test for an ARM-based processor.  I have defined CONFIG_POST CONFIG_SYS_POST_MEMORY in include/configs/<board>.h; I have also defined CONFIG_POST_EXTERNAL_WORD_FUNCS and wrote some external word functions.  U-Boot builds with no errors and works on the board; however, the memory test is not being run, and I'm trying to figure out why.  Through some printf debugging I have determined that board_init_f() and board_init_r() are calling post_run(), as it should be (discussed in doc/README.POST).  In trying to understand the code and what I can do to make this work, I have encountered some questions:

  1.  Since the memory test runs before U-Boot relocates to RAM, the memory test should be run during the post_run() call that happens in board_init_f() and not board_init_r(), correct?  (I just want to clarify that I am understanding that correctly.)

  1.  What is the purpose of post_bootmode_get() (in post/post.c)?

  1.  In post_run() (in post/post.c), I noticed that an unsigned int called "last" is declared but never initialized with a value; however, "last" is then used as if it were initialized.  Why is it that we can use this variable without initializing it, and what is the purpose of this variable?

  1.  Does memory_post_test() (as declared in post/tests.c and defined in post/drivers/memory.c) ever get called, and if so, where?

  1.  Ultimately, like I said, I am just trying to make the POST memory test work; if anyone has any suggestions as to what I can do to do this it would be greatly appreciated.

Thank you,

More information about the U-Boot mailing list