From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (NAM11-CO1-obe.outbound.protection.outlook.com [40.107.220.133]) by mx.groups.io with SMTP id smtpd.web10.18797.1683877834677004819 for ; Fri, 12 May 2023 00:50:35 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="no key for verify" header.i=@amperemail.onmicrosoft.com header.s=selector1-amperemail-onmicrosoft-com header.b=vKLtJdG6; spf=pass (domain: os.amperecomputing.com, ip: 40.107.220.133, mailfrom: tinhnguyen@os.amperecomputing.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QcphNQDE5ORRE+2Pnsen3Uy4+WnYms153zkLBulWBVGgiaWxS4j8FXs6nfgAVc/DW6zZwcDyriHFN2iNZqyctTCqQecTD5HvfGqX1dC2dqcovoW5Ite8UCzQRvnPr1oszMMI9OsZvzrxEzQ3avycl0qgMd8Me1Njmb/cc2SL2sG86PSJjOTUTN8mBC31L5T4E0JZ+exocJZ3oRyPbPsj/bbC1VrdsLdazWlx7Mh0myAIRVouigdUs/80YdXx9L76TZgN+IojN2sbJwJLcd+E/+4LjG8UxjtcnZzFP96zNFGvdbeO5lTdIgYJ7XFbrAKfc6FqZBQK26ASk+O7ZK2JxA== 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=6dzOjMcIc5DQugLXrjMQ0KTWH9ixdEQasxcn933wgKc=; b=XR3e8Xhc93qQkwt/ccu7N/hphSYnw5+VpMxcw1f44+LPKXXdzFpy9hO3pPr+x5Mkp2A07amP4kgrsgWjSURbPzdI1KsnHniVuO7jB3gZAjg/BlRv4qnNdnmDTqgH5IvqGwL/WB6HYxSEJrLdEXJbmZ1wgStsJwSVQyyRK0gMTS4IJoY4ekPnEZHPIDrEiMtjGKlmNTMM+AdwFMYDFYmc8NVXCwhEc4PEdnqAQw+sBGO95XICfohGPbh51nz8ADz/OBABBt9/srOm6AW+O/IhOLywwtHNt4PImVCX9Z9BPU5lHGgLA0Ad+07MsS3wW8FqKFvL3k+RAokCLN8DMQXiZg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=amperemail.onmicrosoft.com; dkim=pass header.d=amperemail.onmicrosoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amperemail.onmicrosoft.com; s=selector1-amperemail-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6dzOjMcIc5DQugLXrjMQ0KTWH9ixdEQasxcn933wgKc=; b=vKLtJdG6nO9Ee1QxddWW7p51Yt+jhLcRcKObOfKnG+D7Of77n4fqKihY3S/xTOcbMYcvuVFiC+oJbOFZ6WAPp3ncW1TsUAnjJ0r0ywOPChkhcWwvB+y1nP4yWXhtT/BnhEjPVqmTmLsERo/+CTzVW8uaAfUx5WBgf2oDj2QfuVU= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amperemail.onmicrosoft.com; Received: from DM5PR0102MB3336.prod.exchangelabs.com (2603:10b6:4:9f::11) by CH2PR01MB5752.prod.exchangelabs.com (2603:10b6:610:48::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.23; Fri, 12 May 2023 07:50:30 +0000 Received: from DM5PR0102MB3336.prod.exchangelabs.com ([fe80::fefc:e2a9:e823:fe42]) by DM5PR0102MB3336.prod.exchangelabs.com ([fe80::fefc:e2a9:e823:fe42%6]) with mapi id 15.20.6387.020; Fri, 12 May 2023 07:50:30 +0000 Message-ID: Date: Fri, 12 May 2023 14:50:14 +0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Subject: Re: [edk2-platforms][PATCH 1/2] ManageabilityPkg/IpmiFru: IPMI FRU Driver To: abner.chang@amd.com, devel@edk2.groups.io Cc: Isaac Oram , Abdul Lateef Attar , Nickle Wang , Tinh Nguyen References: <20230512032633.1740-1-abner.chang@amd.com> From: "Tinh Nguyen" In-Reply-To: <20230512032633.1740-1-abner.chang@amd.com> X-ClientProxiedBy: ME2PR01CA0181.ausprd01.prod.outlook.com (2603:10c6:220:20::25) To DM5PR0102MB3336.prod.exchangelabs.com (2603:10b6:4:9f::11) Return-Path: tinhnguyen@os.amperecomputing.com MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR0102MB3336:EE_|CH2PR01MB5752:EE_ X-MS-Office365-Filtering-Correlation-Id: 3c460290-0e2b-400d-5e1b-08db52bd8e88 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oTbHvJMI/lKZ5S6D7UwBc09g8vHeQbe+IXWIObH1eppN2XiEE3Tk5gH1jJ2hSeRzGQIk0RfZwuo4hp+7MF7qkpFdOK3AxdwM4v4AaUDWHqJn/UXe3GKI2CZwarWeR9TTWWs7XrlYuUpS7xJO6zQrupBSEowOLJJaGNE5V83j/iD0OXfEoZjVeamgI484VJNDh9KXWZZAzJwzTaZ2d0dwqcX1E/0OCZK1J/RVz6g5MZqznbhTrB0W+pEf9vPtvGxiYyNd1grlRRq5wP+oJnbBSflZ5mTytBRsEAumzQNHNU3uKzngVC+wT9d+4S1Eq2LH8jngrLKdKzV3JRu7mvuEL3HgeaQIuLMPPUXp6LE0swW08sqAVSzY3DGK6f3V3zgMjDgjiOUvIXdaFS2/6N91A8K0Wt7et62kQcvQVXoJOyBhm5REgbQjhA31FsePRJ7kb+JdnPf767HWNvyQBRepT9QEvwnzWj+CynBty8NhewzFIoaN23gOiJlZ9JyZI1Q4qQq3Zaet0xN+1dnxRW6CCgHpoacBISPQFA8gWXAKCsTsoMbOqWrvGfPsP5JFQgSbC7IZVabnqaj8/rYJQ25klrn0vtWDlBFvzWyru7msWAZkxwmpajMyLW3iJcy8feNX X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM5PR0102MB3336.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(39850400004)(396003)(376002)(366004)(346002)(451199021)(54906003)(478600001)(2906002)(66946007)(66556008)(66476007)(2616005)(41300700001)(316002)(6666004)(4326008)(31686004)(19627235002)(8936002)(8676002)(5660300002)(107886003)(26005)(53546011)(186003)(6512007)(6506007)(42882007)(6486002)(83380400001)(83170400001)(38100700002)(31696002)(43740500002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?UzlxUHQ2SVpoQm9xZldyNXBwSmQrdE5JUVhGNWV3WTJEbTBpVVFuVG44NHY0?= =?utf-8?B?U0ZIeU5tYVB2QzNBYjdEZWlheEpVTStYckFuU1I0ZVBlajJiSTVvQVFkaUd4?= =?utf-8?B?all6SDhOU3M4dm5GaFVoSU9SYjZ3dERIY2lRb2JwSXZYaDFwTlg2TGh3ZWI1?= =?utf-8?B?NjgxUkUvcjBWejRVYk9UU2NSaVBpb2Y4VkZHVGxIVjBueGNORXUyUjV1M0xI?= =?utf-8?B?UVVBR1NjSTNMK1pyN1QrNXBxNVBDWmEyeFN0bGwwa3lqUlJ2azNlQXFvUG1E?= =?utf-8?B?VUJlTjFTZmlxbDJETHJ6bkwzN3dCOHNCRC82SXdKV3doYTJsNmR3emRBWnZZ?= =?utf-8?B?d1o3QU9XUnZxbmFlbGlpd2RLRnRRTEhNN09pcWlYdWNFd2xmajczYUdIRzhq?= =?utf-8?B?Y3k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oft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3c460290-0e2b-400d-5e1b-08db52bd8e88 X-MS-Exchange-CrossTenant-AuthSource: DM5PR0102MB3336.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2023 07:50:29.9152 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: WSuqhYkcy3NSN1HmhqUbPgO9KPyJzNRkwMtjJHvCSQx2w4IC1JpFRQnFSVdim3joLOlSI/d55QbMOjXIPydUGy0Lm91wxSTYy67hmGFD/pU1cXnurVQO1YxEqGQdHBGG X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR01MB5752 Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Reviewed-by: Tinh Nguyen Thanks, - Tinh On 12/05/2023 10:26, abner.chang@amd.com wrote: > From: Abner Chang > > IpmiFru is cloned from > edk2-platforms/Features/Intel/OutOfBandManagement/ > IpmiFeaturePkg/IpmiFru in order to consolidate > edk2 system manageability support in one place. > Uncustify is applied to C files and no functionalities > are changed in this patch. > > We will still keep the one under IpmiFeaturePkg/IpmiFru > until the reference to this instance are removed from > platforms. > > Signed-off-by: Abner Chang > Cc: Isaac Oram > Cc: Abdul Lateef Attar > Cc: Nickle Wang > Cc: Tinh Nguyen > --- > .../Universal/IpmiFru/IpmiFru.inf | 34 ++++++++++ > .../Universal/IpmiFru/IpmiFru.c | 67 +++++++++++++++++++ > 2 files changed, 101 insertions(+) > create mode 100644 Features/ManageabilityPkg/Universal/IpmiFru/IpmiFru.inf > create mode 100644 Features/ManageabilityPkg/Universal/IpmiFru/IpmiFru.c > > diff --git a/Features/ManageabilityPkg/Universal/IpmiFru/IpmiFru.inf b/Features/ManageabilityPkg/Universal/IpmiFru/IpmiFru.inf > new file mode 100644 > index 0000000000..ddef310309 > --- /dev/null > +++ b/Features/ManageabilityPkg/Universal/IpmiFru/IpmiFru.inf > @@ -0,0 +1,34 @@ > +### @file > +# Component description file for IPMI FRU. > +# > +# Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
> +# > +# SPDX-License-Identifier: BSD-2-Clause-Patent > +# > +### > + > +[Defines] > + INF_VERSION = 0x00010005 > + BASE_NAME = IpmiFru > + FILE_GUID = CD9B99D9-E86F-48CF-A8EB-20120AC22666 > + MODULE_TYPE = DXE_DRIVER > + PI_SPECIFICATION_VERSION = 0x0001000A > + VERSION_STRING = 1.0 > + ENTRY_POINT = InitializeFru > + > +[Sources] > + IpmiFru.c > + > +[Packages] > + ManageabilityPkg/ManageabilityPkg.dec > + MdePkg/MdePkg.dec > + > +[LibraryClasses] > + DebugLib > + IpmiCommandLib > + UefiBootServicesTableLib > + UefiDriverEntryPoint > + UefiLib > + > +[Depex] > + TRUE > diff --git a/Features/ManageabilityPkg/Universal/IpmiFru/IpmiFru.c b/Features/ManageabilityPkg/Universal/IpmiFru/IpmiFru.c > new file mode 100644 > index 0000000000..2b489410db > --- /dev/null > +++ b/Features/ManageabilityPkg/Universal/IpmiFru/IpmiFru.c > @@ -0,0 +1,67 @@ > +/** @file > + IPMI FRU Driver. > + > +Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
> +SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#include > +#include > +#include > +#include > +#include > +#include > + > +/*++ > + > +Routine Description: > + > + Initialize SM Redirection Fru Layer > + > +Arguments: > + > + ImageHandle - ImageHandle of the loaded driver > + SystemTable - Pointer to the System Table > + > +Returns: > + > + EFI_STATUS > + > +--*/ > +EFI_STATUS > +EFIAPI > +InitializeFru ( > + IN EFI_HANDLE ImageHandle, > + IN EFI_SYSTEM_TABLE *SystemTable > + ) > +{ > + EFI_STATUS Status; > + IPMI_GET_DEVICE_ID_RESPONSE ControllerInfo; > + IPMI_GET_FRU_INVENTORY_AREA_INFO_REQUEST GetFruInventoryAreaInfoRequest; > + IPMI_GET_FRU_INVENTORY_AREA_INFO_RESPONSE GetFruInventoryAreaInfoResponse; > + > + // > + // Get all the SDR Records from BMC and retrieve the Record ID from the structure for future use. > + // > + Status = IpmiGetDeviceId (&ControllerInfo); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "!!! IpmiFru IpmiGetDeviceId Status=%x\n", Status)); > + return Status; > + } > + > + DEBUG ((DEBUG_ERROR, "!!! IpmiFru FruInventorySupport %x\n", ControllerInfo.DeviceSupport.Bits.FruInventorySupport)); > + > + if (ControllerInfo.DeviceSupport.Bits.FruInventorySupport) { > + GetFruInventoryAreaInfoRequest.DeviceId = 0; > + Status = IpmiGetFruInventoryAreaInfo (&GetFruInventoryAreaInfoRequest, &GetFruInventoryAreaInfoResponse); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "!!! IpmiFru IpmiGetFruInventoryAreaInfo Status=%x\n", Status)); > + return Status; > + } > + > + DEBUG ((DEBUG_ERROR, "!!! IpmiFru InventoryAreaSize=%x\n", GetFruInventoryAreaInfoResponse.InventoryAreaSize)); > + } > + > + return EFI_SUCCESS; > +}