/* 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[])
/* 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;
	}
	strcpy((char *)buf, p);
	env_set("boardid", (char *)buf);
	printf("set boardid=%s\n", buf);
	p = get_local_var("IVM_HWKey");
	if (p == NULL) {
		printf("can't get the IVM_HWKey\n");
		return 1;
	}
	strcpy((char *)buf, p);
	env_set("hwkey", (char *)buf);
	printf("set hwkey=%s\n", buf);
	printf("Execute manually saveenv for persistent storage.\n");
	return 0;
}