{\r
UINT64 Delay;\r
UINT32 Value;\r
+ UINT32 Capability;\r
\r
- AhciOrReg (PciIo, EFI_AHCI_GHC_OFFSET, EFI_AHCI_GHC_ENABLE);\r
+ //\r
+ // Collect AHCI controller information\r
+ //\r
+ Capability = AhciReadReg (PciIo, EFI_AHCI_CAPABILITY_OFFSET);\r
+ \r
+ //\r
+ // Enable AE before accessing any AHCI registers if Supports AHCI Mode Only is not set\r
+ //\r
+ if ((Capability & EFI_AHCI_CAP_SAM) == 0) {\r
+ AhciOrReg (PciIo, EFI_AHCI_GHC_OFFSET, EFI_AHCI_GHC_ENABLE);\r
+ }\r
\r
AhciOrReg (PciIo, EFI_AHCI_GHC_OFFSET, EFI_AHCI_GHC_RESET);\r
\r
}\r
\r
//\r
- // Enable AE before accessing any AHCI registers\r
+ // Collect AHCI controller information\r
//\r
- AhciOrReg (PciIo, EFI_AHCI_GHC_OFFSET, EFI_AHCI_GHC_ENABLE);\r
-\r
+ Capability = AhciReadReg (PciIo, EFI_AHCI_CAPABILITY_OFFSET);\r
+ \r
//\r
- // Collect AHCI controller information\r
+ // Enable AE before accessing any AHCI registers if Supports AHCI Mode Only is not set\r
//\r
- Capability = AhciReadReg(PciIo, EFI_AHCI_CAPABILITY_OFFSET);\r
-\r
+ if ((Capability & EFI_AHCI_CAP_SAM) == 0) {\r
+ AhciOrReg (PciIo, EFI_AHCI_GHC_OFFSET, EFI_AHCI_GHC_ENABLE);\r
+ }\r
+ \r
//\r
// Get the number of command slots per port supported by this HBA.\r
//\r
/** @file\r
Header file for AHCI mode of ATA host controller.\r
\r
- Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials \r
are licensed and made available under the terms and conditions of the BSD License \r
which accompanies this distribution. The full text of the license may be found at \r
#define EFI_AHCI_BAR_INDEX 0x05\r
\r
#define EFI_AHCI_CAPABILITY_OFFSET 0x0000\r
+#define EFI_AHCI_CAP_SAM BIT18\r
#define EFI_AHCI_CAP_SSS BIT27\r
#define EFI_AHCI_CAP_S64A BIT31\r
#define EFI_AHCI_GHC_OFFSET 0x0004\r