audk/MdeModulePkg
Hao A Wu e2afc8ab59 MdeModulePkg/AhciPei: Fix device cannot be found in non-S3 path
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1862

Current implementation of function AhciModeInitialization() has an
incorrect assumption that the value in the CAP (offset 00h) register will
always be greater than the highest bit set for the value in the PI (offset
0Ch) register.

This will lead to an issue that hard disk devices may not be found in the
non-S3 boot path for some AHCI controller capabilities.

More specifically, variable 'PortInitializeBitMap' will have the value
from 'Private->PortBitMap', which will be 0xFFFFFFFF in non-S3 boot path.
When the CAP register is of value 0x1 and PI register with value 0x4
(meaning port 2 is available), the current logic will only enumerate port
0. And the device attached behind port 2 will not be enumerated.

To address this issue, variable 'PortInitializeBitMap' will now take the
bitwise and result between 'Private->PortBitMap' and the value read from
the PI register.

Please note that there will be no function impact for S3 path, since in
this case, the bits being set in 'Private->PortBitMap' will be a subset
of the bits being set in the PI register. Their bitwise and operation will
still be the value of 'Private->PortBitMap'.

Cc: Maggie Chu <maggie.chu@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Signed-off-by: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
2019-05-31 15:56:41 +08:00
..
Application MdeModulePkg/DumpDynPcd: Add application to dump dynamic PCD settings 2019-05-08 14:15:40 +08:00
Bus MdeModulePkg/AhciPei: Fix device cannot be found in non-S3 path 2019-05-31 15:56:41 +08:00
Core MdeModulePkg/Core: Remove PcdFrameworkCompatibilitySupport usage 2019-05-09 09:42:55 +08:00
Include NetworkPkg: Move Network library header file from MdeModulePkg to NetworkPkg 2019-05-27 09:25:18 +08:00
Library NetworkPkg: Move Network library and drivers from MdeModulePkg to NetworkPkg 2019-05-27 09:25:18 +08:00
Logo MdeModulePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:08 -07:00
Universal NetworkPkg: Move Network library and drivers from MdeModulePkg to NetworkPkg 2019-05-27 09:25:18 +08:00
MdeModulePkg.dec MdeModulePkg: Remove network library header file from package DEC file 2019-05-27 09:25:18 +08:00
MdeModulePkg.dsc MdeModulePkg: Update MdeModulePkg.dsc to remove Network related modules 2019-05-23 22:41:01 +08:00
MdeModulePkg.uni MdeModulePkg: BaseSerialPortLib16550: Add missing Pcd to UNI 2019-05-10 16:43:22 +08:00
MdeModulePkgExtra.uni MdeModulePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:08 -07:00