From patchwork Fri Jul 9 08:26:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zong Li X-Patchwork-Id: 1502973 X-Patchwork-Delegate: uboot@andestech.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=sifive.com header.i=@sifive.com header.a=rsa-sha256 header.s=google header.b=goZJBSbL; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GLmVB74Lpz9sRf for ; Fri, 9 Jul 2021 18:26:56 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8B93382991; Fri, 9 Jul 2021 10:26:49 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=sifive.com header.i=@sifive.com header.b="goZJBSbL"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 496AF83202; Fri, 9 Jul 2021 10:26:48 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 87B8982916 for ; Fri, 9 Jul 2021 10:26:45 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=zong.li@sifive.com Received: by mail-pf1-x42a.google.com with SMTP id j9so2421802pfc.5 for ; Fri, 09 Jul 2021 01:26:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=PQLLY1ZyurO2VYpbzIcU2qeSDxaR2wWWlVf63ybBrDs=; b=goZJBSbLTP2/6MpXkWjeLYcBJsp456qI7Wkgjed39H3m1IjaOPVzhc4J0jYuLccnqe /J7cOm1982/5m1lrmeiXAj5fIHQAcS8pN//7ppndF9QNxYabhCjKNf5zNqo7cuCJBkP4 N1VG7W3+uGLA0jE7z1BUmwYiOL7pDC633xkgcysTakx/Sv7HCgdS2v2zfA6E4ZobZW+Q QKhWPpPeoRegS/82lva3XX5zs/NjkW86NehuCzBAg5YN5J41CjgSyvGwxO+BpiZmDFN2 /xMje0K72WM6nFeIe7JCkO1yesfG0yD4/PMKfkNeAjBLA7bM6X5Sot/jm2AKgcO0zdum 9h0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=PQLLY1ZyurO2VYpbzIcU2qeSDxaR2wWWlVf63ybBrDs=; b=ifSMnsPyU31X3vdhFHpwkhne0/S99UKpu3u8SaBdzJFNPDlG6UoAeD9o5uTcMrmxRm 4ztf8KEiGFyrNNXsVNHRRN0DFUKd+Nw6jiB8J6Kzm2EGNDqRZ9XhHmchW+Tc5ngYYPp3 IaxeCwg5QNzlaMqV1IFL5AZyJTQ8yI4dAH6vOQltiaNf/bLcOZveV1DF1TFu1Lj/cKAR efyQkLEtnStXI3lD7UbUw0/dL0UWiti0SaH7Oy82SY4qDa4WwKD1o3EwX7lbvABGWj1A 8g8azUWypCjyfLSBcCSQPnTR41gD4HklaxveUXIKgW46ibajZn2W0AiYsh5AUwjjOb7v sXtA== X-Gm-Message-State: AOAM530YO9c78fSJuQP9YaIYZ2Il0gNYQKRHYGCCupXgU4cvmn7rRocy QVPvrU3yWKvx1g9zqud+kChUrA== X-Google-Smtp-Source: ABdhPJybFdZopr/t2Cd4fFjBtqKM/OfYYMLRHGrArXo2ZO0Len657DpWMF1v3LRN2zh0kpwI3mvxPA== X-Received: by 2002:a63:66c7:: with SMTP id a190mr37162259pgc.123.1625819203882; Fri, 09 Jul 2021 01:26:43 -0700 (PDT) Received: from hsinchu16.internal.sifive.com (59-124-168-89.HINET-IP.hinet.net. [59.124.168.89]) by smtp.gmail.com with ESMTPSA id g141sm5312070pfb.210.2021.07.09.01.26.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Jul 2021 01:26:43 -0700 (PDT) From: Zong Li To: paul.walmsley@sifive.com, pragnesh.patel@sifive.com, green.wan@sifive.com, rick@andestech.com, ycliang@andestech.com, david.abdurachmanov@sifive.com, u-boot@lists.denx.de Cc: Zong Li Subject: [PATCH] board: sifive: remove the command for setting serial number Date: Fri, 9 Jul 2021 16:26:35 +0800 Message-Id: <20210709082635.27065-1-zong.li@sifive.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean 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 Suggested-by: David Abdurachmanov Reviewed-by: Leo Yu-Chi Liang --- .../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")) {