From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web10.27417.1659373243314533655 for ; Mon, 01 Aug 2022 10:00:43 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=d0paKZml; spf=pass (domain: intel.com, ip: 134.134.136.65, mailfrom: maciej.czajkowski@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1659373243; x=1690909243; h=from:to:cc:subject:date:message-id:references: in-reply-to:mime-version:content-transfer-encoding; bh=e06TJxwZWhfjzsxcgly8flTgNlWb96HnGZvjOknM+xg=; b=d0paKZmlJm8TggZKlZBqxr21a1EtEZaIgvq501hh8HQ3GWOnIoa5pNXq 59+MVdSXHvCPGdhMJnGtyDD6OkP3XBNbIa7fkA1zRZNxOlyoeTBeO8pQJ m2Q7poru/2fA4g41bGld+gt1HZAAs+VDX+AJ+NfwEPxcTFDEGzpmMszvt 9hFtwh6jrQXBfGl7h9A3+VgwZDwt7CJ1dvQb8y4nkeVtoPY17AB0ntz84 /yLKtLzqmAieeMfroyT3QVKyyeGvIJG4uIF1wZAGbv7QcHF9ej9XP3Agz pNkvvjM91C3vLgRHqelpRCv7DnT4x9axRoCvSjwV4z8vNDxu1rvMceg/2 Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10426"; a="290408019" X-IronPort-AV: E=Sophos;i="5.93,208,1654585200"; d="scan'208";a="290408019" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Aug 2022 10:00:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,208,1654585200"; d="scan'208";a="605722355" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga007.fm.intel.com with ESMTP; 01 Aug 2022 10:00:41 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Mon, 1 Aug 2022 10:00:41 -0700 Received: from orsmsx605.amr.corp.intel.com (10.22.229.18) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Mon, 1 Aug 2022 10:00:40 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28 via Frontend Transport; Mon, 1 Aug 2022 10:00:40 -0700 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (104.47.73.169) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.28; Mon, 1 Aug 2022 10:00:40 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IkZT/btVouXzjOE8uRbyu/uTuoiJCU7rDQvnCfYS/n5D2hJ47U6YAdTHtV9RdQB/PKs1M/NWq3I5HMvZWxf8mzQzYBdCiq3c9Ou0EMpDHDI+4vZnQbfpltTu7ACI9FrLwVtnoIrQJFxWB3K92xa6b1y/01dmCuGFyAWtGcg2QlQn5MXDk6Chp7SmFJgBDvO6BliWCLEKuJxX8knS37+XnBw8ZsGMZkrlheATpXQr8Pe4mZMDIuymYw649TlJyG8nTwZ9iqun7dxTnEGrrpdps8L9yQwxCkAfu8lEP5lnabSh9mROtWPUh72hxsIdawVtEoeTXCjY3Hai2b1vGVUiXQ== 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=rfYqHgqNIuncyfp8mTpgayyMkFyMlqOr1lgcyREmVvc=; b=iF5IvhFpEm8vccQfWFqsirMIIYUzCTPAvt3Of3uyHeXLMcBcH9gwhQfygIXUOoWjm4GdaK/CMOlz7z1ZcZ0lNt9dMuebxNNon9rZYvYkncpAAB7DTc116mcOyFqN5XjX4ZCuRfC4NNvN/gWtWKkvIf4TsPXZOlnQmsaKVVh8430hk8gCTCCg9zXM/oWMgaY2iiRJ8S7zJfejlXnYIUQxTT2jLB2TwWO/U60Z+kFTYMgW2VWDy4XB7szPwYumUt0r/dfjfEoZChYP+Su48QvH7Vxfvdktga8DAS7NQpXDhBw8k5Vw4ox8vvbpLts1Q5PvOld3wJ8TyeOYUqoIEcb8HQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from BYAPR11MB3047.namprd11.prod.outlook.com (2603:10b6:a03:8b::32) by MWHPR11MB1373.namprd11.prod.outlook.com (2603:10b6:300:25::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5482.14; Mon, 1 Aug 2022 17:00:38 +0000 Received: from BYAPR11MB3047.namprd11.prod.outlook.com ([fe80::d8f5:9ead:a0ee:33c9]) by BYAPR11MB3047.namprd11.prod.outlook.com ([fe80::d8f5:9ead:a0ee:33c9%4]) with mapi id 15.20.5482.016; Mon, 1 Aug 2022 17:00:38 +0000 From: "Maciej Czajkowski" To: "Wu, Hao A" , "devel@edk2.groups.io" CC: "Ni, Ray" , "Gao, Liming" Subject: Re: [PATCH v2 2/2] MdeModulePkg/AhciPei: Use PCI_DEVICE_PPI to manage AHCI device Thread-Topic: [PATCH v2 2/2] MdeModulePkg/AhciPei: Use PCI_DEVICE_PPI to manage AHCI device Thread-Index: AQHYobRKYfwov/OA9EynI50oRBpGqa2S/4EggAcQMIA= Date: Mon, 1 Aug 2022 17:00:38 +0000 Message-ID: References: <20220727122733.2251-1-maciej.czajkowski@intel.com> <20220727122733.2251-3-maciej.czajkowski@intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.6.500.17 dlp-product: dlpe-windows dlp-reaction: no-action authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f657ae41-d65d-4f63-52a1-08da73df5c1a x-ms-traffictypediagnostic: MWHPR11MB1373:EE_ x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: PrQSLPZDCHZh4jF6oYdd1cR/gh+ruLZsg9Ht4lXmjwvUox8aAjeFpgkxTLn6l6VavKWUDWaF9ARicrIrcNEAuBQr0qG4dql2MYF7JOZ8+ZJm2zbkHkFe5Q3FTfeUeCvFU1pFoTGEOU12WwsCKyTzsLHhxPGJ6wB6SdALTfVA5dtTT+cqwGV/08wZDy7H85Ecx9FS3HbQ1YfY/3M6a/hV3ABI7zs2ssQ0cEnjpp7edT0g0xGI4TDnsxkNnH1EX+kluHls+2s6LSwIEB0B+aPHFMww51lvRo7Cvw6CSfBpegef3gBZ1CVmP5Olizox09jMZa4exN1t5rv9ZQCz6skonvTyxdpXdglZgMxMuRiwUIJvR0Ewq6+NQDXkvRTr9jOk4QcvrjRGMSFv2Y2IYTLuJvuFI5ffy1NpnlQjxg2G5Wzv6uoza2KLHvGsbAejsnwunKUQ+YJXbph1x2MgMPvnaC5isJm7F9zZFf+8Ef7IOdZBlbGpA0lDESI7fbCWRTiGHD0lGnJixfV27XXsCGg2WHg2uROTkkITtQ8mLlt6zIHocUf8hwp2vFPqb5vYfymGfQ4884RQVhsfu1NIo38TWxj+jkrAfrvAScKUS/ppMArlEu7X1PMrb3dE9bHGtB8h6FKL9vdkkzTVHTDijgrWGq1LX2KyXmUiQvicZO8a58d1gRzoInlUGUB4S+dB/JQFmeObjCpKRsC80KMUjjrNHV7QU7h7fej4UKsbNL4SB86NTAjmqcCZbcjdoHC3nldQINW1EbCFcXyNldcsa3bBDya9GmXUprAP85ITHluQFVHuH9HmkQKHfpdSntZlPwmUxt+IuI5LZBLau++Luk72Qw== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR11MB3047.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(136003)(396003)(346002)(39860400002)(366004)(376002)(83380400001)(9686003)(26005)(7696005)(6506007)(53546011)(38070700005)(186003)(82960400001)(122000001)(86362001)(38100700002)(8936002)(30864003)(52536014)(5660300002)(8676002)(4326008)(55016003)(2906002)(71200400001)(66446008)(966005)(41300700001)(478600001)(66556008)(76116006)(66476007)(64756008)(110136005)(19627235002)(316002)(54906003)(66946007)(33656002)(559001)(579004);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?kTcOECVWArZyVCwNRjJRrNwDzExO0I5/925M9ZpW2CJ7OnCjXvJ4pLjWBj7P?= =?us-ascii?Q?mv0SWMUxWPcRcVF55iX7zfTj2PmlMA9bQslH3p445mmHE0V+U9lMXE97ZTWb?= =?us-ascii?Q?jWnDjfmnuJSEoSTJ0OzqTFiyHWHkGyVMRsemF0DiLUTmo/sFowH71WLvLBAg?= =?us-ascii?Q?tpvxQcXZsWIG9xLOYFKZIkUg9osyrgTYLM5AVRXvFwB+UiVY3WYpbrUhcgAS?= =?us-ascii?Q?AMA0VsKnVfuWsJkZzy3r5Sc8Dt2wk4h6kFhIGJBQhcVUpEDjozvG0PECvZuj?= =?us-ascii?Q?YISGFvxFTD//+y2kG4+dIL5ym+Zg6e9maSNWKTMPvrMeaUxZfgheqLcyrFzz?= =?us-ascii?Q?IXUtUzbFbI6Qai3GRbgWKb5IqAVpdzXbjs2VH3QjLPjA2zmErk7dDBjlgGFn?= =?us-ascii?Q?Z8oJV7I9iOP0jWgqkZMXcKPRSQmqn2Bu/kIYhC/LXjteW2BHB9Rc2D14Cm6h?= =?us-ascii?Q?dS625UK1BfxwzFViy67U0mFHeyVXheGjxOerzhxebIlqRn+ZE33MofWzU8As?= =?us-ascii?Q?pxc8oH0URWLD8fYCwqbQvi0WlKE9VJXovEYVC5zfWwqyvXGpeik4lPAtRs+F?= =?us-ascii?Q?nAVOdh/yzPbFkpcE3f3xOMbqPlhEorZnUpPDWVFnmfMCiHnxNcO+8G9JhAo1?= =?us-ascii?Q?KypYBXGCuU7pKZbm8L9DVTsr43gjgPMiPt/JTP4WtSbCj9WydmakSgBKk2mw?= =?us-ascii?Q?+0HascVw82vkgH8WdmWSmuYuftwWrflZCoYtHXfmOLKiRe5rdJZs7ZDwx9vw?= =?us-ascii?Q?psAsvG+OYC+vcjxBU3im1LfCTo0GcqamudZ7iBa4hN2YIvjOPipE8umuJ77v?= =?us-ascii?Q?oWMp6HZ54YV5/a9XNBWZ8sNAKQGmrpYdoXbC9Ztbe3dcUYRK4Q+S56sqzgW9?= =?us-ascii?Q?8ogzO5rgy+ITuV/L5KxKXNiVOAZC1Fq7WbuxBbt+uwAV7fZOVIPvrHmn8dtF?= =?us-ascii?Q?/zO9CTTutMtfM3mPLTsNDBFxyvFLHFZpQsxkq884VhmGtU25pvfwyi4ZazRP?= =?us-ascii?Q?p3R/+jiLJDa46nv5IGKA65FFHcGWfYMKffmVUYwUMnayDL9uRfJ50hPk2IoU?= =?us-ascii?Q?k377R8e24v1DxEbcYTEXrrme4WkP0JqoqP0vS3dtxPv3MvblEIpRLAJOPk6w?= =?us-ascii?Q?z1GN+UgmvbNnciZ/dNQ5RCgiWGKQ8uQvJIDQtUure7REDFIFSRiMiMuBc2nF?= =?us-ascii?Q?4sK7dDRpBUCrG4jVTh2KzQiRpN5b7C8WBPmolaz4I48lDjI5PitfP3MhSBbW?= =?us-ascii?Q?oYhtEuSZiSr85mJttncBcYmbbD55xbXrcyfzuSdKWTo+PVp+L2Z5tlQdfj94?= =?us-ascii?Q?SxfSQ/SLT2+g8jEBQaUBFJR8meI5jcJXEofHLMxolz8NKaQxlxXHFedBZWYT?= =?us-ascii?Q?5cKOxieLC7JHBEDwYusk8DMiQuJ0TEtYAE0yc3F9a8BJNKcTOECHQkRqLxCT?= =?us-ascii?Q?1qQb/6q1C1HkHR9GKs6y9AuXcyosrMufERk8Mr5fpV/54lPItBaIOv1F51Hi?= =?us-ascii?Q?BSilLI3XHr2Haoa5j803wbvUIpnOxNeJsJI804SPOnxcPoNtCPysVIt61qBi?= =?us-ascii?Q?KCDUymRV0y9/2FWfz9LZd6IaS72ha3SCq7kFvt2u?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BYAPR11MB3047.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f657ae41-d65d-4f63-52a1-08da73df5c1a X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Aug 2022 17:00:38.6320 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: eD7ph0nQwAS99jvXwQKl3idvxWXanG6VRxMHHIS2+c/7Sa9lHfdsfnm7B+ap+ku2plDhrjW5wy9Ct1v1VE/nCd0AyhTlqTBCxtcRpAcmEJk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1373 Return-Path: maciej.czajkowski@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hello, 1. I checked that and you are right. It will invoke callback functions when= PPIs are already installed. I removed unnecessary function calls in v3 pat= ch. 2. Moved in v3. 3. Corrected in v3. 4. Aligned in v3. 5. Whole debug removed because of point 1. 6. Code removed - point 1. Thanks, Maciej = -----Original Message----- From: Wu, Hao A = Sent: czwartek, 28 lipca 2022 05:30 To: Czajkowski, Maciej ; devel@edk2.groups.io Cc: Ni, Ray ; Gao, Liming Subject: RE: [PATCH v2 2/2] MdeModulePkg/AhciPei: Use PCI_DEVICE_PPI to man= age AHCI device 1. In the AHCI PEIM entrypoint, after registering the PPI callbacks for: * gEdkiiPeiAtaAhciHostControllerPpiGuid and * gEdkiiPeiPciDevicePpiGuid My take is that there is no need to locate above PPI instances already inst= alled within system (codes in entry point that come after the callback regi= stration). The current implementation of PeiServicesNotifyPpi (details can be referred= at MdeModulePkg\Core\Pei\Ppi\Ppi.c - InternalPeiNotifyPpi) will invoke the= callback functions for all the matched PPI instances already installed. Could you help to double confirm on this in your unit test? Sorry for missi= ng this on the V1 patch. 2. Please help to move the function declaration for: AtaAhciHostControllerPpiInstallationCallback() AtaAhciPciDevicePpiInstallationCallback() from AhciPei.c to AhciPei.h to keep consistency. 3. The function description comments for: AtaAhciHostControllerPpiInstallationCallback() AtaAhciPciDevicePpiInstallationCallback() do not exactly match between their declaration and definition. 4. During the enabling of the HC in function AtaAhciInitPrivateDataFromPciD= evice(): Status =3D PciDevice->PciIo.Attributes ( &PciDevice->PciIo, EfiPciIoAttributeOperationSet, EFI_PCI_DEVICE_ENABLE, NULL ); Could you help to update the flow to align with AtaAtapiPassThru DXE counte= rpart when enabling the controller? MdeModulePkg\Bus\Ata\AtaAtapiPassThru\AtaAtapiPassThru.c - AtaAtapiPassThru= Start(): Status =3D PciIo->Attributes ( PciIo, EfiPciIoAttributeOperationSupported, 0, &EnabledPciAttributes ); if (!EFI_ERROR (Status)) { EnabledPciAttributes &=3D (UINT64)EFI_PCI_DEVICE_ENABLE; Status =3D PciIo->Attributes ( PciIo, EfiPciIoAttributeOperationEnable, EnabledPciAttributes, NULL ); } 5. DEBUG ((DEBUG_ERROR, "%a: Using AtaAhciHostControllerPpi to initialize p= rivate data.\n", __FUNCTION__)); -> DEBUG ((DEBUG_INFO, "%a: Using AtaAhciHostControllerPpi to initialize = -> private data.\n", __FUNCTION__)); 6. I think for AtaAhciInitPrivateDataFromPciDevices(), the below code snipp= et: // // Override the status to continue the for loop // Status =3D EFI_SUCCESS; is no longer needed. Could you help to check? Best Regards, Hao Wu > -----Original Message----- > From: Czajkowski, Maciej > Sent: Wednesday, July 27, 2022 8:28 PM > To: devel@edk2.groups.io > Cc: Wu, Hao A ; Ni, Ray ; Gao, = > Liming > Subject: [PATCH v2 2/2] MdeModulePkg/AhciPei: Use PCI_DEVICE_PPI to = > manage AHCI device > = > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3907 > = > This change modifies AhciPei library to allow usage both = > EDKII_PCI_DEVICE_PPI and EDKII_PEI_ATA_AHCI_HOST_CONTROLLER_PPI > to manage ATA HDD working under AHCI mode. > = > Cc: Hao A Wu > Cc: Ray Ni > Cc: Liming Gao > Signed-off-by: Maciej Czajkowski > --- > = > Notes: > v2 changes: > - added missing function descriptions > - moved controller initialization from PCI_DEVICE_PPI to seperate fun= citon > in order to reduce code duplication > - added DevicePathLib BASE instance to the MdeModulePkg.dec to = > allow PEIMs to consume it > = > MdeModulePkg/Bus/Ata/AhciPei/AhciPei.c | 585 ++++++++++++++------ > MdeModulePkg/Bus/Ata/AhciPei/DevicePath.c | 44 -- > MdeModulePkg/Bus/Ata/AhciPei/AhciPei.h | 17 +- > MdeModulePkg/Bus/Ata/AhciPei/AhciPei.inf | 5 +- > MdeModulePkg/MdeModulePkg.dsc | 1 + > 5 files changed, 430 insertions(+), 222 deletions(-) > = > diff --git a/MdeModulePkg/Bus/Ata/AhciPei/AhciPei.c > b/MdeModulePkg/Bus/Ata/AhciPei/AhciPei.c > index 208b7e9a3606..8ad98dc76bc1 100644 > --- a/MdeModulePkg/Bus/Ata/AhciPei/AhciPei.c > +++ b/MdeModulePkg/Bus/Ata/AhciPei/AhciPei.c > @@ -9,6 +9,47 @@ > **/ #include "AhciPei.h"+#include +#include = > +#include ++/**+ = > Callback for EDKII_ATA_AHCI_HOST_CONTROLLER_PPI installation.++ > @param[in] PeiServices Pointer to PEI Services Table.+ @param[in] > NotifyDescriptor Pointer to the descriptor for the Notification+ > event that caused this function to execute.+ @param[in] Ppi = Pointer > to the PPI data associated with this function.++ @retval EFI_SUCCESS = The > function completes > successfully++**/+EFI_STATUS+EFIAPI+AtaAhciHostControllerPpiInstallati > successfully++on > Callback (+ IN EFI_PEI_SERVICES **PeiServices,+ IN > EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor,+ IN VOID *Ppi+ = > );++/**+ Callback for EDKII_PCI_DEVICE_PPI installation.++ > @param[in] PeiServices Pointer to PEI Services Table.+ @param[in] > NotifyDescriptor Pointer to the descriptor for the Notification+ > event that caused this function to execute.+ @param[in] Ppi = Pointer > to the PPI data associated with this function.++ @retval EFI_SUCCESS = The > function completes > successfully++**/+EFI_STATUS+EFIAPI+AtaAhciPciDevicePpiInstallationCal > successfully++lb > ack (+ IN EFI_PEI_SERVICES **PeiServices,+ IN > EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor,+ IN VOID *Ppi+ ); = > EFI_PEI_PPI_DESCRIPTOR mAhciAtaPassThruPpiListTemplate =3D > { (EFI_PEI_PPI_DESCRIPTOR_PPI | > EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),@@ -40,6 +81,18 @@ = > EFI_PEI_NOTIFY_DESCRIPTOR mAhciEndOfPeiNotifyListTemplate =3D { > AhciPeimEndOfPei }; +EFI_PEI_NOTIFY_DESCRIPTOR = > mAtaAhciHostControllerNotify =3D {+ = > (EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK | = > EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),+ > &gEdkiiPeiAtaAhciHostControllerPpiGuid,+ > AtaAhciHostControllerPpiInstallationCallback+};++EFI_PEI_NOTIFY_DESCRI > AtaAhciHostControllerPpiInstallationCallback+PT > OR mPciDevicePpiNotify =3D {+ (EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK > | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),+ > &gEdkiiPeiPciDevicePpiGuid,+ AtaAhciPciDevicePpiInstallationCallback+};+ > /** Free the DMA resources allocated by an ATA AHCI controller. @@ - > 111,33 +164,30 @@ AhciPeimEndOfPei ( > } /**- Entry point of the PEIM.+ Initialize and install PrivateData P= PIs. - > @param[in] FileHandle Handle of the file being invoked.- @param[in] > PeiServices Describes the list of possible PEI Services.-- @retval > EFI_SUCCESS PPI successfully installed.+ @param[in] MmioBase > MMIO base address of specific AHCI controller+ @param[in] DevicePath > A pointer to the EFI_DEVICE_PATH_PROTOCOL+ = structure.+ > @param[in] DevicePathLength Length of the device path. + @retval > EFI_SUCCESS AHCI controller initialized and PPIs installed+ @retval = > others Failed to initialize AHCI controller **/ EFI_STATUS-EFIAPI-AtaAhci= PeimEntry > (- IN EFI_PEI_FILE_HANDLE FileHandle,- IN CONST EFI_PEI_SERVICES > **PeiServices+AtaAhciInitPrivateData (+ IN UINTN Mmi= oBase,+ > IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,+ IN UINTN > DevicePathLength ) {- EFI_STATUS Status;- EF= I_BOOT_MODE > BootMode;- EDKII_ATA_AHCI_HOST_CONTROLLER_PPI *AhciHcPpi;- UINT8 > Controller;- UINTN MmioBase;- UINTN > DevicePathLength;- EFI_DEVICE_PATH_PROTOCOL *DevicePath;- > UINT32 PortBitMap;- PEI_AHCI_CONTROLLER_PRI= VATE_DATA > *Private;- UINT8 NumberOfPorts;+ EFI_STAT= US > Status;+ UINT32 PortBitMap;+ UINT8 > NumberOfPorts;+ PEI_AHCI_CONTROLLER_PRIVATE_DATA *Private;+ > EFI_BOOT_MODE BootMode; - DEBUG ((DEBUG_INFO, "%a: > Enters.\n", __FUNCTION__));+ DEBUG ((DEBUG_INFO, "Initializing private > data for ATA\n")); // // Get the current boot mode.@@ -149,19 +199,1= 49 > @@ AtaAhciPeimEntry ( > } //- // Locate the ATA AHCI host controller PPI.- //- Status = =3D > PeiServicesLocatePpi (- &gEdkiiPeiAtaAhciHostControllerPpiGui= d,- > 0,- NULL,- (VOID **)&AhciHcPpi- );+ = // Check validity of > the device path of the ATA AHCI controller.+ //+ Status =3D = > AhciIsHcDevicePathValid (DevicePath, DevicePathLength);+ if (EFI_ERROR > (Status)) {+ DEBUG ((+ DEBUG_ERROR,+ "%a: The device path is > invalid.\n",+ __FUNCTION__+ ));+ return Status;+ }++ //+ = // For S3 > resume performance consideration, not all ports on an ATA AHCI+ // = > controller will be enumerated/initialized. The driver consumes the+ = > // content within S3StorageDeviceInitList LockBox to get the ports = > that+ // will be enumerated/initialized during S3 resume.+ //+ if (Boo= tMode =3D=3D > BOOT_ON_S3_RESUME) {+ NumberOfPorts =3D AhciS3GetEumeratePorts > (DevicePath, DevicePathLength, &PortBitMap);+ if (NumberOfPorts =3D=3D= 0) > {+ return EFI_SUCCESS;+ }+ } else {+ PortBitMap =3D MAX_UINT3= 2;+ }++ > //+ // Memory allocation for controller private data.+ //+ Private = > =3D AllocateZeroPool (sizeof (PEI_AHCI_CONTROLLER_PRIVATE_DATA));+ if > (Private =3D=3D NULL) {+ DEBUG ((+ DEBUG_ERROR,+ "%a: Fail t= o allocate > private data.\n",+ __FUNCTION__+ ));+ return > EFI_OUT_OF_RESOURCES;+ }++ //+ // Initialize controller private = > data.+ //+ > Private->Signature =3D > AHCI_PEI_CONTROLLER_PRIVATE_DATA_SIGNATURE;+ Private->MmioBase =3D = > MmioBase;+ Private->DevicePathLength =3D DevicePathLength;+ Private- > >DevicePath =3D DevicePath;+ Private->PortBitMap =3D PortBit= Map;+ > InitializeListHead (&Private->DeviceList);++ Status =3D AhciModeInitiali= zation > (Private); if (EFI_ERROR (Status)) {- DEBUG ((DEBUG_ERROR, "%a: Fail= ed to > locate AtaAhciHostControllerPpi.\n", __FUNCTION__));- return > EFI_UNSUPPORTED;+ return Status;+ }++ Private- > >AtaPassThruMode.Attributes =3D > EFI_ATA_PASS_THRU_ATTRIBUTES_PHYSICAL |+ = > EFI_ATA_PASS_THRU_ATTRIBUTES_LOGICAL;+ Private- > >AtaPassThruMode.IoAlign =3D sizeof (UINTN);+ Private- > >AtaPassThruPpi.Revision =3D EDKII_PEI_ATA_PASS_THRU_PPI_REVISION;+ > Private->AtaPassThruPpi.Mode =3D &Private->AtaPassThruMode;+ > Private->AtaPassThruPpi.PassThru =3D AhciAtaPassThruPassThru;+ Priv= ate- > >AtaPassThruPpi.GetNextPort =3D AhciAtaPassThruGetNextPort;+ Private- > >AtaPassThruPpi.GetNextDevice =3D AhciAtaPassThruGetNextDevice;+ > Private->AtaPassThruPpi.GetDevicePath =3D AhciAtaPassThruGetDevicePath;+ > CopyMem (+ &Private->AtaPassThruPpiList,+ > &mAhciAtaPassThruPpiListTemplate,+ sizeof > (EFI_PEI_PPI_DESCRIPTOR)+ );+ Private->AtaPassThruPpiList.Ppi =3D > &Private->AtaPassThruPpi;+ PeiServicesInstallPpi (&Private- > >AtaPassThruPpiList);++ Private->BlkIoPpi.GetNumberOfBlockDevices =3D > AhciBlockIoGetDeviceNo;+ Private->BlkIoPpi.GetBlockDeviceMediaInfo =3D > AhciBlockIoGetMediaInfo;+ Private->BlkIoPpi.ReadBlocks =3D > AhciBlockIoReadBlocks;+ CopyMem (+ &Private->BlkIoPpiList,+ > &mAhciBlkIoPpiListTemplate,+ sizeof (EFI_PEI_PPI_DESCRIPTOR)+ );+ > Private->BlkIoPpiList.Ppi =3D &Private->BlkIoPpi;+ = > Private->PeiServicesInstallPpi > (&Private->BlkIoPpiList);++ Private->BlkIo2Ppi.Revision = =3D > EFI_PEI_RECOVERY_BLOCK_IO2_PPI_REVISION;+ Private- > >BlkIo2Ppi.GetNumberOfBlockDevices =3D AhciBlockIoGetDeviceNo2;+ > Private->BlkIo2Ppi.GetBlockDeviceMediaInfo =3D AhciBlockIoGetMediaInfo2;+ > Private->BlkIo2Ppi.ReadBlocks =3D AhciBlockIoReadBlocks2;+ = CopyMem > (+ &Private->BlkIo2PpiList,+ &mAhciBlkIo2PpiListTemplate,+ sizeof > (EFI_PEI_PPI_DESCRIPTOR)+ );+ Private->BlkIo2PpiList.Ppi =3D &Private- > >BlkIo2Ppi;+ PeiServicesInstallPpi (&Private->BlkIo2PpiList);++ if (Pri= vate- > >TrustComputingDevices !=3D 0) {+ DEBUG ((+ DEBUG_INFO,+ "%a: > Security Security Command PPI will be produced.\n",+ > __FUNCTION__+ ));+ Private->StorageSecurityPpi.Revision = =3D > EDKII_STORAGE_SECURITY_PPI_REVISION;+ Private- > >StorageSecurityPpi.GetNumberofDevices =3D > AhciStorageSecurityGetDeviceNo;+ Private- > >StorageSecurityPpi.GetDevicePath =3D > AhciStorageSecurityGetDevicePath;+ Private- > >StorageSecurityPpi.ReceiveData =3D AhciStorageSecurityReceiveData= ;+ > Private->StorageSecurityPpi.SendData =3D > AhciStorageSecuritySendData;+ CopyMem (+ &Private- > >StorageSecurityPpiList,+ &mAhciStorageSecurityPpiListTemplate,+ > sizeof (EFI_PEI_PPI_DESCRIPTOR)+ );+ Private- > >StorageSecurityPpiList.Ppi =3D &Private->StorageSecurityPpi;+ > PeiServicesInstallPpi (&Private->StorageSecurityPpiList); } + CopyMem = (+ > &Private->EndOfPeiNotifyList,+ &mAhciEndOfPeiNotifyListTemplate,+ > sizeof (EFI_PEI_NOTIFY_DESCRIPTOR)+ );+ PeiServicesNotifyPpi (&Privat= e- > >EndOfPeiNotifyList);++ return EFI_SUCCESS;+}++/**+ Initialize AHCI > controller from EDKII_ATA_AHCI_HOST_CONTROLLER_PPI instance.++ = > @param[in] AhciHcPpi Pointer to the AHCI Host Controller PPI instance.++ > @retval EFI_SUCCESS PPI successfully > installed.+**/+EFI_STATUS+AtaAhciInitPrivateDataFromHostControllerPpi = > (+ IN EDKII_ATA_AHCI_HOST_CONTROLLER_PPI *AhciHcPpi+ )+{+ UINT8 > Controller;+ UINTN MmioBase;+ UINTN > DevicePathLength;+ EFI_DEVICE_PATH_PROTOCOL *DevicePath;+ > EFI_STATUS Status;+ Controller =3D 0; MmioBase =3D 0= ; while (TRUE) > {@@ -193,65 +373,7 @@ AtaAhciPeimEntry ( > return Status; } - //- // Check validity of the device p= ath of the ATA > AHCI controller.- //- Status =3D AhciIsHcDevicePathValid (DevicePat= h, > DevicePathLength);- if (EFI_ERROR (Status)) {- DEBUG ((- > DEBUG_ERROR,- "%a: The device path is invalid for Controller %d.\n= ",- > __FUNCTION__,- Controller- ));- Controller++;- co= ntinue;- }-- > //- // For S3 resume performance consideration, not all ports on an ATA > AHCI- // controller will be enumerated/initialized. The driver consume= s the- > // content within S3StorageDeviceInitList LockBox to get the ports that- = // > will be enumerated/initialized during S3 resume.- //- if (BootMode = =3D=3D > BOOT_ON_S3_RESUME) {- NumberOfPorts =3D AhciS3GetEumeratePorts > (DevicePath, DevicePathLength, &PortBitMap);- if (NumberOfPorts =3D= =3D 0) > {- //- // No ports need to be enumerated for this controlle= r.- //- > Controller++;- continue;- }- } else {- PortBitMap =3D= MAX_UINT32;- > }-- //- // Memory allocation for controller private data.- /= /- Private =3D > AllocateZeroPool (sizeof (PEI_AHCI_CONTROLLER_PRIVATE_DATA));- if > (Private =3D=3D NULL) {- DEBUG ((- DEBUG_ERROR,- "%a: = Fail to allocate > private data for Controller %d.\n",- __FUNCTION__,- Control= ler- > ));- return EFI_OUT_OF_RESOURCES;- }-- //- // Initi= alize controller > private data.- //- Private->Signature =3D > AHCI_PEI_CONTROLLER_PRIVATE_DATA_SIGNATURE;- Private->MmioBase > =3D MmioBase;- Private->DevicePathLength =3D DevicePathLength;- Pri= vate- > >DevicePath =3D DevicePath;- Private->PortBitMap =3D PortB= itMap;- > InitializeListHead (&Private->DeviceList);-- Status =3D AhciModeInitia= lization > (Private);+ Status =3D AtaAhciInitPrivateData (MmioBase, DevicePath, > DevicePathLength); if (EFI_ERROR (Status)) { DEBUG > (( DEBUG_ERROR,@@ -260,86 +382,229 @@ AtaAhciPeimEntry ( > Controller, Status ));- Controller++;- = continue;- }-- > Private->AtaPassThruMode.Attributes =3D > EFI_ATA_PASS_THRU_ATTRIBUTES_PHYSICAL |- > EFI_ATA_PASS_THRU_ATTRIBUTES_LOGICAL;- Private- > >AtaPassThruMode.IoAlign =3D sizeof (UINTN);- Private- > >AtaPassThruPpi.Revision =3D EDKII_PEI_ATA_PASS_THRU_PPI_REVISION;- > Private->AtaPassThruPpi.Mode =3D &Private->AtaPassThruMode;- > Private->AtaPassThruPpi.PassThru =3D AhciAtaPassThruPassThru;- Pr= ivate- > >AtaPassThruPpi.GetNextPort =3D AhciAtaPassThruGetNextPort;- Private- > >AtaPassThruPpi.GetNextDevice =3D AhciAtaPassThruGetNextDevice;- > Private->AtaPassThruPpi.GetDevicePath =3D AhciAtaPassThruGetDevicePath;- > CopyMem (- &Private->AtaPassThruPpiList,- > &mAhciAtaPassThruPpiListTemplate,- sizeof (EFI_PEI_PPI_DESCRIPTOR)- > );- Private->AtaPassThruPpiList.Ppi =3D &Private->AtaPassThruPpi= ;- > PeiServicesInstallPpi (&Private->AtaPassThruPpiList);-- Private- > >BlkIoPpi.GetNumberOfBlockDevices =3D AhciBlockIoGetDeviceNo;- Private- > >BlkIoPpi.GetBlockDeviceMediaInfo =3D AhciBlockIoGetMediaInfo;- Privat= e- > >BlkIoPpi.ReadBlocks =3D AhciBlockIoReadBlocks;- CopyMem = (- > &Private->BlkIoPpiList,- &mAhciBlkIoPpiListTemplate,- sizeof > (EFI_PEI_PPI_DESCRIPTOR)- );- Private->BlkIoPpiList.Ppi =3D &Priv= ate- > >BlkIoPpi;- PeiServicesInstallPpi (&Private->BlkIoPpiList);-- Priva= te- > >BlkIo2Ppi.Revision =3D > EFI_PEI_RECOVERY_BLOCK_IO2_PPI_REVISION;- Private- > >BlkIo2Ppi.GetNumberOfBlockDevices =3D AhciBlockIoGetDeviceNo2;- > Private->BlkIo2Ppi.GetBlockDeviceMediaInfo =3D AhciBlockIoGetMediaInfo2;- > Private->BlkIo2Ppi.ReadBlocks =3D AhciBlockIoReadBlocks2;- = CopyMem > (- &Private->BlkIo2PpiList,- &mAhciBlkIo2PpiListTemplate,- = sizeof > (EFI_PEI_PPI_DESCRIPTOR)- );- Private->BlkIo2PpiList.Ppi =3D &Pri= vate- > >BlkIo2Ppi;- PeiServicesInstallPpi (&Private->BlkIo2PpiList);-- if = (Private- > >TrustComputingDevices !=3D 0) {+ } else { DEBUG (( DEBU= G_INFO,- > "%a: Security Security Command PPI will be produced for Controller %d.\n"= ,+ > "%a: Controller %d has been successfully initialized.\n", __FUNCT= ION__, > Controller ));- Private->StorageSecurityPpi.Revision = =3D > EDKII_STORAGE_SECURITY_PPI_REVISION;- Private- > >StorageSecurityPpi.GetNumberofDevices =3D > AhciStorageSecurityGetDeviceNo;- Private- > >StorageSecurityPpi.GetDevicePath =3D > AhciStorageSecurityGetDevicePath;- Private- > >StorageSecurityPpi.ReceiveData =3D AhciStorageSecurityReceiveData= ;- > Private->StorageSecurityPpi.SendData =3D AhciStorageSecuritySen= dData;- > CopyMem (- &Private->StorageSecurityPpiList,- > &mAhciStorageSecurityPpiListTemplate,- sizeof > (EFI_PEI_PPI_DESCRIPTOR)- );- Private->StorageSecurityPpiList= .Ppi =3D > &Private->StorageSecurityPpi;- PeiServicesInstallPpi (&Private- > >StorageSecurityPpiList); } - CopyMem (- &Private- > >EndOfPeiNotifyList,- &mAhciEndOfPeiNotifyListTemplate,- sizeof > (EFI_PEI_NOTIFY_DESCRIPTOR)- );- PeiServicesNotifyPpi (&Private- > >EndOfPeiNotifyList);-- DEBUG ((- DEBUG_INFO,- "%a: Controll= er %d > has been successfully initialized.\n",- __FUNCTION__,- Controll= er- )); > Controller++; } return EFI_SUCCESS; }++/**+ Callback for > EDKII_ATA_AHCI_HOST_CONTROLLER_PPI installation.++ @param[in] > PeiServices Pointer to PEI Services Table.+ @param[in] NotifyDes= criptor > Pointer to the descriptor for the Notification+ = event that > caused this function to execute.+ @param[in] Ppi Pointer= to the PPI > data associated with this function.++ @retval EFI_SUCCESS The > function completes successfully+ @retval Others Cannot i= nitialize > AHCI controller for given > device+**/+EFI_STATUS+EFIAPI+AtaAhciHostControllerPpiInstallationCallb > device+ac > k (+ IN EFI_PEI_SERVICES **PeiServices,+ IN > EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor,+ IN VOID *Ppi+ )+{+ = > EDKII_ATA_AHCI_HOST_CONTROLLER_PPI *AhciHcPpi;++ if (Ppi > =3D=3D NULL) {+ return EFI_INVALID_PARAMETER;+ }++ AhciHcPpi =3D > (EDKII_ATA_AHCI_HOST_CONTROLLER_PPI *)Ppi;++ return = > AtaAhciInitPrivateDataFromHostControllerPpi (AhciHcPpi);+}++/**+ = > Initialize AHCI controller from fiven PCI_DEVICE_PPI.++ @param[in] PciDe= vice > Pointer to the PCI Device PPI instance.++ @retval EFI_SUCCESS The > function completes successfully+ @retval Others Cannot initial= ize AHCI > controller for given > device+**/+EFI_STATUS+AtaAhciInitPrivateDataFromPciDevice (+ > EDKII_PCI_DEVICE_PPI *PciDevice+ )+{+ EFI_STATUS Status= ;+ > PCI_TYPE00 PciData;+ UINTN MmioBase;+ > EFI_DEVICE_PATH_PROTOCOL *DevicePath;+ UINTN DevicePathLength;++ = > //+ // Now further check the PCI header: Base Class (offset 0x0B) = > and+ // Sub Class (offset 0x0A). This controller should be an SATA = > controller+ //+ Status =3D PciDevice->PciIo.Pci.Read (+ > &PciDevice->PciIo,+ EfiPciIoWidthUint8,+ > PCI_CLASSCODE_OFFSET,+ sizeof (PciData.H= dr.ClassCode),+ > PciData.Hdr.ClassCode+ );+ if (EFI_ERRO= R (Status)) {+ > return EFI_UNSUPPORTED;+ }++ if (!IS_PCI_IDE (&PciData) > && !IS_PCI_SATADPA (&PciData)) {+ return EFI_UNSUPPORTED;+ }++ > Status =3D PciDevice->PciIo.Attributes (+ &P= ciDevice->PciIo,+ > EfiPciIoAttributeOperationSet,+ EFI_PCI_DEVI= CE_ENABLE,+ > NULL+ );+ if (EFI_ERROR (Status)) {+ ret= urn > EFI_UNSUPPORTED;+ }++ Status =3D PciDevice->PciIo.Pci.Read (+ > &PciDevice->PciIo,+ EfiPciIoWidthUint32,+ > 0x24,+ sizeof (UINTN),+ > &MmioBase+ );+ if (EFI_ERROR (Status)) = {+ return > EFI_UNSUPPORTED;+ }++ DevicePathLength =3D GetDevicePathSize > (PciDevice->DevicePath);+ DevicePath =3D PciDevice->DevicePath;++ > Status =3D AtaAhciInitPrivateData (MmioBase, DevicePath, > DevicePathLength);+ if (EFI_ERROR (Status)) {+ DEBUG ((+ > DEBUG_INFO,+ "%a: Failed to init controller, with Status - %r\n",+ > __FUNCTION__,+ Status+ ));+ }++ return EFI_SUCCESS;+}++/**+ > Callback for EDKII_PCI_DEVICE_PPI installation.++ @param[in] PeiServices > Pointer to PEI Services Table.+ @param[in] NotifyDescriptor Pointer t= o the > descriptor for the Notification+ event th= at caused this > function to execute.+ @param[in] Ppi Pointer to the PPI = data > associated with this function.++ @retval EFI_SUCCESS The func= tion > completes successfully+ @retval Others Cannot initialize= AHCI > controller for given > device+**/+EFI_STATUS+EFIAPI+AtaAhciPciDevicePpiInstallationCallback = > device+(+ > IN EFI_PEI_SERVICES **PeiServices,+ IN EFI_PEI_NOTIFY_DESCRIPT= OR > *NotifyDescriptor,+ IN VOID *Ppi+ )+{+ EDKII_PCI= _DEVICE_PPI > *PciDevice;++ PciDevice =3D (EDKII_PCI_DEVICE_PPI *)Ppi;++ return = > AtaAhciInitPrivateDataFromPciDevice (PciDevice);+}++/**+ Initialize = > AHCI controller from EDKII_ATA_AHCI_HOST_CONTROLLER_PPI instances found in > the system.++ @retval EFI_SUCCESS The function completes > successfully+**/+EFI_STATUS+AtaAhciInitPrivateDataFromPciDevices (+ > VOID+ )+{+ EFI_STATUS Status;+ UINTN Contro= llerIndex;+ > EDKII_PCI_DEVICE_PPI *PciDevice;++ Status =3D EFI_SUCCESS;+ for = > (ControllerIndex =3D 0; Status !=3D EFI_NOT_FOUND; ControllerIndex++) {+ > Status =3D PeiServicesLocatePpi (+ &gEdkiiPeiPciDevicePpiGu= id,+ > ControllerIndex,+ NULL,+ (VOID **)&PciDevice+= );+ if > (EFI_ERROR (Status)) {+ continue;+ }++ > AtaAhciInitPrivateDataFromPciDevice (PciDevice);++ //+ // Override = the > status to continue the for loop+ //+ Status =3D EFI_SUCCESS;+ }++ = return > EFI_SUCCESS;+}++/**+ Entry point of the PEIM.++ @param[in] FileHandle > Handle of the file being invoked.+ @param[in] PeiServices Describes t= he > list of possible PEI Services.++ @retval EFI_SUCCESS PPI successfully > installed.++**/+EFI_STATUS+EFIAPI+AtaAhciPeimEntry (+ IN > EFI_PEI_FILE_HANDLE FileHandle,+ IN CONST EFI_PEI_SERVICES > **PeiServices+ )+{+ EFI_STATUS Status;+ > EDKII_ATA_AHCI_HOST_CONTROLLER_PPI *AhciHcPpi;++ DEBUG ((DEBUG_INFO, = > "%a: Enters.\n", __FUNCTION__));++ PeiServicesNotifyPpi = > (&mAtaAhciHostControllerNotify);++ PeiServicesNotifyPpi = > (&mPciDevicePpiNotify);++ AtaAhciInitPrivateDataFromPciDevices ();++ = > //+ // Locate the ATA AHCI host controller PPI.+ //+ Status =3D > PeiServicesLocatePpi (+ &gEdkiiPeiAtaAhciHostControllerPpiGui= d,+ > 0,+ NULL,+ (VOID **)&AhciHcPpi+ );+ = if (!EFI_ERROR > (Status)) {+ DEBUG ((DEBUG_ERROR, "%a: Using AtaAhciHostControllerPpi > to initialize private data.\n", __FUNCTION__));+ Status =3D > AtaAhciInitPrivateDataFromHostControllerPpi (AhciHcPpi);+ }++ return = > Status;+}diff --git a/MdeModulePkg/Bus/Ata/AhciPei/DevicePath.c > b/MdeModulePkg/Bus/Ata/AhciPei/DevicePath.c > index 81f8743d40d8..cf0955929dde 100644 > --- a/MdeModulePkg/Bus/Ata/AhciPei/DevicePath.c > +++ b/MdeModulePkg/Bus/Ata/AhciPei/DevicePath.c > @@ -38,50 +38,6 @@ EFI_DEVICE_PATH_PROTOCOL = > mAhciEndDevicePathNodeTemplate =3D { > } }; -/**- Returns the 16-bit Length field of a device path = > node.-- Returns the 16-bit Length field of the device path node = > specified by Node.- Node is not required to be aligned on a 16-bit = > boundary, so it is recommended- that a function such as ReadUnaligned16(= ) be used to extract the contents of- > the Length field.-- If Node is NULL, then ASSERT().-- @param Node = A > pointer to a device path node data structure.-- @return The 16-bit = > Length field of the device path node specified by Node.--**/-UINTN- = > DevicePathNodeLength (- IN CONST VOID *Node- )-{- ASSERT (Node !=3D > NULL);- return ReadUnaligned16 ((UINT16 *)&((EFI_DEVICE_PATH_PROTOCOL = > *)(Node))->Length[0]);-}--/**- Returns a pointer to the next node in = > a device path.-- If Node is NULL, then > ASSERT().-- @param Node A pointer to a device path node data structu= re.- > - @return a pointer to the device path node that follows the device = > path > node- specified by Node.--**/-EFI_DEVICE_PATH_PROTOCOL *- = > NextDevicePathNode (- IN CONST VOID *Node- )-{- ASSERT (Node !=3D > NULL);- return (EFI_DEVICE_PATH_PROTOCOL *)((UINT8 *)(Node) + > DevicePathNodeLength (Node));-}- /** Get the size of the current device > path instance. diff --git a/MdeModulePkg/Bus/Ata/AhciPei/AhciPei.h > b/MdeModulePkg/Bus/Ata/AhciPei/AhciPei.h > index 43ad4639bd77..7332c4051a0c 100644 > --- a/MdeModulePkg/Bus/Ata/AhciPei/AhciPei.h > +++ b/MdeModulePkg/Bus/Ata/AhciPei/AhciPei.h > @@ -29,6 +29,7 @@ > #include #include = > #include +#include // = > // Structure forward declarations@@ -631,22 +632,6 @@ TrustTransferAtaDev= ice ( > OUT UINTN *TransferLengthOut ); -/**- Return= s a pointer to > the next node in a device path.-- If Node is NULL, then ASSERT().-- @pa= ram > Node A pointer to a device path node data structure.-- @return a poin= ter > to the device path node that follows the device path node- specified = > by Node.--**/-EFI_DEVICE_PATH_PROTOCOL *-NextDevicePathNode (- IN > CONST VOID *Node- );- /** Get the size of the current device path > instance. diff --git a/MdeModulePkg/Bus/Ata/AhciPei/AhciPei.inf > b/MdeModulePkg/Bus/Ata/AhciPei/AhciPei.inf > index 912ff7a8ba4f..788660b33299 100644 > --- a/MdeModulePkg/Bus/Ata/AhciPei/AhciPei.inf > +++ b/MdeModulePkg/Bus/Ata/AhciPei/AhciPei.inf > @@ -50,11 +50,13 @@ [LibraryClasses] > TimerLib LockBoxLib PeimEntryPoint+ DevicePathLib [Ppis] > gEdkiiPeiAtaAhciHostControllerPpiGuid ## CONSUMES > gEdkiiIoMmuPpiGuid ## CONSUMES > gEfiEndOfPeiSignalPpiGuid ## CONSUMES+ > gEdkiiPeiPciDevicePpiGuid ## CONSUMES > gEdkiiPeiAtaPassThruPpiGuid ## SOMETIMES_PRODUCES > gEfiPeiVirtualBlockIoPpiGuid ## SOMETIMES_PRODUCES > gEfiPeiVirtualBlockIo2PpiGuid ## SOMETIMES_PRODUCES@@ -6= 5,8 > +67,7 @@ [Guids] > [Depex] gEfiPeiMemoryDiscoveredPpiGuid AND- > gEfiPeiMasterBootModePpiGuid AND- > gEdkiiPeiAtaAhciHostControllerPpiGuid+ gEfiPeiMasterBootModePpiGuid > [UserExtensions.TianoCore."ExtraFiles"] AhciPeiExtra.unidiff --git > a/MdeModulePkg/MdeModulePkg.dsc > b/MdeModulePkg/MdeModulePkg.dsc > index 90a0a7ec4a7c..45a8ec84ad69 100644 > --- a/MdeModulePkg/MdeModulePkg.dsc > +++ b/MdeModulePkg/MdeModulePkg.dsc > @@ -117,6 +117,7 @@ [LibraryClasses.common.PEIM] > = > MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemory > AllocationLib.inf > ExtractGuidedSectionLib|MdePkg/Library/PeiExtractGuidedSectionLib/PeiE > ExtractGuidedSectionLib|x > tractGuidedSectionLib.inf > LockBoxLib|MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxPeiLib.inf > + > DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibBase.i > nf [LibraryClasses.common.DXE_CORE] > HobLib|MdePkg/Library/DxeCoreHobLib/DxeCoreHobLib.inf-- > 2.27.0.windows.1 --------------------------------------------------------------------- Intel Technology Poland sp. z o.o. ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydz= ial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-31= 6 | Kapital zakladowy 200.000 PLN. Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata= i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wi= adomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiek= olwiek przegladanie lub rozpowszechnianie jest zabronione. This e-mail and any attachments may contain confidential material for the s= ole use of the intended recipient(s). If you are not the intended recipient= , please contact the sender and delete all copies; any review or distributi= on by others is strictly prohibited.