From patchwork Sat Dec 23 00:44:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 1879816 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; secure) header.d=gmx.de header.i=xypron.glpk@gmx.de header.a=rsa-sha256 header.s=s31663417 header.b=Y+J2IegL; 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 4SxlnF4lDfz1ydZ for ; Sat, 23 Dec 2023 11:45:05 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 16EEE876BF; Sat, 23 Dec 2023 01:44:51 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=gmx.de 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; secure) header.d=gmx.de header.i=xypron.glpk@gmx.de header.b="Y+J2IegL"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B1AD7871CE; Sat, 23 Dec 2023 01:44: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,FREEMAIL_FROM,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) (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 D91ED874AC for ; Sat, 23 Dec 2023 01:44:47 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=gmx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=xypron.glpk@gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1703292286; x=1703897086; i=xypron.glpk@gmx.de; bh=kVAfIZBf46G043JD7oJySFPmZFjX54+PEB3y0+1grwU=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To: References; b=Y+J2IegL16ykSkP7dD4TI3Fa/mqaE1v6l8QfNuBPSZQe06p4LmlLclpvKl2i3BRf ckVP4359lAIBzuCcdsnkWGa1DGnJ5majO9PpTpHJ3qLGoA5YJXVKnxoc3bOU6O/bO 9bsRKS4J4dfX+IS6WqHUC5PpK6nTZFuqhUJga3uSfVFv6dxzOZRZ7LACuIL5K5XVJ h28T4TlzDvAeaf5X8ZqC0WMWsTULP1T01SvuX6nNvNwo+h1Of266QBMlnLpehM3bt 9GQu8xrvzWmPP8Loa77IG+FPnrQVZEFvvHLagvxTC4EOMjMIGX1aHf8DTfLeFJDwc KMmmrBKmd41UFjEtWg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from x13s.fritz.box ([178.202.40.247]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1M4b1o-1rFBhg2GaU-001l52; Sat, 23 Dec 2023 01:44:46 +0100 From: Heinrich Schuchardt To: Simon Glass Cc: Ilias Apalodimas , Bin Meng , u-boot@lists.denx.de, Heinrich Schuchardt Subject: [PATCH 1/5] smbios: correct definition of gd_smbios_start() macro Date: Sat, 23 Dec 2023 01:44:25 +0100 Message-ID: <20231223004429.247301-2-xypron.glpk@gmx.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231223004429.247301-1-xypron.glpk@gmx.de> References: <20231223004429.247301-1-xypron.glpk@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:vL9YIXAspd4PE/MdYVP1T34wvqk4FuGdcqHTgXdKabiaK3DgbPQ XCskIzDkitFeOXBGHglux/PIEqXQ6cO6iCahWnQ9japfgNBqgN9AJwWJstv27BH1mXbjD3N wJssZf06NxDU3HzhHsP4aIQaMghF7EvApODBuTDhfWFH2l+lxDe/A8RLvZTJXz5IVzXNUAs 169VJbmAJCLZZdR7eqblg== UI-OutboundReport: notjunk:1;M01:P0:A+NSzR8rY+c=;Yctt3U/ZXjGzEhM7kfY/dAYBipl 8qdqbU6DgOGlZKw8iVAG7ILfw9BqEOY+5ZyACpl8TE2Z/BugjPYIiZZyWqea0eE7M71B4lQbv Q2MNbyZ12rWIlZO5ZyznXhdLyMi1X0GP/Ke0ewSwkR+zrTmAz1FxosVrRawrN0KfYCjTQygZ2 rbXn3d0r0fOKzP2XlW1BL+eOgGWguvg0SYO1jJjU9RtXPe8ia+VrX82dK/1FUT9zSpa3SMkMr XpbwJO6vcWtTnt1dq9Vd0vydsw6KiBhMea6buH5JLtpfgUIQQNioelmfVZZiov+laVktrW3Ch hIKUB+0y3bhto+52smBP99xXSPTpyB1j0PbmecSP3rAfCN3QoZexjIodE3kNkMhi+gBv7Fnbh YWEJELZS0K3ydALVUYwD6rIw/84Y9QUXcyB7zzK1lqlXQnOfuIq48KVVnEWiZ0DIFJg5RS0t7 PgiBXi3gxaTAFCLlrEEJwmhrC//NPxRd/9R5YEmDY0F7QkMf1zdOm7pV/YngiGCXrQgEBMx1v MO9HtOzJVGRMbFIdGWl/oBrev2HId8SQEnhvL/I6zdlV+ElUzDvuGgTFfit9/5YMwNd8Fwq2/ havK0tEpgDZnmilnbT1EJ7dTc5sTcUAL6Gi3+v7wnWsfzkvdXOJyQA1W+BGTWNhATtCnXI22/ xMarbMmN8Fbv6izNA/ZfUclIT3lNmJreJ+GEWCmc91BWt+Beb3Ayspa+f16zCBvcZGZ2xv3R5 dAnddt3oCYqOTC8drtgxjsnVSBtO5qcBAj4gXbryOzFrlt7CQIcLAgDKsLyldKmNco87MkBnc fVqrdcxIIym26b4rBxcByP1CdmWDJpyvLcZ/VlprOE04sShPI6thrbBPYwU3Gz71mIhk01LAv 2ZOmAfkGjI2cLIinkkZea+t9x1W8CQ/LEgoCrTr/8tuhc/fRWabJLuMswuL15CKwvhBk2LKrZ gLB57CuprNN5mHPP7ir1aED9SdE= 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 gd_smbios_start() currently points to a non-existent field. It should return the field written by gd_set_smbios_start(). Fixes: 50834884a815 ("Record the position of the SMBIOS tables") Signed-off-by: Heinrich Schuchardt --- include/asm-generic/global_data.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.43.0 diff --git a/include/asm-generic/global_data.h b/include/asm-generic/global_data.h index e8c6412e3f..c1f7818817 100644 --- a/include/asm-generic/global_data.h +++ b/include/asm-generic/global_data.h @@ -553,7 +553,7 @@ static_assert(sizeof(struct global_data) == GD_SIZE); #endif #ifdef CONFIG_SMBIOS -#define gd_smbios_start() gd->smbios_start +#define gd_smbios_start() gd->arch.smbios_start #define gd_set_smbios_start(addr) gd->arch.smbios_start = addr #else #define gd_smbios_start() 0UL From patchwork Sat Dec 23 00:44:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 1879817 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; secure) header.d=gmx.de header.i=xypron.glpk@gmx.de header.a=rsa-sha256 header.s=s31663417 header.b=Jq2ZN6it; 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 4SxlnQ3kxmz20R1 for ; Sat, 23 Dec 2023 11:45:14 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7AD5F87579; Sat, 23 Dec 2023 01:44:53 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=gmx.de 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; secure) header.d=gmx.de header.i=xypron.glpk@gmx.de header.b="Jq2ZN6it"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3D16F8772E; Sat, 23 Dec 2023 01:44:51 +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,FREEMAIL_FROM,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) (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 291F68753D for ; Sat, 23 Dec 2023 01:44:48 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=gmx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=xypron.glpk@gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1703292287; x=1703897087; i=xypron.glpk@gmx.de; bh=5gko8YhLDnHiZj2VIXDQFGXfSNsSo0H4Zn6w8AiXDkE=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To: References; b=Jq2ZN6itd2xPRlbDuWL+ASAwSB8E87UE9gQgWh4ev7e1KqNeaNNy8PoCFYYCQDve +WZCIG/FB/Rvq4F3j0cXVIvpFmc70ihI3FYo4+S5CwZE6mKu9SzAAvCHgSnncZh3P UU1vtEKPz4mGyEDmBesP3V+rDamEWeVQpsSR/PRnYkE6a44YTG4Ra2hkfl/4Cf0kd wpaBWEINjIxpQ+r8rgc8g9u4/yTqHhmChL2dUr2s42f0RSrEFoK5yq6/BABVv18qE WfbuOe1Yid0G0n2DWMNkH55xIbUlYH3hcDnyU8nvcrevvrI6lIFbrzDUAGBwNaVMe L5BVG860GfNDBkJhSQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from x13s.fritz.box ([178.202.40.247]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MbivM-1qiJrE3QHW-00dIkm; Sat, 23 Dec 2023 01:44:46 +0100 From: Heinrich Schuchardt To: Simon Glass Cc: Ilias Apalodimas , Bin Meng , u-boot@lists.denx.de, Heinrich Schuchardt Subject: [PATCH 2/5] smbios: type2: contained object handles Date: Sat, 23 Dec 2023 01:44:26 +0100 Message-ID: <20231223004429.247301-3-xypron.glpk@gmx.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231223004429.247301-1-xypron.glpk@gmx.de> References: <20231223004429.247301-1-xypron.glpk@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:JFjuCNQx00t1MunG95DWZhloJTCTRn/CBeiKYeNCwJHDEpuoR/U a1KVO4BN5yMO8EL04PurfL2ahY6VJ4oaXYTj3ydt5YMOaJU3hs6vL+qp6MQYoQv4+WrtTRd D+OgB/WXE5QtRE2uHWhwnIxdpgYmk+7W55z/CPkIyLNuZ9v8cZMbHKQpPfPNPWGmdORyjnL 3FTae+eC88aVon9IPhTPQ== UI-OutboundReport: notjunk:1;M01:P0:Is8ERwoFrtM=;+ttOVOOY0NtoJLO1O1msvVdNkTq phjg4HHror1ZE3WJuk6iTXoe3CDB1anIHLCrBgsnXfpeH73gS8r52WeE0M9zdb9SyUHrkmict DG24PNSmhKf7vPZni3Gn/fgFJ4vWWnRP7uOnbkjSKLyn/tAmH0zxqTU8xX2CTXTUjfErDTHSN mTLIdJrDNFElkGCnL3Q7FOLTYPgKdp/G44e9OeQiFSFAO5YlkJ6g37WRCsQ9NL0yPbpb4sY4Y 1RfZpR6dVmciU1/43DjTrMtlQZjSfv+OcVtasNGxOaIVr7ZGtfJQWIYIwY8jMwORPp5rxdN2E Va8J1ageFuiriVhNbQz0bkhTXg6Pm5q+ZyXV4UR/goOc2SyUa7NbCIVr6l2Z526s0UEsEnW+P gHCqSJwArHIWiIKuGci5xTG2kIrxegwBgFTdYmAY0e/w9Rbi93IzUycdOS10o3uU3+yxPp6El 6BpY4OZc/tvgsf5oKMMVpSCPbcaL6zojwtKej0IEzEKhIQTZzrCCMN+5EY2LjUa7ktTztJALI 8lDfu3Vp0IRV33IejSavd3GIY+ZCRGElIaxNBNcRMLixWFD7MyFgUXIuTkBx4ggND62GUj8oa yB50N9XLRZCDMaC57/hTZJZ+Lpi2V4eJHMHFavunu44iOwUnPOeIv7V8jxEbwUDdifspf/ja1 ibBaJDZVwRrNUeB3IKTLPzJT19weEtI+jbYDlETVGA6NueZfd2QQA141vooEonCaAOV8Tg6Nc WQcyxZSLz1jteDDFqXVGUJ6jq/VkU9AGCA+M8HDGFud70xtOMlZ3EMXXeuZoynXfdQXqdyZlQ S6ghFMEPJ4lkFridImZ01LF209MBj5gXV8XDDyANo+kZCxN4HL45BSCWiyTmFTHhg1RBHDPM3 eJLebNFPPX5uS6P7Juu7jNz+sbLRIZ1Fm72+eMYfh1Mp6wg1urboTEGk9cz6nI4o1L3nME9h7 7008n9Y8XgyMI5/jVkX1vtsCAs8= 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 type 2 structure must include information about the contained objects. It is fine to set the number of contained object handles to 0. Add the missing field. Fixes: 721e992a8af5 ("x86: Add SMBIOS table support") Signed-off-by: Heinrich Schuchardt Reviewed-by: Ilias Apalodimas --- include/smbios.h | 1 + 1 file changed, 1 insertion(+) -- 2.43.0 diff --git a/include/smbios.h b/include/smbios.h index e601283d29..88c19ae062 100644 --- a/include/smbios.h +++ b/include/smbios.h @@ -139,6 +139,7 @@ struct __packed smbios_type2 { u8 chassis_location; u16 chassis_handle; u8 board_type; + u8 number_contained_objects; char eos[SMBIOS_STRUCT_EOS_BYTES]; }; From patchwork Sat Dec 23 00:44:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 1879819 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; secure) header.d=gmx.de header.i=xypron.glpk@gmx.de header.a=rsa-sha256 header.s=s31663417 header.b=LJolok3f; 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 4Sxlns582rz20R1 for ; Sat, 23 Dec 2023 11:45:37 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 48CF7871CE; Sat, 23 Dec 2023 01:44:54 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=gmx.de 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; secure) header.d=gmx.de header.i=xypron.glpk@gmx.de header.b="LJolok3f"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7E51687579; Sat, 23 Dec 2023 01:44:51 +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,FREEMAIL_FROM,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) (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 5EFEB87640 for ; Sat, 23 Dec 2023 01:44:48 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=gmx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=xypron.glpk@gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1703292287; x=1703897087; i=xypron.glpk@gmx.de; bh=qRhYStgJWrJohh1moIc9Gu986sqUmIChoooVSpFxHgM=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To: References; b=LJolok3fu/tbTjkg5bmBYJvrr0cU9ETs3PuvkKG4Ond7gH4a5TCjDLYOVShvGBLn IM/BPJGNNCA0CgCkUyuAlhu/honaEJdAPovPfkX93sUcoV6WPn3KBe2rIgHeCpYK9 SE35YSSI68zHeYsK57hsVkW1DfFklIipLWCeijHoUaDg2kQdVIa1UB/NsmLa6rnjR CQ1wTfckxlsNHxaZ5fadY8ChcXOvL0gK+aWIgVQwCAlWDvgGIZ0Z9CjsR2xCSjUcm Pqc2mSPlUU7AEeiYkCOZ6xbEvCjVPxaoT8S4tv6/Z9vXS1wR58vWS0xHapysVfmwE LiJh1Z8QqPprJ4qlwg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from x13s.fritz.box ([178.202.40.247]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MhD6W-1qleJB0XGk-00ePDk; Sat, 23 Dec 2023 01:44:47 +0100 From: Heinrich Schuchardt To: Simon Glass Cc: Ilias Apalodimas , Bin Meng , u-boot@lists.denx.de, Heinrich Schuchardt Subject: [PATCH 3/5] cmd: provide command to display SMBIOS information Date: Sat, 23 Dec 2023 01:44:27 +0100 Message-ID: <20231223004429.247301-4-xypron.glpk@gmx.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231223004429.247301-1-xypron.glpk@gmx.de> References: <20231223004429.247301-1-xypron.glpk@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:l/VoTmZVWGc1jpd3HnZvPppRtVm0AjsA4koZxn1cjN29o/mwv8v bKXT6QAZkkLtagpMLwPNH5RB683jcrMW09MfL8MnuUbEhYwNfrsUDIVVLHTunEywHuBodii 5Mfgg9RincEDKnLH35mmLyxTqQ9Quc/RYfUq7XZcT7esuiCdy4kKc4ZvvSYPXJI9/K6Nn37 AegohVlTJgSkZJXD/WI3w== UI-OutboundReport: notjunk:1;M01:P0:fitGTQUQ234=;Mu9A94nuCZgU+Z8Zu5wCIv5W0dh X3p69xhkxXUkJz+XsNgz2foFW1J5UYQBN+KqLJHefOh+IgpE+iVsW9P2wzxBm815NXrbUpyun ZHnVBLc2XXtqkYYVPqKzYGVbB/MtEEL+lkFdpCXzLczViSo7AL0mmBp/rflUYYbv1UhrrpJoC fVtR6OA0BmxiKclFrdaC3rkyKqVcASCvEH9sH4rP+AekGsaFWrisL3/0BrAWflkbPBaYcjWLH r37Po5ZOzOgoG0Mi65kp8+jKx/wtBUrZ5aB2hDUnNFi2hclYROVhEBwS5zQ3JUj89JFoUWDrm rzINbwL1i4dSYFOkCNQqt5nPLujJdEvjuCy4NxZcZ8iG+eafq9t8lhbwci5OvCfW9PGHrymsI PAq+QfJ7+JIfaaLaGQGtdSLIuNdw+NyEvel2xB+Wfk0ovLVJ87hso5nRD1jRlmWveWQRrCGzW q2y1JkC3eXGSkY/FEk5qnvxiq2wwrRTUMKklYlIObsDuXsga/XZ+tTbj8vGTt9ANpvWizkuZk ajUbwIgfksI4m69RKYC/atWnUBSbNc11VQXTh6Q620VXTdemPCtnbFQmLryaK/LDmC4tY8R/o fBy1YiJhu6MfMdyPrpeztCE4aRxE4BvdT1ofYbO2SHJR7GSJhc8exzTK4AoeBEkuEEXG9cicu Sc/ZBKWCTPFWemcHOnd7dWx6+4hW9Q2PWdBncnGdMfyzMkcagG7FGD+fHPcfPIWQKHoI0YrOW 0A8p076Ksz2MkbLwfbhsm78EkOcAwrXo/qvUd9bmrd/+ZWKnT9kz3PODJc7xqb4bjrE1dQcl9 NqY06/Dq9Xdt3zB0euHbvuLmB2y9VAQc1/gRs7epplsX6akt9+UEbKGZGMUrUxX6ANq5gmclC c5KOkkLnd4U89JzVr8CPjnNI8yb7thcLZblrH63DhZeyBxqgKlvKun4lk0rtVq+Bvj3cBOV5y +hpTXn3+95iGchi3mWm0EG9rZso= 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 U-Boot can either generated an SMBIOS table or copy it from a prior boot stage, e.g. QEMU. Provide a command to display the SMBIOS information. Currently only type 1 and 2 are translated to human readable text. Other types may be added later. Currently only a hexdump and the list of strings is provided for these. Signed-off-by: Heinrich Schuchardt Reviewed-by: Simon Glass --- cmd/Kconfig | 7 ++ cmd/Makefile | 1 + cmd/smbios.c | 191 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 199 insertions(+) create mode 100644 cmd/smbios.c -- 2.43.0 diff --git a/cmd/Kconfig b/cmd/Kconfig index 5a7678f0ac..580aeec8ee 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -206,6 +206,13 @@ config CMD_SBI help Display information about the SBI implementation. +config CMD_SMBIOS + bool "smbios" + depends on SMBIOS + default y + help + Display the SMBIOS information. + endmenu menu "Boot commands" diff --git a/cmd/Makefile b/cmd/Makefile index 5ed0e4011d..8a5dfd8ca9 100644 --- a/cmd/Makefile +++ b/cmd/Makefile @@ -168,6 +168,7 @@ obj-$(CONFIG_CMD_SETEXPR) += setexpr.o obj-$(CONFIG_CMD_SETEXPR_FMT) += printf.o obj-$(CONFIG_CMD_SPI) += spi.o obj-$(CONFIG_CMD_STRINGS) += strings.o +obj-$(CONFIG_CMD_SMBIOS) += smbios.o obj-$(CONFIG_CMD_SMC) += smccc.o obj-$(CONFIG_CMD_SYSBOOT) += sysboot.o obj-$(CONFIG_CMD_STACKPROTECTOR_TEST) += stackprot_test.o diff --git a/cmd/smbios.c b/cmd/smbios.c new file mode 100644 index 0000000000..63f908e92c --- /dev/null +++ b/cmd/smbios.c @@ -0,0 +1,191 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * The 'smbios' command displays information from the SMBIOS table. + * + * Copyright (c) 2023, Heinrich Schuchardt + */ + +#include +#include +#include +#include +#include +#include + +DECLARE_GLOBAL_DATA_PTR; + +/** + * smbios_get_string() - get SMBIOS string from table + * + * @table: SMBIOS table + * @index: index of the string + * Return: address of string, may point to empty string + */ +static const char *smbios_get_string(void *table, int index) +{ + const char *str = (char *)table + + ((struct smbios_header *)table)->length; + + if (!*str) + ++str; + for (--index; *str && index; --index) + str += strlen(str) + 1; + + return str; +} + +static struct smbios_header *next_table(struct smbios_header *table) +{ + const char *str; + + if (table->type == SMBIOS_END_OF_TABLE) + return NULL; + + str = smbios_get_string(table, 0); + return (struct smbios_header *)(++str); +} + +static void smbios_print_generic(struct smbios_header *table) +{ + char *str = (char *)table + table->length; + + if (CONFIG_IS_ENABLED(HEXDUMP)) { + printf("Header and Data:\n"); + print_hex_dump("\t", DUMP_PREFIX_OFFSET, 16, 1, + table, table->length, false); + } + if (*str) { + printf("Strings:\n"); + for (int index = 1; *str; ++index) { + printf("\tString %u: %s\n", index, str); + str += strlen(str) + 1; + } + } +} + +void smbios_print_str(const char *label, void *table, u8 index) +{ + printf("\t%s: %s\n", label, smbios_get_string(table, index)); +} + +static void smbios_print_type1(struct smbios_type1 *table) +{ + printf("System Information\n"); + smbios_print_str("Manufacturer", table, table->manufacturer); + smbios_print_str("Product Name", table, table->product_name); + smbios_print_str("Version", table, table->version); + smbios_print_str("Serial Number", table, table->serial_number); + if (table->length >= 0x19) { + printf("\tUUID %pUl\n", table->uuid); + smbios_print_str("Wake Up Type", table, table->serial_number); + } + if (table->length >= 0x1b) { + smbios_print_str("Serial Number", table, table->serial_number); + smbios_print_str("SKU Number", table, table->sku_number); + } +} + +static void smbios_print_type2(struct smbios_type2 *table) +{ + u16 *handle; + + printf("Base Board Information\n"); + smbios_print_str("Manufacturer", table, table->manufacturer); + smbios_print_str("Product Name", table, table->product_name); + smbios_print_str("Version", table, table->version); + smbios_print_str("Serial Number", table, table->serial_number); + smbios_print_str("Asset Tag", table, table->asset_tag_number); + printf("\tFeature Flags: 0x%2x\n", table->feature_flags); + smbios_print_str("Chassis Location", table, table->chassis_location); + printf("\tChassis Handle: 0x%2x\n", table->chassis_handle); + smbios_print_str("Board Type", table, table->board_type); + printf("\tContained Object Handles: "); + handle = (void *)table->eos; + for (int i = 0; i < table->number_contained_objects; ++i) + printf("0x%04x ", handle[i]); + printf("\n"); +} + +static void smbios_print_type127(struct smbios_type127 *table) +{ + printf("End Of Table\n"); +} + +static int do_smbios(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[]) +{ + ulong addr; + void *entry; + u32 size; + char version[12]; + struct smbios_header *table; + static const char smbios_sig[] = "_SM_"; + static const char smbios3_sig[] = "_SM3_"; + size_t count = 0; + u32 max_struct_size; + + addr = gd_smbios_start(); + if (!addr) { + log_warning("SMBIOS not available\n"); + return CMD_RET_FAILURE; + } + entry = map_sysmem(addr, 0); + if (!memcmp(entry, smbios3_sig, sizeof(smbios3_sig) - 1)) { + struct smbios3_entry *entry3 = entry; + + table = (void *)(uintptr_t)entry3->struct_table_address; + snprintf(version, sizeof(version), "%d.%d.%d", + entry3->major_ver, entry3->minor_ver, entry3->doc_rev); + table = (void *)(uintptr_t)entry3->struct_table_address; + size = entry3->length; + max_struct_size = entry3->max_struct_size; + } else if (!memcmp(entry, smbios_sig, sizeof(smbios_sig) - 1)) { + struct smbios_entry *entry2 = entry; + + snprintf(version, sizeof(version), "%d.%d", + entry2->major_ver, entry2->minor_ver); + table = (void *)(uintptr_t)entry2->struct_table_address; + size = entry2->length; + max_struct_size = entry2->max_struct_size; + } else { + log_err("Unknown SMBIOS anchor format\n"); + return CMD_RET_FAILURE; + } + if (table_compute_checksum(entry, size)) { + log_err("Invalid anchor checksum\n"); + return CMD_RET_FAILURE; + } + printf("SMBIOS %s present.\n", version); + + for (struct smbios_header *pos = table; pos; pos = next_table(pos)) + ++count; + printf("%zd structures occupying %d bytes\n", count, max_struct_size); + printf("Table at 0x%llx\n", (unsigned long long)map_to_sysmem(table)); + + for (struct smbios_header *pos = table; pos; pos = next_table(pos)) { + printf("\nHandle 0x%04x, DMI type %d, %d bytes at 0x%llx\n", + pos->handle, pos->type, pos->length, + (unsigned long long)map_to_sysmem(pos)); + switch (pos->type) { + case 1: + smbios_print_type1((struct smbios_type1 *)pos); + break; + case 2: + smbios_print_type2((struct smbios_type2 *)pos); + break; + case 127: + smbios_print_type127((struct smbios_type127 *)pos); + break; + default: + smbios_print_generic(pos); + break; + } + } + + return CMD_RET_SUCCESS; +} + +U_BOOT_LONGHELP(smbios, "- display SMBIOS information"); + +U_BOOT_CMD(smbios, 1, 0, do_smbios, "display SMBIOS information", + smbios_help_text); From patchwork Sat Dec 23 00:44:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 1879818 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; secure) header.d=gmx.de header.i=xypron.glpk@gmx.de header.a=rsa-sha256 header.s=s31663417 header.b=tSsGilyw; 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 4Sxlnd4YxXz20R1 for ; Sat, 23 Dec 2023 11:45:25 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DC69C8772E; Sat, 23 Dec 2023 01:44:53 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=gmx.de 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; secure) header.d=gmx.de header.i=xypron.glpk@gmx.de header.b="tSsGilyw"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 595F987579; Sat, 23 Dec 2023 01:44:51 +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,FREEMAIL_FROM,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) (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 49A08875FA for ; Sat, 23 Dec 2023 01:44:48 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=gmx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=xypron.glpk@gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1703292287; x=1703897087; i=xypron.glpk@gmx.de; bh=GnWjx8hWwuDHDfOYVfZIPfjMVY78/OpVbI8AprLjN4k=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To: References; b=tSsGilywDt84T5kSZgrqtiuCqye+eIZ6V2qsxi4CFK1wpELJAjLf0LKB0x7gJUGB TQC6YRYxZz4WJqeboSB1EfsNuhFDuhOYvQl5z7Id3ALSgxWbjKoFRcwFUxAwIUXuU 18tlMCPRoV4eVp0Ey4+Yj4yEASm4aBnMY9F+bEPi4N/Nl2wctw2jhWlLuQEy8CAG0 WE4lcPTFuZ85iPXrxMXrP6w5CnWgrdIDfMHYJbgbbPf8L2d4YjVUfGPBXCM8fFuCi Wi7HstBRAciL7RF3JiOY/+bCP/i1hXWpP9kT2W4gvzucaA5r/iPBZZJPdW+t7wcpx Awa0wzDtpbolDaSOnA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from x13s.fritz.box ([178.202.40.247]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MD9T1-1rPsXW1ghN-00993r; Sat, 23 Dec 2023 01:44:47 +0100 From: Heinrich Schuchardt To: Simon Glass Cc: Ilias Apalodimas , Bin Meng , u-boot@lists.denx.de, Heinrich Schuchardt Subject: [PATCH 4/5] doc: man-page for smbios command Date: Sat, 23 Dec 2023 01:44:28 +0100 Message-ID: <20231223004429.247301-5-xypron.glpk@gmx.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231223004429.247301-1-xypron.glpk@gmx.de> References: <20231223004429.247301-1-xypron.glpk@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:tDky/Y3+RbncKGNwWQPbatYftLm3/yET7uYqrXr14McXcQikOXR oDLKfMcmZs/nMLcV5vZhTHXvS+NWodWEgJDSThwG+SQrN92UvMVbuEOHyWmo1jk+BVlKNmw o48wgexa3XtqMfBFDIl7dMtgQKEyexnqZvJ+I9ugVYkWBIX1v8w7xQzrzlNTPGUaRNOedAO ue0Jcnjwmq49W481tyGXQ== UI-OutboundReport: notjunk:1;M01:P0:SyFRFjEpQeY=;4IFnNjHAZqgR+vOL5dBjsR37jbr DJi7RCzjFbQa+p1C7N5stNJgaD8/IliaXWNUqc8Ae3BLnxUFvlJ5xwlUowuBOZCU6p24a77Wa qOPucrmsM3GgrMfuyXcP7IzFIW19I/YSa7BdExdtf9TyA5YOBQRw1gJNxvyAMJqYKFlrPYrRw SUF+x0ICwWGiviw+zj1jk+g5l0tx6k/rBjMwmhQniDGh4AMlMu31CJFqvBPCoLMIL7ZeT/OZS n0IPsX9OEkj4POYLYJckYjrtTSsnP6WbE47+M7RaW/+1hIk2HjxyI34cz8k/bX3xlNVbotR8W 8QyRTqDw8Hd7zLXBPmXpQeC6yNOSPsjR6Ci+PdtjtUF4FtjE1SR5fGPBJ2LjFZeBie5QAt+aP 90yzmYZtLpxUyJx/52ZVfifYpNapg3Jqj5XUOmOMVik8Pf6X9dxNK7ZyQwfBNTlsUfOtqBJ5o cUSch1lSsYCWfviq7pRBE17nwDuWBgvkAWBkPmOy4CU9U1freYT4EGeXjQNiFHh2+u0+e8ZLq HcuWKN0D/4qGakGR7bRjnFUH7WF9CxfW2MWL6IL4qv5NHVcPsavPiWycd3Oa9S97UWC/q8roc +p3L86DkC02wUOSkS3Z/JQqoY0jioetCsnn03j2z9Fja5zFhdWaenPXYDLj/ZrWv2NM1OFaTL MFLONd3/yyVQ3zItlAVU8OhoKN4sITyM0ZzRZDKDhEagyfcWCTePUT/994LB1HN4buUveTA+z K31AyE0tOusk+tZI2qEQh8h8Y/trkqwgULa7kNpNrTOukoMnsA9ocra2r4MBrtJTcAhnhLiYR Q9HTAnCHNBb3PQbBJ/4vT1u0OtspY8d2v7gLv8vHBVyAfuz1IZFz1a5HMc9/pSAr8yQCulAnx nQjXY8CZsalCAPGPcCP5aY/1/pytQdlq04/OCJVsjmVocSTV0opO2vpnrd7NmeG0J7A+WLR5j JJrDZQ== 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 Provide a man-page for the smbios command. Signed-off-by: Heinrich Schuchardt Reviewed-by: Simon Glass Reviewed-by: Ilias Apalodimas --- doc/usage/cmd/smbios.rst | 93 ++++++++++++++++++++++++++++++++++++++++ doc/usage/index.rst | 1 + 2 files changed, 94 insertions(+) create mode 100644 doc/usage/cmd/smbios.rst -- 2.43.0 diff --git a/doc/usage/cmd/smbios.rst b/doc/usage/cmd/smbios.rst new file mode 100644 index 0000000000..1ffd706d7d --- /dev/null +++ b/doc/usage/cmd/smbios.rst @@ -0,0 +1,93 @@ +.. SPDX-License-Identifier: GPL-2.0-or-later: + +smbios command +============== + +Synopsis +-------- + +:: + + smbios + +Description +----------- + +The smbios command displays information from the SMBIOS tables. + +Examples +-------- + +The example below shows an example output of the smbios command. + +:: + + => smbios + SMBIOS 2.8.0 present. + 8 structures occupying 81 bytes + Table at 0x6d35018 + + Handle 0x0100, DMI type 1, 27 bytes at 0x6d35018 + System Information + Manufacturer: QEMU + Product Name: Standard PC (i440FX + PIIX, 1996) + Version: pc-i440fx-2.5 + Serial Number: + UUID 00000000-0000-0000-0000-000000000000 + Wake Up Type: + Serial Number: + SKU Number: + + Handle 0x0300, DMI type 3, 22 bytes at 0x6d35069 + Header and Data: + 00000000: 03 16 00 03 01 01 02 00 00 03 03 03 02 00 00 00 + 00000010: 00 00 00 00 00 00 + Strings: + String 1: QEMU + String 2: pc-i440fx-2.5 + + Handle 0x0400, DMI type 4, 42 bytes at 0x6d35093 + Header and Data: + 00000000: 04 2a 00 04 01 03 01 02 63 06 00 00 fd ab 81 07 + 00000010: 03 00 00 00 d0 07 d0 07 41 01 ff ff ff ff ff ff + 00000020: 00 00 00 01 01 01 02 00 01 00 + Strings: + String 1: CPU 0 + String 2: QEMU + String 3: pc-i440fx-2.5 + + Handle 0x1000, DMI type 16, 23 bytes at 0x6d350d7 + Header and Data: + 00000000: 10 17 00 10 01 03 06 00 00 02 00 fe ff 01 00 00 + 00000010: 00 00 00 00 00 00 00 + + Handle 0x1100, DMI type 17, 40 bytes at 0x6d350f0 + Header and Data: + 00000000: 11 28 00 11 00 10 fe ff ff ff ff ff 80 00 09 00 + 00000010: 01 00 07 02 00 00 00 02 00 00 00 00 00 00 00 00 + 00000020: 00 00 00 00 00 00 00 00 + Strings: + String 1: DIMM 0 + String 2: QEMU + + Handle 0x1300, DMI type 19, 31 bytes at 0x6d35125 + Header and Data: + 00000000: 13 1f 00 13 00 00 00 00 ff ff 01 00 00 10 01 00 + 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + + Handle 0x2000, DMI type 32, 11 bytes at 0x6d35146 + Header and Data: + 00000000: 20 0b 00 20 00 00 00 00 00 00 00 + + Handle 0x7f00, DMI type 127, 4 bytes at 0x6d35153 + End Of Table + +Configuration +------------- + +The command is only available if CONFIG_CMD_SMBIOS=y. + +Return value +------------ + +The return value $? is 0 (true) on success, 1 (false) otherwise. diff --git a/doc/usage/index.rst b/doc/usage/index.rst index 1a626c03c2..eb2b2311f8 100644 --- a/doc/usage/index.rst +++ b/doc/usage/index.rst @@ -102,6 +102,7 @@ Shell commands cmd/size cmd/sleep cmd/sm + cmd/smbios cmd/sound cmd/source cmd/temperature From patchwork Sat Dec 23 00:44:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 1879820 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; secure) header.d=gmx.de header.i=xypron.glpk@gmx.de header.a=rsa-sha256 header.s=s31663417 header.b=mCCrSrKo; 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 4Sxlp43xxHz20R1 for ; Sat, 23 Dec 2023 11:45:48 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id AEB2A877C8; Sat, 23 Dec 2023 01:44:54 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=gmx.de 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; secure) header.d=gmx.de header.i=xypron.glpk@gmx.de header.b="mCCrSrKo"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2C4A187579; Sat, 23 Dec 2023 01:44:53 +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,FREEMAIL_FROM,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) (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 F0B908765A for ; Sat, 23 Dec 2023 01:44:48 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=gmx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=xypron.glpk@gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1703292287; x=1703897087; i=xypron.glpk@gmx.de; bh=IaPG7a7Of7PGsljf85C33tr12ykGzUSrJgQLSDKeYuk=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To: References; b=mCCrSrKoJZueI93euW78J4+L6soUTume6w9l7/vbxNzepcevmf+jYIHrzzrstU54 XygCZyoe0d+1CqT2E76QYusvZGbOZFbXcWMB5TkosEwI8knMXJgdxe7il2zYqpJZx 04lsORFPQX/mivPx93CohSMPG/ASRVR/TDcWEKfmQchojIz/q67BFRBusqivZKxVz iQ5o3Mm6FgAnrBAgjpgjJ/U813El8qZOUB/An0qGVPWpq7Y47CfWfKc8Jep2zWARl rTzKsN3DFzdRq4ImMGZGcGA0h9ckysu0Jo38PLAUDlxaPV8vO8s61HDbhihFMYXvY +Enc6qQ/7CMPvfYatA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from x13s.fritz.box ([178.202.40.247]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MfpOd-1qof702vFZ-00gLA3; Sat, 23 Dec 2023 01:44:47 +0100 From: Heinrich Schuchardt To: Simon Glass Cc: Ilias Apalodimas , Bin Meng , u-boot@lists.denx.de, Heinrich Schuchardt Subject: [PATCH 5/5] test: unit test for smbios command Date: Sat, 23 Dec 2023 01:44:29 +0100 Message-ID: <20231223004429.247301-6-xypron.glpk@gmx.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231223004429.247301-1-xypron.glpk@gmx.de> References: <20231223004429.247301-1-xypron.glpk@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:PjDELppHGRwGKfuJ3rtIamgzG+wizpHXZOnvfz1A77QYnFKb5qM 8nSe9O7/iPLefJn7N1WSb9511FPI8s+WqRhlXxH5Ptse744dIA29VzP0g1v9beqKJ5/hRp5 BPtR7gCnX1aCOIiqVex0hY21xiRNVBCk1GRqCcdcyRE+QNC7jhwFqKkDSj3QneTY0mg+vSd 2WgIPPwsn8JnHSxUtTPNw== UI-OutboundReport: notjunk:1;M01:P0:zZw5PJxPMNo=;8jWRr8OUfG7FJV26xcsvGOFoWhv 5c8L9UbukcDdmnJxkE/MFRaJSr1b2pG8UHFYxX+PJNw/00a7OdJNsVYyx+rtqPW/ApDQUNMYv LDV8c0zqYtJddFmD/zcOGTnC1LzcwiRblhEDd0r4XjYSHf+8NlSu3rntYSR3zB76b4oelcoLU /lDrGJQHOqAE+3+PQpHfVO7ArpOXqGbZQMvqrcsZ04sZM+1+96vkdVsVDaOcM1gZwRCgFpqG+ CMR+Bo0h0+3fGUFbGGrv1o4w+lqZiYbO14ccdtBhhF33jhWKXMiF3v2Pg7s2XWXyVXPMs/DY2 3nRJE5mcvSc6ZdFWZil3hA3EYBgE2fX9EZ3ATDzI4rVuQuTREd7c/1de2govz24k1ycJ/37Qo hrtMeGrpBtrgAyawx1QlIeHYgAvaR+n1CF4QcApL4gNUqoXj4B+afxr4JXwHuRf3A/4nl8UDV OBQ5X/YsHPfELCTTczKqL5hXWKXsmp0F+R9Fybj5vEHmM+lcJ4mOXo5IRX1ijOq4gbX0EOMSA grPpbBzyTF7JSf+9T8FPzsNJCcbbq7M6KB+dcZIKqLu4Xap9LR9HVnVb/thTueIBuuxuE1DV6 k2gWN6i1sc6znfZ1ZFJBJwiqn8iKdDAjQ3GGiyzytvrXid+RwKN9gSn7ia8c6zoMQYGQLqe8G MTvOoBQ/8dTB2GE1Mb2kHhwUrpnqEMsyeqsa1nNnIv5CSshPJZVXIChRsoJTgyqHYKz4Kz/IE 69XZ32MaJgMMiP+7H1GWqAqYenCTWUZp73ReReTOgJ/tksafQmn19ig2OkAdLIf9fI8enm1ax 4Ogu8+5Fo2wkzySM9Q6zvSagoU/D63fqZhIe/od4ImNWty4z5bnV9/GW/j+JUzUlLSGXg8Mdl +Vs8V7Rgs5WAI4qtYQfNgp3QVrVhpwmyR++l0VS8XVM4HK0yVcnSNwIwZ1LnORFVNl9ZB9+4K ILqz4CP5Dk4+05s529EDZfO5Nc8= 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 Provide a unit test for the smbios command. Provide different test functions for QEMU, sandbox, and other systems. Signed-off-by: Heinrich Schuchardt Acked-by: Ilias Apalodimas Reviewed-by: Simon Glass --- test/py/tests/test_smbios.py | 47 ++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 test/py/tests/test_smbios.py -- 2.43.0 diff --git a/test/py/tests/test_smbios.py b/test/py/tests/test_smbios.py new file mode 100644 index 0000000000..86d8d07539 --- /dev/null +++ b/test/py/tests/test_smbios.py @@ -0,0 +1,47 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + +"""Test smbios command""" + +import pytest + +@pytest.mark.buildconfigspec('cmd_smbios') +@pytest.mark.notbuildconfigspec('qfw_smbios') +@pytest.mark.notbuildconfigspec('sandbox') +def test_cmd_smbios(u_boot_console): + """Run the smbios command""" + output = u_boot_console.run_command('smbios') + assert 'DMI type 0,' in output + assert 'String 1: U-Boot' in output + assert 'DMI type 1,' in output + assert 'DMI type 2,' in output + assert 'DMI type 3,' in output + assert 'DMI type 4,' in output + assert 'DMI type 127,' in output + +@pytest.mark.buildconfigspec('cmd_smbios') +@pytest.mark.buildconfigspec('qfw_smbios') +@pytest.mark.notbuildconfigspec('sandbox') +# TODO: +# QEMU v8.2.0 lacks SMBIOS support for RISC-V +# Once support is available in our Docker image we can remove the constraint. +@pytest.mark.notbuildconfigspec('riscv') +def test_cmd_smbios_qemu(u_boot_console): + """Run the smbios command on QEMU""" + output = u_boot_console.run_command('smbios') + assert 'DMI type 1,' in output + assert 'Manufacturer: QEMU' in output + assert 'DMI type 127,' in output + +@pytest.mark.buildconfigspec('cmd_smbios') +@pytest.mark.buildconfigspec('sandbox') +def test_cmd_smbios_sandbox(u_boot_console): + """Run the smbios command on the sandbox""" + output = u_boot_console.run_command('smbios') + assert 'DMI type 0,' in output + assert 'String 1: U-Boot' in output + assert 'DMI type 1,' in output + assert 'Manufacturer: sandbox' in output + assert 'DMI type 2,' in output + assert 'DMI type 3,' in output + assert 'DMI type 4,' in output + assert 'DMI type 127,' in output