update_crc();
}
+/**
+ * set_vendor() - set vendor name
+ *
+ * Takes a pointer to a string representing the vendor name, e.g.
+ * "StarFive Technology Co., Ltd.", stores it in the vendor field
+ * of the EEPROM local copy, and updates the CRC of the local copy.
+ */
+static void set_vendor(char *string)
+{
+ memset(pbuf.eeprom.atom1.data.vstr, 0,
+ sizeof(pbuf.eeprom.atom1.data.vstr));
+
+ strncpy(pbuf.eeprom.atom1.data.vstr,
+ string, sizeof(pbuf.eeprom.atom1.data.vstr) - 1);
+
+ update_crc();
+}
+
const char *get_product_id_from_eeprom(void)
{
if (read_eeprom())
} else if (!strcmp(cmd, "product_id")) {
set_product_id(argv[2]);
return 0;
+ } else if (!strcmp(cmd, "vendor")) {
+ set_vendor(argv[2]);
+ return 0;
}
return CMD_RET_USAGE;
"mac bom_revision <A>\n"
" - stores a StarFive BOM revision into the local EEPROM copy\n"
"mac product_id <VF7110A1-2228-D008E000-xxxxxxxx>\n"
- " - stores a StarFive product ID into the local EEPROM copy\n");
+ " - stores a StarFive product ID into the local EEPROM copy\n"
+ "mac vendor <Vendor Name>\n"
+ " - set vendor string\n");
U_BOOT_CMD(
mac, 3, 1, do_mac,