From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.43; helo=mga05.intel.com; envelope-from=ruiyu.ni@intel.com; receiver=edk2-devel@lists.01.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 C705E2035D329 for ; Mon, 8 Jan 2018 19:36:03 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Jan 2018 19:41:13 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,334,1511856000"; d="scan'208";a="193297882" Received: from ray-dev.ccr.corp.intel.com (HELO [10.239.9.19]) ([10.239.9.19]) by fmsmga005.fm.intel.com with ESMTP; 08 Jan 2018 19:41:13 -0800 To: edk2-devel@lists.01.org References: <1515410208-14559-1-git-send-email-meenakshi.aggarwal@nxp.com> <1515410208-14559-2-git-send-email-meenakshi.aggarwal@nxp.com> From: "Ni, Ruiyu" Message-ID: <4ea591d7-5218-d174-7fde-90ecf8a76f02@Intel.com> Date: Tue, 9 Jan 2018 11:41:12 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <1515410208-14559-2-git-send-email-meenakshi.aggarwal@nxp.com> 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: Tue, 09 Jan 2018 03:36:04 -0000 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit On 1/8/2018 7:16 PM, Meenakshi Aggarwal wrote: > 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. Is the logic error mentioned here is the error in HW? Then I do not prefer to add such PCD for a HW workaround. > > 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 = (UINT32)RemainedData - 1; > } else { > - AhciRegisters->AhciCommandTable->PrdtTable[PrdtIndex].AhciPrdtDbc = EFI_AHCI_MAX_DATA_PER_PRDT - 1; > + AhciRegisters->AhciCommandTable->PrdtTable[PrdtIndex].AhciPrdtDbc = PcdGet32 (PcdPrdtMaxDataLength); > } > > Data64.Uint64 = (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|0x4000000e > > + ## This PCD specifies the Maximum data length for a PRD Entry > + gEfiMdeModulePkgTokenSpaceGuid.PcdPrdtMaxDataLength|0x3FFFFF|UINT32|0x4000000f > + > [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx] > ## UART clock frequency is for the baud rate configuration. > # @Prompt Serial Port Clock Rate. > -- Thanks, Ray