From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web10.1614.1659406839482260551 for ; Mon, 01 Aug 2022 19:20:39 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=IhB1T+Rm; spf=pass (domain: intel.com, ip: 192.55.52.93, mailfrom: hao.a.wu@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1659406839; x=1690942839; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=naRPd/IOQWp88AofLxhLOFAyR1+72a49gIBYNRyPpOY=; b=IhB1T+RmNr6fc5YFJfiN+OUa3zH+2cGv2nAIjuIRX8zWNuRFuWb3F/A6 CjIdG6IfG+K0JNXc56EdXpX6Kb0NmIG2di7yKeu7x1DAQYPVTfWWbpU3K MRtoOvATebEPzkkFPzXVCQRITyfYK5uCq6Wcj2t0kFGnPCCxmzJkk0NGn gJa4MWza5jfx/ofrz0oo8sTq6mFjw5xX/SBHPsI5A3pEaIFUKa5ebeRyf Xn4t4BaYw9PMSIyjeiPbhzRAuBVOGjiq0kvfRNMjIoTGNWSNtI7Ryiz9G d8wLQgzs/JTK9E636mNs1URIx2wL6BlUiEXh4/uC1zBrz9tmxrRWoGvLO g==; X-IronPort-AV: E=McAfee;i="6400,9594,10426"; a="286861337" X-IronPort-AV: E=Sophos;i="5.93,209,1654585200"; d="scan'208";a="286861337" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Aug 2022 19:20:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,209,1654585200"; d="scan'208";a="744499398" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga001.fm.intel.com with ESMTP; 01 Aug 2022 19:20:38 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx601.amr.corp.intel.com (10.18.126.81) 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 19:20:38 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx608.amr.corp.intel.com (10.18.126.88) 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 19:20:38 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.109) by edgegateway.intel.com (192.55.55.70) 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 19:20:37 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BI7XaOvbGau9gidSdZsVbwcAIGxzqy64Z75FYLRp9wteKf7r3rpqEtNHLvGNxIuKfZsj/zTulkdl9CqEP6atKr3iYbCGRHVEStJ3NkdBY3mj8lJbJLxi0Tfv0sIp9FuIr9MkiOFAk9lzmF1nSzd64ZL0PwFcUev264A2wBSJu/cI1cj7MO1SArzHRs9Fc5MM2VtRFRSkyrE9Nht6duZpTyNYKyM+tLFF4BNYZIVCiPpDD1kjfz+yxKVEwPbJAqMjFDO10DM0J+JbvWpM3bzb179bmVjeKrEJ3aMJO97Y0KHRu1Ok4P4IBCbqu6Qk26nxKRDh38sDXpsEAWtrncH5ag== 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=m67NA00gDNFFvwgm78cU1UaDNm36QjqijjaxC4mW344=; b=S+9KUokSYURI6jPk3HKYlZrARLAH8elqn8t8OaJhScDljr8bMDUYuBxByKccfTkg9xK90SCLU81OWXMj71p1TntZG5BzpnVZBHdw8rlLdODHVlO9u/1EALSO1MlZJcrLXhU5QsQlgOp9/oWuET6V2hH/QsVNJnDTXCUTz8WdWccThdWeNDNDSByn8Saj7IeuVzJrdAiLXys1W1o2khtMFr2/aKtVwotzsjdiOBbnAowj/ZAbyCui8v+r2fgnPO47MBss1cxotSTmlyyLpLGEP0DVNSEopyDaNOquvSG2o5aVDljd+NkY8P7SVGZpj2hLOZzwQUkkt6057QByIrMZtw== 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 DM6PR11MB4025.namprd11.prod.outlook.com (2603:10b6:5:197::31) by BYAPR11MB3224.namprd11.prod.outlook.com (2603:10b6:a03:77::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5482.11; Tue, 2 Aug 2022 02:20:32 +0000 Received: from DM6PR11MB4025.namprd11.prod.outlook.com ([fe80::e9b3:7cad:874e:77f]) by DM6PR11MB4025.namprd11.prod.outlook.com ([fe80::e9b3:7cad:874e:77f%7]) with mapi id 15.20.5482.016; Tue, 2 Aug 2022 02:20:32 +0000 From: "Wu, Hao A" To: "Czajkowski, Maciej" , "devel@edk2.groups.io" CC: "Ni, Ray" , "Gao, Liming" Subject: Re: [PATCH v3 2/2] MdeModulePkg/AhciPei: Use PCI_DEVICE_PPI to manage AHCI device Thread-Topic: [PATCH v3 2/2] MdeModulePkg/AhciPei: Use PCI_DEVICE_PPI to manage AHCI device Thread-Index: AQHYpchC/Nl7pb+QTEOPfnc6BJJCiq2a2Wlg Date: Tue, 2 Aug 2022 02:20:32 +0000 Message-ID: References: <20220801170009.2113-1-maciej.czajkowski@intel.com> <20220801170009.2113-3-maciej.czajkowski@intel.com> In-Reply-To: <20220801170009.2113-3-maciej.czajkowski@intel.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 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: fce0f1e6-f0ca-420d-72cc-08da742d9391 x-ms-traffictypediagnostic: BYAPR11MB3224: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: fYEE6u87D6F5vCx5/7RGQoHWJiLi5AQL53soFWYPQQPG00UW4pSms/lvmRAQqbbEwf5h2xQA2mxvw/EmnH5CvnmNp0A7/43vU5CWRpZaok+kSt/fwHw+9nJJO/rpWZqadfv0WG1CTlGAoRnqJr6n95IIKs+Q5wmuRw+aX6RkOmdBpQ6ngu+vuKoOnjcw8geix2RRITF016AJAF2Z8tBiEMv9agv1hjv8IZrqJBAhbeHolh9pORUmiimH7Bb7/SWp1KyZ8B1mtfImjONmaMTe/XRE/AkbGlbyYR8K0LocTIPu64gBW8Dn+6THeYtbKZxhrYaQSPrgdusnGUgC4uNzSbQJBbu2muP6Kyoke0J64lI7uLrZhlgnIj/2CIfC9Vt2DJkBqyYHqNhgpUC8ng2hL7qu/FmTLI6PV2OyPSDpggHE0sqib0J8/vHyzf+nLgJoq77Je5iW3M759e3LJZjhJDf3RQ4JmkTkR17DYIRMnqx+H6dpfTStBQ012Y0wjWa39oUgXU2RsI/U7hq5WTb6BKAv9I2IZz447vM+/p+WuvgzckWRqNHIPLPNFux2Rgqxb2qUGowZe6ah64Qxrm0uX3sykmLamE5E6wlLVuoQfJuJAGTy8LONRKS5srRn4IcB/3kGKuNMOlDb9155WwVgKjXQERXQWtMkqEuLAQw3YupOhFkf1+BLT8/2HtDBpr89O0/bGwP7W7IGS53rDRPATXaUZ/uTNF0gBNAw5cABq9uXz7QZoK7SpWS1RX0Ke0MfdTrzZBUc+HSK8Pakfutdn7VBPhN1t+9iXDHzXq6qQPPvi2XcSg7ZAxa4XKnqYwYrX6Mtr0moSywFvRtWZ1ZHwQ== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR11MB4025.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(39860400002)(136003)(366004)(376002)(346002)(396003)(41300700001)(6506007)(7696005)(53546011)(9686003)(26005)(316002)(19627235002)(55016003)(110136005)(54906003)(478600001)(86362001)(966005)(71200400001)(82960400001)(38070700005)(122000001)(38100700002)(83380400001)(186003)(4326008)(30864003)(33656002)(2906002)(66946007)(76116006)(66556008)(8676002)(66446008)(52536014)(66476007)(64756008)(8936002)(5660300002)(579004)(559001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?VFYI3lZrZPxjwOhpzt4pU2NobfXCJemynE73gxxAT/k2GoYflv5G8QFxRKjP?= =?us-ascii?Q?F0/7v1r/HS92gcww2P0EmlYKIZEtFmwWkgLEHc1FhtggCdE7KsG9vpG5yZoI?= =?us-ascii?Q?oVEUvk6oqKX1xHmOX6QlBIuMJD6imTjEzsT4cY1s3aiIN0Zpa+HgSvg2IIxN?= =?us-ascii?Q?oWxoEsjZCclVnWJwJjJxfod57xP6qtTixAdWtcgZuVEztWaBxN4oDoAR7+oz?= =?us-ascii?Q?czGJI09XIKGBtiKG29VIPGuqrsk5nbsx0xb05rmu+7x4oAm3xDig0wshwSIr?= =?us-ascii?Q?tI6nZw2ftj3O35g6szCROrE+Ni2DChFmaXmI3CyksxDQZxj8ih07DytQEOJb?= =?us-ascii?Q?TUPpRvCo/x0Fr+es58V0tdOwSLFaDstphAXijpKQS35EIupG72Iv2RF+FBqR?= =?us-ascii?Q?/pOZ8HIRj6Hl4z/2q1amq0QoXYy/7d4nw1ErELTawnsBAHeBH9jucerJjGIy?= =?us-ascii?Q?p44b5tmLFR4k1CFogRumF9Wbffp6hglcbeHcjq5YvNFH51ykOfdUJAgKzfZh?= =?us-ascii?Q?Znu9Pcu0JT3jtRQMMkn2F6WXZkZYQ01LynJRDZghxerv1FcYSMUZ8RInK94K?= =?us-ascii?Q?leMhuQjeQyAqXr38blM2Z2LavpUuhvSBuX62/lFTBYXw7gtRDkMyq2yOAf1Q?= =?us-ascii?Q?4TTqn7GBUkOtu2irVBi2AkUXoV9NCixiN175sw8UJoNDSuAvKl3lvMKENLwK?= =?us-ascii?Q?zD6wbvorruC/lQg4PO9EbKHuy5fkVe8aWANnHte4JFeJNY+0+/bVwN6HzXrx?= =?us-ascii?Q?sGzM0wBqosQtRe7cUA7Hi3LPFreKn59SzcH7X1w9LuuaqDZa/33C4Mt5/cV4?= =?us-ascii?Q?YcI0i6PqQ9t7czDXFxI+Vv+51PfNA/dLNVIAu4DNa8Y5eMB6B5xBgUd2cRtT?= =?us-ascii?Q?50WHtwtHhqSngbjnHqpjmoV1ScrWiV/grNxwCl3JkUzBgFkuoi2n0GDu43JW?= =?us-ascii?Q?/SZ5L53prcG+2enj9m6GzCedav1JzZSJo2xN04wCg/MMHfUENket6asmcOF9?= =?us-ascii?Q?vhhcYfxy//JnQG3BRz5d7QvrSSAYFXgk7RAbYlEQ4NW/kbGp6EcWux1Z+DkR?= =?us-ascii?Q?WCCsxC3qdWHth5tn43RUT63EkQyBv/KXR86l+exVxX7h8XKBMRSGIBZ063+h?= =?us-ascii?Q?xwe6sGUwkpeLbsExYxqD7/VIf1WEMttWCzyp+3BjkgEBOYmJuv1kzRVPpjbg?= =?us-ascii?Q?iS0vwWxgBllNUcvzjuLjyEVlgkPJiq2LGZXI5ws0NDPNn2Hrf9R7rpU5/1de?= =?us-ascii?Q?Cfn+ubLE28rYfGmYG7rDw28LBPkIP+b9wbbnY6LUkpi17LauyKarbIVuQOEm?= =?us-ascii?Q?wgXhNNUIqBFYlv+vZGSW06fSnqnltg5D1UoT4x2PSwRyzmkY+OYcX8kIR2Fc?= =?us-ascii?Q?NWn4AOLVNVol+hpqqQ21Vx26VWVkXdP+TCr6gUvnFq4tuAqS4MHthmC7nNyK?= =?us-ascii?Q?NvGSlu+RGaT8ImVrc22tAwCBVjVb80LJq5JafEG+vBSQPf2VLe/xsEN2mdLQ?= =?us-ascii?Q?Hsx56nPlit2oj015jp4+uQReAKHbcfjNVw1bywS2KbrVeGT5qFHgBmU4ib+h?= =?us-ascii?Q?yXpFyLP6e+OKNVu/T4mPMG6NFl3pRAd+tCTuZhB/?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB4025.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: fce0f1e6-f0ca-420d-72cc-08da742d9391 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Aug 2022 02:20:32.4010 (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: 0FKc1l3JoywIM0b4XGRY2C1cfunXE78cmvNEeX3OnKnelijOXbKxSWreFdUOvTqV64FYhB+oTpCzVDLsL47r7g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3224 Return-Path: hao.a.wu@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Hao A Wu Best Regards, Hao Wu > -----Original Message----- > From: Czajkowski, Maciej > Sent: Tuesday, August 2, 2022 1:00 AM > To: devel@edk2.groups.io > Cc: Wu, Hao A ; Ni, Ray ; Gao, > Liming > Subject: [PATCH v3 2/2] MdeModulePkg/AhciPei: Use PCI_DEVICE_PPI to > manage AHCI device >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3907 >=20 > 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. >=20 > Cc: Hao A Wu > Cc: Ray Ni > Cc: Liming Gao > Signed-off-by: Maciej Czajkowski > --- >=20 > 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 >=20 > v3 changes: > - removed redundant locate PPI calls (if already installed, NotifyPpi > executes callback) > - aligned enabling HC device from PCI_DEVICE_PPI with flow from > AtaAtapiPassThru DXE driver > - corrected function descriptions >=20 > MdeModulePkg/Bus/Ata/AhciPei/AhciPei.c | 505 +++++++++++++------- > MdeModulePkg/Bus/Ata/AhciPei/DevicePath.c | 44 -- > MdeModulePkg/Bus/Ata/AhciPei/AhciPei.h | 57 ++- > MdeModulePkg/Bus/Ata/AhciPei/AhciPei.inf | 5 +- > MdeModulePkg/MdeModulePkg.dsc | 1 + > 5 files changed, 390 insertions(+), 222 deletions(-) >=20 > diff --git a/MdeModulePkg/Bus/Ata/AhciPei/AhciPei.c > b/MdeModulePkg/Bus/Ata/AhciPei/AhciPei.c > index 208b7e9a3606..98dd732a4023 100644 > --- a/MdeModulePkg/Bus/Ata/AhciPei/AhciPei.c > +++ b/MdeModulePkg/Bus/Ata/AhciPei/AhciPei.c > @@ -9,6 +9,9 @@ > **/ #include "AhciPei.h"+#include +#include > +#include > EFI_PEI_PPI_DESCRIPTOR mAhciAtaPassThruPpiListTemplate =3D > { (EFI_PEI_PPI_DESCRIPTOR_PPI | > EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),@@ -40,6 +43,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_DESCRIPT > 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 +126,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 oth= ers > Failed to initialize AHCI controller **/ EFI_STATUS-EFIAPI-AtaAhciPeimEnt= ry > (- 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 +161,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 (BootMode =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;+ 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,+ sizeo= f > (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 +335,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 AT= A > 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 +344,187 @@ 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 from given > EDKII_ATA_AHCI_HOST_CONTROLLER_PPI++**/+EFI_STATUS+EFIAPI+AtaA > hciHostControllerPpiInstallationCallback (+ IN EFI_PEI_SERVICES > **PeiServices,+ IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor,+ IN > VOID *Ppi+ )+{+ EDKII_ATA_AHCI_HOST_CONTROLLER_PP= I > *AhciHcPpi;++ if (Ppi =3D=3D NULL) {+ return EFI_INVALID_PARAMETER;+ = }++ > AhciHcPpi =3D (EDKII_ATA_AHCI_HOST_CONTROLLER_PPI *)Ppi;++ return > AtaAhciInitPrivateDataFromHostControllerPpi (AhciHcPpi);+}++/**+ Initial= ize > AHCI controller from fiven PCI_DEVICE_PPI.++ @param[in] PciDevice > 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;+ UINT64 EnabledPciAttributes;++ //= + // 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_OFFSE= T,+ > sizeof (PciData.Hdr.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,+ > EfiPciIoAttributeOperationSupported,+ 0,+ > &EnabledPciAttributes+ );+ if (EFI_ERROR (S= tatus)) {+ return > EFI_UNSUPPORTED;+ } else {+ EnabledPciAttributes &=3D > (UINT64)EFI_PCI_DEVICE_ENABLE;+ Status =3D PciDevice- > >PciIo.Attributes (+ &PciDe= vice->PciIo,+ > EfiPciIoAttributeOperationEnable,+ > EnabledPciAttributes,+ > NULL+ );+ if (EFI_ERROR = (Status)) {+ return > 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 from given > PCI_DEVICE_PPI++**/+EFI_STATUS+EFIAPI+AtaAhciPciDevicePpiInstallation > Callback (+ IN EFI_PEI_SERVICES **PeiServices,+ IN > EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor,+ IN VOID > *Ppi+ )+{+ EDKII_PCI_DEVICE_PPI *PciDevice;++ PciDevice =3D > (EDKII_PCI_DEVICE_PPI *)Ppi;++ return > AtaAhciInitPrivateDataFromPciDevice (PciDevice);+}++/**+ Entry point of > the PEIM.++ @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.++**/+EFI_STATUS+EFIAPI+AtaAhciPeimEntry (+ IN > EFI_PEI_FILE_HANDLE FileHandle,+ IN CONST EFI_PEI_SERVICES > **PeiServices+ )+{+ DEBUG ((DEBUG_INFO, "%a: Enters.\n", > __FUNCTION__));++ PeiServicesNotifyPpi > (&mAtaAhciHostControllerNotify);++ PeiServicesNotifyPpi > (&mPciDevicePpiNotify);++ return EFI_SUCCESS;+}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- t= hat > 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 Lengt= h > 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..4aed1cb7ad8a 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@@ -354,6 +355,46 @@ extern UINT32 > mMaxTransferBlockNumber[2]; > // Internal functions // +/**+ 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 from given > EDKII_ATA_AHCI_HOST_CONTROLLER_PPI++**/+EFI_STATUS+EFIAPI+AtaA > hciHostControllerPpiInstallationCallback (+ 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 T= able.+ > @param[in] NotifyDescriptor Pointer to the descriptor for the Notifica= tion+ > 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 Cann= ot > initialize AHCI controller from given > PCI_DEVICE_PPI++**/+EFI_STATUS+EFIAPI+AtaAhciPciDevicePpiInstallation > Callback (+ IN EFI_PEI_SERVICES **PeiServices,+ IN > EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor,+ IN VOID > *Ppi+ );+ /** Allocates pages that are suitable for an > OperationBusMasterCommonBuffer or > OperationBusMasterCommonBuffer64 mapping.@@ -631,22 +672,6 @@ > TrustTransferAtaDevice ( > 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] >=20 > MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemory > AllocationLib.inf > ExtractGuidedSectionLib|MdePkg/Library/PeiExtractGuidedSectionLib/PeiEx > 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