Skip to content
Snippets Groups Projects
Commit a9417ce7 authored by Holger Brunck's avatar Holger Brunck Committed by Wolfgang Denk
Browse files

km/common: implement setboardid command


Read out board id and HW key from the IVM eeprom and set
these values as an environment variable.

Signed-off-by: default avatarHolger Brunck <holger.brunck@keymile.com>
Acked-by: default avatarHeiko Schocher <hs@denx.de>
cc: Wolfgang Denk <wd@denx.de>
cc: Detlev Zundel <dzu@denx.de>
cc: Valentin Longchamp <valentin.longchamp@keymile.com>
parent eae3b064
No related branches found
No related tags found
No related merge requests found
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <mpc8260.h> #include <mpc8260.h>
#endif #endif
#include <ioports.h> #include <ioports.h>
#include <command.h>
#include <malloc.h> #include <malloc.h>
#include <hush.h> #include <hush.h>
#include <net.h> #include <net.h>
...@@ -682,3 +683,36 @@ int board_eth_init(bd_t *bis) ...@@ -682,3 +683,36 @@ int board_eth_init(bd_t *bis)
return -1; return -1;
} }
/*
* do_setboardid command
* read out the board id and the hw key from the intventory EEPROM and set
* this values as environment variables.
*/
static int do_setboardid(cmd_tbl_t *cmdtp, int flag, int argc,
char *const argv[])
{
unsigned char buf[32];
char *p;
p = get_local_var("IVM_BoardId");
if (p == NULL) {
printf("can't get the IVM_Boardid\n");
return 1;
}
sprintf((char *)buf, "%s", p);
setenv("boardid", (char *)buf);
p = get_local_var("IVM_HWKey");
if (p == NULL) {
printf("can't get the IVM_HWKey\n");
return 1;
}
sprintf((char *)buf, "%s", p);
setenv("hwkey", (char *)buf);
return 0;
}
U_BOOT_CMD(km_setboardid, 1, 0, do_setboardid, "setboardid", "read out bid and "
"hwkey from IVM and set in environment");
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment