From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (EUR01-HE1-obe.outbound.protection.outlook.com [40.107.13.42]) by mx.groups.io with SMTP id smtpd.web11.7739.1659100212752026935 for ; Fri, 29 Jul 2022 06:10:13 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=TmXzLb6R; spf=pass (domain: arm.com, ip: 40.107.13.42, mailfrom: sunny.wang@arm.com) ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=B2vCQxSPU1o01hjTO2o1ctBwaAgYqKMpvFAg2pOpmX2/qAUO4gBc7Oz637vLIXLwK7kgOMmeBi7EXOWW30cY3ttwEjJQn1ZzOg8hiVviIsq3R9lUpuNFgJ3azmf4iK0V4XFZTI+O3EOnHC++ifl1C9cR1U8YKKp+NLszocKej2eV2j1bAbiDFgq5KWgsV8eVEwItFvrB96Qg4+XhsH4ugX+xrVzHx73eqqhV4bWfc4eH0y58l5hnM1ajAHWh26K987g4/z+k8HQeTf0klEJMQ90SoKOtuRY6MjJ21FFTUYGJ3T2KHN74lvTZ4sZWdygpJMj2JTSQqMIHlOHuRMzKqA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=F9hpU8fP184qCq1HWbQx5hc2b5Pzbn3jd6E4HINpdHI=; b=UPbz5dUMf314Vy2u4ZX36foKRac3bWrm6MOfyQMvgH9K4Q52sowG4JL57zNeoYBwejk60mYJsqs1jHVjtU13fOVP2C/8Uvqu5tg00MMadiAJN3JIvTJA3ovPJCRBnrr0dtB6smjERdVZaA+KOHx3k9STBVb6uPbDTYDW85LTE+34+XMp9STjeGuJ0+ZeF8GXt8jMwhhAsCaGnYnM0BL+5ETreLgqwo1OsvVSR2PHYl3AThALsrKkI89nGDnYP3vVEjQOQ+O/axSY3hKMYD5FuuW2agSz3SVkIygQ0ZQ4XoGJqoByKEmx5LZYz8CizQJJldZNhn40fEcXbc4yfdIZ3A== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=F9hpU8fP184qCq1HWbQx5hc2b5Pzbn3jd6E4HINpdHI=; b=TmXzLb6R50XjNGjEXN502JfGPmkP4u6gvS9rSCNe/aeWtsUebPG3OIp2VRBveo8btZ5rcPXPsAnxAnhlYQAnZvStd9lvyVoiLmnB5zT3JxGDkIqrQeicDLXU1UWU2g2z2omj825jKsFmYpW19sJ2GnD2yBSFouKBmMzcEExJVds= Received: from DU2PR04CA0182.eurprd04.prod.outlook.com (2603:10a6:10:28d::7) by AS4PR08MB8071.eurprd08.prod.outlook.com (2603:10a6:20b:58a::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5482.12; Fri, 29 Jul 2022 13:10:04 +0000 Received: from DBAEUR03FT030.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:28d:cafe::f5) by DU2PR04CA0182.outlook.office365.com (2603:10a6:10:28d::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5482.12 via Frontend Transport; Fri, 29 Jul 2022 13:10:04 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DBAEUR03FT030.mail.protection.outlook.com (100.127.142.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5482.12 via Frontend Transport; Fri, 29 Jul 2022 13:10:04 +0000 Received: ("Tessian outbound fccf984e7173:v123"); Fri, 29 Jul 2022 13:10:04 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: b75b8605dd1883cf X-CR-MTA-TID: 64aa7808 Received: from b90c4f0c7c62.3 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 3EFFAA36-104C-4075-8468-FEA5BA602CBC.1; Fri, 29 Jul 2022 13:09:53 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id b90c4f0c7c62.3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 29 Jul 2022 13:09:53 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ktyajYkNIJXx9cWNsOZ82fdVDfyEzMI7TVXoCpbovDx0Z3f84DtBhp5sJNrO8ImGw1jTOh9+i+TjY8ZN03QyKdJ2HAUFYMvT/lp0R1KcPSOM5yMeeLe/fSjgH5H/Md+jwKmQQPAykOODp+yUKXaaF9FvgcgymXl98FdoUw4xbFNxrF/OSwerJ+sBmp+z1sl8EZ1OkVD+kt8g/U9A6c0yCc1OqoE4kikQMMuXL0LiwDQJNiJyRRnYLnfW+5G9PF60qSqWfMh2qogJsZ2Pj/aphW6xvjaGoUpJCb6qF2Vo93pZtmMeEPOkQeRBkWSu0HTX0d906z8vApJMJe0d+ykZGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=F9hpU8fP184qCq1HWbQx5hc2b5Pzbn3jd6E4HINpdHI=; b=ZkI5p9OGNZDuDT+ay/9al0hJIpu3ded7a8gN8Rn1z5EsIdkunm2YwVdnVoL2Apb0nOAzDEHfTgQuakn+MKFor+16Ccujfug3urtjqhwdMJkmYQodnZuFPpoC63SPkXI0xjWjHDU/wbuxn4DlNvga+cC9IoenwYifZiBC4GpEer0G4hqi8iGGBaoqfM+igUcSNRHsiazOx5ftoEeQZasjMIHCnn1rCdCnm5MdInRieXlbM1HysCNrxqDnmwnnoYbxh5jvcWm8VyJkmy+a7P8pEyZVi2hwhV/0H0AzFCH1R3F7TQH7V8ZgXfyidUilMFwdX1qMIV9ZrrCofEgII/3+DQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=F9hpU8fP184qCq1HWbQx5hc2b5Pzbn3jd6E4HINpdHI=; b=TmXzLb6R50XjNGjEXN502JfGPmkP4u6gvS9rSCNe/aeWtsUebPG3OIp2VRBveo8btZ5rcPXPsAnxAnhlYQAnZvStd9lvyVoiLmnB5zT3JxGDkIqrQeicDLXU1UWU2g2z2omj825jKsFmYpW19sJ2GnD2yBSFouKBmMzcEExJVds= Received: from AS8PR08MB7791.eurprd08.prod.outlook.com (2603:10a6:20b:52d::6) by AM9PR08MB6675.eurprd08.prod.outlook.com (2603:10a6:20b:300::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5482.11; Fri, 29 Jul 2022 13:09:50 +0000 Received: from AS8PR08MB7791.eurprd08.prod.outlook.com ([fe80::f53a:a7c8:f845:4b37]) by AS8PR08MB7791.eurprd08.prod.outlook.com ([fe80::f53a:a7c8:f845:4b37%5]) with mapi id 15.20.5482.006; Fri, 29 Jul 2022 13:09:50 +0000 From: "Sunny Wang" To: Dimitrije Pavlov , "devel@edk2.groups.io" CC: Ard Biesheuvel , Leif Lindholm , Graeme Gregory , Radoslaw Biernacki , Jeff Booher-Kaeding , Samer El-Haj-Mahmoud , Jeremy Linton , Sunny Wang Subject: Re: [edk2-platforms][PATCH v1 1/1] Silicon/Qemu: Add SMBIOS tables of types 16, 17, and 19 Thread-Topic: [edk2-platforms][PATCH v1 1/1] Silicon/Qemu: Add SMBIOS tables of types 16, 17, and 19 Thread-Index: AQHYnITV1FdJfjwMiECKxPznB0hzmq2VXajA Date: Fri, 29 Jul 2022 13:09:50 +0000 Message-ID: References: <20220720220518.14686-1-Dimitrije.Pavlov@arm.com> In-Reply-To: <20220720220518.14686-1-Dimitrije.Pavlov@arm.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-MS-Office365-Filtering-Correlation-Id: 313bfb33-e911-431b-78b6-08da7163a6fb x-ms-traffictypediagnostic: AM9PR08MB6675:EE_|DBAEUR03FT030:EE_|AS4PR08MB8071:EE_ x-checkrecipientrouted: true nodisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: K7wRtOQ5lpEYX8hOresTTAkmcP4PtjVITZwc53xW9z9s2C/gD3q87ywDkCeGzxxoJQNKUcnZ+7OFiMfC01cKENqAkaYlGM+1aTZ6NtU2BEKABsmLloV0BaTPxImJek3ckUCyFpe7w4aUmN+9CF+1Me48HWlP/DLO13eTGgWp1fr/LrHW0FMOGVZtlWDP/yfsxdTDGayQ3I5qOtQ/JppXvi3bVF6RJSIupa/2L+bRUoGROg4upDeVJaSpOQtdwDvTvH2sQtBjhyRX4u9d87QOUX5pOkx15KRiH9uY2g2+oQGY9jWndOqcuu8mBknHToTzyRjDA+PzUMcRuM++609QTJypYePb9XeCbqy1ToahRESCydhW5leHarYl5noAqbNe94/eXFXzbz+hEvy6ZzH3DtcX7Ogxvrbv8qFTE8xoCYu1gPhQwBTPQ2xkPcWjPtzFm7iOlaFf8lIs1uV6a0JIsuX2fhxH2GsIQ5Yf+TisvQOwpGig1GClfC0Q8ricIbjBa4eaVAtULaI8sLNakH34URg43fQ5dlbce/3l4q1GnqOouBMO2lsnCRAdxjSoDjzf+x+1IeSSmp5VbSWzCBMTKaM6CHY4yfD7rMnmqZshjLQk0w/IGuEM8tPBJ4bsVRGSn6VpDUzzPRNx/SPiDR5XmgDp7CWw1dTvy3mFqvOhIpJm7X4zPOuKTjk3bFpVCtX0NFxk06W0sedz8GEnzIY8/2bmPuuPo5j/FdVIYSlZ7SanGEkBcnQfCf2a3yQb3DaaUb2q+xHGaDC2VLbI9RwKZxVO1rYRBmFrUMIKlm0y2UaLS6XMa3ppFUECEs/oeOJd X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR08MB7791.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(136003)(39860400002)(376002)(346002)(366004)(396003)(83380400001)(9686003)(52536014)(7696005)(38070700005)(41300700001)(6506007)(66946007)(53546011)(26005)(64756008)(8936002)(110136005)(54906003)(66556008)(4326008)(66446008)(66476007)(76116006)(86362001)(8676002)(316002)(19627235002)(55016003)(478600001)(5660300002)(71200400001)(122000001)(2906002)(186003)(33656002)(38100700002)(30864003);DIR:OUT;SFP:1101; MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR08MB6675 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Return-Path: Sunny.Wang@arm.com X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT030.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 46b9c65c-005f-4f45-56d2-08da71639ece X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /8IWlgQY998exRk/j9/6h8qCoCPwvJndMuohK990xRZho1MCsI2pDjFnlnlmq5dyJ6o9auivtiiRMh4Evk2PhXG7Qu7Q67ZP1lAU5D2RLXSX6k398xgMqld1+j8eagxzzwFIQPa5Lv5eUT1OTwlwQhgcFu8tGCCYVLEAXaYXbJW1uJObh0rjNfqZvLXP3zx3OQgBWKNXs9xbErCGTSSgV5Ct3kb6ZX7PsdvCXhBKYZGZ0ogCm61nBE8LezOi+wWHL0BZ8p43680JeB0BgEgF9oH/ykZO+u7eLDV4hsS+IYFaoOtuG3dNkU0yfAtdj0Wi6EclAT5tAhfL3OsH0cYML8MzKCqzw0OvyU7YR2bcYCVF9387DY205r0kf6qDnNcsjlyjoUZxKIQRDl7lyHZX4T1EaYxh4DhmcqmVZZOP0ldC5yQKFXtR0LvIq+xXwbcgwvl9JNGOuAe3YWbFbYoHbY4gKQOi7Lp7OtMb4ezjfPCtFh7Vk15kWx2P3Ot3T5zNknQfDXPD0UFDZpQF4SDqx1iOtkrDs82NYJrhsHoR5deG6N6+z/v2kG8guu9rbfiDF9wjBxJNGmsurDl9CdVUQyr/ofg4kQ8FcEIodk6g4qtpkvAnaVNQOBthm/4b3bTl9pXMR8jpOUudO5XI1CaL3ZjIixERBj7NlfQVAhxw5IKV9k+IYGEVM0mrRcKn0aeucu8/uyawyqbwBBTesScmMWAQ44dT5SOwW9wGJR9bdhliAyr8R+nA0kqtlnKRLh+zXXVaV2gfHTk257L669Z2qOvAtZZfBeubs8dVd2udG8dxx+i4fcGuUyrL3Zucf2UV X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230016)(4636009)(396003)(39860400002)(136003)(346002)(376002)(36840700001)(40470700004)(46966006)(82740400003)(41300700001)(52536014)(356005)(8936002)(5660300002)(478600001)(81166007)(70586007)(83380400001)(70206006)(8676002)(4326008)(19627235002)(316002)(186003)(47076005)(336012)(53546011)(36860700001)(54906003)(6506007)(7696005)(110136005)(40460700003)(9686003)(26005)(30864003)(82310400005)(55016003)(40480700001)(2906002)(86362001)(33656002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jul 2022 13:10:04.3389 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 313bfb33-e911-431b-78b6-08da7163a6fb X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DBAEUR03FT030.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR08MB8071 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Looks good to me. Reviewed-by: Sunny Wang -----Original Message----- From: Dimitrije Pavlov Sent: 20 July 2022 23:05 To: devel@edk2.groups.io Cc: Ard Biesheuvel ; Leif Lindholm ; Graeme Gregory ; Radoslaw Biernacki ; Jeff Booher-Kaeding ; Samer = El-Haj-Mahmoud ; Sunny Wang ; Jeremy Linton Subject: [edk2-platforms][PATCH v1 1/1] Silicon/Qemu: Add SMBIOS tables of = types 16, 17, and 19 Arm SBBR specification includes the list of required and recommended SMBIOS tables. Tables of types 16 (Physical Memory Array), 17 (Memory Device), and 19 (Memory Array Mapped Address) are required, but are not included in the current SbsaQemu SMBIOS driver. The current SMBIOS driver provides a limited number of tables using ArmPkg. This patch adds SbsaQemu-specific tables of types 16, 17, and 19. Cc: Ard Biesheuvel Cc: Leif Lindholm Cc: Graeme Gregory Cc: Radoslaw Biernacki Cc: Jeff Booher-Kaeding Cc: Samer El-Haj-Mahmoud Cc: Sunny Wang Cc: Jeremy Linton Signed-off-by: Dimitrije Pavlov --- Platform/Qemu/SbsaQemu/SbsaQemu.dsc | = 1 + Platform/Qemu/SbsaQemu/SbsaQemu.fdf | = 1 + Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuSmbiosDxe/SbsaQemuSmbiosDxe.inf | 4= 8 +++ Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuSmbiosDxe/SbsaQemuSmbiosDxe.c | 40= 5 ++++++++++++++++++++ 4 files changed, 455 insertions(+) diff --git a/Platform/Qemu/SbsaQemu/SbsaQemu.dsc b/Platform/Qemu/SbsaQemu/S= bsaQemu.dsc index 97014e2fb630..b7050d911708 100644 --- a/Platform/Qemu/SbsaQemu/SbsaQemu.dsc +++ b/Platform/Qemu/SbsaQemu/SbsaQemu.dsc @@ -721,6 +721,7 @@ [Components.common] ArmPkg/Universal/Smbios/SmbiosMiscDxe/SmbiosMiscDxe.inf EmbeddedPkg/Library/FdtLib/FdtLib.inf MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf + Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuSmbiosDxe/SbsaQemuSmbiosDxe.inf # # PCI support diff --git a/Platform/Qemu/SbsaQemu/SbsaQemu.fdf b/Platform/Qemu/SbsaQemu/S= bsaQemu.fdf index c35e3ed44054..9f031c3e6649 100644 --- a/Platform/Qemu/SbsaQemu/SbsaQemu.fdf +++ b/Platform/Qemu/SbsaQemu/SbsaQemu.fdf @@ -242,6 +242,7 @@ [FV.FvMain] INF ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClassDxe.in= f INF ArmPkg/Universal/Smbios/SmbiosMiscDxe/SmbiosMiscDxe.inf INF MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf + INF Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuSmbiosDxe/SbsaQemuSmbiosDxe.in= f # # PCI support diff --git a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuSmbiosDxe/SbsaQemuSmbios= Dxe.inf b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuSmbiosDxe/SbsaQemuSmbiosDxe= .inf new file mode 100644 index 000000000000..b5d156f6654e --- /dev/null +++ b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuSmbiosDxe/SbsaQemuSmbiosDxe.inf @@ -0,0 +1,48 @@ +#/** @file +# +# Static SMBIOS tables for the SbsaQemu platform. +# +# Copyright (c) 2022, ARM Limited. All rights reserved. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +#**/ + +[Defines] + INF_VERSION =3D 0x0001001A + BASE_NAME =3D SbsaQemuSmbiosDxe + FILE_GUID =3D DDE1ACCB-0555-4CAA-85E7-3CBC8962026E + MODULE_TYPE =3D DXE_DRIVER + VERSION_STRING =3D 1.0 + ENTRY_POINT =3D SbsaQemuSmbiosDriverEntryPoint + +[Sources] + SbsaQemuSmbiosDxe.c + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + ArmPlatformPkg/ArmPlatformPkg.dec + ArmPkg/ArmPkg.dec + +[LibraryClasses] + ArmLib + ArmPlatformLib + UefiBootServicesTableLib + MemoryAllocationLib + BaseMemoryLib + BaseLib + UefiLib + UefiDriverEntryPoint + DebugLib + PrintLib + +[Protocols] + gEfiSmbiosProtocolGuid + +[Depex] + gEfiSmbiosProtocolGuid + +[Pcd] + gArmTokenSpaceGuid.PcdSystemMemorySize + gArmTokenSpaceGuid.PcdSystemMemoryBase diff --git a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuSmbiosDxe/SbsaQemuSmbios= Dxe.c b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuSmbiosDxe/SbsaQemuSmbiosDxe.c new file mode 100644 index 000000000000..9ef5168b79f6 --- /dev/null +++ b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuSmbiosDxe/SbsaQemuSmbiosDxe.c @@ -0,0 +1,405 @@ +/** @file + * + * Static SMBIOS tables for the SbsaQemu platform. + * + * Note: Some tables are provided by ArmPkg. The tables that are not prov= ided by + * ArmPkg, but are required by SBBR, are as follows: + * Physical Memory Array (Type 16) + * Memory Device (Type 17) - For each socketed system-memory Device + * Memory Array Mapped Address (Type 19) - One per contiguous block per= Physical Memory Array + * + * Copyright (c) 2022, ARM Limited. All rights reserved. + * + * SPDX-License-Identifier: BSD-2-Clause-Patent + * + **/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/** + A global variable to store the SMBIOS handle for table Type 16. This var= iable should + only be modified by calling PhyMemArrayInfoUpdateSmbiosType16. +**/ +STATIC SMBIOS_HANDLE mPhyMemArrayInfoType16Handle =3D SMBIOS_HANDLE_PI_RES= ERVED; + +/** + SMBIOS data definition, TYPE16, Physical Memory Array +**/ +SMBIOS_TABLE_TYPE16 mPhyMemArrayInfoType16 =3D { + { EFI_SMBIOS_TYPE_PHYSICAL_MEMORY_ARRAY, sizeof (SMBIOS_TABLE_TYPE16), 0= }, + MemoryArrayLocationSystemBoard, // Location; (system board) + MemoryArrayUseSystemMemory, // Use; (system memory) + MemoryErrorCorrectionUnknown, // MemoryErrorCorrection; (unknown). + 0x80000000, // MaximumCapacity; (capacity is repres= ented in the ExtendedMaximumCapacity field) + 0xFFFE, // MemoryErrorInformationHandle; (not p= rovided) + 1, // NumberOfMemoryDevices + 0x0000080000000000ULL // ExtendedMaximumCapacity; (fixed at 8= TiB for SbsaQemu) +}; +CHAR8 *mPhyMemArrayInfoType16Strings[] =3D { + NULL +}; + +/** + SMBIOS data definition, TYPE17, Physical Memory Array +**/ +SMBIOS_TABLE_TYPE17 mMemDevInfoType17 =3D { + { EFI_SMBIOS_TYPE_MEMORY_DEVICE, sizeof (SMBIOS_TABLE_TYPE17), 0 }, + 0, // MemoryArrayHandle; should match SMBIOS_TABL= E_TYPE16.Handle, + // initialized at runtime, refer to MemDevInfo= UpdateSmbiosType17 + 0xFFFE, // MemoryErrorInformationHandle; (not provided= ) + 0xFFFF, // TotalWidth; (unknown) + 0xFFFF, // DataWidth; (unknown) + 0x0, // Size; initialized at runtime, refer to MemD= evInfoUpdateSmbiosType17 + MemoryFormFactorUnknown, // FormFactor; (unknown) + 0, // DeviceSet; (not part of a set) + 0, // DeviceLocator String + 0, // BankLocator String + MemoryTypeUnknown, // MemoryType; (unknown) + { // TypeDetail; + 0, // Reserved :1; + 0, // Other :1; + 1, // Unknown :1; + 0, // FastPaged :1; + 0, // StaticColumn :1; + 0, // PseudoStatic :1; + 0, // Rambus :1; + 0, // Synchronous :1; + 0, // Cmos :1; + 0, // Edo :1; + 0, // WindowDram :1; + 0, // CacheDram :1; + 0, // Nonvolatile :1; + 0, // Registered :1; + 0, // Unbuffered :1; + 0, // Reserved1 :1; + }, + 0, // Speed; (unknown) + 0, // Manufacturer String + 0, // SerialNumber String + 0, // AssetTag String + 0, // PartNumber String + 0, // Attributes; (unknown rank) + 0, // ExtendedSize; potentially initialized at ru= ntime if size is >=3D 32 GiB - 1 MiB, + // refer to MemDevInfoUpdateSmbiosType17 + 0, // ConfiguredMemoryClockSpeed; (unknown) + 0, // MinimumVoltage; (unknown) + 0, // MaximumVoltage; (unknown) + 0, // ConfiguredVoltage; (unknown) + MemoryTechnologyDram, // MemoryTechnology; (DRAM) + {{ // MemoryOperatingModeCapability + 0, // Reserved :1; + 0, // Other :1; + 0, // Unknown :1; + 1, // VolatileMemory :1; + 0, // ByteAccessiblePersistentMemory :1; + 0, // BlockAccessiblePersistentMemory :1; + 0 // Reserved :10; + }}, + 0, // FirwareVersion + 0, // ModuleManufacturerID (unknown) + 0, // ModuleProductID (unknown) + 0, // MemorySubsystemControllerManufacturerID (un= known) + 0, // MemorySubsystemControllerProductID (unknown= ) + 0, // NonVolatileSize + 0, // VolatileSize; initialized at runtime, refer= to MemDevInfoUpdateSmbiosType17 + 0, // CacheSize + 0, // LogicalSize (since MemoryType is not Memory= TypeLogicalNonVolatileDevice) + 0, // ExtendedSpeed + 0 // ExtendedConfiguredMemorySpeed +}; +CHAR8 *mMemDevInfoType17Strings[] =3D { + NULL +}; + + +SMBIOS_TABLE_TYPE19 mMemArrMapInfoType19 =3D { + { EFI_SMBIOS_TYPE_MEMORY_ARRAY_MAPPED_ADDRESS, sizeof (SMBIOS_TABLE_TYPE= 19), 0 }, + 0, // StartingAddress; initialized at runtime, refer to MemArrMapInfoUp= dateSmbiosType19 + 0, // EndingAddress; initialized at runtime, refer to MemArrMapInfoUpda= teSmbiosType19 + 0, // MemoryArrayHandle; should match SMBIOS_TABLE_TYPE16.Handle, + // initialized at runtime, refer to MemDevInfoUpdateSmbiosType17 + 1, // PartitionWidth + 0, // ExtendedStartingAddress; potentially initialized at runtime, + // refer to MemDevInfoUpdateSmbiosType17 + 0, // ExtendedEndingAddress; potentially initialized at runtime, + // refer to MemDevInfoUpdateSmbiosType17 +}; +CHAR8 *mMemArrMapInfoType19Strings[] =3D { + NULL +}; + + +/** + Create an SMBIOS record. + + Converts a fixed SMBIOS structure and an array of pointers to strings in= to + an SMBIOS record where the strings are cat'ed on the end of the fixed re= cord + and terminated via a double NULL and add to SMBIOS table. + + @param Template Fixed SMBIOS structure, required. + @param StringPack Array of strings to convert to an SMBIOS strin= g pack. + NULL is OK. + @param DataSmbiosHandle The new SMBIOS record handle. + NULL is OK. + + @return EFI_SUCCESS on success, other values on error. +**/ + +STATIC +EFI_STATUS +EFIAPI +LogSmbiosData ( + IN EFI_SMBIOS_TABLE_HEADER *Template, + IN CHAR8 **StringPack, + OUT EFI_SMBIOS_HANDLE *DataSmbiosHandle + ) +{ + EFI_STATUS Status; + EFI_SMBIOS_PROTOCOL *Smbios; + EFI_SMBIOS_HANDLE SmbiosHandle; + EFI_SMBIOS_TABLE_HEADER *Record; + UINTN Index; + UINTN StringSize; + UINTN Size; + CHAR8 *Str; + + Status =3D gBS->LocateProtocol (&gEfiSmbiosProtocolGuid, NULL, (VOID**)&= Smbios); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "Failed to locate SMBIOS protocol: %r\n", Status)= ); + return Status; + } + + // + // Calculate the size of the fixed record and optional string pack + // + Size =3D Template->Length; + if (StringPack =3D=3D NULL) { + // + // If there are no strings, allow for a double-NULL + // + Size +=3D 2; + } else { + for (Index =3D 0; StringPack[Index] !=3D NULL; Index++) { + StringSize =3D AsciiStrSize (StringPack[Index]); + Size +=3D StringSize; + } + if (StringPack[0] =3D=3D NULL) { + // + // If the only string is NULL, include it in size calculation + // + Size +=3D 1; + } + + // + // Add an additional NULL for a terminating double NULL + // + Size +=3D 1; + } + + // + // Copy over the template + // + Record =3D (EFI_SMBIOS_TABLE_HEADER*)AllocateZeroPool (Size); + if (Record =3D=3D NULL) { + DEBUG ((DEBUG_ERROR, "Failed to allocate memory for SMBIOS table\n")); + return EFI_OUT_OF_RESOURCES; + } + CopyMem (Record, Template, Template->Length); + + // + // Append the string pack + // + Str =3D ((CHAR8*)Record) + Record->Length; + for (Index =3D 0; StringPack[Index] !=3D NULL; Index++) { + StringSize =3D AsciiStrSize (StringPack[Index]); + CopyMem (Str, StringPack[Index], StringSize); + Str +=3D StringSize; + } + // + // Add an additional NULL for a terminating double NULL + // + *Str =3D 0; + + // + // Add the table to SMBIOS + // + SmbiosHandle =3D SMBIOS_HANDLE_PI_RESERVED; + Status =3D Smbios->Add ( + Smbios, + gImageHandle, + &SmbiosHandle, + Record + ); + + if ((Status =3D=3D EFI_SUCCESS) && (DataSmbiosHandle !=3D NULL)) { + *DataSmbiosHandle =3D SmbiosHandle; + } + + ASSERT_EFI_ERROR (Status); + FreePool (Record); + return Status; +} + + +/** + Updates SMBIOS table Type 16 and creates an SMBIOS record for it. + + Stores the SMBIOS handle for table Type 16 in mPhyMemArrayInfoType16Hand= le. +**/ +STATIC +VOID +PhyMemArrayInfoUpdateSmbiosType16 ( + VOID + ) +{ + LogSmbiosData ( + (EFI_SMBIOS_TABLE_HEADER*)&mPhyMemArrayInfoType16, + mPhyMemArrayInfoType16Strings, + &mPhyMemArrayInfoType16Handle + ); +} + + +/** + Updates SMBIOS table Type 17 and creates an SMBIOS record for it. + + Must be called after PhyMemArrayInfoUpdateSmbiosType16. +**/ +STATIC +VOID +MemDevInfoUpdateSmbiosType17 ( + VOID + ) +{ + UINT64 MemorySize; + + // + // PhyMemArrayInfoUpdateSmbiosType16 must be called before MemDevInfoUpd= ateSmbiosType17 + // + if (mPhyMemArrayInfoType16Handle =3D=3D SMBIOS_HANDLE_PI_RESERVED) { + DEBUG ((DEBUG_ERROR, "%a: mPhyMemArrayInfoType16Handle is not initiali= zed\n", __FUNCTION__)); + return; + } + + mMemDevInfoType17.MemoryArrayHandle =3D mPhyMemArrayInfoType16Handle; + + MemorySize =3D PcdGet64 (PcdSystemMemorySize); + if (MemorySize >=3D SIZE_32GB - SIZE_1MB) { + // + // If memory size is >=3D 32 GiB - 1 MiB, we need to use ExtendedSize = to represent it. + // In this case, Size is set to 0x7FFF. + // + mMemDevInfoType17.Size =3D 0x7FFF; + mMemDevInfoType17.ExtendedSize =3D MemorySize / SIZE_1MB; + } else { + // + // If memory size is < 32 GiB - 1 MiB, we use just Size. + // + mMemDevInfoType17.Size =3D MemorySize / SIZE_1MB; + mMemDevInfoType17.ExtendedSize =3D 0; + } + + // + // All memory on SbsaQemu is volatile + // + mMemDevInfoType17.VolatileSize =3D MemorySize; + + LogSmbiosData ( + (EFI_SMBIOS_TABLE_HEADER*)&mMemDevInfoType17, + mMemDevInfoType17Strings, + NULL + ); +} + + +/** + Updates SMBIOS table Type 19 and creates an SMBIOS record for it. + + Must be called after PhyMemArrayInfoUpdateSmbiosType16. +**/ +VOID +MemArrMapInfoUpdateSmbiosType19 ( + VOID + ) +{ + UINT64 MemorySize; + UINT64 MemoryBase; + UINT64 StartingAddressKiB; + UINT64 EndingAddressKiB; + + // + // PhyMemArrayInfoUpdateSmbiosType16 must be called before MemDevInfoUpd= ateSmbiosType17 + // + if (mPhyMemArrayInfoType16Handle =3D=3D SMBIOS_HANDLE_PI_RESERVED) { + DEBUG ((DEBUG_ERROR, "%a: mPhyMemArrayInfoType16Handle is not initiali= zed\n", __FUNCTION__)); + return; + } + + mMemArrMapInfoType19.MemoryArrayHandle =3D mPhyMemArrayInfoType16Handle; + + MemorySize =3D PcdGet64 (PcdSystemMemorySize); + MemoryBase =3D PcdGet64 (PcdSystemMemoryBase); + StartingAddressKiB =3D MemoryBase / SIZE_1KB; + EndingAddressKiB =3D StartingAddressKiB + (MemorySize / SIZE_1KB) - 1; + if (EndingAddressKiB > MAX_UINT32) { + // + // If the ending address cannot fit in a 32-bit unsigned integer, we u= se + // ExtendedStartingAddress and ExtendedEndingAddress fields, which are= 64 bits. + // In this case, StartingAddress and EndingAddress fields are set to 0= xFFFFFFFF. + // Note that, since always starting address < ending address, if the e= nding address + // can fit into 32 bits, then so can the starting address. + // + mMemArrMapInfoType19.StartingAddress =3D 0xFFFFFFFF; + mMemArrMapInfoType19.EndingAddress =3D 0xFFFFFFFF; + mMemArrMapInfoType19.ExtendedStartingAddress =3D StartingAddressKiB; + mMemArrMapInfoType19.ExtendedEndingAddress =3D EndingAddressKiB; + } else { + // + // If the starting address and the ending address can fit into 32 bits= , we just use + // StartingAddress and EndingAddress fields. + // + mMemArrMapInfoType19.StartingAddress =3D StartingAddressKiB; + mMemArrMapInfoType19.EndingAddress =3D EndingAddressKiB; + mMemArrMapInfoType19.ExtendedStartingAddress =3D 0; + mMemArrMapInfoType19.ExtendedEndingAddress =3D 0; + } + + LogSmbiosData ( + (EFI_SMBIOS_TABLE_HEADER*)&mMemArrMapInfoType19, + mMemArrMapInfoType19Strings, + NULL + ); +} + + +/** + Driver entry point. +**/ +EFI_STATUS +EFIAPI +SbsaQemuSmbiosDriverEntryPoint ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + PhyMemArrayInfoUpdateSmbiosType16 (); + MemDevInfoUpdateSmbiosType17 (); + MemArrMapInfoUpdateSmbiosType19 (); + + return EFI_SUCCESS; +} -- 2.34.1 IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease notify the sender immediately and do not disclose the contents to any= other person, use it for any purpose, or store or copy the information in = any medium. Thank you.