]> git.proxmox.com Git - mirror_edk2.git/commit - MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c
MdeModulePkg/AtaAtapiPassThru: Ensure GHC.AE bit is always set in Ahci
authorMarcin Wojtas <mw@semihalf.com>
Thu, 24 Nov 2016 07:54:33 +0000 (08:54 +0100)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Thu, 24 Nov 2016 15:54:55 +0000 (15:54 +0000)
commit6052a15f4a4297b430cf03f2456e51f8d3bb4598
tree9a6184de1537b3948df98db2e0cc5fd90e1614ef
parent2667ad40919afa6e4cd1b5f572584fbd440689b4
MdeModulePkg/AtaAtapiPassThru: Ensure GHC.AE bit is always set in Ahci

According to AHCI Spec 1.3 GHC.AE bit description:
"The implementation of this bit is dependent upon the value of the
CAP.SAM bit. If CAP.SAM is '0', then GHC.AE shall be read-write and shall
have a reset value of '0'. If CAP.SAM is '1', then AE shall be read-only
and shall have a reset value of '1'."

Being in AhciMode, for proper operation it is required, that GHC.AE bit
is always set, before any other AHCI registers are written to. Current
AhciMode implementation, both in AhciReset() and AhciModeInitialization()
functions, set GHC.AE bit only depending on 'CAP.SAM == 0' condition,
assuming (according to the AHCI spec), that otherwise it has to be set
anyway. It may however happen, that even if 'CAP.SAM == 1', GHC.AE
requires updating by software.

This patch enables in AhciMode setting GHC.AE in case its initial value
is '0'. It fixes AHCI support for Marvell Armada 70x0 and 80x0 SoC
families. The change is transparent to all other platforms.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Marcin Wojtas <mw@semihalf.com>
Signed-off-by: Jan Dabros <jsd@semihalf.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c