From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.31; helo=mga06.intel.com; envelope-from=star.zeng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 5B638222275AA for ; Mon, 8 Jan 2018 01:42:44 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Jan 2018 01:47:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,330,1511856000"; d="scan'208";a="191296435" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga005.jf.intel.com with ESMTP; 08 Jan 2018 01:47:53 -0800 Received: from fmsmsx111.amr.corp.intel.com (10.18.116.5) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 8 Jan 2018 01:47:53 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx111.amr.corp.intel.com (10.18.116.5) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 8 Jan 2018 01:47:52 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.189]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.213]) with mapi id 14.03.0319.002; Mon, 8 Jan 2018 17:47:51 +0800 From: "Zeng, Star" To: Meenakshi Aggarwal , "ard.biesheuvel@linaro.org" , "leif.lindholm@linaro.org" , "edk2-devel@lists.01.org" , "Dong, Eric" CC: "Ni, Ruiyu" , "Zeng, Star" Thread-Topic: [edk2] [RFC] SATA : Implemented NXP errata A008402 Thread-Index: AQHTiEGa49/stOPWz0uqNyuQLcNP3KNpd/mA//98BQCAAAiNgIAAvVDQ Date: Mon, 8 Jan 2018 09:47:50 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB0483103B9F90C3@shsmsx102.ccr.corp.intel.com> References: <1515410208-14559-1-git-send-email-meenakshi.aggarwal@nxp.com> <1515410208-14559-2-git-send-email-meenakshi.aggarwal@nxp.com> <0C09AFA07DD0434D9E2A0C6AEB0483103B9F8EE6@shsmsx102.ccr.corp.intel.com> In-Reply-To: Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [RFC] SATA : Implemented NXP errata A008402 X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jan 2018 09:42:44 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable So this PCD needs to be defined as 0x3FFFFF or may be 0x400000, then it nee= ds to be configured to 0 for your case, right? Could the PCD be configured to other values? According to the statement you provided, is it possible to handle the case = in the device firmware? " Due to a logic error, 3F_FFFFh is misinterpreted by the device as zero le= ngth." Thanks, Star -----Original Message----- From: Meenakshi Aggarwal [mailto:meenakshi.aggarwal@nxp.com]=20 Sent: Monday, January 8, 2018 2:26 PM To: Zeng, Star ; ard.biesheuvel@linaro.org; leif.lindh= olm@linaro.org; edk2-devel@lists.01.org; Dong, Eric Cc: Ni, Ruiyu Subject: RE: [edk2] [RFC] SATA : Implemented NXP errata A008402 Hi Star, Apologies and some correction in my last reply. As per the errata, PRDT Maximum value needs to be set to 0 only when creat= ing a PRD entry for a maximum data transfer size. So there is no need to replace all occurrences of EFI_AHCI_MAX_DATA_PER_PRD= T in file. Just need to change it where we are setting the Data length. I define it to 0x3FFFFF, as this is the actual value we are setting and thi= s PCD need to be used only once. I know, its NXP specific patch only, and i try to made changes which will n= ot impact any other package. Thanks, Meenakshi > -----Original Message----- > From: Meenakshi Aggarwal > Sent: Monday, January 08, 2018 11:25 AM > To: 'Zeng, Star' ; ard.biesheuvel@linaro.org;=20 > leif.lindholm@linaro.org; edk2-devel@lists.01.org; Dong, Eric=20 > > Cc: Ni, Ruiyu > Subject: RE: [edk2] [RFC] SATA : Implemented NXP errata A008402 >=20 > Hi, >=20 > I didn't prepare the full patch but will send in next few minutes, >=20 > i made the very basic changes required to test Errata implementation. >=20 > I will redefine it to 0x400000. > PcdPrdtMaxDataLength was defined to 0x3FFFFF just for testing purpose. >=20 > Thanks, > Meenakshi >=20 > > -----Original Message----- > > From: Zeng, Star [mailto:star.zeng@intel.com] > > Sent: Monday, January 08, 2018 11:19 AM > > To: Meenakshi Aggarwal ;=20 > > ard.biesheuvel@linaro.org; leif.lindholm@linaro.org; edk2-=20 > > devel@lists.01.org; Dong, Eric > > Cc: Ni, Ruiyu ; Zeng, Star > > Subject: RE: [edk2] [RFC] SATA : Implemented NXP errata A008402 > > > > Do you have a full patch already? > > Why the PcdPrdtMaxDataLength is defined to 0x3FFFFF, but not 0x400000? > > > > > > Thanks, > > Star > > -----Original Message----- > > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf=20 > > Of Meenakshi Aggarwal > > Sent: Monday, January 8, 2018 7:17 PM > > To: ard.biesheuvel@linaro.org; leif.lindholm@linaro.org; edk2-=20 > > devel@lists.01.org; Zeng, Star ; Dong, Eric=20 > > > > Subject: [edk2] [RFC] SATA : Implemented NXP errata A008402 > > > > Description: > > Commands with 4 MB PRD length entries fail if PRD[DBC] is set to the=20 > > value according to AHCI standard spec. > > Due to a logic error, 3F_FFFFh is misinterpreted by the device as=20 > > zero length. > > > > Workaround: > > Set PRD length to 0 when creating a PRD entry for a maximum data=20 > > transfer size of 4 MB to fix the erratum. > > > > Contributed-under: TianoCore Contribution Agreement 1.1 > > Signed-off-by: Meenakshi Aggarwal > > --- > > MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c | 2 +- > > MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf | 1 + > > MdeModulePkg/MdeModulePkg.dec | 3 +++ > > 3 files changed, 5 insertions(+), 1 deletion(-) > > > > diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c > > b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c > > index e6de5d6..fb6dc0b 100644 > > --- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c > > +++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c > > @@ -591,7 +591,7 @@ AhciBuildCommand ( > > if (RemainedData < EFI_AHCI_MAX_DATA_PER_PRDT) { > > AhciRegisters->AhciCommandTable-=20 > >PrdtTable[PrdtIndex].AhciPrdtDbc =3D (UINT32)RemainedData - 1; > > } else { > > - AhciRegisters->AhciCommandTable- > >PrdtTable[PrdtIndex].AhciPrdtDbc > > =3D EFI_AHCI_MAX_DATA_PER_PRDT - 1; > > + AhciRegisters->AhciCommandTable- > >PrdtTable[PrdtIndex].AhciPrdtDbc > > =3D PcdGet32 (PcdPrdtMaxDataLength); > > } > > > > Data64.Uint64 =3D (UINT64)MemAddr; diff --git > a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf > > b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf > > index 82d5f7a..8921dd5 100644 > > --- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf > > +++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf > > @@ -70,6 +70,7 @@ > > > > [Pcd] > > gEfiMdeModulePkgTokenSpaceGuid.PcdAtaSmartEnable ## > > SOMETIMES_CONSUMES > > + gEfiMdeModulePkgTokenSpaceGuid.PcdPrdtMaxDataLength > > > > # [Event] > > # EVENT_TYPE_PERIODIC_TIMER ## SOMETIMES_CONSUMES diff --git=20 > > a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec=20 > > index 8efad57..b2f9f2b 100644 > > --- a/MdeModulePkg/MdeModulePkg.dec > > +++ b/MdeModulePkg/MdeModulePkg.dec > > @@ -1434,6 +1434,9 @@ > > # @Prompt Console Output Row of Text Setup > > > > > gEfiMdeModulePkgTokenSpaceGuid.PcdSetupConOutRow|25|UINT32|0x40 > > 00000e > > > > + ## This PCD specifies the Maximum data length for a PRD Entry > > + > > > gEfiMdeModulePkgTokenSpaceGuid.PcdPrdtMaxDataLength|0x3FFFFF|UIN > > T32|0x4000000f > > + > > [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, > PcdsDynamicEx] > > ## UART clock frequency is for the baud rate configuration. > > # @Prompt Serial Port Clock Rate. > > -- > > 1.9.1 > > > > _______________________________________________ > > edk2-devel mailing list > > edk2-devel@lists.01.org > > > https://emea01.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Flis > t > > s.01.org%2Fmailman%2Flistinfo%2Fedk2- > > > devel&data=3D02%7C01%7Cmeenakshi.aggarwal%40nxp.com%7C9b1e2bde5b > > > 4b47746d0e08d5565b8394%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C > > > 0%7C636509873433437533&sdata=3Dwg3Sg5SiU2MrbZSkZMlboldcXnMBKKg3jG > > yA45YZo1Q%3D&reserved=3D0