From patchwork Sat Sep 30 12:01:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 1841564 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=HG9qr3J/; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RyQnl6SS9z1ypb for ; Sat, 30 Sep 2023 22:02:35 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3BB228705F; Sat, 30 Sep 2023 14:02:23 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.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=canonical.com header.i=@canonical.com header.b="HG9qr3J/"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 709D986FD3; Sat, 30 Sep 2023 14:02:20 +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.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from smtp-relay-canonical-1.canonical.com (smtp-relay-canonical-1.canonical.com [185.125.188.121]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 03C9B87018 for ; Sat, 30 Sep 2023 14:02:18 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=heinrich.schuchardt@canonical.com Received: from workstation5.fritz.box (ip-178-202-040-247.um47.pools.vodafone-ip.de [178.202.40.247]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-1.canonical.com (Postfix) with ESMTPSA id 274ED440A5; Sat, 30 Sep 2023 12:02:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1696075336; bh=IqehM34qZcm5ziRYe+BMfu8DC1bOE/61/9isOldaehU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=HG9qr3J/SO4ukVbxpRYI5NxQfVFmCEUVLfrAHYFpJQLbt6sGjm9of4irVzPAUaz7M ovl9GNqEI65kSiQcVTKwvHgiaw3TSBF++WJnqDANRjJgXL7nU/O8qQZoATX9OOZl27 TYxZiPujRJbHeltMn23eS2PMSZmq5d/4cH8fAn3aMrkEefB83K/J8zUo8A1+fqmWy4 tKj+lCJZ9tS8YH54PRbt+BfrVLQE4b9h7BAL/a2uCWT2OL/wMsuOws2GxDp+JBRWHq t9rzQ7yuu9c1WOiMeVzxzrxPwm6XhzlhM1NBfZmWhEtunKijLURqtauU0YoZ6oIrvN WpU3GEhMfbvtg== From: Heinrich Schuchardt To: Tom Rini , Stefano Babic , Fabio Estevam , Paul Walmsley , Green Wan , Yanhong Wang Cc: "NXP i . MX U-Boot Team" , Simon Glass , Ilias Apalodimas , Roger Knecht , Neil Armstrong , Abdellatif El Khlifi , Masahisa Kojima , Alexey Romanov , Dzmitry Sankouski , u-boot@lists.denx.de, Heinrich Schuchardt Subject: [PATCH 1/6] cmd: move mac command Date: Sat, 30 Sep 2023 14:01:42 +0200 Message-Id: <20230930120147.59482-2-heinrich.schuchardt@canonical.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230930120147.59482-1-heinrich.schuchardt@canonical.com> References: <20230930120147.59482-1-heinrich.schuchardt@canonical.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.8 at phobos.denx.de X-Virus-Status: Clean Board specific implementations of the 'mac' command differ concerning the supported sub-commands. Move the Freescale specific mac command definition to the board code. Signed-off-by: Heinrich Schuchardt --- board/freescale/common/sys_eeprom.c | 22 +++++++++++++++++++ cmd/Makefile | 1 - cmd/mac.c | 33 ----------------------------- 3 files changed, 22 insertions(+), 34 deletions(-) delete mode 100644 cmd/mac.c diff --git a/board/freescale/common/sys_eeprom.c b/board/freescale/common/sys_eeprom.c index 431f8caeb0..d4a00fe920 100644 --- a/board/freescale/common/sys_eeprom.c +++ b/board/freescale/common/sys_eeprom.c @@ -623,3 +623,25 @@ unsigned int get_cpu_board_revision(void) return MPC85XX_CPU_BOARD_REV(be.major, be.minor); } #endif + +U_BOOT_CMD( + mac, 3, 1, do_mac, + "display and program the system ID and MAC addresses in EEPROM", + "[read|save|id|num|errata|date|ports|port_number]\n" + "mac read\n" + " - read EEPROM content into memory data structure\n" + "mac save\n" + " - save memory data structure to the EEPROM\n" + "mac id\n" + " - program system id per hard coded value\n" + "mac num string\n" + " - program system serial number to value string\n" + "mac errata string\n" + " - program errata data to value string\n" + "mac date YYMMDDhhmmss\n" + " - program date to string value YYMMDDhhmmss\n" + "mac ports N\n" + " - program the number of network ports to integer N\n" + "mac X string\n" + " - program MAC addr for port X [X=0,1..] to colon separated string" +); diff --git a/cmd/Makefile b/cmd/Makefile index 9bebf321c3..d515d241e6 100644 --- a/cmd/Makefile +++ b/cmd/Makefile @@ -107,7 +107,6 @@ obj-$(CONFIG_CMD_LICENSE) += license.o obj-y += load.o obj-$(CONFIG_CMD_LOG) += log.o obj-$(CONFIG_CMD_LSBLK) += lsblk.o -obj-$(CONFIG_ID_EEPROM) += mac.o obj-$(CONFIG_CMD_MD5SUM) += md5sum.o obj-$(CONFIG_CMD_MEMORY) += mem.o obj-$(CONFIG_CMD_IO) += io.o diff --git a/cmd/mac.c b/cmd/mac.c deleted file mode 100644 index a39e1168a5..0000000000 --- a/cmd/mac.c +++ /dev/null @@ -1,33 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ -/* - * Copyright 2006 Freescale Semiconductor - * York Sun (yorksun@freescale.com) - */ - -#include -#include - -extern int do_mac(struct cmd_tbl *cmdtp, int flag, int argc, - char *const argv[]); - -U_BOOT_CMD( - mac, 3, 1, do_mac, - "display and program the system ID and MAC addresses in EEPROM", - "[read|save|id|num|errata|date|ports|port_number]\n" - "mac read\n" - " - read EEPROM content into memory data structure\n" - "mac save\n" - " - save memory data structure to the EEPROM\n" - "mac id\n" - " - program system id per hard coded value\n" - "mac num string\n" - " - program system serial number to value string\n" - "mac errata string\n" - " - program errata data to value string\n" - "mac date YYMMDDhhmmss\n" - " - program date to string value YYMMDDhhmmss\n" - "mac ports N\n" - " - program the number of network ports to integer N\n" - "mac X string\n" - " - program MAC addr for port X [X=0,1..] to colon separated string" -); From patchwork Sat Sep 30 12:01:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 1841566 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=WAULtkr3; dkim-atps=neutral Authentication-Results: legolas.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=patchwork.ozlabs.org) 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 ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RyQp02mp3z1yp7 for ; Sat, 30 Sep 2023 22:02:48 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1703687067; Sat, 30 Sep 2023 14:02:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.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=canonical.com header.i=@canonical.com header.b="WAULtkr3"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id EE2DB8704A; Sat, 30 Sep 2023 14:02:20 +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.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from smtp-relay-canonical-1.canonical.com (smtp-relay-canonical-1.canonical.com [185.125.188.121]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 795DA8701F for ; Sat, 30 Sep 2023 14:02:18 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=heinrich.schuchardt@canonical.com Received: from workstation5.fritz.box (ip-178-202-040-247.um47.pools.vodafone-ip.de [178.202.40.247]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-1.canonical.com (Postfix) with ESMTPSA id A1540440A7; Sat, 30 Sep 2023 12:02:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1696075338; bh=1zNmeDlNh1JoKtc5BSz826c292+j+wSQm6gY9VrvWnU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=WAULtkr3hxhcxG96GJtBk7Cn1SUs38YpgvNFwZdeasHZvRr685Qd5kIOxeyfYBdL3 geFVT43NKVhhP76O4+kLTTgOzn4T56wL05x5zR+nkN3L8SfrfXEG7QnLbAPkrtw6eY on8s0Ddb47uNE28aIIxXruc5GYejGyltT8szFbSTgkHPju1HtpZbYsN6/sj/avxxZw iDbukvWOLKPN7cRZYEmxNsELLaED11V3LVMEKwks2bcLglAeJ03XeAEO16UZUQnMb8 M6i/UStZwdBppekni2Ale2xiFY683xc4iu8LoTwrtFzA6LSSmghI9w3HmjEC/WR1XI qu1tM7a574w8A== From: Heinrich Schuchardt To: Tom Rini , Stefano Babic , Fabio Estevam , Paul Walmsley , Green Wan , Yanhong Wang Cc: "NXP i . MX U-Boot Team" , Simon Glass , Ilias Apalodimas , Roger Knecht , Neil Armstrong , Abdellatif El Khlifi , Masahisa Kojima , Alexey Romanov , Dzmitry Sankouski , u-boot@lists.denx.de, Heinrich Schuchardt Subject: [PATCH 2/6] freescale: fix long help handling in mac command Date: Sat, 30 Sep 2023 14:01:43 +0200 Message-Id: <20230930120147.59482-3-heinrich.schuchardt@canonical.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230930120147.59482-1-heinrich.schuchardt@canonical.com> References: <20230930120147.59482-1-heinrich.schuchardt@canonical.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.8 at phobos.denx.de X-Virus-Status: Clean CONFIG_SYS_LONGHELP=n we want to reduce the size of the U-Boot binary. The long text should be reduced to and empty string in this case. There is not need to call cmd_usage() directly. It is sufficient to return CMD_RET_USAGE. Signed-off-by: Heinrich Schuchardt --- board/freescale/common/sys_eeprom.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/board/freescale/common/sys_eeprom.c b/board/freescale/common/sys_eeprom.c index d4a00fe920..9363251dc2 100644 --- a/board/freescale/common/sys_eeprom.c +++ b/board/freescale/common/sys_eeprom.c @@ -424,7 +424,7 @@ int do_mac(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) prog_eeprom(); break; default: - return cmd_usage(cmdtp); + return CMD_RET_USAGE; } return 0; @@ -624,9 +624,8 @@ unsigned int get_cpu_board_revision(void) } #endif -U_BOOT_CMD( - mac, 3, 1, do_mac, - "display and program the system ID and MAC addresses in EEPROM", +#ifdef CONFIG_SYS_LONGHELP +static char booti_help_text[] = "[read|save|id|num|errata|date|ports|port_number]\n" "mac read\n" " - read EEPROM content into memory data structure\n" @@ -643,5 +642,12 @@ U_BOOT_CMD( "mac ports N\n" " - program the number of network ports to integer N\n" "mac X string\n" - " - program MAC addr for port X [X=0,1..] to colon separated string" -); + " - program MAC addr for port X [X=0,1..] to colon separated string"; +#else + ""; +#endif + +U_BOOT_CMD( + mac, 3, 1, do_mac, + "display and program the system ID and MAC addresses in EEPROM", + booti_help_text); From patchwork Sat Sep 30 12:01:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 1841567 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=nk/X1tUg; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RyQp92DlFz1yp7 for ; Sat, 30 Sep 2023 22:02:57 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 93E6686FBC; Sat, 30 Sep 2023 14:02:28 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.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=canonical.com header.i=@canonical.com header.b="nk/X1tUg"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3587D86C0B; Sat, 30 Sep 2023 14:02:24 +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.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from smtp-relay-canonical-1.canonical.com (smtp-relay-canonical-1.canonical.com [185.125.188.121]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 4EA9C86C0B for ; Sat, 30 Sep 2023 14:02:19 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=heinrich.schuchardt@canonical.com Received: from workstation5.fritz.box (ip-178-202-040-247.um47.pools.vodafone-ip.de [178.202.40.247]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-1.canonical.com (Postfix) with ESMTPSA id 40533440A8; Sat, 30 Sep 2023 12:02:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1696075338; bh=LjMCh5p7KBtXQ0H4KRUPsb1Egg9c4IshPCust/akme4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=nk/X1tUgr8CaulNbBkpD6VN46b5VXzmAXEvCMxbv6rpalpLNmTZ5gBifR7p9/bNhN qCnKHf+aM1yIMDybrGALh7oIbCZlWvuOIfEkpt50XWuFinhpomcAuP6i4C3Pgg4OC6 lAn4UhGFKsKWU1uBOdyKzYaQ2qRo0kC0y9iYPoyLbGeg4kygRVji79nibYIeAhp0bP tHcLnhhdbApiTKLXNpn3vOBQOkaitgHwG1S1sw5DKF7pJMbNW6oJ+av1MtsjZ+d6hs fXHtbEHg6naSKuhYCSH12IoLgik5njLSn8EBRrj7XhhGGmCHB5M3AnqUhMoSEuptEb fAxDrjDC4vaEw== From: Heinrich Schuchardt To: Tom Rini , Stefano Babic , Fabio Estevam , Paul Walmsley , Green Wan , Yanhong Wang Cc: "NXP i . MX U-Boot Team" , Simon Glass , Ilias Apalodimas , Roger Knecht , Neil Armstrong , Abdellatif El Khlifi , Masahisa Kojima , Alexey Romanov , Dzmitry Sankouski , u-boot@lists.denx.de, Heinrich Schuchardt Subject: [PATCH 3/6] eeprom: SiFive Unmatched: re-implement mac command Date: Sat, 30 Sep 2023 14:01:44 +0200 Message-Id: <20230930120147.59482-4-heinrich.schuchardt@canonical.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230930120147.59482-1-heinrich.schuchardt@canonical.com> References: <20230930120147.59482-1-heinrich.schuchardt@canonical.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.8 at phobos.denx.de X-Virus-Status: Clean The different implementations of the mac command have board or vendor specific sub-commands. Add the command definition specific to the SiFive HiFive Unmatched board. Don't call cmd_usage() directly but return CMD_RET_USAGE instead. Signed-off-by: Heinrich Schuchardt --- .../unmatched/hifive-platform-i2c-eeprom.c | 30 +++++++++++++++++-- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/board/sifive/unmatched/hifive-platform-i2c-eeprom.c b/board/sifive/unmatched/hifive-platform-i2c-eeprom.c index 2b985b9b22..3c7ba4e0d3 100644 --- a/board/sifive/unmatched/hifive-platform-i2c-eeprom.c +++ b/board/sifive/unmatched/hifive-platform-i2c-eeprom.c @@ -426,7 +426,7 @@ int do_mac(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) } if (argc > 3) - return cmd_usage(cmdtp); + return CMD_RET_USAGE; cmd = argv[1]; @@ -443,7 +443,7 @@ int do_mac(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) } if (argc != 3) - return cmd_usage(cmdtp); + return CMD_RET_USAGE; if (!is_match_magic()) { printf("Please read the EEPROM ('read_eeprom') and/or initialize the EEPROM ('initialize') first.\n"); @@ -470,7 +470,7 @@ int do_mac(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) return 0; } - return cmd_usage(cmdtp); + return CMD_RET_USAGE; } /** @@ -551,3 +551,27 @@ u8 get_pcb_revision_from_eeprom(void) return be.pcb_revision; } + +#ifndef CONFIG_SPL_BUILD + +#ifdef CONFIG_SYS_LONGHELP +static char booti_help_text[] = + "- displays memory copy of EEPROM\n" + "mac read_eeprom - reads EEPROM into memory\n" + "mac initialize - initializes memory copy with magic number\n" + "mac write_eeprom - writes the EEPROM from memory\n" + "mac manuf_test_status [unknown|pass|fail] - sets test status in memory\n" + "mac_address - sets MAC address in memory\n" + "mac pcb_revision - sets PCB revision in memory\n" + "mac bom_variant - sets BOM variant in memory\n" + "mac bom_revision - sets BOM revision in memory\n"; +#else + ""; +#endif + +U_BOOT_CMD( + mac, 3, 1, do_mac, + "display and program the board revision and MAC address in EEPROM", + booti_help_text); + +#endif /* CONFIG_SPL_BUILD */ From patchwork Sat Sep 30 12:01:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 1841569 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=Sfg1Itar; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RyQpc1BTxz1yp7 for ; Sat, 30 Sep 2023 22:03:20 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CBB2387037; Sat, 30 Sep 2023 14:02:29 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.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=canonical.com header.i=@canonical.com header.b="Sfg1Itar"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 398BA86FC4; Sat, 30 Sep 2023 14:02:25 +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.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from smtp-relay-canonical-1.canonical.com (smtp-relay-canonical-1.canonical.com [185.125.188.121]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id DB0F087037 for ; Sat, 30 Sep 2023 14:02:19 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=heinrich.schuchardt@canonical.com Received: from workstation5.fritz.box (ip-178-202-040-247.um47.pools.vodafone-ip.de [178.202.40.247]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-1.canonical.com (Postfix) with ESMTPSA id DA9C0440A9; Sat, 30 Sep 2023 12:02:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1696075339; bh=OFQmueqMEEPSBCWtv2OAuyRnbpeut7Xq7GXo6q42mWo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Sfg1ItarUn4pNDrjAgHdggji30JGNaD9nzuR8BMDfXV1yyH4dwXqYQ/gP06l9YAGM l+G2QobEkKJOr1/OQrwrfW3nvNXRGgdQngEx5skg8cmxFsM7rVcp5tiXow6dagqzLa pYWsoH56NxpHRZhtSNt4gNU4jP9MJXQ68rdbAPn0UN/FoxaD0otyhhDWDRvpM84Ggq LRTazPveYe2GKgvatjw9ETPtPFIrrA79jxzCDe1xV59hLBcIP3Ziwmz2TWqep0wuP+ clNKYIIsQtcqI1smkX2ZhltppmZzNLZFrOjFFNYKFgJhRCPVO4ES8hLFoAOep+9J0Q lryLtY+XwjxMQ== From: Heinrich Schuchardt To: Tom Rini , Stefano Babic , Fabio Estevam , Paul Walmsley , Green Wan , Yanhong Wang Cc: "NXP i . MX U-Boot Team" , Simon Glass , Ilias Apalodimas , Roger Knecht , Neil Armstrong , Abdellatif El Khlifi , Masahisa Kojima , Alexey Romanov , Dzmitry Sankouski , u-boot@lists.denx.de, Heinrich Schuchardt Subject: [PATCH 4/6] eeprom: starfive: re-implement mac command Date: Sat, 30 Sep 2023 14:01:45 +0200 Message-Id: <20230930120147.59482-5-heinrich.schuchardt@canonical.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230930120147.59482-1-heinrich.schuchardt@canonical.com> References: <20230930120147.59482-1-heinrich.schuchardt@canonical.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.8 at phobos.denx.de X-Virus-Status: Clean The different implementations of the mac command have board or vendor specific sub-commands. Add the command definition specific to the VisionFive 2 board. Don't call cmd_usage() directly but return CMD_RET_USAGE instead. Signed-off-by: Heinrich Schuchardt --- .../visionfive2/visionfive2-i2c-eeprom.c | 62 +++++++++++-------- 1 file changed, 36 insertions(+), 26 deletions(-) diff --git a/board/starfive/visionfive2/visionfive2-i2c-eeprom.c b/board/starfive/visionfive2/visionfive2-i2c-eeprom.c index befe7888c4..8d99249279 100644 --- a/board/starfive/visionfive2/visionfive2-i2c-eeprom.c +++ b/board/starfive/visionfive2/visionfive2-i2c-eeprom.c @@ -404,29 +404,6 @@ static void set_product_id(char *string) update_crc(); } -static int print_usage(void) -{ - printf("display and program the system ID and MAC addresses in EEPROM\n" - "[read_eeprom|initialize|write_eeprom|mac_address|pcb_revision|bom_revision|product_id]\n" - "mac read_eeprom\n" - " - read EEPROM content into memory data structure\n" - "mac write_eeprom\n" - " - save memory data structure to the EEPROM\n" - "mac initialize\n" - " - initialize the in-memory EEPROM copy with default data\n" - "mac mac0_address \n" - " - stores a MAC0 address into the local EEPROM copy\n" - "mac mac1_address \n" - " - stores a MAC1 address into the local EEPROM copy\n" - "mac pcb_revision \n" - " - stores a StarFive PCB revision into the local EEPROM copy\n" - "mac bom_revision \n" - " - stores a StarFive BOM revision into the local EEPROM copy\n" - "mac product_id \n" - " - stores a StarFive product ID into the local EEPROM copy\n"); - return 0; -} - int do_mac(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { char *cmd; @@ -437,7 +414,7 @@ int do_mac(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) } if (argc > 3) - return print_usage(); + return CMD_RET_USAGE; cmd = argv[1]; @@ -453,7 +430,7 @@ int do_mac(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) } if (argc != 3) - return print_usage(); + return CMD_RET_USAGE; if (is_match_magic()) { printf("Please read the EEPROM ('read_eeprom') and/or initialize the EEPROM ('initialize') first.\n"); @@ -477,7 +454,7 @@ int do_mac(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) return 0; } - return print_usage(); + return CMD_RET_USAGE; } /** @@ -559,3 +536,36 @@ u32 get_ddr_size_from_eeprom(void) return hextoul(&pbuf.eeprom.atom1.data.pstr[14], NULL); } + +#ifndef CONFIG_SPL_BUILD + +#ifdef CONFIG_SYS_LONGHELP +static char booti_help_text[] = + "\n" + " - display EEPROM content\n" + "mac read_eeprom\n" + " - read EEPROM content into memory data structure\n" + "mac write_eeprom\n" + " - save memory data structure to the EEPROM\n" + "mac initialize\n" + " - initialize the in-memory EEPROM copy with default data\n" + "mac mac0_address \n" + " - stores a MAC0 address into the local EEPROM copy\n" + "mac mac1_address \n" + " - stores a MAC1 address into the local EEPROM copy\n" + "mac pcb_revision \n" + " - stores a StarFive PCB revision into the local EEPROM copy\n" + "mac bom_revision \n" + " - stores a StarFive BOM revision into the local EEPROM copy\n" + "mac product_id \n" + " - stores a StarFive product ID into the local EEPROM copy\n"; +#else + ""; +#endif + +U_BOOT_CMD( + mac, 3, 1, do_mac, + "display and program the board revision and MAC address in EEPROM", + booti_help_text); + +#endif /* CONFIG_SPL_BUILD */ From patchwork Sat Sep 30 12:01:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 1841568 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=h2Uwop0v; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RyQpN3dH7z1yp7 for ; Sat, 30 Sep 2023 22:03:08 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6D22E87019; Sat, 30 Sep 2023 14:02:29 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.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=canonical.com header.i=@canonical.com header.b="h2Uwop0v"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C43578702C; Sat, 30 Sep 2023 14:02:24 +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.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from smtp-relay-canonical-1.canonical.com (smtp-relay-canonical-1.canonical.com [185.125.188.121]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id A32A486FD3 for ; Sat, 30 Sep 2023 14:02:20 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=heinrich.schuchardt@canonical.com Received: from workstation5.fritz.box (ip-178-202-040-247.um47.pools.vodafone-ip.de [178.202.40.247]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-1.canonical.com (Postfix) with ESMTPSA id 8351B440AA; Sat, 30 Sep 2023 12:02:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1696075340; bh=9hrCWFhS+DQT72CYzcY7UANA/8KwkJFkLWnc857HsUQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=h2Uwop0vSODb42/1kZiDN7+odVsyrOwNhBuz+zM6DgCYiQzmBXai8FU1RNdFORaug O/b+DsaW6OT8fN5boGa+dhugDQqFnCm/8GT4R7VL9/HCUdIYJIWRsZbvIrNRlRMmJT Ej5ksYD+xXjGsVEiZYnzRAzQfl1Jc/GGxicljGbyXR13sljtqxelS4AMySL5jlRwoN +z06+52UiQc7PMGM+BWkYpczbPIHVwy1GCpWoz+WcfuFQex0Q4jmNJcLO00nxU3tDp P3btnfiVp54sgvh8CZPn5MDMocOasjl6mumMjXcVBZIiezs01A/nbKoxWcDycQmhhN rkzsvJ4kBYm0A== From: Heinrich Schuchardt To: Tom Rini , Stefano Babic , Fabio Estevam , Paul Walmsley , Green Wan , Yanhong Wang Cc: "NXP i . MX U-Boot Team" , Simon Glass , Ilias Apalodimas , Roger Knecht , Neil Armstrong , Abdellatif El Khlifi , Masahisa Kojima , Alexey Romanov , Dzmitry Sankouski , u-boot@lists.denx.de, Heinrich Schuchardt Subject: [PATCH 5/6] eeprom: starfive: raw dump if unsupported data version Date: Sat, 30 Sep 2023 14:01:46 +0200 Message-Id: <20230930120147.59482-6-heinrich.schuchardt@canonical.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230930120147.59482-1-heinrich.schuchardt@canonical.com> References: <20230930120147.59482-1-heinrich.schuchardt@canonical.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.8 at phobos.denx.de X-Virus-Status: Clean If the data version field of the EEPROM is not supported, provide a hexdump of the data. Signed-off-by: Heinrich Schuchardt --- board/starfive/visionfive2/visionfive2-i2c-eeprom.c | 1 + 1 file changed, 1 insertion(+) diff --git a/board/starfive/visionfive2/visionfive2-i2c-eeprom.c b/board/starfive/visionfive2/visionfive2-i2c-eeprom.c index 8d99249279..329fbf6644 100644 --- a/board/starfive/visionfive2/visionfive2-i2c-eeprom.c +++ b/board/starfive/visionfive2/visionfive2-i2c-eeprom.c @@ -190,6 +190,7 @@ static void show_eeprom(void) pbuf.eeprom.atom4.data.mac1_addr[4], pbuf.eeprom.atom4.data.mac1_addr[5]); } else { printf("Custom data v%d is not Supported\n", pbuf.eeprom.atom4.data.version); + dump_raw_eeprom(); } printf("--------EEPROM INFO--------\n\n"); } From patchwork Sat Sep 30 12:01:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 1841570 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=MON6ZeoD; dkim-atps=neutral Authentication-Results: legolas.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=patchwork.ozlabs.org) 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 ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RyQpr1wKcz1yp7 for ; Sat, 30 Sep 2023 22:03:32 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 425098706B; Sat, 30 Sep 2023 14:02:30 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.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=canonical.com header.i=@canonical.com header.b="MON6ZeoD"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1973C86F96; Sat, 30 Sep 2023 14:02:26 +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.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from smtp-relay-canonical-1.canonical.com (smtp-relay-canonical-1.canonical.com [185.125.188.121]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 9E2868701F for ; Sat, 30 Sep 2023 14:02:22 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=heinrich.schuchardt@canonical.com Received: from workstation5.fritz.box (ip-178-202-040-247.um47.pools.vodafone-ip.de [178.202.40.247]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-1.canonical.com (Postfix) with ESMTPSA id 45BD4440AB; Sat, 30 Sep 2023 12:02:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1696075340; bh=TkTdSZq9kDadojQGkrZZ6Cptma3RecLqYKmd4dH+xmE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=MON6ZeoDcX8hGsazh8B0jf1nhR6Me8gx/hHVOZPb6D23VX22mz0yzgOud4RTlWD7/ WCBpnm/CcRGepYMsY/1ZyXIM1YvBnjUn3aLZkbYjqop9mWqs10v89Qefmagqky4yzD tEujsgEX50zWIjGdQ/UHGOGAJxMUST4DR9SJH2hDXCRW2euME3aBfAhRk+xO6nFtve WUEuVu+9xV0V9HFRnLkFQAELA1Xjb+OFq8sEDnIlf6yaVlpBc7eOue+3UEoAdnt/sn FIed083Ru3RnXaXPw5H261vXwFD1I2Yrp2I7F91eDj0W+Pasd3y7F48fKlYUalnqsm m3GArzQ7zT0xg== From: Heinrich Schuchardt To: Tom Rini , Stefano Babic , Fabio Estevam , Paul Walmsley , Green Wan , Yanhong Wang Cc: "NXP i . MX U-Boot Team" , Simon Glass , Ilias Apalodimas , Roger Knecht , Neil Armstrong , Abdellatif El Khlifi , Masahisa Kojima , Alexey Romanov , Dzmitry Sankouski , u-boot@lists.denx.de, Heinrich Schuchardt Subject: [PATCH 6/6] eeprom: starfive: add 'mac raw' command Date: Sat, 30 Sep 2023 14:01:47 +0200 Message-Id: <20230930120147.59482-7-heinrich.schuchardt@canonical.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230930120147.59482-1-heinrich.schuchardt@canonical.com> References: <20230930120147.59482-1-heinrich.schuchardt@canonical.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.8 at phobos.denx.de X-Virus-Status: Clean Add a sub-command to print a hexdump of the EEPROM content. Signed-off-by: Heinrich Schuchardt --- board/starfive/visionfive2/visionfive2-i2c-eeprom.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/board/starfive/visionfive2/visionfive2-i2c-eeprom.c b/board/starfive/visionfive2/visionfive2-i2c-eeprom.c index 329fbf6644..710044a235 100644 --- a/board/starfive/visionfive2/visionfive2-i2c-eeprom.c +++ b/board/starfive/visionfive2/visionfive2-i2c-eeprom.c @@ -428,6 +428,9 @@ int do_mac(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) return 0; } else if (!strcmp(cmd, "write_eeprom")) { return prog_eeprom(STARFIVE_EEPROM_HATS_SIZE_MAX); + } else if (!strcmp(cmd, "raw")) { + dump_raw_eeprom(); + return 0; } if (argc != 3) @@ -550,6 +553,8 @@ static char booti_help_text[] = " - save memory data structure to the EEPROM\n" "mac initialize\n" " - initialize the in-memory EEPROM copy with default data\n" + "mac raw\n" + " - hexdump memory data structure\n" "mac mac0_address \n" " - stores a MAC0 address into the local EEPROM copy\n" "mac mac1_address \n"