All of lore.kernel.org
 help / color / mirror / Atom feed
* U-Boot Tests for ARM Architecture
@ 2020-07-21 22:28 Brownlie, Lewis
  2020-07-22 19:07 ` Heinrich Schuchardt
  0 siblings, 1 reply; 3+ messages in thread
From: Brownlie, Lewis @ 2020-07-21 22:28 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* U-Boot Tests for ARM Architecture
  2020-07-21 22:28 U-Boot Tests for ARM Architecture Brownlie, Lewis
@ 2020-07-22 19:07 ` Heinrich Schuchardt
  2020-07-22 19:32   ` [External] " Brownlie, Lewis
  0 siblings, 1 reply; 3+ messages in thread
From: Heinrich Schuchardt @ 2020-07-22 19:07 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [External] Re: U-Boot Tests for ARM Architecture
  2020-07-22 19:07 ` Heinrich Schuchardt
@ 2020-07-22 19:32   ` Brownlie, Lewis
  0 siblings, 0 replies; 3+ messages in thread
From: Brownlie, Lewis @ 2020-07-22 19:32 UTC (permalink / raw)
  To: u-boot

Thank you for your response.

I will have to look into it more to see if I should use the given post_word_load() and and post_word_store() functions or if I should define CONFIG_POST_EXTERNAL_WORD_FUNCS and create my own functions.  If I end up doing the former, I will have to define CONFIG_SYS_POST_WORD_ADDR with a memory address as you said; does it matter what address I use?  Can I use any address, or are there any I should avoid?

As for UART, I would like to run a loopback test on the board's UART, something similar to uart_post_test() in drivers/serial/serial.c.  From what I can tell from reading test/py/README.md, the tests in test/py are for testing U-Boot itself and not the board, which is not what I want.  I apologize for not making that more clear.

Thanks again,

-Lewis 

-----Original Message-----
From: Heinrich Schuchardt <xypron.debian@gmx.de> 
Sent: Wednesday, July 22, 2020 12:08 PM
To: Brownlie, Lewis <Lewis.Brownlie@Honeywell.com>; u-boot at lists.denx.de
Subject: [External] Re: U-Boot Tests for ARM Architecture

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-07-22 19:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-21 22:28 U-Boot Tests for ARM Architecture Brownlie, Lewis
2020-07-22 19:07 ` Heinrich Schuchardt
2020-07-22 19:32   ` [External] " Brownlie, Lewis

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.