From patchwork Thu Dec 22 12:57:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Romanov X-Patchwork-Id: 1718814 X-Patchwork-Delegate: narmstrong@baylibre.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=sberdevices.ru header.i=@sberdevices.ru header.a=rsa-sha256 header.s=mail header.b=kV14Xaaq; dkim-atps=neutral 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 (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Nd9Mp6jdTz1ydb for ; Thu, 22 Dec 2022 23:57:58 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 86DCD85350; Thu, 22 Dec 2022 13:57:45 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=sberdevices.ru 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=sberdevices.ru header.i=@sberdevices.ru header.b="kV14Xaaq"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BA4328532E; Thu, 22 Dec 2022 13:57:41 +0100 (CET) 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,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 mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 9FED0852E7 for ; Thu, 22 Dec 2022 13:57:39 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=sberdevices.ru Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=AVRomanov@sberdevices.ru Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id 16F335FD04; Thu, 22 Dec 2022 15:57:39 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1671713859; bh=RHD3izU5D+OGt26TNuX/pacvAnHCjQ9AnmxjGGgb3g8=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=kV14XaaqJXtm34c+P1wwcwhxxW5rwc9FZOnLUipy/Jhcn6Rw/Nuc3peUt//7kPkp5 Ry5BDC+C+Ao4axCwKmEvAYWTZC+WtnFvNtGweh2PyZvkMAPOtzfX3yQWkZipqBHKPK Kl4v0qjsFcKyTeMZ+9xCdC4SFWPdJBgHMkvtmn0Rj8pY9cgfT3sOCvNZe0UZ8lgp3z y3t8bj101L8PivWAXlZEpF8aatF8MhF2+wr4QjvRDPsZw+LUj0qflJ/WgtIAGB5QNh D5ImEhAKQbnT7bKqYbgupkXUQiibOCUnbwHXS54RHRT5GfQmihcnBOqr5I2yZyrxYh gZ4hBlmCqiwIQ== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Thu, 22 Dec 2022 15:57:39 +0300 (MSK) From: Alexey Romanov To: , , , CC: , , , Alexey Romanov Subject: [PATCH v3 1/5] asm/arch-meson: add missing meson_sm_write_efuse signature Date: Thu, 22 Dec 2022 15:57:23 +0300 Message-ID: <20221222125727.47893-2-avromanov@sberdevices.ru> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20221222125727.47893-1-avromanov@sberdevices.ru> References: <20221222125727.47893-1-avromanov@sberdevices.ru> MIME-Version: 1.0 X-Originating-IP: [172.16.1.6] X-ClientProxiedBy: S-MS-EXCH02.sberdevices.ru (172.16.1.5) To S-MS-EXCH01.sberdevices.ru (172.16.1.4) X-KSMG-Rule-ID: 4 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiPhishing: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 1.1.2.30, bases: 2022/12/22 08:09:00 #20696641 X-KSMG-AntiVirus-Status: Clean, skipped 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.6 at phobos.denx.de X-Virus-Status: Clean This function can be used by other modules. Also add comments. Signed-off-by: Alexey Romanov Reviewed-by: Neil Armstrong --- arch/arm/include/asm/arch-meson/sm.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/arch/arm/include/asm/arch-meson/sm.h b/arch/arm/include/asm/arch-meson/sm.h index f3ae46a6d6b..53b75176493 100644 --- a/arch/arm/include/asm/arch-meson/sm.h +++ b/arch/arm/include/asm/arch-meson/sm.h @@ -6,10 +6,35 @@ #ifndef __MESON_SM_H__ #define __MESON_SM_H__ +/** + * meson_sm_read_efuse - read efuse memory into buffer + * + * @offset: offset from the start efuse memory + * @buffer: pointer to buffer + * @size: number of bytes to read + * @return: number of bytes read + */ ssize_t meson_sm_read_efuse(uintptr_t offset, void *buffer, size_t size); +/** + * meson_sm_write_efuse - write into efuse memory from buffer + * + * @offset: offset from the start efuse memory + * @buffer: pointer to buffer + * @size: number of bytes to write + * @return: number of bytes written + */ +ssize_t meson_sm_write_efuse(uintptr_t offset, void *buffer, size_t size); + #define SM_SERIAL_SIZE 12 +/** + * meson_sm_get_serial - read chip unique id into buffer + * + * @buffer: pointer to buffer + * @size: buffer size. + * @return: zero on success or -errno on failure + */ int meson_sm_get_serial(void *buffer, size_t size); enum { @@ -28,6 +53,9 @@ enum { REBOOT_REASON_WATCHDOG_REBOOT = 13, }; +/** + * meson_sm_get_reboot_reason - get reboot reason + */ int meson_sm_get_reboot_reason(void); #endif /* __MESON_SM_H__ */ From patchwork Thu Dec 22 12:57:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Romanov X-Patchwork-Id: 1718815 X-Patchwork-Delegate: narmstrong@baylibre.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=sberdevices.ru header.i=@sberdevices.ru header.a=rsa-sha256 header.s=mail header.b=GyLUQZc5; dkim-atps=neutral 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 (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Nd9N25DLqz1ydb for ; Thu, 22 Dec 2022 23:58:10 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 932AD85351; Thu, 22 Dec 2022 13:57:49 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=sberdevices.ru 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=sberdevices.ru header.i=@sberdevices.ru header.b="GyLUQZc5"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5A7FC85286; Thu, 22 Dec 2022 13:57:45 +0100 (CET) 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,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 mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 37FCB85286 for ; Thu, 22 Dec 2022 13:57:41 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=sberdevices.ru Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=AVRomanov@sberdevices.ru Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id 9CADF5FD08; Thu, 22 Dec 2022 15:57:40 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1671713860; bh=WtSDHsNChT8X6edGpoAVO+xSmvHx6XVq8Qh9OcR6pi8=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=GyLUQZc5B5ICEXBjlS6ahskL1JrluaYDiTWQ0jnXtMCdzZA+Qo2dCKAV/73qO4RHe trrlqOIKMhP384Vz02csLezbxt7RahB2sSmLBB3QmByHOq5a9mhnfpvYy7mGosVqSa WDzM6DgJPs6v3GlNjtjryMOuySEpeWu/6I4JaxEbtSPfWeVOhu6P9Z/BaZGdMlJUj6 vXRr6a8xSuj7gDb5grCD12/qQNg1zOP5wmeDpQTczfXf+rzldcEfHIsMXnVYuyEsrQ dC7Ce42EcTtAhz5hK7wrjJ5RcL1gsjDakNBncj/NJSi26we7pKwWG1gipocVsPf2GC bjK4ezyp38NbA== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Thu, 22 Dec 2022 15:57:40 +0300 (MSK) From: Alexey Romanov To: , , , CC: , , , Alexey Romanov Subject: [PATCH v3 2/5] arm/mach-meson: move smc commands in cmd/meson Date: Thu, 22 Dec 2022 15:57:24 +0300 Message-ID: <20221222125727.47893-3-avromanov@sberdevices.ru> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20221222125727.47893-1-avromanov@sberdevices.ru> References: <20221222125727.47893-1-avromanov@sberdevices.ru> MIME-Version: 1.0 X-Originating-IP: [172.16.1.6] X-ClientProxiedBy: S-MS-EXCH02.sberdevices.ru (172.16.1.5) To S-MS-EXCH01.sberdevices.ru (172.16.1.4) X-KSMG-Rule-ID: 4 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiPhishing: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 1.1.2.30, bases: 2022/12/22 08:09:00 #20696641 X-KSMG-AntiVirus-Status: Clean, skipped 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.6 at phobos.denx.de X-Virus-Status: Clean It is incorrect to keep commands in the arch/ folder. Signed-off-by: Alexey Romanov Reviewed-by: Mattijs Korpershoek Reviewed-by: Neil Armstrong --- MAINTAINERS | 1 + arch/arm/mach-meson/sm.c | 144 ------------------------------------ cmd/Kconfig | 7 ++ cmd/Makefile | 3 + cmd/meson/Makefile | 5 ++ cmd/meson/sm.c | 156 +++++++++++++++++++++++++++++++++++++++ 6 files changed, 172 insertions(+), 144 deletions(-) create mode 100644 cmd/meson/Makefile create mode 100644 cmd/meson/sm.c diff --git a/MAINTAINERS b/MAINTAINERS index 7f27ff4c20f..7a5460d4922 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -149,6 +149,7 @@ L: u-boot-amlogic@groups.io T: git https://source.denx.de/u-boot/custodians/u-boot-amlogic.git F: arch/arm/mach-meson/ F: arch/arm/include/asm/arch-meson/ +F: cmd/meson/ F: drivers/clk/meson/ F: drivers/serial/serial_meson.c F: drivers/reset/reset-meson.c diff --git a/arch/arm/mach-meson/sm.c b/arch/arm/mach-meson/sm.c index d6eb910689f..f2ca7e76932 100644 --- a/arch/arm/mach-meson/sm.c +++ b/arch/arm/mach-meson/sm.c @@ -6,8 +6,6 @@ */ #include -#include -#include #include #include #include @@ -139,145 +137,3 @@ int meson_sm_get_reboot_reason(void) /* The SMC call is not used, we directly use AO_SEC_SD_CFG15 */ return FIELD_GET(REBOOT_REASON_MASK, reason); } - -static int do_sm_serial(struct cmd_tbl *cmdtp, int flag, int argc, - char *const argv[]) -{ - ulong address; - int ret; - - if (argc < 2) - return CMD_RET_USAGE; - - address = simple_strtoul(argv[1], NULL, 0); - - ret = meson_sm_get_serial((void *)address, SM_CHIP_ID_SIZE); - if (ret) - return CMD_RET_FAILURE; - - return CMD_RET_SUCCESS; -} - -#define MAX_REBOOT_REASONS 14 - -static const char *reboot_reasons[MAX_REBOOT_REASONS] = { - [REBOOT_REASON_COLD] = "cold_boot", - [REBOOT_REASON_NORMAL] = "normal", - [REBOOT_REASON_RECOVERY] = "recovery", - [REBOOT_REASON_UPDATE] = "update", - [REBOOT_REASON_FASTBOOT] = "fastboot", - [REBOOT_REASON_SUSPEND_OFF] = "suspend_off", - [REBOOT_REASON_HIBERNATE] = "hibernate", - [REBOOT_REASON_BOOTLOADER] = "bootloader", - [REBOOT_REASON_SHUTDOWN_REBOOT] = "shutdown_reboot", - [REBOOT_REASON_RPMBP] = "rpmbp", - [REBOOT_REASON_CRASH_DUMP] = "crash_dump", - [REBOOT_REASON_KERNEL_PANIC] = "kernel_panic", - [REBOOT_REASON_WATCHDOG_REBOOT] = "watchdog_reboot", -}; - -static int do_sm_reboot_reason(struct cmd_tbl *cmdtp, int flag, int argc, - char *const argv[]) -{ - const char *reason_str; - char *destarg = NULL; - int reason; - - if (argc > 1) - destarg = argv[1]; - - reason = meson_sm_get_reboot_reason(); - if (reason < 0) - return CMD_RET_FAILURE; - - if (reason >= MAX_REBOOT_REASONS || - !reboot_reasons[reason]) - reason_str = "unknown"; - else - reason_str = reboot_reasons[reason]; - - if (destarg) - env_set(destarg, reason_str); - else - printf("reboot reason: %s (%x)\n", reason_str, reason); - - return CMD_RET_SUCCESS; -} - -static int do_efuse_read(struct cmd_tbl *cmdtp, int flag, int argc, - char *const argv[]) -{ - ulong address, offset, size; - int ret; - - if (argc < 4) - return CMD_RET_USAGE; - - offset = simple_strtoul(argv[1], NULL, 0); - size = simple_strtoul(argv[2], NULL, 0); - - address = simple_strtoul(argv[3], NULL, 0); - - ret = meson_sm_read_efuse(offset, (void *)address, size); - if (ret != size) - return CMD_RET_FAILURE; - - return CMD_RET_SUCCESS; -} - -static int do_efuse_write(struct cmd_tbl *cmdtp, int flag, int argc, - char *const argv[]) -{ - ulong address, offset, size; - int ret; - - if (argc < 4) - return CMD_RET_USAGE; - - offset = simple_strtoul(argv[1], NULL, 0); - size = simple_strtoul(argv[2], NULL, 0); - - address = simple_strtoul(argv[3], NULL, 0); - - ret = meson_sm_write_efuse(offset, (void *)address, size); - if (ret != size) - return CMD_RET_FAILURE; - - return CMD_RET_SUCCESS; -} - -static struct cmd_tbl cmd_sm_sub[] = { - U_BOOT_CMD_MKENT(serial, 2, 1, do_sm_serial, "", ""), - U_BOOT_CMD_MKENT(reboot_reason, 1, 1, do_sm_reboot_reason, "", ""), - U_BOOT_CMD_MKENT(efuseread, 4, 1, do_efuse_read, "", ""), - U_BOOT_CMD_MKENT(efusewrite, 4, 0, do_efuse_write, "", ""), -}; - -static int do_sm(struct cmd_tbl *cmdtp, int flag, int argc, - char *const argv[]) -{ - struct cmd_tbl *c; - - if (argc < 2) - return CMD_RET_USAGE; - - /* Strip off leading 'sm' command argument */ - argc--; - argv++; - - c = find_cmd_tbl(argv[0], &cmd_sm_sub[0], ARRAY_SIZE(cmd_sm_sub)); - - if (c) - return c->cmd(cmdtp, flag, argc, argv); - else - return CMD_RET_USAGE; -} - -U_BOOT_CMD( - sm, 5, 0, do_sm, - "Secure Monitor Control", - "serial
- read chip unique id to memory address\n" - "sm reboot_reason [name] - get reboot reason and store to to environment\n" - "sm efuseread
- read efuse to memory address\n" - "sm efusewrite
- write into efuse from memory address" -); diff --git a/cmd/Kconfig b/cmd/Kconfig index 09193b61b95..07833f958e7 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -2565,4 +2565,11 @@ config MMC_SPEED_MODE_SET and is indicated using the index from enum bus_mode in include/mmc.h. A speed mode can be set only if it has already been enabled in the device tree. + +config CMD_MESON + bool "Amlogic Meson commands" + depends on ARCH_MESON + default y + help + Enable useful commands for the Meson Soc family developed by Amlogic Inc. endmenu diff --git a/cmd/Makefile b/cmd/Makefile index 5e43a1e022e..146c5ebb227 100644 --- a/cmd/Makefile +++ b/cmd/Makefile @@ -210,6 +210,9 @@ obj-$(CONFIG_RISCV) += riscv/ obj-$(CONFIG_SANDBOX) += sandbox/ obj-$(CONFIG_X86) += x86/ +# Meson +obj-$(CONFIG_CMD_MESON) += meson/ + obj-$(CONFIG_ARCH_MVEBU) += mvebu/ endif # !CONFIG_SPL_BUILD diff --git a/cmd/meson/Makefile b/cmd/meson/Makefile new file mode 100644 index 00000000000..ee26c175cfe --- /dev/null +++ b/cmd/meson/Makefile @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# Copyright (c) 2022, SberDevices. All rights reserved. + +obj-y += sm.o diff --git a/cmd/meson/sm.c b/cmd/meson/sm.c new file mode 100644 index 00000000000..c2b57707258 --- /dev/null +++ b/cmd/meson/sm.c @@ -0,0 +1,156 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (c) 2016 Beniamino Galvani + * + * Author: Beniamino Galvani + * Author: Vyacheslav Bocharov + * Author: Neil Armstrong + */ + +#include +#include +#include +#include +#include + +static int do_sm_serial(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[]) +{ + ulong address; + int ret; + + if (argc < 2) + return CMD_RET_USAGE; + + address = simple_strtoul(argv[1], NULL, 0); + + ret = meson_sm_get_serial((void *)address, SM_SERIAL_SIZE); + if (ret) + return CMD_RET_FAILURE; + + return CMD_RET_SUCCESS; +} + +#define MAX_REBOOT_REASONS 14 + +static const char *reboot_reasons[MAX_REBOOT_REASONS] = { + [REBOOT_REASON_COLD] = "cold_boot", + [REBOOT_REASON_NORMAL] = "normal", + [REBOOT_REASON_RECOVERY] = "recovery", + [REBOOT_REASON_UPDATE] = "update", + [REBOOT_REASON_FASTBOOT] = "fastboot", + [REBOOT_REASON_SUSPEND_OFF] = "suspend_off", + [REBOOT_REASON_HIBERNATE] = "hibernate", + [REBOOT_REASON_BOOTLOADER] = "bootloader", + [REBOOT_REASON_SHUTDOWN_REBOOT] = "shutdown_reboot", + [REBOOT_REASON_RPMBP] = "rpmbp", + [REBOOT_REASON_CRASH_DUMP] = "crash_dump", + [REBOOT_REASON_KERNEL_PANIC] = "kernel_panic", + [REBOOT_REASON_WATCHDOG_REBOOT] = "watchdog_reboot", +}; + +static int do_sm_reboot_reason(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[]) +{ + const char *reason_str; + char *destarg = NULL; + int reason; + + if (argc > 1) + destarg = argv[1]; + + reason = meson_sm_get_reboot_reason(); + if (reason < 0) + return CMD_RET_FAILURE; + + if (reason >= MAX_REBOOT_REASONS || + !reboot_reasons[reason]) + reason_str = "unknown"; + else + reason_str = reboot_reasons[reason]; + + if (destarg) + env_set(destarg, reason_str); + else + printf("reboot reason: %s (%x)\n", reason_str, reason); + + return CMD_RET_SUCCESS; +} + +static int do_efuse_read(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[]) +{ + ulong address, offset, size; + int ret; + + if (argc < 4) + return CMD_RET_USAGE; + + offset = simple_strtoul(argv[1], NULL, 0); + size = simple_strtoul(argv[2], NULL, 0); + + address = simple_strtoul(argv[3], NULL, 0); + + ret = meson_sm_read_efuse(offset, (void *)address, size); + if (ret != size) + return CMD_RET_FAILURE; + + return CMD_RET_SUCCESS; +} + +static int do_efuse_write(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[]) +{ + ulong address, offset, size; + int ret; + + if (argc < 4) + return CMD_RET_USAGE; + + offset = simple_strtoul(argv[1], NULL, 0); + size = simple_strtoul(argv[2], NULL, 0); + + address = simple_strtoul(argv[3], NULL, 0); + + ret = meson_sm_write_efuse(offset, (void *)address, size); + if (ret != size) + return CMD_RET_FAILURE; + + return CMD_RET_SUCCESS; +} + +static struct cmd_tbl cmd_sm_sub[] = { + U_BOOT_CMD_MKENT(serial, 2, 1, do_sm_serial, "", ""), + U_BOOT_CMD_MKENT(reboot_reason, 1, 1, do_sm_reboot_reason, "", ""), + U_BOOT_CMD_MKENT(efuseread, 4, 1, do_efuse_read, "", ""), + U_BOOT_CMD_MKENT(efusewrite, 4, 0, do_efuse_write, "", ""), +}; + +static int do_sm(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[]) +{ + struct cmd_tbl *c; + + if (argc < 2) + return CMD_RET_USAGE; + + /* Strip off leading 'sm' command argument */ + argc--; + argv++; + + c = find_cmd_tbl(argv[0], &cmd_sm_sub[0], ARRAY_SIZE(cmd_sm_sub)); + + if (c) + return c->cmd(cmdtp, flag, argc, argv); + else + return CMD_RET_USAGE; +} + +U_BOOT_CMD( + sm, 5, 0, do_sm, + "Secure Monitor Control", + "serial
- read chip unique id to memory address\n" + "sm reboot_reason [name] - get reboot reason and store to environment\n" + "sm efuseread
- read efuse to memory address\n" + "sm efusewrite
- write into efuse from memory address" +); From patchwork Thu Dec 22 12:57:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Romanov X-Patchwork-Id: 1718816 X-Patchwork-Delegate: narmstrong@baylibre.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=sberdevices.ru header.i=@sberdevices.ru header.a=rsa-sha256 header.s=mail header.b=nu6CaQQf; 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 ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Nd9NJ4Xk1z1ydb for ; Thu, 22 Dec 2022 23:58:24 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CD1218539D; Thu, 22 Dec 2022 13:57:51 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=sberdevices.ru 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=sberdevices.ru header.i=@sberdevices.ru header.b="nu6CaQQf"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3A68C85286; Thu, 22 Dec 2022 13:57:46 +0100 (CET) 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,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 mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id DE6948532C for ; Thu, 22 Dec 2022 13:57:43 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=sberdevices.ru Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=AVRomanov@sberdevices.ru Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id 451A55FD02; Thu, 22 Dec 2022 15:57:43 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1671713863; bh=yHjeNvpGpgd9Tom1+aMC2RhEagJs98dPJr+/zz5X80E=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=nu6CaQQfDf7OXmgUZuyV50jeR5dLIT/slmLhh7Q7WcGrMKB4Wu+VcoNzElHqPWWHQ q9kNrXORBmY2cY0SNNS7wH9gG3XPepC5bMc0slIvNEumMjZQ5Y6hMQEnxA7VV9Uyff b6TOdmR4j02XXsXmtFaz3xdp8GRgNsfv01UIWIf2AX0CN4ed1Ot+ABRVOy50VH++pg JGa1unBQJUWUOEMs6h2xpoornHQ0/i28qEpJA6VyYcwJTVrfaEeipGGvhUAsMt4ZoR J10i2v/7ufkCMoTVpCKgD8+ZwiltmcqErUGcvzliXrqJ6oEf2rqlesH3EefuT9Qf7H SutFot4g6Opsg== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Thu, 22 Dec 2022 15:57:43 +0300 (MSK) From: Alexey Romanov To: , , , CC: , , , Alexey Romanov Subject: [PATCH v3 3/5] doc/usage: cmd: documentation for meson/sm command Date: Thu, 22 Dec 2022 15:57:25 +0300 Message-ID: <20221222125727.47893-4-avromanov@sberdevices.ru> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20221222125727.47893-1-avromanov@sberdevices.ru> References: <20221222125727.47893-1-avromanov@sberdevices.ru> MIME-Version: 1.0 X-Originating-IP: [172.16.1.6] X-ClientProxiedBy: S-MS-EXCH02.sberdevices.ru (172.16.1.5) To S-MS-EXCH01.sberdevices.ru (172.16.1.4) X-KSMG-Rule-ID: 4 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiPhishing: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 1.1.2.30, bases: 2022/12/22 08:09:00 #20696641 X-KSMG-AntiVirus-Status: Clean, skipped 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.6 at phobos.denx.de X-Virus-Status: Clean Signed-off-by: Alexey Romanov Reviewed-by: Neil Armstrong --- doc/usage/cmd/sm.rst | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 doc/usage/cmd/sm.rst diff --git a/doc/usage/cmd/sm.rst b/doc/usage/cmd/sm.rst new file mode 100644 index 00000000000..3a70c137ec9 --- /dev/null +++ b/doc/usage/cmd/sm.rst @@ -0,0 +1,44 @@ +.. SPDX-License-Identifier: GPL-2.0+: + +Meson Security Monitor command +============================== + +Synopis +------- + +:: + + sm serial
+ sm reboot_reason [name] + sm efuseread
+ sm efusewrite
+ sm efusedump + +Description +----------- + +The sm command is used to request services from the secure monitor. User +can call secure monitor to request special TEE function, for example chip +serial number info, reboot reason, etc. + +sm serial + Retrieve chip unique serial number from sm and write it to memory on + appropriate address. + +sm reboot_reason + Print reboot reason to the console, if parameter [name] isn't specified. + If parameter specified, set reboot reason string to environment variable + with this name. + +sm efuseread + Read bytes starting from from efuse memory bank and write + result to the address
. + +sm efusewrite + Write into efuse memory bank, starting from , the bytes + of data, located at address
. + +Configuration +------------- + +To use the sm command you must specify CONFIG_CMD_MESON=y From patchwork Thu Dec 22 12:57:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Romanov X-Patchwork-Id: 1718817 X-Patchwork-Delegate: narmstrong@baylibre.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=sberdevices.ru header.i=@sberdevices.ru header.a=rsa-sha256 header.s=mail header.b=CQudraSu; dkim-atps=neutral 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 (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Nd9NW5YXwz1ydb for ; Thu, 22 Dec 2022 23:58:35 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D6FAF85346; Thu, 22 Dec 2022 13:57:53 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=sberdevices.ru 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=sberdevices.ru header.i=@sberdevices.ru header.b="CQudraSu"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 56B0085355; Thu, 22 Dec 2022 13:57:48 +0100 (CET) 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,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 mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 68207852F8 for ; Thu, 22 Dec 2022 13:57:45 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=sberdevices.ru Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=AVRomanov@sberdevices.ru Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id D564F5FD04; Thu, 22 Dec 2022 15:57:44 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1671713864; bh=5rLOuhoEQhgrqpyfDI+xBhoFlhhONODVpGzo+D9uNWw=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=CQudraSu9DUsT9rtImDAEmU21PdQKnO++mI0ZFagZ1BCTigmpcrQv/0Ga6ICoZKIF Im4UOMamHHGxETjfV5wJWWhdOHEpuqkJN33B+L/BuDTgtDSH/msTx0JaBZ7xHlBat4 VG0XVQdeddK7S6mOur2BKNMElshiqOo/cwmjdYfc5Tvf3UKY+YVA+pcFtzcQsi0CrQ uA3GOtAbWpZb+TBYng5/7wZkqZ9PhmODZQ40x5mIP1R5rAl3X4t21Tm6FYUi7H8MEH ElmCs+E+XEaoJ8gHY7RG2IV7FX+u0qCGqPxGkIwa01wKDltvuDWyQAG6lu4lCR+Qvj 254JXOdgoB4tQ== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Thu, 22 Dec 2022 15:57:44 +0300 (MSK) From: Alexey Romanov To: , , , CC: , , , Alexey Romanov Subject: [PATCH v3 4/5] cmd/arm: meson: sm: introduce efusedump command Date: Thu, 22 Dec 2022 15:57:26 +0300 Message-ID: <20221222125727.47893-5-avromanov@sberdevices.ru> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20221222125727.47893-1-avromanov@sberdevices.ru> References: <20221222125727.47893-1-avromanov@sberdevices.ru> MIME-Version: 1.0 X-Originating-IP: [172.16.1.6] X-ClientProxiedBy: S-MS-EXCH02.sberdevices.ru (172.16.1.5) To S-MS-EXCH01.sberdevices.ru (172.16.1.4) X-KSMG-Rule-ID: 4 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiPhishing: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 1.1.2.30, bases: 2022/12/22 08:09:00 #20696641 X-KSMG-AntiVirus-Status: Clean, skipped 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.6 at phobos.denx.de X-Virus-Status: Clean Using this command user can print efuse memory: $ sm efusedump 0 10 00000000: ff 00 31 00 00 ff 66 00 00 00 ..1...f... Signed-off-by: Alexey Romanov Reviewed-by: Mattijs Korpershoek Reviewed-by: Neil Armstrong --- cmd/meson/sm.c | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/cmd/meson/sm.c b/cmd/meson/sm.c index c2b57707258..d5eb1d6c084 100644 --- a/cmd/meson/sm.c +++ b/cmd/meson/sm.c @@ -5,6 +5,7 @@ * Author: Beniamino Galvani * Author: Vyacheslav Bocharov * Author: Neil Armstrong + * Author: Alexey Romanov */ #include @@ -119,11 +120,43 @@ static int do_efuse_write(struct cmd_tbl *cmdtp, int flag, int argc, return CMD_RET_SUCCESS; } +static int do_efuse_dump(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[]) +{ + ulong offset, size; + u8 *buffer; + int ret; + + if (argc != 3) + return CMD_RET_USAGE; + + offset = simple_strtoul(argv[1], NULL, 0); + size = simple_strtoul(argv[2], NULL, 0); + buffer = malloc(size); + if (!buffer) { + pr_err("Failed to allocate %lu bytes\n", size); + return CMD_RET_FAILURE; + } + + ret = meson_sm_read_efuse(offset, (void *)buffer, size); + if (ret != size) { + ret = CMD_RET_FAILURE; + goto free_buffer; + } + + print_buffer(0, buffer, 1, size, 0); + +free_buffer: + free(buffer); + return ret; +} + static struct cmd_tbl cmd_sm_sub[] = { U_BOOT_CMD_MKENT(serial, 2, 1, do_sm_serial, "", ""), U_BOOT_CMD_MKENT(reboot_reason, 1, 1, do_sm_reboot_reason, "", ""), U_BOOT_CMD_MKENT(efuseread, 4, 1, do_efuse_read, "", ""), U_BOOT_CMD_MKENT(efusewrite, 4, 0, do_efuse_write, "", ""), + U_BOOT_CMD_MKENT(efusedump, 3, 1, do_efuse_dump, "", ""), }; static int do_sm(struct cmd_tbl *cmdtp, int flag, int argc, @@ -152,5 +185,6 @@ U_BOOT_CMD( "serial
- read chip unique id to memory address\n" "sm reboot_reason [name] - get reboot reason and store to environment\n" "sm efuseread
- read efuse to memory address\n" - "sm efusewrite
- write into efuse from memory address" + "sm efusewrite
- write into efuse from memory address\n" + "sm efusedump - dump efuse data range to console" ); From patchwork Thu Dec 22 12:57:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Romanov X-Patchwork-Id: 1718818 X-Patchwork-Delegate: narmstrong@baylibre.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=sberdevices.ru header.i=@sberdevices.ru header.a=rsa-sha256 header.s=mail header.b=F6mbSLWG; dkim-atps=neutral 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 (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Nd9Nm2sVdz1ydb for ; Thu, 22 Dec 2022 23:58:48 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8C98385368; Thu, 22 Dec 2022 13:57:59 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=sberdevices.ru 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=sberdevices.ru header.i=@sberdevices.ru header.b="F6mbSLWG"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 96C6A85346; Thu, 22 Dec 2022 13:57:49 +0100 (CET) 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,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 mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 38A1385286 for ; Thu, 22 Dec 2022 13:57:47 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=sberdevices.ru Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=AVRomanov@sberdevices.ru Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id AB1795FD02; Thu, 22 Dec 2022 15:57:46 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1671713866; bh=YzJm2PA5bVPmuDhiYC7Nw31tyE264Ry90BJHOeUWyZ4=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=F6mbSLWGvFvSJLUlzAEwaaEALjB0fE0LgVDyOJvWjv+ntT9ewZ+bMYY3CrAPq08qF stKdHXVB6Av3gHcoq7BkpDKj/KIFtyTSJuN073sZaNrA90dn0rdaZTfKWm6n2Y5Z43 9JsXUoyWW2wY58y56PQponVPBZ6+mKOYpF0vECWZ6fvKfjR8GEeR/t5hKSXZpfmc2+ 2fWMRWh0HEtxauHJ6YYevJPoVzkgyTgFtyWz1bwdHn9Cds7ZVpyOlOyIsXvc8X2t64 U8ZxdasLmDzYF+R6GawhOroPFBN8OdEZpKVHp6z5T86fDuFOrM8jCHqEQAKi0PDG1W ndlzztdva8JJQ== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Thu, 22 Dec 2022 15:57:46 +0300 (MSK) From: Alexey Romanov To: , , , CC: , , , Alexey Romanov Subject: [PATCH v3 5/5] doc/usage: cmd: sm: documentation efusedump cmd Date: Thu, 22 Dec 2022 15:57:27 +0300 Message-ID: <20221222125727.47893-6-avromanov@sberdevices.ru> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20221222125727.47893-1-avromanov@sberdevices.ru> References: <20221222125727.47893-1-avromanov@sberdevices.ru> MIME-Version: 1.0 X-Originating-IP: [172.16.1.6] X-ClientProxiedBy: S-MS-EXCH02.sberdevices.ru (172.16.1.5) To S-MS-EXCH01.sberdevices.ru (172.16.1.4) X-KSMG-Rule-ID: 4 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiPhishing: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 1.1.2.30, bases: 2022/12/22 08:09:00 #20696641 X-KSMG-AntiVirus-Status: Clean, skipped 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.6 at phobos.denx.de X-Virus-Status: Clean Signed-off-by: Alexey Romanov Reviewed-by: Neil Armstrong --- doc/usage/cmd/sm.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/usage/cmd/sm.rst b/doc/usage/cmd/sm.rst index 3a70c137ec9..beb53b3f46d 100644 --- a/doc/usage/cmd/sm.rst +++ b/doc/usage/cmd/sm.rst @@ -38,6 +38,10 @@ sm efusewrite Write into efuse memory bank, starting from , the bytes of data, located at address
. +sm efusedump + Read bytes starting from from efuse memory bank and print + them to the console. + Configuration -------------