mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-11 15:34:55 +00:00
board: dhelectronics: Sync env variable dh_som_serial_number with SN
The env variable "SN" is used to store the serial number on DH electronics SoMs. New SoMs will use the variable "dh_som_serial_number". To ensure compatibility, these env variables are synchronized. This is achieved using callback functions. Signed-off-by: Christoph Niedermaier <cniedermaier@dh-electronics.com> Reviewed-by: Marek Vasut <marex@denx.de>
This commit is contained in:
parent
86f58ea539
commit
1c9fe756ed
2 changed files with 18 additions and 0 deletions
|
@ -11,6 +11,23 @@
|
|||
|
||||
#include "dh_common.h"
|
||||
|
||||
static int on_dh_som_serial_number(const char *name, const char *value, enum env_op op,
|
||||
int flags)
|
||||
{
|
||||
env_set("SN", value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
U_BOOT_ENV_CALLBACK(dh_som_serial_number, on_dh_som_serial_number);
|
||||
|
||||
static int on_SN(const char *name, const char *value, enum env_op op, int flags)
|
||||
{
|
||||
env_set("dh_som_serial_number", value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
U_BOOT_ENV_CALLBACK(SN, on_SN);
|
||||
|
||||
bool dh_mac_is_in_env(const char *env)
|
||||
{
|
||||
unsigned char enetaddr[6];
|
||||
|
|
|
@ -49,6 +49,7 @@ CONFIG_CMD_UUID=y
|
|||
CONFIG_CMD_WGET=y
|
||||
CONFIG_CMD_XXD=y
|
||||
CONFIG_CRC32_VERIFY=y
|
||||
CONFIG_ENV_CALLBACK_LIST_STATIC="dh_som_serial_number:dh_som_serial_number,SN:SN,"
|
||||
CONFIG_HASH_VERIFY=y
|
||||
CONFIG_MD5SUM_VERIFY=y
|
||||
CONFIG_SHA1SUM_VERIFY=y
|
||||
|
|
Loading…
Add table
Reference in a new issue