X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdeModulePkg%2FBus%2FAta%2FAtaAtapiPassThru%2FIdeMode.c;h=b06f9889ed03abe60a7af0f8b43feeab60c3ad7e;hb=dfc229f6a67b03e3c47b67b92982a100cfef738a;hp=420ad273dc3cea2a0ffdee58102799cbff524ca6;hpb=51492422806c7d9cc932e8d27f1e32bab7ac7cf0;p=mirror_edk2.git diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/IdeMode.c b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/IdeMode.c index 420ad273dc..b06f9889ed 100644 --- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/IdeMode.c +++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/IdeMode.c @@ -467,9 +467,18 @@ DRQClear2 ( @param IdeRegisters A pointer to EFI_IDE_REGISTERS data structure. @param Timeout The time to complete the command, uses 100ns as a unit. - @retval EFI_SUCCESS DRQ bit set within the time out. - @retval EFI_TIMEOUT DRQ bit not set within the time out. - @retval EFI_ABORTED DRQ bit not set caused by the command abort. + @retval EFI_SUCCESS BSY bit cleared and DRQ bit set within the + timeout. + + @retval EFI_TIMEOUT BSY bit not cleared within the timeout. + + @retval EFI_ABORTED Polling abandoned due to command abort. + + @retval EFI_DEVICE_ERROR Polling abandoned due to a non-abort error. + + @retval EFI_NOT_READY BSY bit cleared within timeout, and device + reported "command complete" by clearing DRQ + bit. @note Read Status Register will clear interrupt status. @@ -542,9 +551,19 @@ DRQReady ( @param IdeRegisters A pointer to EFI_IDE_REGISTERS data structure. @param Timeout The time to complete the command, uses 100ns as a unit. - @retval EFI_SUCCESS DRQ bit set within the time out. - @retval EFI_TIMEOUT DRQ bit not set within the time out. - @retval EFI_ABORTED DRQ bit not set caused by the command abort. + @retval EFI_SUCCESS BSY bit cleared and DRQ bit set within the + timeout. + + @retval EFI_TIMEOUT BSY bit not cleared within the timeout. + + @retval EFI_ABORTED Polling abandoned due to command abort. + + @retval EFI_DEVICE_ERROR Polling abandoned due to a non-abort error. + + @retval EFI_NOT_READY BSY bit cleared within timeout, and device + reported "command complete" by clearing DRQ + bit. + @note Read Alternate Status Register will not clear interrupt status. **/ @@ -1949,7 +1968,7 @@ AtaPacketReadWrite ( // Status = DRQReady2 (PciIo, IdeRegisters, Timeout); if (EFI_ERROR (Status)) { - return CheckStatusRegister (PciIo, IdeRegisters); + return Status; } // @@ -2613,6 +2632,11 @@ DetectAndConfigIdeDevice ( PciIo = Instance->PciIo; for (IdeDevice = 0; IdeDevice < EfiIdeMaxDevice; IdeDevice++) { + // + // Select Master or Slave device to get the return signature for ATA DEVICE DIAGNOSTIC cmd. + // + IdeWritePortB (PciIo, IdeRegisters->Head, (UINT8)((IdeDevice << 4) | 0xe0)); + // // Send ATA Device Execut Diagnostic command. // This command should work no matter DRDY is ready or not