From: "Zeng, Star" <star.zeng@intel.com>
To: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com>,
"ard.biesheuvel@linaro.org" <ard.biesheuvel@linaro.org>,
"leif.lindholm@linaro.org" <leif.lindholm@linaro.org>,
"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>,
"Dong, Eric" <eric.dong@intel.com>
Cc: "Ni, Ruiyu" <ruiyu.ni@intel.com>, "Zeng, Star" <star.zeng@intel.com>
Subject: Re: [RFC] SATA : Implemented NXP errata A008402
Date: Mon, 8 Jan 2018 05:48:53 +0000 [thread overview]
Message-ID: <0C09AFA07DD0434D9E2A0C6AEB0483103B9F8EE6@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <1515410208-14559-2-git-send-email-meenakshi.aggarwal@nxp.com>
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 <star.zeng@intel.com>; Dong, Eric <eric.dong@intel.com>
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 <meenakshi.aggarwal@nxp.com>
---
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.
--
1.9.1
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
next prev parent reply other threads:[~2018-01-08 5:43 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-08 11:16 [RFC] define PCD for EFI_AHCI_MAX_DATA_PER_PRDT Meenakshi Aggarwal
2018-01-08 5:47 ` Zeng, Star
2018-01-08 11:16 ` [RFC] SATA : Implemented NXP errata A008402 Meenakshi Aggarwal
2018-01-08 5:48 ` Zeng, Star [this message]
2018-01-08 5:55 ` Meenakshi Aggarwal
2018-01-08 6:26 ` Meenakshi Aggarwal
2018-01-08 9:47 ` Zeng, Star
2018-01-08 9:54 ` Meenakshi Aggarwal
2018-01-08 10:24 ` Zeng, Star
2018-01-08 10:50 ` Meenakshi Aggarwal
2018-01-09 3:41 ` Ni, Ruiyu
[not found] ` <DB5PR04MB0998FE9A915B10A3EF97E4278E110@DB5PR04MB0998.eurprd04.prod.outlook.com>
2018-01-10 9:31 ` Ni, Ruiyu
2018-01-10 9:43 ` Udit Kumar
2018-01-10 9:52 ` Ard Biesheuvel
2018-01-10 10:35 ` Udit Kumar
2018-01-11 2:25 ` Ni, Ruiyu
2018-01-11 10:09 ` Ard Biesheuvel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0C09AFA07DD0434D9E2A0C6AEB0483103B9F8EE6@shsmsx102.ccr.corp.intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox