Revision: 18529
http://sourceforge.net/p/edk2/code/18529
Author: lersek
Date: 2015-09-22 11:18:31 +0000 (Tue, 22 Sep 2015)
Log Message:
-----------
MdeModulePkg: AtaAtapiPassThru: select master/slave around DIAG command
Some IDE controllers only update ID fields such as sector information on
specific commands such as the DIAG command.
The master/slave device is therefore selected both before and after
sending the DIAG command; otherwise reading the IDE registers yields the
master's ID fields.
(Reza's patch originally *moved* the master/slave selection from after the
DIAG command before it, however Feng asked for the original master/slave
select to be preserved; effectively making the master/slave select
*bracket* the DIAG command. See this subthread:
<http://thread.gmane.org/gmane.comp.bios.tianocore.devel/10545/focus=10550>.)
Cc: Alexander Graf <[email protected]>
Cc: Reza Jelveh <[email protected]>
Cc: Jordan Justen <[email protected]>
Cc: Hannes Reinecke <[email protected]>
Cc: Gabriel L. Somlo <[email protected]>
Cc: Feng Tian <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Reza Jelveh <[email protected]>
[[email protected]: see above]
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian <[email protected]>
[[email protected]: updated commit message]
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <[email protected]>
Reviewed-by: Feng Tian <[email protected]>
Tested-by: Gabriel Somlo <[email protected]>
Reviewed-by: Jordan Justen <[email protected]>
Modified Paths:
--------------
trunk/edk2/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/IdeMode.c
Modified: trunk/edk2/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/IdeMode.c
===================================================================
--- trunk/edk2/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/IdeMode.c 2015-09-22
11:18:27 UTC (rev 18528)
+++ trunk/edk2/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/IdeMode.c 2015-09-22
11:18:31 UTC (rev 18529)
@@ -2614,6 +2614,11 @@
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
//
------------------------------------------------------------------------------
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits