world leader in high performance signal processing
Trace: » post

Das U-Boot Power On Self Tests (POST)

Starting with the 2011R1 release, Das U-Boot has built-in support for POSTs. There are many standard tests already included, and support for adding arbitrary board-specific tests.

Currently, the POSTs are executed after U-Boot has relocated to external memory and otherwise is up and running. There is no support yet for executing POSTs out of flash in the Blackfin port.

Config

There are two important defines to be familiar with for all POST code:

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

The first define (CONFIG_POST) is a bit field of which tests to enable. You can see the list of available tests in the include/post.h header file. The BSPEC tests are reserved for board specific tests.

file: include/post.h

scm failed with exit code 1:
file does not exist in git

The second define (CONFIG_CMD_DIAG) enables the diag command at runtime so you can execute specific tests on the fly.

POST Button

You can optionally execute POST when booting up. This is also the only way to execute some tests (like memory).

You can either define the int post_hotkeys_pressed(void) function in your own board code (return 1 if the button is pushed, or 0 otherwise).

If you have a button connected to a GPIO line to signal things, you can use the common implementation. Simply define CONFIG_SYS_POST_HOTKEYS_GPIO to the GPIO you wish to use.

file: include/configs/bf537-stamp.h

scm failed with exit code 1:
file does not exist in git

Specific Tests

All Blackfin boards have BSPEC1 and BSPEC2 reserved for LED and button tests respectively.

Flash

The flash test requires you to declare the range of sectors that you wish to have tested.

file: include/configs/bf537-stamp.h

scm failed with exit code 1:
file does not exist in git

If your board has more than one flash part, then define CONFIG_SYS_POST_FLASH_NUM to the one you wish to test.

GPIO LEDs

Define CONFIG_POST_BSPEC1_GPIO_LEDS to a list of GPIOs which are connected to LEDs:

file: include/configs/bf537-stamp.h

scm failed with exit code 1:
file does not exist in git

GPIO Buttons

Define CONFIG_POST_BSPEC2_GPIO_BUTTONS to a list of GPIOs which are connected to buttons, and CONFIG_POST_BSPEC2_GPIO_NAMES to a list of their names:

file: include/configs/bf537-stamp.h

scm failed with exit code 1:
file does not exist in git

Runtime

POST Button

Note that the hotkey check does not wait for you to push the button. So you most likely will need to hold it down before the board powers on so that it has a chance to trigger.

Here is a helpful list for some ADI boards with known buttons:

Board Button
BF537-STAMP SW10

diag Command

At runtime, you can execute some tests with the diag command.

To see which tests are available:

bfin> diag

To see more info about specific tests:

bfin> diag rtc flash …

To execute all tests:

bfin> diag run

To execute specific tests:

bfin> diag run rtc flash …

Board Specific Tests

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

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

You can see an example of CONFIG_POST_BSPEC# in the Blackfin code:

file: arch/blackfin/include/asm/config.h

scm failed with exit code 1:
file does not exist in git

The implementation of this test:

file: arch/blackfin/lib/post.c

scm failed with exit code 1:
file does not exist in git