From nobody Tue Feb 10 15:46:10 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+75527+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75527+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1621866524; cv=none; d=zohomail.com; s=zohoarc; b=VpH8xfJtABHdea8cccxvMH/yx3rBZS5mYQ2XP+CJf6HgYevbYO5AakpFVrm4APsIK/Ka5Kg9duD5VH50vRLeLMtTujJGDR3Or7u/gNHgqW12OaArIu/HmYj+Dfz07rMTjRrq3LmHsMmswLoKhHNTGkNiuJXhmQKrOCV1QCjMs8s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621866524; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=V4tRbwpRWagCNWrjy34A7e3kt0fisfKYJq5C1K9ihpQ=; b=hFrg67sYB0qAoVS0/7AjfYdWBmmVf62YYElpm5iI7yfgvOa189c0yCU19f9Vd4hIZhIink0E2YijcQJ+0ncQVqJlykDBZCWq/kdLKlw7VWa9hdQcQxvuV3wo++icmOHT+tKH2Yg7j5NM3Z7H7hj6mroEpHyKLYGuixcOgbMGM+Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75527+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1621866524306584.9477458958172; Mon, 24 May 2021 07:28:44 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id LeFbYY1788612xIbQ1QRr5uS; Mon, 24 May 2021 07:28:43 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web08.23864.1621866516091160630 for ; Mon, 24 May 2021 07:28:36 -0700 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id AF9ACED1; Mon, 24 May 2021 07:28:35 -0700 (PDT) X-Received: from usa.arm.com (a074742.blr.arm.com [10.162.16.32]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 85EBA3F719; Mon, 24 May 2021 07:28:34 -0700 (PDT) From: "Pranav Madhu" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Sami Mujawar Subject: [edk2-devel] [edk2-platforms][PATCH V4 05/11] Platform/Sgi: Add SMBIOS Type3 Table Date: Mon, 24 May 2021 19:58:10 +0530 Message-Id: <20210524142816.9967-6-pranav.madhu@arm.com> In-Reply-To: <20210524142816.9967-1-pranav.madhu@arm.com> References: <20210524142816.9967-1-pranav.madhu@arm.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,pranav.madhu@arm.com X-Gm-Message-State: 0PBD1jRRC3mtrD6gvcFMfIy0x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1621866523; bh=3frqZVdiqRl3mio+v4Pk+CbdXAFfRNlgL4/vocXO7xw=; h=Cc:Date:From:Reply-To:Subject:To; b=SXtNayEcxYpykYwp0GN3ICEI6WUqiyVn5SmiZNXxx3A7XpXyRbX+ew9FbLciclAKvHQ byuYYa4NyF/9eLR7DLrQ5S6WSIGWiqJQr3UHjJqCWuAvibbmfi/7iiKJfG+PmOqDnrGkv neTnesA+4nakbYRlNIL9/NGW4WdW+dQk4sQ= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Add the SMBIOS type 3 table (System Enclosure) that includes information about manufacturer, type, serial number and other information related to system enclosure. Signed-off-by: Pranav Madhu Reviewed-by: Sami Mujawar --- Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.inf | 1= + Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.h | 22= +++++ Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.c | 1= + Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/Type3SystemEnclosure.c | 103= ++++++++++++++++++++ 4 files changed, 127 insertions(+) diff --git a/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDx= e.inf b/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.inf index f7beb1c66c80..b3c1619ddc66 100644 --- a/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.inf +++ b/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.inf @@ -17,6 +17,7 @@ SmbiosPlatformDxe.c Type0BiosInformation.c Type1SystemInformation.c + Type3SystemEnclosure.c =20 [Packages] ArmPkg/ArmPkg.dec diff --git a/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDx= e.h b/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.h index e2437b109899..fc18cfc9f369 100644 --- a/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.h +++ b/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.h @@ -48,4 +48,26 @@ InstallType1SystemInformation ( IN EFI_SMBIOS_PROTOCOL *Smbios ); =20 +/** + Install SMBIOS System Enclosure Table + + Install the SMBIOS System Enclosure (type 3) table for Arm's Reference D= esign + platforms. + + @param[in] Smbios SMBIOS protocol. + + @retval EFI_SUCCESS Record was added. + @retval EFI_OUT_OF_RESOURCES Record was not added. + @retval EFI_ALREADY_STARTED The SmbiosHandle passed is already in use. +**/ +EFI_STATUS +EFIAPI +InstallType3SystemEnclosure ( + IN EFI_SMBIOS_PROTOCOL *Smbios + ); + +typedef enum { + SMBIOS_HANDLE_ENCLOSURE =3D 0x1000, +} SMBIOS_REFRENCE_HANDLES; + #endif // SMBIOS_PLATFORM_DXE_H_ diff --git a/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDx= e.c b/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.c index b9ce50c82b4c..ac4c6120841f 100644 --- a/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.c +++ b/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.c @@ -28,6 +28,7 @@ STATIC CONST ARM_RD_SMBIOS_TABLE_INSTALL_FPTR mSmbiosTableList[] =3D { &InstallType0BiosInformation, &InstallType1SystemInformation, + &InstallType3SystemEnclosure, }; =20 /** diff --git a/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/Type3SystemEnclo= sure.c b/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/Type3SystemEnclosure= .c new file mode 100644 index 000000000000..146852eb4ae6 --- /dev/null +++ b/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/Type3SystemEnclosure.c @@ -0,0 +1,103 @@ +/** @file + SMBIOS Type 3 (System enclosure) table for ARM RD platforms. + + This file installs SMBIOS Type 3 (System enclosure) table for Arm Refere= nce + Design platforms. SMBIOS Type 3 table (System Enclosure) includes inform= ation + about manufacturer, type, serial number and other information related to + system enclosure. + + Copyright (c) 2021, ARM Limited. All rights reserved. + SPDX-License-Identifier: BSD-2-Clause-Patent + + @par Specification Reference: + - SMBIOS Reference Specification 3.4.0, Chapter 7.4 +**/ + +#include +#include + +#include "SmbiosPlatformDxe.h" + +#define TYPE3_STRINGS \ + "ARM LTD\0" /* Manufacturer */ \ + "Version not set\0" /* Version */ \ + "Serial not set\0" /* Serial */ \ + "Asset Tag not set\0" /* Asset Tag */ + +typedef enum { + ManufacturerName =3D 1, + Version, + SerialNumber, + AssetTag +} TYPE3_STRING_ELEMENTS; + +/* SMBIOS Type3 structure */ +#pragma pack(1) +typedef struct { + SMBIOS_TABLE_TYPE3 Base; + CHAR8 Strings[sizeof (TYPE3_STRINGS)]; +} ARM_RD_SMBIOS_TYPE3; +#pragma pack() + +/* System information */ +STATIC ARM_RD_SMBIOS_TYPE3 mArmRdSmbiosType3 =3D { + { + { + // SMBIOS header + EFI_SMBIOS_TYPE_SYSTEM_ENCLOSURE, // Type 3 + sizeof (SMBIOS_TABLE_TYPE1), // Length + SMBIOS_HANDLE_ENCLOSURE, // Assign an unused handle number + }, + ManufacturerName, // Manufacturer + 2, // Enclosure type unknown + Version, // Version + SerialNumber, // Serial + AssetTag, // Asset Tag + ChassisStateSafe, // Boot chassis state + ChassisStateSafe, // Power supply state + ChassisStateSafe, // Thermal state + ChassisSecurityStatusUnknown, // Security Status + {0}, // BIOS vendor specific Information + }, + // Text strings (unformatted) + TYPE3_STRINGS +}; + +/** + Install SMBIOS System Enclosure Table + + Install the SMBIOS System Enclosure (type 3) table for Arm's Reference D= esign + platforms. + + @param[in] Smbios SMBIOS protocol. + + @retval EFI_SUCCESS Record was added. + @retval EFI_OUT_OF_RESOURCES Record was not added. + @retval EFI_ALREADY_STARTED The SmbiosHandle passed is already in use. +**/ +EFI_STATUS +InstallType3SystemEnclosure ( + IN EFI_SMBIOS_PROTOCOL *Smbios + ) +{ + EFI_STATUS Status; + EFI_SMBIOS_HANDLE SmbiosHandle; + + SmbiosHandle =3D ((EFI_SMBIOS_TABLE_HEADER *)&mArmRdSmbiosType3)->Handle; + + /* Install type 3 table */ + Status =3D Smbios->Add ( + Smbios, + NULL, + &SmbiosHandle, + (EFI_SMBIOS_TABLE_HEADER *)&mArmRdSmbiosType3 + ); + if (EFI_ERROR (Status)) { + DEBUG (( + DEBUG_ERROR, + "SMBIOS: Failed to install Type3 SMBIOS table.\n" + )); + } + + return Status; +} --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#75527): https://edk2.groups.io/g/devel/message/75527 Mute This Topic: https://groups.io/mt/83052325/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-