From nobody Tue Feb 10 05:46:41 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+70441+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+70441+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1610735231; cv=none; d=zohomail.com; s=zohoarc; b=iAYiEPxmVyrhU3EIw/SHEaUfamY3IRBj8syn2BspzCkiDKpSMeAGztWshSQksqjfYJip3hjF8Jk72tEBu7XhYJRTVkajgDVA4XX0SFIvw5fRDFcC+io3VCOhs1SM2ZxwTOz2GsGAu9WiTA42DRc/2cVyzq+O0nV3POdCVT36kIM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610735231; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=87RzcSr8kdvd1sUUCAVjHfYiX3Pm3LcvdEmlYQTDAJo=; b=aPp3xOWU2SpK0CmnVcp3W1/4l02Ehr15tLlvgotyGSdvpUeWZKuWSKCgOqmSgvOAEdU1rRsIO92XtowP29EBwidiI27062/4qA+dxmDWYrnHA74VE8IFgeRXvqYxkga+gk/CGUkICm6cQM1+Lf/PngW3JIiCcc0fqLkO7Y+vOL0= 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+70441+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 16107352313541013.5610085446697; Fri, 15 Jan 2021 10:27:11 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id S78CYY1788612xwWZ9LbJAcF; Fri, 15 Jan 2021 10:27:11 -0800 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web09.74.1610735230516187397 for ; Fri, 15 Jan 2021 10:27:10 -0800 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 2EB54ED1; Fri, 15 Jan 2021 10:27:10 -0800 (PST) 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 005B13F719; Fri, 15 Jan 2021 10:27:08 -0800 (PST) From: "Pranav Madhu" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Leif Lindholm Subject: [edk2-devel] [edk2-platforms][PATCH V1 04/11] Platform/ARM/SgiPkg: Add SMBIOS Type1 Table Date: Fri, 15 Jan 2021 23:56:41 +0530 Message-Id: <20210115182648.20938-5-pranav.madhu@arm.com> In-Reply-To: <20210115182648.20938-1-pranav.madhu@arm.com> References: <20210115182648.20938-1-pranav.madhu@arm.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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: ygPWDWH1zLEY2SpAH3MnzB3wx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1610735231; bh=pm3vYmhz05dBTfRB1BVdInFFktB0Hb+y+VFPtxBpbBs=; h=Cc:Date:From:Reply-To:Subject:To; b=e0+KklNvUoVcvokKnodwbY266nK6+XSQf/2lM40r8s9lro+7k1eKf67RUNSe8k2ypaz vcv3OluRnH1ryZCCAcnaDA4RhkvJ26N3lnovLqlWkNac+ZDWeem72kDUQwIS/vJMsQMJ6 R27V9bm84S/IaHzVt8OCw8M0ie0xNra45PY= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Add the SMBIOS type 1 table (System Information) that includes information about manufacturer, product name, version, serial number and other information related to the system identification. Signed-off-by: Pranav Madhu --- Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.inf | = 1 + Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.h | = 6 ++ Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.c | = 1 + Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/Type1SystemInformation.c | 1= 14 ++++++++++++++++++++ 4 files changed, 122 insertions(+) diff --git a/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDx= e.inf b/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.inf index 8996c521de54..6a00912ab742 100644 --- a/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.inf +++ b/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.inf @@ -26,6 +26,7 @@ [Sources] SmbiosPlatformDxe.c Type0BiosInformation.c + Type1SystemInformation.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 9a10bbf15e9e..43427158106d 100644 --- a/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.h +++ b/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.h @@ -15,4 +15,10 @@ InstallBiosInformation ( IN EFI_SMBIOS_PROTOCOL *Smbios ); =20 +EFI_STATUS +EFIAPI +InstallSystemInformation ( + IN EFI_SMBIOS_PROTOCOL *Smbios + ); + #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 f00ef5f8c415..1068398bcba3 100644 --- a/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.c +++ b/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.c @@ -22,6 +22,7 @@ typedef EFI_STATUS (*ARM_RD_SMBIOS_TABLE_INSTALL_FPTR)(EF= I_SMBIOS_PROTOCOL *); STATIC ARM_RD_SMBIOS_TABLE_INSTALL_FPTR mSmbiosTableList[] =3D { &InstallBiosInformation, + &InstallSystemInformation, }; =20 /** diff --git a/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/Type1SystemInfor= mation.c b/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/Type1SystemInforma= tion.c new file mode 100644 index 000000000000..21b3ad863719 --- /dev/null +++ b/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/Type1SystemInformation.c @@ -0,0 +1,114 @@ +/** @file + SMBIOS Type 1 (System information) table for ARM RD platforms. + + Copyright (c) 2020-2021, ARM Limited. All rights reserved. + + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include +#include +#include + +#include "SgiPlatform.h" + +#define PRODUCT_NAME_BASE 6 /* Product name base from TYPE1_STRINGS */ +#define TYPE1_STRINGS \ + "ARM LTD\0" /* Manufacturer */ \ + "Version not set\0" /* Version */ \ + "Serial not set\0" /* Serial number */ \ + "Not Applicable\0" /* SKU */ \ + "Not Applicable\0" /* Family */ \ + "SGI575\0" /* Product Names */ \ + "RdN1Edge\0" \ + "RdN1EdgeX2\0" \ + "RdE1Edge\0" \ + "RdV1\0" \ + "RdV1Mc\0" \ + "RdN2\0" + +/* SMBIOS Type1 structure */ +#pragma pack(1) +struct ArmRdSmbiosType1 { + SMBIOS_TABLE_TYPE1 Base; + UINT8 Strings[sizeof (TYPE1_STRINGS)]; +} ARM_TYPE1; +#pragma pack() + +STATIC GUID mSmbiosUid[] =3D { + /* Sgi575 */ + {0xdd7cad0a, 0x227c, 0x4ed4, {0x9f, 0x42, 0xa9, 0x8b, 0xd6, 0xa2, 0x42, = 0x6c}}, + /* Rd-N1-Edge */ + {0x80984efe, 0x404a, 0x43e0, {0xad, 0xa4, 0x63, 0xa0, 0xe0, 0xc4, 0x5e, = 0x60}}, + /* Rd-N1-Edge-X2 */ + {0x2cc4f916, 0x267a, 0x4251, {0x95, 0x6e, 0xf0, 0x49, 0x82, 0xbe, 0x94, = 0x58}}, + /* Rd-E1-Edge */ + {0x567f35c4, 0x104f, 0x447b, {0xa0, 0x94, 0x89, 0x2f, 0xbd, 0xb6, 0x5a, = 0x55}}, + /* Rd-V1 */ + {0xc481f0b1, 0x237c, 0x42d7, {0x98, 0xb2, 0xb4, 0xb4, 0x8d, 0xb5, 0x4f, = 0x50}}, + /* Rd-V1Mc */ + {0x1f3a0806, 0x18b5, 0x4eca, {0xad, 0xcd, 0xba, 0x9b, 0x07, 0xb1, 0x0a, = 0xcf}}, + /* Rd-N2 */ + {0xf2cded73, 0x37f9, 0x4ec9, {0xd9, 0xf9, 0x89, 0x9b, 0x74, 0x91, 0x20, = 0x49}} +}; + +/* System information (SMBIOS 3.4 spec, section 7.2) */ +static struct ArmRdSmbiosType1 mArmRdSmbiosType1 =3D { + { + { + // SMBIOS header + EFI_SMBIOS_TYPE_SYSTEM_INFORMATION, // Type 1 + sizeof (SMBIOS_TABLE_TYPE1), // Length + SMBIOS_HANDLE_PI_RESERVED, // Assign an unused handle number + }, + 1, // Manufacturer + PRODUCT_NAME_BASE, // Product Name, update dynamically + 2, // Version + 3, // Serial + {0}, // UUID, Update dymanically + 1, // Wakeup type other + 4, // SKU + 5, // Family + }, + // Text strings (unformatted) + TYPE1_STRINGS +}; + +/** + Install SMBIOS System information Table + + @retval EFI_SUCCESS Record was added. + @retval EFI_NOT_FOUND Unknown product id. + @retval EFI_OUT_OF_RESOURCES Record was not added. + @retval EFI_ALREADY_STARTED The SmbiosHandle passed in is already in u= se. +**/ +EFI_STATUS +InstallSystemInformation ( + IN EFI_SMBIOS_PROTOCOL *Smbios + ) +{ + EFI_STATUS Status; + EFI_SMBIOS_HANDLE SmbiosHandle; + + SmbiosHandle =3D ((EFI_SMBIOS_TABLE_HEADER *)&mArmRdSmbiosType1)->Handle; + + if (SgiGetProductId () !=3D UnknownId) { + mArmRdSmbiosType1.Base.ProductName =3D + PRODUCT_NAME_BASE + (SgiGetProductId () - 1); // from TYPE1_STRINGS + CopyGuid (&mArmRdSmbiosType1.Base.Uuid, + &mSmbiosUid[SgiGetProductId () - 1]); + } else { + return EFI_NOT_FOUND; + } + + Status =3D Smbios->Add ( + Smbios, + NULL, + &SmbiosHandle, + (EFI_SMBIOS_TABLE_HEADER *)&mArmRdSmbiosType1 + ); + + 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 (#70441): https://edk2.groups.io/g/devel/message/70441 Mute This Topic: https://groups.io/mt/79709186/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-