summaryrefslogtreecommitdiff
path: root/board/dhelectronics
diff options
context:
space:
mode:
authorChristoph Niedermaier <[email protected]>2024-12-07 00:04:20 +0100
committerFabio Estevam <[email protected]>2024-12-07 09:07:45 -0300
commit1c9fe756edba755679e8e4dc525d12e7deda3808 (patch)
tree275308e9fd137acde53d74c8d5170a21cbeb9cd4 /board/dhelectronics
parent86f58ea539e35b47235dff0dd77ec20fe8894469 (diff)
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 <[email protected]> Reviewed-by: Marek Vasut <[email protected]>
Diffstat (limited to 'board/dhelectronics')
-rw-r--r--board/dhelectronics/common/dh_common.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/board/dhelectronics/common/dh_common.c b/board/dhelectronics/common/dh_common.c
index 6a942909ccf..71010803f55 100644
--- a/board/dhelectronics/common/dh_common.c
+++ b/board/dhelectronics/common/dh_common.c
@@ -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];