diff options
author | Sekhar Nori <nsekhar@ti.com> | 2013-12-10 09:32:16 (GMT) |
---|---|---|
committer | Tom Rini <trini@ti.com> | 2013-12-19 02:14:00 (GMT) |
commit | f4af163e6c8efbc768c2c0962c7823d6363e30fe (patch) | |
tree | 08e0e5dcdb965f7a5aea3a506815dde2d4ca8619 /board | |
parent | 9f1a8cd33fec83c5e04c8d1103fb3ee2857ff2f0 (diff) | |
download | u-boot-fsl-qoriq-f4af163e6c8efbc768c2c0962c7823d6363e30fe.tar.xz |
ARM: AM43XX: Add CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG support
CONFIG_ENV_VARS_UBOOT_CONFIG, CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG and
CONFIG_BOARD_LATE_INIT is already set. Adding support to detect the
board. These variables are used by findfdt.
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Diffstat (limited to 'board')
-rw-r--r-- | board/ti/am43xx/board.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/board/ti/am43xx/board.c b/board/ti/am43xx/board.c index 4fc1a40..723d0ca 100644 --- a/board/ti/am43xx/board.c +++ b/board/ti/am43xx/board.c @@ -98,6 +98,22 @@ int board_init(void) #ifdef CONFIG_BOARD_LATE_INIT int board_late_init(void) { +#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG + char safe_string[HDR_NAME_LEN + 1]; + struct am43xx_board_id header; + + if (read_eeprom(&header) < 0) + puts("Could not get board ID.\n"); + + /* Now set variables based on the header. */ + strncpy(safe_string, (char *)header.name, sizeof(header.name)); + safe_string[sizeof(header.name)] = 0; + setenv("board_name", safe_string); + + strncpy(safe_string, (char *)header.version, sizeof(header.version)); + safe_string[sizeof(header.version)] = 0; + setenv("board_rev", safe_string); +#endif return 0; } #endif |