public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 1/1] Fixed SiI3132 status check of SW reset
@ 2020-05-29  5:24 Hiroaki Isono
  0 siblings, 0 replies; only message in thread
From: Hiroaki Isono @ 2020-05-29  5:24 UTC (permalink / raw)
  To: devel@edk2.groups.io

[-- Attachment #1: Type: text/plain, Size: 1926 bytes --]

Fixed the timeout error in SiI3132SoftResetCommand() function.
The timeout "SiI3132AtaPassThru() Err:Timeout" occurs when using "WD SSD WDS100T2B0A 1TB", but doesn't occur when using "Intel SSD 530 Series 240GB".
Compared with the linux kernel driver, and found it has the status check during software reset function.
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/ata/sata_sil24.c?h=v5.6.14
After this modification, confirmed that the WD SSD works without timeout error during software reset function.


Tested platform: Juno R2
Signed-off-by: Hiroaki isono Hiroaki.isono@...


diff --git a/EmbeddedPkg/Drivers/SataSiI3132Dxe/SiI3132AtaPassThru.c b/EmbeddedPkg/Drivers/SataSiI3132Dxe/SiI3132AtaPassThru.c
index a938563ebd..64a9f94c6c 100644
--- a/EmbeddedPkg/Drivers/SataSiI3132Dxe/SiI3132AtaPassThru.c
+++ b/EmbeddedPkg/Drivers/SataSiI3132Dxe/SiI3132AtaPassThru.c
@@ -79,6 +79,14 @@ SiI3132AtaPassThruCommand (
     SATA_TRACE ("SiI3132AtaPassThru() EFI_ATA_PASS_THRU_PROTOCOL_ATA_SOFTWARE_RESET");
     Control = PRB_CTRL_SRST;

+    SATA_PORT_READ32 (SataPort->RegBase + SII3132_PORT_INTSTATUS_REG, &Value32);^M
+    Timeout = 1000;^M
+    while (Timeout && !(Value32 & IrqMask)) {^M
+      gBS->Stall (1);^M
+      SATA_PORT_READ32 (SataPort->RegBase + SII3132_PORT_INTSTATUS_REG, &Value32);^M
+      Timeout--;^M
+    }^M
+^M
     if (FeaturePcdGet (PcdSataSiI3132FeaturePMPSupport)) {
         SataPort->HostPRB->Fis.Control = 0x0F;
     }



https://github.com/hiro-isono/edk2/commit/fa638c358e1a1afd46a8f0c4f04adfd5900622ca


IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

[-- Attachment #2: Type: text/html, Size: 12749 bytes --]

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-05-29  5:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-29  5:24 [PATCH 1/1] Fixed SiI3132 status check of SW reset Hiroaki Isono

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox