1 From e6b25cf93a9255a5c167ffab7a6e87c272a2b07d Mon Sep 17 00:00:00 2001
2 From: Zong Li <zong.li@sifive.com>
3 Date: Fri, 9 Jul 2021 16:26:35 +0800
4 Subject: [PATCH 07/16] board: sifive: remove the command for setting serial
7 We wouldn't like to allow user to change the serial number, so remove
8 the command for changing serial number in EEPROM.
10 Signed-off-by: Zong Li <zong.li@sifive.com>
11 Suggested-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
12 Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
14 .../sifive/unmatched/hifive-platform-i2c-eeprom.c | 23 +---------------------
15 1 file changed, 1 insertion(+), 22 deletions(-)
17 diff --git a/board/sifive/unmatched/hifive-platform-i2c-eeprom.c b/board/sifive/unmatched/hifive-platform-i2c-eeprom.c
18 index a2151f1..ad2f315 100644
19 --- a/board/sifive/unmatched/hifive-platform-i2c-eeprom.c
20 +++ b/board/sifive/unmatched/hifive-platform-i2c-eeprom.c
21 @@ -402,24 +402,6 @@ static void set_product_id(char *string)
25 - * set_serial_number() - set the PCB serial number in the in-memory copy
27 - * Set the board serial number in the in-memory EEPROM copy from the supplied
28 - * string argument, and update the CRC.
30 -static void set_serial_number(char *string)
32 - if (strlen(string) > SERIAL_NUMBER_BYTES) {
33 - printf("Serial number must not be greater than 16 bytes\n");
37 - memset(e.serial, 0, sizeof(e.serial));
38 - strncpy((char *)e.serial, string, sizeof(e.serial));
43 * init_local_copy() - initialize the in-memory EEPROM copy
45 * Initialize the in-memory EEPROM copy with the magic number. Must
46 @@ -468,10 +450,7 @@ int do_mac(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
50 - if (!strcmp(cmd, "serial_number")) {
51 - set_serial_number(argv[2]);
53 - } else if (!strcmp(cmd, "manuf_test_status")) {
54 + if (!strcmp(cmd, "manuf_test_status")) {
55 set_manuf_test_status(argv[2]);
57 } else if (!strcmp(cmd, "mac_address")) {