public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH] board: sifive: remove the command for setting serial number
@ 2021-07-09  8:26 Zong Li
  2021-07-12 13:26 ` Leo Liang
  0 siblings, 1 reply; 2+ messages in thread
From: Zong Li @ 2021-07-09  8:26 UTC (permalink / raw)
  To: paul.walmsley, pragnesh.patel, green.wan, rick, ycliang,
	david.abdurachmanov, u-boot
  Cc: Zong Li

We wouldn't like to allow user to change the serial number, so remove
the command for changing serial number in EEPROM.

Signed-off-by: Zong Li <zong.li@sifive.com>
Suggested-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
---
 .../unmatched/hifive-platform-i2c-eeprom.c    | 23 +------------------
 1 file changed, 1 insertion(+), 22 deletions(-)

diff --git a/board/sifive/unmatched/hifive-platform-i2c-eeprom.c b/board/sifive/unmatched/hifive-platform-i2c-eeprom.c
index a2151f15e0..ad2f3155d0 100644
--- a/board/sifive/unmatched/hifive-platform-i2c-eeprom.c
+++ b/board/sifive/unmatched/hifive-platform-i2c-eeprom.c
@@ -401,24 +401,6 @@ static void set_product_id(char *string)
 	update_crc();
 }
 
-/**
- * set_serial_number() - set the PCB serial number in the in-memory copy
- *
- * Set the board serial number in the in-memory EEPROM copy from the supplied
- * string argument, and update the CRC.
- */
-static void set_serial_number(char *string)
-{
-	if (strlen(string) > SERIAL_NUMBER_BYTES) {
-		printf("Serial number must not be greater than 16 bytes\n");
-		return;
-	}
-
-	memset(e.serial, 0, sizeof(e.serial));
-	strncpy((char *)e.serial, string, sizeof(e.serial));
-	update_crc();
-}
-
 /**
  * init_local_copy() - initialize the in-memory EEPROM copy
  *
@@ -468,10 +450,7 @@ int do_mac(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
 		return 0;
 	}
 
-	if (!strcmp(cmd, "serial_number")) {
-		set_serial_number(argv[2]);
-		return 0;
-	} else if (!strcmp(cmd, "manuf_test_status")) {
+	if (!strcmp(cmd, "manuf_test_status")) {
 		set_manuf_test_status(argv[2]);
 		return 0;
 	} else if (!strcmp(cmd, "mac_address")) {
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-07-12 13:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-09  8:26 [PATCH] board: sifive: remove the command for setting serial number Zong Li
2021-07-12 13:26 ` Leo Liang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox