From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=104.47.1.61; helo=eur01-ve1-obe.outbound.protection.outlook.com; envelope-from=meenakshi.aggarwal@nxp.com; receiver=edk2-devel@lists.01.org Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0061.outbound.protection.outlook.com [104.47.1.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id CEF4C2094561A for ; Mon, 8 Jan 2018 02:44:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=KcboxhcdDuPQ2O5FUO2LjdxFRMESiFacOGyI++sZQeY=; b=C3xVwVWggM24HhN4U8tqKvxJ9c0l19Ouvt4PXU8KMaMeQcw6XPYbEITLSh5ldSETmF1XzqvyuVruzwKYkgqiGZie3OSwekJowe2Rakni3S7qX+NRLQJT4ET8NvwnQX4N4r0o2qAfXN5731pxbQ2p2+vrd7vURp0QMan2CgMkJYE= Received: from DB5PR04MB0998.eurprd04.prod.outlook.com (10.161.199.12) by DB5PR04MB0999.eurprd04.prod.outlook.com (10.161.199.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.366.8; Mon, 8 Jan 2018 10:50:03 +0000 Received: from DB5PR04MB0998.eurprd04.prod.outlook.com ([fe80::8554:8835:334d:27b7]) by DB5PR04MB0998.eurprd04.prod.outlook.com ([fe80::8554:8835:334d:27b7%13]) with mapi id 15.20.0386.008; Mon, 8 Jan 2018 10:50:03 +0000 From: Meenakshi Aggarwal To: "Zeng, Star" , "ard.biesheuvel@linaro.org" , "leif.lindholm@linaro.org" , "edk2-devel@lists.01.org" , "Dong, Eric" CC: "Ni, Ruiyu" Thread-Topic: [edk2] [RFC] SATA : Implemented NXP errata A008402 Thread-Index: AQHTiEGW1LNus4t+bU21whIVuvRhB6NpeDeAgAAAQPCAAAg28IAAOk0AgAAAQbCAAAnrAIAAAFiw Date: Mon, 8 Jan 2018 10:50:03 +0000 Message-ID: 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> <0C09AFA07DD0434D9E2A0C6AEB0483103B9F90C3@shsmsx102.ccr.corp.intel.com> <0C09AFA07DD0434D9E2A0C6AEB0483103B9F911F@shsmsx102.ccr.corp.intel.com> In-Reply-To: <0C09AFA07DD0434D9E2A0C6AEB0483103B9F911F@shsmsx102.ccr.corp.intel.com> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=meenakshi.aggarwal@nxp.com; x-originating-ip: [192.88.169.1] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB5PR04MB0999; 7:MHZ+5Wote2K8NfnaggHXIQeX8UqpBrzjpAnkwRmNhpPoLB3V5UP7LIJuZhgH52bK/WJyFc0ct62P2oJDuU/I0l4c5+WmBRTuaR4xuq/wq2EVG/s47LD9dSltKWt+OYH+Pa95qWHjpwt0RllBiSdLvZcOv/BhfBsDSTup+ARBdvfXPsvyE5+KY3mX/w+Rtyt/uQCDhuebwwCJmGtSiRdIAGnrSDJQcmZjucylEZ4u5sygiOK2CjnxLQ5gCUMz1ZNv x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: 81db07e0-d16c-49ba-7985-08d5568592c6 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(3008032)(48565401081)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603307)(7153060)(7193020); SRVR:DB5PR04MB0999; x-ms-traffictypediagnostic: DB5PR04MB0999: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(189930954265078)(185117386973197)(788757137089)(162533806227266)(45079756050767)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(3231023)(944501075)(10201501046)(6055026)(6041268)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(6072148)(201708071742011); SRVR:DB5PR04MB0999; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:DB5PR04MB0999; x-forefront-prvs: 054642504A x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(39380400002)(346002)(39860400002)(396003)(376002)(189003)(199004)(13464003)(50944005)(81156014)(81166006)(8676002)(110136005)(86362001)(2201001)(229853002)(76176011)(8936002)(6436002)(9686003)(59450400001)(6306002)(68736007)(55016002)(6116002)(7696005)(53936002)(575784001)(2906002)(3846002)(93886005)(33656002)(6506007)(53546011)(102836004)(316002)(105586002)(3280700002)(7736002)(14454004)(97736004)(99286004)(74316002)(305945005)(2950100002)(6246003)(4326008)(106356001)(5250100002)(2900100001)(478600001)(66066001)(25786009)(2501003)(3660700001)(5660300001)(966005)(45080400002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB5PR04MB0999; H:DB5PR04MB0998.eurprd04.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:3; A:1; LANG:en; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: rgzhe8dvR37x3igOzScY4UWFwaqENZl/wMp2W+PUUudp66gyfOB4PvfoffJBt1g8keR5sr5MFXoxwnQOQdvGNw== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 81db07e0-d16c-49ba-7985-08d5568592c6 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jan 2018 10:50:03.4819 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR04MB0999 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 10:44:59 -0000 Content-Language: en-US Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Hi, We will set PCD value to 0 to support our board and its default value is se= t to maximum data length. If someone change its value to any other value in their package, then he/sh= e must be aware of the consequences. I cannot say how controller will react if value is other than 0x3f_ffff and= 0 (in our case). Thanks, Meenakshi > -----Original Message----- > From: Zeng, Star [mailto:star.zeng@intel.com] > Sent: Monday, January 08, 2018 3:54 PM > To: Meenakshi Aggarwal ; > ard.biesheuvel@linaro.org; leif.lindholm@linaro.org; edk2- > devel@lists.01.org; Dong, Eric > Cc: Ni, Ruiyu ; Zeng, Star > Subject: RE: [edk2] [RFC] SATA : Implemented NXP errata A008402 >=20 > How will the code work based on your patch if the this PCD is configured = to > other value, for example 0x200000/0x300000? >=20 >=20 > Thanks, > Star > -----Original Message----- > From: Meenakshi Aggarwal [mailto:meenakshi.aggarwal@nxp.com] > Sent: Monday, January 8, 2018 5:54 PM > To: Zeng, Star ; ard.biesheuvel@linaro.org; > leif.lindholm@linaro.org; edk2-devel@lists.01.org; Dong, Eric > > Cc: Ni, Ruiyu > Subject: RE: [edk2] [RFC] SATA : Implemented NXP errata A008402 >=20 >=20 > > -----Original Message----- > > From: Zeng, Star [mailto:star.zeng@intel.com] > > Sent: Monday, January 08, 2018 3:18 PM > > To: Meenakshi Aggarwal ; > > ard.biesheuvel@linaro.org; leif.lindholm@linaro.org; edk2- > > devel@lists.01.org; Dong, Eric > > Cc: Ni, Ruiyu ; Zeng, Star > > Subject: RE: [edk2] [RFC] SATA : Implemented NXP errata A008402 > > > > So this PCD needs to be defined as 0x3FFFFF or may be 0x400000, then > > it needs to be configured to 0 for your case, right? > > Could the PCD be configured to other values? > No, in my case i need to set it to 0 only. No other value is needed. > > > > 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 length." > > > No, it can't be handle in device firmware for existing SATA controller. > There are chances that in future releases of SATA controller it will get = fixed in > RTL, but this change will still be needed for LS2088 board. >=20 >=20 > > > > Thanks, > > Star > > -----Original Message----- > > From: Meenakshi Aggarwal [mailto:meenakshi.aggarwal@nxp.com] > > Sent: Monday, January 8, 2018 2:26 PM > > To: Zeng, Star ; ard.biesheuvel@linaro.org; > > leif.lindholm@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 > > creating a PRD entry for a maximum data transfer size. > > > > So there is no need to replace all occurrences of > > EFI_AHCI_MAX_DATA_PER_PRDT 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 this PCD need to be used only once. > > > > I know, its NXP specific patch only, and i try to made changes which > > will not 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; > > > leif.lindholm@linaro.org; edk2-devel@lists.01.org; Dong, Eric > > > > > > Cc: Ni, Ruiyu > > > Subject: RE: [edk2] [RFC] SATA : Implemented NXP errata A008402 > > > > > > Hi, > > > > > > I didn't prepare the full patch but will send in next few minutes, > > > > > > i made the very basic changes required to test Errata implementation= . > > > > > > I will redefine it to 0x400000. > > > PcdPrdtMaxDataLength was defined to 0x3FFFFF just for testing purpose= . > > > > > > Thanks, > > > Meenakshi > > > > > > > -----Original Message----- > > > > From: Zeng, Star [mailto:star.zeng@intel.com] > > > > Sent: Monday, January 08, 2018 11:19 AM > > > > To: Meenakshi Aggarwal ; > > > > ard.biesheuvel@linaro.org; leif.lindholm@linaro.org; edk2- > > > > 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 Of Meenakshi Aggarwal > > > > Sent: Monday, January 8, 2018 7:17 PM > > > > To: ard.biesheuvel@linaro.org; leif.lindholm@linaro.org; edk2- > > > > devel@lists.01.org; Zeng, Star ; Dong, Eric > > > > > > > > Subject: [edk2] [RFC] SATA : Implemented NXP errata A008402 > > > > > > > > Description: > > > > Commands with 4 MB PRD length entries fail if PRD[DBC] is set to > > > > the value according to AHCI standard spec. > > > > Due to a logic error, 3F_FFFFh is misinterpreted by the device as > > > > zero length. > > > > > > > > Workaround: > > > > Set PRD length to 0 when creating a PRD entry for a maximum data > > > > 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- > > > >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 > > > > a/MdeModulePkg/MdeModulePkg.dec > > b/MdeModulePkg/MdeModulePkg.dec > > > > 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