Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 774FDC32771 for ; Thu, 29 Sep 2022 00:09:48 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8715A84575; Thu, 29 Sep 2022 02:09:45 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=kohlschutter.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=kohlschutter-com.20210112.gappssmtp.com header.i=@kohlschutter-com.20210112.gappssmtp.com header.b="vic4FUcn"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2ADBE84BE6; Thu, 29 Sep 2022 02:09:43 +0200 (CEST) Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 98E3184571 for ; Thu, 29 Sep 2022 02:09:40 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=kohlschutter.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=christian@kohlschuetter.com Received: by mail-ej1-x630.google.com with SMTP id lh5so30315125ejb.10 for ; Wed, 28 Sep 2022 17:09:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kohlschutter-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=Dw5iwgGrQbSsjfUtdLpjXVKOJpyXsgaoW4cNVaSeKaw=; b=vic4FUcnd97Ogrdi788+P6KIswavwK7WrJ5jfp5VkhZi+U8k66uKhL+ODNtXYtO9FP Gw+/Nt2TqSwNZPorquLP7D0rxXvBvK4BapiSmLPhbiTkMBvucvtbJwZvhCW7BlSweoHi vwjQxBN0wGBVemI7JmEDKz3bUZMg4oibXA3a3T+WeM8kdW1St2FBWfbiCvuhxCUbH7K2 5xyeti41FUsg8MnIEscEk7FNs/rHBcfM0OISIRqv2NB0N0oHJIds/y2IfLaiPFzA8RDQ tl5e05vMVEdCHd372MQqGvB37I580zbMRpK/YJyBTh/9axZbHPLpLjeP9VcGwIoYaLjw eEdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=Dw5iwgGrQbSsjfUtdLpjXVKOJpyXsgaoW4cNVaSeKaw=; b=ezYK0YacVyaQoyuc1wHD1YUliU6cTPNoDYxZkxr8HfcNixbiz/mM2IqBGOg8Ph577G s2C1fvxgf8rZtM2Igsshpd76gPOUvAJuARb/iw/c6BxPCHxJ76sJX0lPv7M2O2XbzqtQ nw6dXnx8BlCuVskxANDWnoqSLZQFlr425WBhmJruYNLn/Y7h0R38i3pnr7x4d9isdDty H6/uCZL/bO8VNHbsvZoaqNY4sy/7DWHSb0/cONQIT5dDAjaFi+CAa5ifMgGhYGvSFJSr T8wu8BsJPbtgxnUm4ytEN8bHxjLRTXfIyKueqGJGbSn+nDjS8PGHCpHwBBEKSe81rEFv VrLg== X-Gm-Message-State: ACrzQf1Lo4kEjZn1zUrRSPcSmtFgIXvCO+Llwuru6taDTj5kbxPmlZmJ YzOZRoJhlrJ7VlcFr7Bj4uGYQcpe8oAqjPhl X-Google-Smtp-Source: AMsMyM700ZeZXokImStdIF3MFIKMvT8mlnwEKEmInDtGMnZUMmGT2Q0cFCjeIBcD48MlxmSkSgoTNg== X-Received: by 2002:a17:907:1621:b0:783:84e0:3824 with SMTP id hb33-20020a170907162100b0078384e03824mr356231ejc.692.1664410179905; Wed, 28 Sep 2022 17:09:39 -0700 (PDT) Received: from plus1.kohl.home (ip5b434222.dynamic.kabel-deutschland.de. [91.67.66.34]) by smtp.gmail.com with ESMTPSA id 16-20020a170906329000b007389c5a45f0sm3081294ejw.148.2022.09.28.17.09.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Sep 2022 17:09:39 -0700 (PDT) From: =?UTF-8?q?Christian=20Kohlsch=C3=BCtter?= To: u-boot@lists.denx.de Cc: =?UTF-8?q?Christian=20Kohlsch=C3=BCtter?= Subject: [PATCH] smbios: dts: Add "asset-tag" property to "enclosure" subnode Date: Thu, 29 Sep 2022 00:09:14 +0000 Message-Id: <20220929000914.8553-1-christian@kohlschutter.com> X-Mailer: git-send-email 2.36.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Currently, device trees can only specify an asset tag for the "baseboard" type, not for the "chassis" (system enclosure) type, which usually carries the more user-visible asset tag. Add support for the chassis asset-tag, and update the documentation. Signed-off-by: Christian Kohlschütter --- doc/device-tree-bindings/sysinfo/smbios.txt | 4 ++++ lib/smbios.c | 1 + 2 files changed, 5 insertions(+) diff --git a/doc/device-tree-bindings/sysinfo/smbios.txt b/doc/device-tree-bindings/sysinfo/smbios.txt index b522322802..2c1c9abf7c 100644 --- a/doc/device-tree-bindings/sysinfo/smbios.txt +++ b/doc/device-tree-bindings/sysinfo/smbios.txt @@ -44,6 +44,9 @@ Within each subnode the following tables are recognised: "chassis" subnode optional properties: - manufacturer: Product manufacturer for chassis + - asset-tag: Asset tag for the system enclosure, sometimes used in + organisations to track devices + Example: @@ -72,6 +75,7 @@ sysinfo { /* Type 3 table */ chassis { manufacturer = "Google"; + asset-tag = "XYZ789"; }; }; }; diff --git a/lib/smbios.c b/lib/smbios.c index d7f4999e8b..8f8f160882 100644 --- a/lib/smbios.c +++ b/lib/smbios.c @@ -347,6 +347,7 @@ static int smbios_write_type3(ulong *current, int handle, if (!t->manufacturer) t->manufacturer = smbios_add_string(ctx, "Unknown"); t->chassis_type = SMBIOS_ENCLOSURE_DESKTOP; + t->asset_tag_number = smbios_add_prop(ctx, "asset-tag"); t->bootup_state = SMBIOS_STATE_SAFE; t->power_supply_state = SMBIOS_STATE_SAFE; t->thermal_state = SMBIOS_STATE_SAFE; -- 2.36.2