UBoot的POST(Power On Self Test)

来源:互联网 发布:棋牌类游戏的算法代码 编辑:程序博客网 时间:2024/05/29 15:09

1. POST简介

    从2011R1版本开始,Uboot内置对POST的支持。

    Code Package包含了许多标准的test cases,也支持加入任意的board-specific test cases.

    目前POST里的test cases,都是通过Uboot命令行,执行的.

    也可以,通过在Boot过程中按某个hot key,让POST code在Boot过程中,就被执行.

2. POST code相关的2个宏

    #define CONFIG_POST (CONFIG_SYS_POST_xxx|CONFIG_SYS_POST_yyy|...)

                 用于指定:需要运行哪些test cases.

    #define CONFIG_CMD_DIAG

                  User可以通过Diag命令,运行test cases.

3. include/post.h

     定义了许多test cases

    #define CONFIG_SYS_POST_RTC 0x00000001
    #define CONFIG_SYS_POST_WATCHDOG 0x00000002
    #define CONFIG_SYS_POST_MEMORY 0x00000004
    #define CONFIG_SYS_POST_CPU 0x00000008
    #define CONFIG_SYS_POST_I2C 0x00000010
    #define CONFIG_SYS_POST_CACHE 0x00000020
    #define CONFIG_SYS_POST_UART 0x00000040
    #define CONFIG_SYS_POST_ETHER 0x00000080
    #define CONFIG_SYS_POST_SPI 0x00000100
    #define CONFIG_SYS_POST_USB 0x00000200
    #define CONFIG_SYS_POST_SPR 0x00000400
    #define CONFIG_SYS_POST_SYSMON 0x00000800
    #define CONFIG_SYS_POST_DSP 0x00001000
    #define CONFIG_SYS_POST_OCM 0x00002000
    #define CONFIG_SYS_POST_FPU 0x00004000
    #define CONFIG_SYS_POST_ECC 0x00008000
    #define CONFIG_SYS_POST_BSPEC1 0x00010000
    #define CONFIG_SYS_POST_BSPEC2 0x00020000
    #define CONFIG_SYS_POST_BSPEC3 0x00040000
    #define CONFIG_SYS_POST_BSPEC4 0x00080000
    #define CONFIG_SYS_POST_BSPEC5 0x00100000
    #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

 

4. 如何添加Board Specific test

   You can use BSPEC3, BSPEC4, and BSPEC5for board specific tests. You will need to do a few things:

   (1) add the respective CONFIG_SYS_POST_BSPEC# to your CONFIG_POST
   (2) define CONFIG_POST_BSPEC# in your board config
   (3) add a prototype for the callback function to post/tests.c
   (4) define the callback function in your boards directory (boards/<boardname>/)

    可以参考例子:

    arch\blackfin\include\asm\config.h

    arch\blackfin\lib\post.c

原创粉丝点击