From patchwork Thu Jul 20 14:49:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Detlev Casanova X-Patchwork-Id: 1810518 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=collabora.com header.i=@collabora.com header.a=rsa-sha256 header.s=mail header.b=eHJsfist; 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)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4R6FwZ3bxbz20Cs for ; Fri, 21 Jul 2023 00:50:22 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id ABC18867F0; Thu, 20 Jul 2023 16:50:18 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=collabora.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=collabora.com header.i=@collabora.com header.b="eHJsfist"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 20990867DF; Thu, 20 Jul 2023 16:50:18 +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,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) (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 09C1D867E7 for ; Thu, 20 Jul 2023 16:50:15 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=detlev.casanova@collabora.com Received: from arisu.mtl.collabora.ca (mtl.collabora.ca [66.171.169.34]) (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) (Authenticated sender: detlev) by madras.collabora.co.uk (Postfix) with ESMTPSA id DA1BD6607089; Thu, 20 Jul 2023 15:50:13 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1689864614; bh=Qida9YkA2VgUDLHsw7GxsWArBcd8P4UbUfaZ0NSpz+o=; h=From:To:Cc:Subject:Date:From; b=eHJsfist+fbiDGaDxaE89Fj1qTeDgLV3ZH4MTSuTPMMrvwMKwMEYojjex+BqdVKln EFjWP/3wTeUna23gyZ39ntEmwg71MWvP/C0/hwx8n66Gkx4T/kKNVr3ARZ2zPC3KjF eQAhKC2GTeAELljKRP68XhIUOJGw1oS0Q8jSyKzsSrWZ6Xj8PgG3q+M4jPlMQypoWQ y4i5J3UaoioaGabq2drZxyQvfkAo5si5W/snYATLbTnVxvt9uIiaLkW7eDg/2VYAGh bO5oC2+ytrxJKrqOKF0VixH4bCXHxaMkksHraa/Z1sqPLuSx39TgwuL8+sEF3+wtB1 cHsqHZPtsGh7Q== From: Detlev Casanova To: u-boot@lists.denx.de Cc: Marek Vasut , Hai Pham , Tam Nguyen , Simon Glass , Detlev Casanova Subject: [PATCH v4 0/6] Introduce the sysinfo command Date: Thu, 20 Jul 2023 10:49:41 -0400 Message-ID: <20230720145010.84791-1-detlev.casanova@collabora.com> X-Mailer: git-send-email 2.41.0 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 command can be used to show various information that can be used to identify the running system. Currently supported subcommands are: * model: A string representing the model * id: The id of the board * revision: The revision of this board. Changes since v3: - Fix documentation typo. Changes since v2: - Fix code style. - Use printf() instead of debug(). - Clarify sysinfo new ids types (int). - Add a test for sysinfo command. - Add documentation for sysinfo command. Changes since v1: - Removed shell function to select linux device tree. This will be distributions job. - Break revision in rev_major and rev_minor in the sysinfo driver. Detlev Casanova (6): sysinfo: Add IDs for board id and revision cmd: Add a sysinfo command sysinfo: Add a test sysinfo: Add documentation sysinfo: rcar3: Use int instead of char for revision sysinfo: rcar3: Implement BOARD_ID and BOARD_REV_* cmd/Kconfig | 6 ++ cmd/Makefile | 1 + cmd/sysinfo.c | 133 +++++++++++++++++++++++++++++++++++ configs/sandbox_defconfig | 1 + doc/usage/cmd/sysinfo.rst | 56 +++++++++++++++ drivers/sysinfo/rcar3.c | 141 ++++++++++++++++++++++++++------------ drivers/sysinfo/sandbox.c | 17 +++++ include/sysinfo.h | 5 ++ test/cmd/Makefile | 1 + test/cmd/test_sysinfo.c | 51 ++++++++++++++ 10 files changed, 370 insertions(+), 42 deletions(-) create mode 100644 cmd/sysinfo.c create mode 100644 doc/usage/cmd/sysinfo.rst create mode 100644 test/cmd/test_sysinfo.c