public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Hiroaki Isono <Hiroaki.Isono@arm.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>
Subject: [PATCH 1/1] Fixed SiI3132 status check of SW reset
Date: Fri, 29 May 2020 05:24:26 +0000	[thread overview]
Message-ID: <AM0PR08MB35862398C834F95418F789E1EE8F0@AM0PR08MB3586.eurprd08.prod.outlook.com> (raw)

[-- 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 --]

                 reply	other threads:[~2020-05-29  5:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=AM0PR08MB35862398C834F95418F789E1EE8F0@AM0PR08MB3586.eurprd08.prod.outlook.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