From patchwork Fri Feb 9 15:51:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 1897145 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=bhVb/D3x; 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 4TWddd58jyz23j0 for ; Sat, 10 Feb 2024 02:52:05 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 59A7D87E83; Fri, 9 Feb 2024 16:51:41 +0100 (CET) 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="bhVb/D3x"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E9E1487E70; Fri, 9 Feb 2024 16:51:39 +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.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, 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 smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) (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 22F5387E74 for ; Fri, 9 Feb 2024 16:51:38 +0100 (CET) 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 mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) (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-internal-1.canonical.com (Postfix) with ESMTPS id B70AF40A2B for ; Fri, 9 Feb 2024 15:51:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1707493893; bh=GznVGRl3+h4pqZJpRoPqckiO3GDXVwB88+1KfwtC0sg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bhVb/D3xl7vmcQassqDbu/Gn6UmEp6SdidhoSENzD0AFehKz/iivz+VpEmS46YGWn tpsQUq3t+MFURn+YI0WkFGUQVKOPUIb1I/AO42DnXyE6UBRQT8WeLSwih25I1ZjldL MoDc0k6CAJyrTJJgTnJEzST+5XuGYpBt1i8xd+fmCrqVMEcvUuekfy3xSbquKsuf8R ukuOMNLZR9ctw2KsrrnD0rBSgOBPkOQlpMIXa3De1z/rCMqfDOwLTzjrc9merYdWEK tg62WiyFB8V1aaByjphhRINk3fp8jF89gfH8Lv73jntoCscjC1H3cT16B95jk4phQ2 R5dR42Xe3zBPA== Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-a2c4e9cb449so74388066b.1 for ; Fri, 09 Feb 2024 07:51:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707493891; x=1708098691; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GznVGRl3+h4pqZJpRoPqckiO3GDXVwB88+1KfwtC0sg=; b=wGZKJqlNFSr5wEyHLfDpmMkNlFiJFJPITQhiuBbLhwaMbf54FEeLq3m0AOH+mZ9/iO I3efBVanVY9tjryWSi58ehf+LWyCbzlRb3fTGQtvIs6ZnQWVARdXKAtYdemLzFX6PI/d THfKQpGdAobXUCB2GunEt8H4ha0RCA1Ai75pMNRxyQvhDQyEVo445MFnZfJaaC8XbwAv pG0XmgfoeAP6QPu5M1HhYuTDdt/NqwvAsTIUziv27j4X7FrrZKe+eEbt25uCX/xDFvLi 2AxYYL9PP4w9AnocIutXj8vvc30o5si0DpWRCXSStohS6iaC8A2wq+hxzw5qUXG3Pez8 pI8Q== X-Forwarded-Encrypted: i=1; AJvYcCXAxPw/GmUYf4jxKt4e5ktNUNuhSLSHZpg6/P6N6qyzQ7D9kzAD9le0H42WwNi1Ls5uXRQIHX1JbYoguv3wcz4ZugEAjw== X-Gm-Message-State: AOJu0Yyogovm8rqtbpLGRDiWGJgBqx3BkR+4GTbU8AxlA8IsNiF6E5Wv v6vcxRGo+U5zPWwRRnV/vJqeWKSVUHHEkJ/S5+IWe8JnW1U+xJ9oQ2d5GLnInoPgDZj/gip9cDS KVikyRz9och6E66zBjrHmTYgMYLVI0xFNWIuxat4H7M+A2frEOeBzgVNvf2YiwhvfLtY= X-Received: by 2002:a17:907:111a:b0:a38:4842:56da with SMTP id qu26-20020a170907111a00b00a38484256damr1685780ejb.61.1707493891560; Fri, 09 Feb 2024 07:51:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IEuEkjn2676a4LNrNrIRIO0SXd571YENhxTg9qjiNbid41LodW1Y5nPd2Uo9JRFhYINMGptgA== X-Received: by 2002:a17:907:111a:b0:a38:4842:56da with SMTP id qu26-20020a170907111a00b00a38484256damr1685763ejb.61.1707493891204; Fri, 09 Feb 2024 07:51:31 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCUjFrK6DOrPUvHqDVqrHMvLyWQmTSJSGXMob1hk5BgUTl3bvZphOMBxJdf7dBNDOL2zsQgbXl5WhhoRkjNnhT6HfYnAl5mdOQ8FwhA8XSAEpndL34eoSjbI2WxbvuezLQh3X/1lk47KMydOCEDHbJz9kzUiyyRolk3Y53AUlPFmyTQL5zxL1mERghc3pnmkZHyn6pOYiyqhP8mMCKGW Received: from workstation5.fritz.box (ip-178-202-040-247.um47.pools.vodafone-ip.de. [178.202.40.247]) by smtp.gmail.com with ESMTPSA id z10-20020a17090655ca00b00a38620c3b3dsm866944ejp.198.2024.02.09.07.51.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 07:51:30 -0800 (PST) From: Heinrich Schuchardt To: Tom Rini Cc: Simon Glass , Ilias Apalodimas , u-boot@lists.denx.de, Mark Kettenis , Heinrich Schuchardt Subject: [PATCH v2 1/2] cmd: smbios: type 1 wake-up time, family Date: Fri, 9 Feb 2024 16:51:14 +0100 Message-ID: <20240209155115.102957-2-heinrich.schuchardt@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240209155115.102957-1-heinrich.schuchardt@canonical.com> References: <20240209155115.102957-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 Correct type 1 output * render wake up time as string * print family string * remove duplicate serial number output Signed-off-by: Heinrich Schuchardt --- v2: no change --- cmd/smbios.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/cmd/smbios.c b/cmd/smbios.c index 66f6b761378..d3bd8b12a67 100644 --- a/cmd/smbios.c +++ b/cmd/smbios.c @@ -14,6 +14,18 @@ DECLARE_GLOBAL_DATA_PTR; +static const char * const wakeup_type_strings[] = { + "Reserved", /* 0x00 */ + "Other", /* 0x01 */ + "Unknown", /* 0x02 */ + "APM Timer", /* 0x03 */ + "Modem Ring", /* 0x04 */ + "Lan Remote", /* 0x05 */ + "Power Switch", /* 0x06 */ + "PCI PME#", /* 0x07 */ + "AC Power Restored", /* 0x08 */ +}; + /** * smbios_get_string() - get SMBIOS string from table * @@ -72,6 +84,14 @@ void smbios_print_str(const char *label, void *table, u8 index) printf("\t%s: %s\n", label, smbios_get_string(table, index)); } +const char *smbios_wakeup_type_str(u8 wakeup_type) +{ + if (wakeup_type >= ARRAY_SIZE(wakeup_type_strings)) + /* Values over 0x08 are reserved. */ + wakeup_type = 0; + return wakeup_type_strings[wakeup_type]; +} + static void smbios_print_type1(struct smbios_type1 *table) { printf("System Information\n"); @@ -81,11 +101,12 @@ static void smbios_print_type1(struct smbios_type1 *table) 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); + printf("\tWake-up Type: %s\n", + smbios_wakeup_type_str(table->wakeup_type)); } if (table->length >= 0x1b) { - smbios_print_str("Serial Number", table, table->serial_number); smbios_print_str("SKU Number", table, table->sku_number); + smbios_print_str("Family", table, table->family); } } From patchwork Fri Feb 9 15:51:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 1897143 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=gk429lX1; 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 4TWddQ3Jvzz23j0 for ; Sat, 10 Feb 2024 02:51:54 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E9A1D87E71; Fri, 9 Feb 2024 16:51:40 +0100 (CET) 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="gk429lX1"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DEB7C87E80; Fri, 9 Feb 2024 16:51:39 +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.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, 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 smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) (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 13A6487E70 for ; Fri, 9 Feb 2024 16:51:38 +0100 (CET) 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 mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) (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-internal-1.canonical.com (Postfix) with ESMTPS id 05B7640A2F for ; Fri, 9 Feb 2024 15:51:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1707493897; bh=TcVj/WEgFswytzk8HIvShz74iuP2u/dXptaCoBfwXus=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gk429lX1grF3wlonReXAgGM7ztsytSydJri3XVTJGRMPwE4my07amBmhgMJdbBcYB HPu8U8rmLSW2Fw4AAfhksh4V1X9sufZKOIDRFd2h5KoqtLHcpK4Fm2cA2HRrShUZzO 6wGmFT4pq25eIY1Urff1REEEKCyVTgzCVORlQn2bwfEeod21/77A1Y7jdXznE2G8pr u8jUxL7gjLRX8HIrRowl9bSoVbwPUYx1d8VayUWfs9hMtqpwu63NfkIkeFtLaP5lUo 7id/DcEkSaFg266OxvtoxlkLzXPLftQsByTiXKyxvGAYP12tkyaUmy8zO7lXpPq8xa cIfBHnhqR8pAQ== Received: by mail-ej1-f71.google.com with SMTP id a640c23a62f3a-a382663cfa1so59673166b.3 for ; Fri, 09 Feb 2024 07:51:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707493892; x=1708098692; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TcVj/WEgFswytzk8HIvShz74iuP2u/dXptaCoBfwXus=; b=Veu0MIkLzhrBfSa/J32C5agKqLKhVPl1+EPchma1hyNI4dvme2CU3fijvXx/s97+ze u/4/o8q+IU2W3YY9ap6TVH73aU7YCurdZEbMVRq49EwOUwtsnc0zPfjnVOIXr2ORhh1U o6gZ3c3liNmNA6vPu19NY7y39pBVB5ZPn6/curOELLooPAiXy4RusF+ymklnFKdkhnNZ Ipu1MBB/UQAVez2+VAuFYZR0re/3QBI8XWPKCKymM8Ri+ehvHEQ2dCR6GqJK6MTl254E q5xN3+zowX+kRbgy9IjQjo13zf/OrpI2eMHYifD3F3c0yIFGnv3oJeoLvKqWN65zMdDb vr5g== X-Gm-Message-State: AOJu0YzS+oMLGnuFm67l5qEBLOqmDy2xsvAEQj1Y8tBXpxNuZ4GB48MB r814HNeFH1hDy92LMu9Pe77AxEY+GIY7lDoFBRwr5eKlSBNaErat2xAcxShEvEMSNXF15qFFjPf DwN2nbfSnWc5RRbR2HOeiuq4qEIaHAq25qcmBGOs5TmDr2q9kUL2/dqLhNg0XuGrcJW3WVDIt3n M= X-Received: by 2002:a17:907:10da:b0:a38:1ba8:4609 with SMTP id rv26-20020a17090710da00b00a381ba84609mr1315620ejb.13.1707493892285; Fri, 09 Feb 2024 07:51:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IEe7GmgTU/d75G5nBkcaEiHj53fVjysXBrzbrvoLbsvk7kJRIWF//wDKhhlJ2U477ny5v3aPQ== X-Received: by 2002:a17:907:10da:b0:a38:1ba8:4609 with SMTP id rv26-20020a17090710da00b00a381ba84609mr1315613ejb.13.1707493892061; Fri, 09 Feb 2024 07:51:32 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCUI4zr2BweVA1HYaHcArNGsZO0batdyh2V80rDf2HHvylYzlDvcr/IRchZyxcq8YdRX9Xgq+5JNd5Tc/0140nL5kLCjXH7gbEA2uOkcrJIz3jaKm3cpfBv+IqU2NHi/d9XqJodh/BElRYL6iKr26ggfICFxqU8a1Z2pkPEi838vy7frTh+kpk+2uXGP09htqAAQDtBycVUSyx3/ixvB Received: from workstation5.fritz.box (ip-178-202-040-247.um47.pools.vodafone-ip.de. [178.202.40.247]) by smtp.gmail.com with ESMTPSA id z10-20020a17090655ca00b00a38620c3b3dsm866944ejp.198.2024.02.09.07.51.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 07:51:31 -0800 (PST) From: Heinrich Schuchardt To: Tom Rini Cc: Simon Glass , Ilias Apalodimas , u-boot@lists.denx.de, Mark Kettenis , Heinrich Schuchardt Subject: [PATCH v2 2/2] smbios: fill wake-up type Date: Fri, 9 Feb 2024 16:51:15 +0100 Message-ID: <20240209155115.102957-3-heinrich.schuchardt@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240209155115.102957-1-heinrich.schuchardt@canonical.com> References: <20240209155115.102957-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 We should not use the reserved value 0x00 for the wake up type but use 0x02 (Unknown). Signed-off-by: Heinrich Schuchardt --- v2: use wake-up type 'Unknown' as our default add more SMBIOS wake-up type constants --- include/smbios.h | 10 ++++++++++ lib/smbios.c | 1 + 2 files changed, 11 insertions(+) diff --git a/include/smbios.h b/include/smbios.h index 3df8827b60d..990e37b4d2b 100644 --- a/include/smbios.h +++ b/include/smbios.h @@ -108,6 +108,16 @@ struct __packed smbios_type0 { char eos[SMBIOS_STRUCT_EOS_BYTES]; }; +#define SMBIOS_WAKEUP_TYPE_RESERVED 0x00 +#define SMBIOS_WAKEUP_TYPE_OTHER 0x01 +#define SMBIOS_WAKEUP_TYPE_UNKNOWN 0x02 +#define SMBIOS_WAKEUP_TYPE_APM_TIME 0x03 +#define SMBIOS_WAKEUP_TYPE_MODEM_RING 0x04 +#define SMBIOS_WAKEUP_TYPE_LAN_REMOTE 0x05 +#define SMBIOS_WAKEUP_TYPE_POWER_SWITCH 0x06 +#define SMBIOS_WAKEUP_TYPE_PCI_PME 0x07 +#define SMBIOS_WAKEUP_TYPE_AC_POWER_RESTORED 0x08 + struct __packed smbios_type1 { u8 type; u8 length; diff --git a/lib/smbios.c b/lib/smbios.c index c83af730a91..b190b010f30 100644 --- a/lib/smbios.c +++ b/lib/smbios.c @@ -394,6 +394,7 @@ static int smbios_write_type1(ulong *current, int handle, } else { t->serial_number = smbios_add_prop(ctx, "serial", NULL); } + t->wakeup_type = SMBIOS_WAKEUP_TYPE_UNKNOWN; t->sku_number = smbios_add_prop(ctx, "sku", NULL); t->family = smbios_add_prop(ctx, "family", NULL);