From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (EUR05-VI1-obe.outbound.protection.outlook.com [40.107.21.61]) by mx.groups.io with SMTP id smtpd.web10.20554.1621265641345980592 for ; Mon, 17 May 2021 08:34:01 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=evpvpemR; spf=pass (domain: arm.com, ip: 40.107.21.61, mailfrom: sami.mujawar@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=xd8E3BCulfllzEZ9IefV9ba4yNCaeIhTQ4NzeKGUz9w=; b=evpvpemR2YWvwe3K0qBaT2RbGw/MsrsCEsQ8xukUCOiKVqhC2n+uIa3K01MtrQ87K6RSKWnKPADGc+FN/gCN+APV9t4WqSDlqsvcGGhVe2rK8C4KxJ1MHqgDuYE2m3Q3mhfS1ExmIDK1rTghRmI/48Ca19m9c9g5iwxFxHlL4kA= Received: from AM5PR04CA0009.eurprd04.prod.outlook.com (2603:10a6:206:1::22) by HE1PR0801MB1643.eurprd08.prod.outlook.com (2603:10a6:3:83::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.26; Mon, 17 May 2021 15:33:58 +0000 Received: from VE1EUR03FT053.eop-EUR03.prod.protection.outlook.com (2603:10a6:206:1:cafe::9c) by AM5PR04CA0009.outlook.office365.com (2603:10a6:206:1::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25 via Frontend Transport; Mon, 17 May 2021 15:33:58 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; edk2.groups.io; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;edk2.groups.io; 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; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT053.mail.protection.outlook.com (10.152.19.198) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.25 via Frontend Transport; Mon, 17 May 2021 15:33:58 +0000 Received: ("Tessian outbound 3c5232d12880:v92"); Mon, 17 May 2021 15:33:57 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: f0737bd65e393fcd X-CR-MTA-TID: 64aa7808 Received: from c498d5717974.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 2DCC8CC1-5128-4732-A6EC-311A331C0119.1; Mon, 17 May 2021 15:33:46 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id c498d5717974.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 17 May 2021 15:33:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VkrtAtL4qWyk9HM4No/hYaaQ6CjGN9MfDwED62WEOX5D0CLGwi449EaOvm0pLh+V8is43MTRR3C21bJ6KogBIQZAmP46QwJC9lOZosGdMVESXweL1I+FP6MpLYMLZ6AX/tKXk0SFulLaNnSUONN8sPQAipG9DNcTJGj1KrGI9Dn7KnVTDQkpcqon1iAU8F5VKxrud8P5CH1Ngsu3lthg7ppMS+/1kixGAO9NLoGBAH9/djOsG+u7D2n+xxkPltPbbczoIilBFKK5mwHGxNIujO5Yu3IF7GuiG7oZyo1redW3QlX28oP2boHkH9uw9ieS1W6IH9jbqS0je8C6CkOpjA== 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-SenderADCheck; bh=xd8E3BCulfllzEZ9IefV9ba4yNCaeIhTQ4NzeKGUz9w=; b=AEMI2Z63u/PweXMrh3PFoX3g9MT97NYbOhMqJTIaCZmeufE+F+uTehEqfTCv5RUOc/vEgc7CokwcP/rF1HwPDc1rG5ccs6PP/Db0YiZoKhGvPlRrShCUnkAfkJmoJVigpA63uKVceMk7Y2gI6Ru8XloLKmeBXL/3hlIh+96bYgxnLdtpU5B4uId4fzgEpKKzNiMpjsY+Qcjeiei5fq4Q4KeRDXCUacbb4DXmE3Tr6JCD1qPNggqui67uxX3NnG4y1xuNEduAy9RFY4tJsRMR0VMESoO6taq3HHAIkikXiJCsbZyixvS2QuVjLe5yuFonfKH+UWCOXEa7hEdzW0Q3YQ== 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=xd8E3BCulfllzEZ9IefV9ba4yNCaeIhTQ4NzeKGUz9w=; b=evpvpemR2YWvwe3K0qBaT2RbGw/MsrsCEsQ8xukUCOiKVqhC2n+uIa3K01MtrQ87K6RSKWnKPADGc+FN/gCN+APV9t4WqSDlqsvcGGhVe2rK8C4KxJ1MHqgDuYE2m3Q3mhfS1ExmIDK1rTghRmI/48Ca19m9c9g5iwxFxHlL4kA= Authentication-Results-Original: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=arm.com; Received: from AS8PR08MB6806.eurprd08.prod.outlook.com (2603:10a6:20b:39b::12) by AS8PR08MB6008.eurprd08.prod.outlook.com (2603:10a6:20b:29d::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.26; Mon, 17 May 2021 15:33:41 +0000 Received: from AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::80cb:878d:c8f1:2688]) by AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::80cb:878d:c8f1:2688%7]) with mapi id 15.20.4129.031; Mon, 17 May 2021 15:33:41 +0000 Subject: Re: [edk2-platforms][PATCH V2 08/11] Platform/Sgi: Add SMBIOS Type16 Table To: Pranav Madhu , devel@edk2.groups.io Cc: Ard Biesheuvel , nd@arm.com References: <20210516092917.21124-1-pranav.madhu@arm.com> <20210516092917.21124-9-pranav.madhu@arm.com> From: "Sami Mujawar" Message-ID: <369cdf1d-fffc-e4d2-4fec-dbde5a58de9e@arm.com> Date: Mon, 17 May 2021 16:33:39 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.0.1 In-Reply-To: <20210516092917.21124-9-pranav.madhu@arm.com> X-Originating-IP: [217.140.106.52] X-ClientProxiedBy: LO4P123CA0388.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:18f::15) To AS8PR08MB6806.eurprd08.prod.outlook.com (2603:10a6:20b:39b::12) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [10.1.196.43] (217.140.106.52) by LO4P123CA0388.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:18f::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25 via Frontend Transport; Mon, 17 May 2021 15:33:40 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8e34f7ce-6a2a-4d57-95cf-08d919493044 X-MS-TrafficTypeDiagnostic: AS8PR08MB6008:|HE1PR0801MB1643: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:2582;OLM:2582; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: kavS5H8rxppy+gqiNEqbvQeUa4GPvMh+C2M6B0Afkt3tKx4uJfT7lNA7O/AwpmOg9+rI6xDf+APmgeAFrT0TQ8yDWBQJFHwOQBpGh6jvGA3/QYiPpeRPWHK1Br/O9OXKROMV+wVB6NLiwQ4nCA5bHzor3TH8LT3z8JwiB/BieBvdASMBEWv6KK406jtp5au0FMme1d1sWygskewQWAWnGzbCtL6BzTvli+Fc4mCMI1PGUGDYVjx8Dw1dCweNJYZsTjNEQRg5gLLykWQJY0Dj+Y9w0c9vPfb+SjW6pjXo1Id9EABX0o/Nwzi1b2L7inzD0GZvUlEtRFHD7uSzWgQGiyvUAhDDyAoIl8jbDJeMSMrUNE2g/AQwMBQCVoBBh00l71XRGsGWdRk0zO+OxHnBoUwDvKH3QSY1wQXgoeZ4mbx6FIlFU1LufLxxtzyiTnFd0mHofYZmjoI3J7lbahlyGcmuG1vmh+muStawTGMrQVT3lIOfJ0NjmzqTmjsrB1xfofYmCx2h8PUE910ykgW8Ppny0mshkHcIxsVBf4PnMnBdSKJo/WXm3+3hE3BNsaFKsmpVouAyVIFPf0z1f4aoZCtvHJoerDgRxTfhAPIegJuguVPscVecZYgDaWzW4iHLVqqO9Rr9d/jHQaF1itnhg2iBT9GvQUta7VvaZFvDGifjx/jvdNgnTqe3fD5Y9YrTxr9bIIwsIiNu9Wz6/85F7lYWRRHQ8POIxGZjLEl8cE8= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR08MB6806.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(39850400004)(346002)(366004)(376002)(396003)(136003)(2906002)(5660300002)(38100700002)(38350700002)(19627235002)(6486002)(16526019)(36756003)(83380400001)(66476007)(66556008)(31696002)(66946007)(52116002)(4326008)(316002)(16576012)(44832011)(956004)(2616005)(31686004)(8676002)(86362001)(186003)(53546011)(26005)(8936002)(478600001)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?B?OFovTXJHM25BZ2diZ0c5WjRmVUhRTmRmTXRNUTdycjVOaWh4MHlvM3BDRFdP?= =?utf-8?B?Ly92NjNTYkpIZVJhSHNKNlNrTGNqOHhON1h2NnVOaER3cForVm5BTlZZRW5V?= =?utf-8?B?VG44c1lkaEVNYmsrMjgyQ1ZGeGZRRlVGT3ZGanduWjV2WmJFTGNQaGZjZjBK?= =?utf-8?B?NkppWnVCR3ZyenFtQjF3SjN4Qmc2a0NjSDdYNkR1VFA5OENaYS9jWlNsU3dJ?= =?utf-8?B?cjhzcEQwdzhBUHZMRHhyUUNCandnWXhGZFYzRTYwWHFjNUt4ZmZFcjMwV0Vh?= =?utf-8?B?VGY2U1NXVDJqejlaSnhmMmFSMEt0a0ZNcXdVMHhwZUlWNXVDeHc5N2NralM3?= =?utf-8?B?blVscDduQUtLcnVZcHBRZW9DR1d5amlabEhyQ0VWaHVaRXQ1WnM0NGFhOEdz?= =?utf-8?B?RG82N2hhMWtWMGo0eTFwZUFZeWR0b0EzbGlXaGw3NERIY3lJNWJIM21GRTA2?= =?utf-8?B?dGVQZExpWDdKSTVLU0NwT243Z3RCNWppUVdoQmtkNU5oK1UySFZtaVBVVXJC?= =?utf-8?B?ZEVrbkpBMWM0L1lzcTl1elpuM244WGtTajRLNWNlcWdGVEJqOFpwRjg5NEVO?= =?utf-8?B?M2lkSGlEVnFMNXFOVDZpWkJaZVQwUlVGcHhLR0NxcW55TDV6dGorVEhybVRo?= =?utf-8?B?dktuU1kvTldmR094OXpBejA3YzA3VS9vcjE0TnlkU2d6ZjJlMEVsM21wWmxD?= =?utf-8?B?bEkzVzI5QzdHVEhrTkR3cEFWQ2pUOFl1RDZ4eWt6SFEwN2FYVVNsakx3VWgy?= =?utf-8?B?TlNyK0N2QXZVTUdxeHZkRitDZlpyM01FRU8reVA3b0VEUE1KNUtmcFZTUmN1?= =?utf-8?B?SjZIdkluS05DNEVpcjNwQWdOOTlSSkV1bWx6bjhvSmZYVWdSN2NDc3UwN1Ux?= =?utf-8?B?bElsTXhya2tUUU5FeklzT01MVVcvd0FNRmxybUVqQzNPMWIyejdqRUlCNTdt?= =?utf-8?B?Q0VoMEpYc0I1bkQvQUJwZFloS0NxajNFVGxJTDlDbDRkNVhpRkFQN3pPYVBs?= =?utf-8?B?QXB3V2VxYkp1b2hTODd0c2FSN2JlRDFqRklrRG5HK3FibFVUNHJKSU45Mkp0?= =?utf-8?B?eGVJM29HS3h4L0psN01zUmgvbGcvOG1JUTJGbVpObFhhanRYa2VEMWNzNEQv?= =?utf-8?B?S0MvMmJ0Y1hQc1QwRlphRC9nTE9EcTJKUldWRVo5b0REdXE4RzN5aTQxR045?= =?utf-8?B?czFjaDNZeDVFWml0am5MZUZiL25yUzgwQ1FDRUpkc1N5QUlJNEttNWpVblFB?= =?utf-8?B?UTEzb0trNVZLcTJKcDhJaFg0YitxUFQySVBtajNXWkZaTElMT3JKQTN6dHhF?= =?utf-8?B?WWhpVll2RTNSV0ZwYk5sUGFoM01lSytDWnZMWldkTGtQZEhrVEVxeEU5QVh6?= =?utf-8?B?ODcva3R3REhmbUdHR1ZrUlh1MVRtbDBOaVRCM3Jocys3a25PNndiV0hyazll?= =?utf-8?B?SzZRWGxpVHNBNHVzbVU0TWFUMnJkVHNkcXJBemk0bFgyQmd5YVBQcElCMHZV?= =?utf-8?B?U2IwbUdSRjlWbVRGNml0K1lqR1BOTmF0RThHMldMbGxIaGlSSnluTG5wbUs1?= =?utf-8?B?eTFoejJJMkEwdjFhK3dNQklmUDVPN3d0eVV2WCtvOGZVOXFSemVLbUMvRzA2?= =?utf-8?B?WUFFdjU4a1JWNXF3V1V6K0l4NUZGRHdrZEJ2MUlHSlBOM2M0cjFkRjNXMVRh?= =?utf-8?B?dTdzWkxSL0w4dUxKUndZVlczNUhocVQ4RGo4YXBkNGpMNVNlT1UvMG1SNmZT?= =?utf-8?Q?QyJkUaivF6m4hWSfffuCEgMbUwmGB9/C+atK8h7?= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6008 Original-Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=arm.com; Return-Path: Sami.Mujawar@arm.com X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT053.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: f69a2e1d-3ee7-465e-d8bf-08d9194925c5 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: K7RkjviPLF+omKfV+jITarRHP1XiSGrIcTIyqqe+C3TpOAx8D5gASDOL75GQIfSmca4T619IkxJhimUl6ICGIHXsYFOkIsXQeq26QTtxS+fG0RHXuOJ5NMUndEPxo9iZdCvfOeBqlQbNTVpypzBoJRkOK4RzsBsW2WX+YlYJh1HRGxcPgbh8gZJuMArEvYmBR7XATh3c58IvMMkZ3JKDe+PCWmcoxqxPG1GJXrMmOumVO6LNvfVxOocSi4rgKEmwB0axgMv5o5dpqP9RazrGQaxRG7p8VDrtrayeGTWqzTTFG1V1ltbV+nqUlE0D67mm8MrEx0S6QB0Qp86L352JLdGidAcZU8zfJatJgqvGGzP/fHsD4sJlesn8C0Lckurjl6hjlFxAywSGGtMABDhMWd/PM3Irm15fh2rDmr0LWHBR43DdjNnJeQTuCXaaxvKzhQvD/L21R8aYJCZ/V9OQfJG5I/qSPx4Sj5c0PRTJu71yxWQw0eUBgtZhn6LzK2aYGkvj1ZctVbeKmFeFxHzb+qJCRlHEtzImLJiDhXE054glbbDvVIecMOf4TC9cpeGQFN1chClyTPW0h/vrQS/sHZ8SdqzERWWo7Wyo6CjvCjH/Zq29mykTCmtDDMQEv2+gQZSfUVV7z4RwtJ2WoLobTWOF+QWhRVZ1HqxBL1BDliEa3Exp/50SWWDdTeghiMd2 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:(4636009)(396003)(136003)(346002)(39850400004)(376002)(46966006)(36840700001)(26005)(47076005)(6486002)(2906002)(16576012)(36860700001)(31686004)(336012)(31696002)(316002)(356005)(36756003)(81166007)(70586007)(5660300002)(16526019)(44832011)(478600001)(186003)(8676002)(19627235002)(2616005)(86362001)(82740400003)(70206006)(8936002)(83380400001)(53546011)(956004)(82310400003)(4326008)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 May 2021 15:33:58.0994 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8e34f7ce-6a2a-4d57-95cf-08d919493044 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: VE1EUR03FT053.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0801MB1643 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-GB Hi Pranav, Some comments in previous patches apply here as well and are not mentioned. With those addressed. Reviewed-by: Sami Mujawar Regards, Sami Mujawar On 16/05/2021 10:29 AM, Pranav Madhu wrote: > Add the SMBIOS type 16 table (Physical Memory Array) describes a > collection of memory devices that operate together to form a memory > address. It includes information about number of devices, total memory > installed, error correction mechanism used and other related information. > > Signed-off-by: Pranav Madhu > --- > Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.inf | 4 + > Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.h | 7 ++ > Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.c | 1 + > Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/Type16PhysicalMemoryArray.c | 106 ++++++++++++++++++++ > 4 files changed, 118 insertions(+) > > diff --git a/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.inf b/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.inf > index ee00b773912b..ebd19c1882bb 100644 > --- a/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.inf > +++ b/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.inf > @@ -20,6 +20,7 @@ > Type3SystemEnclosure.c > Type4ProcessorInformation.c > Type7CacheInformation.c > + Type16PhysicalMemoryArray.c > > [Packages] > ArmPkg/ArmPkg.dec > @@ -44,6 +45,9 @@ > gArmPlatformTokenSpaceGuid.PcdClusterCount > gArmPlatformTokenSpaceGuid.PcdCoreCount > gArmSgiTokenSpaceGuid.PcdChipCount > + gArmSgiTokenSpaceGuid.PcdDramBlock2Size > + gArmTokenSpaceGuid.PcdSystemMemoryBase > + gArmTokenSpaceGuid.PcdSystemMemorySize > gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareRevision > > [Protocols] > diff --git a/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.h b/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.h > index 6f3ad29f0797..e195fdea35af 100644 > --- a/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.h > +++ b/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.h > @@ -41,6 +41,12 @@ InstallCacheInformation ( > IN EFI_SMBIOS_PROTOCOL *Smbios > ); > > +EFI_STATUS > +EFIAPI > +InstallPhysicalMemoryArray ( > + IN EFI_SMBIOS_PROTOCOL *Smbios > + ); > + > enum SMBIOS_REFRENCE_HANDLES { > SMBIOS_HANDLE_ENCLOSURE = 0x1000, > SMBIOS_HANDLE_CLUSTER1, > @@ -49,6 +55,7 @@ enum SMBIOS_REFRENCE_HANDLES { > SMBIOS_HANDLE_L2_CACHE, > SMBIOS_HANDLE_L3_CACHE, > SMBIOS_HANDLE_L4_CACHE, > + SMBIOS_HANDLE_PHYSICAL_MEMORY, > }; > > #endif // SMBIOS_PLATFORM_DXE_H_ > diff --git a/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.c b/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.c > index 62d0f5ce8033..48073ad0ad27 100644 > --- a/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.c > +++ b/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.c > @@ -31,6 +31,7 @@ ARM_RD_SMBIOS_TABLE_INSTALL_FPTR mSmbiosTableList[] = { > &InstallSystemEnclosure, > &InstallProcessorInformation, > &InstallCacheInformation, > + &InstallPhysicalMemoryArray, > }; > > /** > diff --git a/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/Type16PhysicalMemoryArray.c b/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/Type16PhysicalMemoryArray.c > new file mode 100644 > index 000000000000..44a71fa8d18d > --- /dev/null > +++ b/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/Type16PhysicalMemoryArray.c > @@ -0,0 +1,106 @@ > +/** @file > + SMBIOS Type 16 (Physical Memory Array) table for ARM RD platforms. > + > + This file installs SMBIOS Type 16 (Physical Memory Array) table for Arm's > + Reference Design platforms. It describes a collection of memory devices that > + operate together to form a memory address. It includes information about > + number of devices, total memory installed, error correction mechanism used > + and other related information. > + > + 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.17 > +**/ > + > +#include > +#include > +#include > + > +#include "SmbiosPlatformDxe.h" > + > +#define TYPE16_STRINGS \ > + "\0" /* Null string */ > + > +/* SMBIOS Type16 structure */ > +#pragma pack(1) > +struct ArmRdSmbiosType16 { > + SMBIOS_TABLE_TYPE16 Base; > + UINT8 Strings[sizeof (TYPE16_STRINGS)]; > +} ARM_TYPE16; > +#pragma pack() > + > +/* Physical Memory Array */ > +static struct ArmRdSmbiosType16 mArmRdSmbiosType16 = { > + { > + { > + // SMBIOS header > + EFI_SMBIOS_TYPE_PHYSICAL_MEMORY_ARRAY, // Type 16 > + sizeof (SMBIOS_TABLE_TYPE16), // Length > + SMBIOS_HANDLE_PHYSICAL_MEMORY > + }, > + MemoryArrayLocationSystemBoard, // Location > + MemoryArrayUseSystemMemory, // Used as system memory > + MemoryErrorCorrectionUnknown, // Error correction > + 0x80000000, // Maximum capacity in KiB, uses Extended Maximum capacity field > + 0xFFFE, // Memory error info handle, does not provide this info > + 0, // Num of memory devices, update dymamically > + 0 // Extended Maximum capacity, update dymamically > + }, > + // Text strings (unformatted area) > + TYPE16_STRINGS > +}; > + > +/** > + Install SMBIOS physical memory array table. > + > + Install the SMBIOS physical memory array (type 16) table for Arm's Reference > + Design 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 in is already in use. > +**/ > +EFI_STATUS > +InstallPhysicalMemoryArray ( > + IN EFI_SMBIOS_PROTOCOL *Smbios > + ) > +{ > + EFI_STATUS Status; > + EFI_SMBIOS_HANDLE SmbiosHandle; > + UINT16 NumOfMemoryDevices = 1; > + UINT64 InstalledMemory; > + > + SmbiosHandle = ((EFI_SMBIOS_TABLE_HEADER *)&mArmRdSmbiosType16)->Handle; > + > + /* Include 16MB of Trusted DRAM as well */ > + InstalledMemory = PcdGet64 (PcdSystemMemorySize) + SIZE_16MB; > + if (PcdGet64 (PcdDramBlock2Size) != 0) { > + NumOfMemoryDevices++; > + InstalledMemory += PcdGet64 (PcdDramBlock2Size); > + } > + > + mArmRdSmbiosType16.Base.ExtendedMaximumCapacity = > + InstalledMemory * FixedPcdGet32 (PcdChipCount); > + mArmRdSmbiosType16.Base.NumberOfMemoryDevices = > + NumOfMemoryDevices * FixedPcdGet32 (PcdChipCount); > + > + /* Install type 16 table */ > + Status = Smbios->Add ( > + Smbios, > + NULL, > + &SmbiosHandle, > + (EFI_SMBIOS_TABLE_HEADER *)&mArmRdSmbiosType16 > + ); > + if (Status != EFI_SUCCESS) { > + DEBUG (( > + DEBUG_ERROR, > + "SMBIOS: Failed to install Type16 SMBIOS table.\n" > + )); > + } > + > + return Status; > +}