From nobody Sat May 4 17:30:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail(p=none dis=none) header.from=intel.com Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1528095811213231.2322010350972; Mon, 4 Jun 2018 00:03:31 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 11EC821BADAB2; Mon, 4 Jun 2018 00:03:29 -0700 (PDT) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id DBA09209605D4 for ; Mon, 4 Jun 2018 00:03:27 -0700 (PDT) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Jun 2018 00:03:26 -0700 Received: from ray-dev.ccr.corp.intel.com ([10.239.9.4]) by fmsmga001.fm.intel.com with ESMTP; 04 Jun 2018 00:03:25 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.126; helo=mga18.intel.com; envelope-from=ruiyu.ni@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,475,1520924400"; d="scan'208";a="61027564" From: Ruiyu Ni To: edk2-devel@lists.01.org Date: Mon, 4 Jun 2018 15:03:34 +0800 Message-Id: <20180604070337.164836-2-ruiyu.ni@intel.com> X-Mailer: git-send-email 2.16.1.windows.1 In-Reply-To: <20180604070337.164836-1-ruiyu.ni@intel.com> References: <20180604070337.164836-1-ruiyu.ni@intel.com> Subject: [edk2] [PATCH v2 1/4] MdeModulePkg/AtaAtapiPassThru: Spin up Power up in Standby devices X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The patch adds support to certain devices that support PUIS (Power up in Standby). For those devices that supports SET_FEATURE spin up, SW needs to send SET_FEATURE subcommand to spin up the devices. For those devices that doesn't support SET_FEATURE spin up, SW needs to send read sectors command to spin up the devices. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni Reviewed-by: Chasel Chiu Reviewed-by: Hao A Wu --- MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c | 130 +++++++++++++++++= +++- .../Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.h | 3 +- 2 files changed, 128 insertions(+), 5 deletions(-) diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c b/MdeModulePk= g/Bus/Ata/AtaAtapiPassThru/AhciMode.c index e6de5d65bc..14578c0f94 100644 --- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c +++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c @@ -1,7 +1,7 @@ /** @file The file for AHCI mode of ATA host controller. =20 - Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
(C) Copyright 2015 Hewlett Packard Enterprise Development LP
This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License @@ -1826,6 +1826,7 @@ AhciIdentifyPacket ( @param PortMultiplier The port multiplier port number. @param Feature The data to send Feature register. @param FeatureSpecificData The specific data for SET FEATURE cmd. + @param Timeout The timeout value of SET FEATURE cmd, uses 1= 00ns as a unit. =20 @retval EFI_DEVICE_ERROR The cmd abort with error occurs. @retval EFI_TIMEOUT The operation is time out. @@ -1841,7 +1842,8 @@ AhciDeviceSetFeature ( IN UINT8 Port, IN UINT8 PortMultiplier, IN UINT16 Feature, - IN UINT32 FeatureSpecificData + IN UINT32 FeatureSpecificData, + IN UINT64 Timeout ) { EFI_STATUS Status; @@ -1868,7 +1870,7 @@ AhciDeviceSetFeature ( 0, &AtaCommandBlock, &AtaStatusBlock, - ATA_ATAPI_TIMEOUT, + Timeout, NULL ); =20 @@ -2216,6 +2218,104 @@ Error6: return Status; } =20 + +/** + Spin-up disk if IDD was incomplete or PUIS feature is enabled + + @param PciIo The PCI IO protocol instance. + @param AhciRegisters The pointer to the EFI_AHCI_REGISTERS. + @param Port The number of port. + @param PortMultiplier The multiplier of port. + @param IdentifyData A pointer to data buffer which is used to co= ntain IDENTIFY data. + +**/ +EFI_STATUS +AhciSpinUpDisk ( + IN EFI_PCI_IO_PROTOCOL *PciIo, + IN EFI_AHCI_REGISTERS *AhciRegisters, + IN UINT8 Port, + IN UINT8 PortMultiplier, + IN OUT EFI_IDENTIFY_DATA *IdentifyData + ) +{ + EFI_STATUS Status; + EFI_ATA_COMMAND_BLOCK AtaCommandBlock; + EFI_ATA_STATUS_BLOCK AtaStatusBlock; + UINT8 Buffer[512]; + + if (IdentifyData->AtaData.specific_config =3D=3D ATA_SPINUP_CFG_REQUIRED= _IDD_INCOMPLETE) { + // + // Use SET_FEATURE subcommand to spin up the device. + // + Status =3D AhciDeviceSetFeature ( + PciIo, AhciRegisters, Port, PortMultiplier, + ATA_SUB_CMD_PUIS_SET_DEVICE_SPINUP, 0x00, ATA_SPINUP_TIMEOUT + ); + DEBUG ((DEBUG_INFO, "CMD_PUIS_SET_DEVICE_SPINUP for device at port [%d= ] PortMultiplier [%d] - %r!\n", + Port, PortMultiplier, Status)); + if (EFI_ERROR (Status)) { + return Status; + } + } else { + ASSERT (IdentifyData->AtaData.specific_config =3D=3D ATA_SPINUP_CFG_NO= T_REQUIRED_IDD_INCOMPLETE); + + // + // Use READ_SECTORS to spin up the device if SpinUp SET FEATURE subcom= mand is not supported + // + ZeroMem (&AtaCommandBlock, sizeof (EFI_ATA_COMMAND_BLOCK)); + ZeroMem (&AtaStatusBlock, sizeof (EFI_ATA_STATUS_BLOCK)); + // + // Perform READ SECTORS PIO Data-In command to Read LBA 0 + // + AtaCommandBlock.AtaCommand =3D ATA_CMD_READ_SECTORS; + AtaCommandBlock.AtaSectorCount =3D 0x1; + + Status =3D AhciPioTransfer ( + PciIo, + AhciRegisters, + Port, + PortMultiplier, + NULL, + 0, + TRUE, + &AtaCommandBlock, + &AtaStatusBlock, + &Buffer, + sizeof (Buffer), + ATA_SPINUP_TIMEOUT, + NULL + ); + DEBUG ((DEBUG_INFO, "Read LBA 0 for device at port [%d] PortMultiplier= [%d] - %r!\n", + Port, PortMultiplier, Status)); + if (EFI_ERROR (Status)) { + return Status; + } + } + + // + // Read the complete IDENTIFY DEVICE data. + // + ZeroMem (IdentifyData, sizeof (*IdentifyData)); + Status =3D AhciIdentify (PciIo, AhciRegisters, Port, PortMultiplier, Ide= ntifyData); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "Read IDD failed for device at port [%d] PortMult= iplier [%d] - %r!\n", + Port, PortMultiplier, Status)); + return Status; + } + + DEBUG ((DEBUG_INFO, "IDENTIFY DEVICE: [0] =3D %016x, [2] =3D %016x, [83]= =3D %016x, [86] =3D %016x\n", + IdentifyData->AtaData.config, IdentifyData->AtaData.specific_con= fig, + IdentifyData->AtaData.command_set_supported_83, IdentifyData->At= aData.command_set_feature_enb_86)); + // + // Check if IDD is incomplete + // + if ((IdentifyData->AtaData.config & BIT2) !=3D 0) { + return EFI_DEVICE_ERROR; + } + + return EFI_SUCCESS; +} + /** Initialize ATA host controller at AHCI mode. =20 @@ -2458,6 +2558,28 @@ AhciModeInitialization ( continue; } =20 + DEBUG (( + DEBUG_INFO, "IDENTIFY DEVICE: [0] =3D %016x, [2] =3D %016x, [83]= =3D %016x, [86] =3D %016x\n", + Buffer.AtaData.config, Buffer.AtaData.specific_config, + Buffer.AtaData.command_set_supported_83, Buffer.AtaData.command_= set_feature_enb_86 + )); + if ((Buffer.AtaData.config & BIT2) !=3D 0) { + // + // SpinUp disk if device reported incomplete IDENTIFY DEVICE. + // + Status =3D AhciSpinUpDisk ( + PciIo, + AhciRegisters, + Port, + 0, + &Buffer + ); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "Spin up standby device failed - %r\n", S= tatus)); + continue; + } + } + DeviceType =3D EfiIdeHarddisk; } else { continue; @@ -2523,7 +2645,7 @@ AhciModeInitialization ( TransferMode.ModeNumber =3D (UINT8) SupportedModes->MultiWordDmaMo= de.Mode; } =20 - Status =3D AhciDeviceSetFeature (PciIo, AhciRegisters, Port, 0, 0x03= , (UINT32)(*(UINT8 *)&TransferMode)); + Status =3D AhciDeviceSetFeature (PciIo, AhciRegisters, Port, 0, 0x03= , (UINT32)(*(UINT8 *)&TransferMode), ATA_ATAPI_TIMEOUT); if (EFI_ERROR (Status)) { DEBUG ((EFI_D_ERROR, "Set transfer Mode Fail, Status =3D %r\n", St= atus)); continue; diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.h b/Mde= ModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.h index 85e5a55539..31b005f2f6 100644 --- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.h +++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.h @@ -1,7 +1,7 @@ /** @file Header file for ATA/ATAPI PASS THRU driver. =20 - Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License which accompanies this distribution. The full text of the license may b= e found at @@ -148,6 +148,7 @@ struct _ATA_NONBLOCK_TASK { // It means 3 second span. // #define ATA_ATAPI_TIMEOUT EFI_TIMER_PERIOD_SECONDS(3) +#define ATA_SPINUP_TIMEOUT EFI_TIMER_PERIOD_SECONDS(10) =20 #define IS_ALIGNED(addr, size) (((UINTN) (addr) & (size - 1)) =3D=3D = 0) =20 --=20 2.16.1.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sat May 4 17:30:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail(p=none dis=none) header.from=intel.com Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1528095813737540.4112897979315; Mon, 4 Jun 2018 00:03:33 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 435BD209688FC; Mon, 4 Jun 2018 00:03:29 -0700 (PDT) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id E8B1F209688EB for ; Mon, 4 Jun 2018 00:03:27 -0700 (PDT) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Jun 2018 00:03:26 -0700 Received: from ray-dev.ccr.corp.intel.com ([10.239.9.4]) by fmsmga001.fm.intel.com with ESMTP; 04 Jun 2018 00:03:25 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.126; helo=mga18.intel.com; envelope-from=ruiyu.ni@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,475,1520924400"; d="scan'208";a="61027581" From: Ruiyu Ni To: edk2-devel@lists.01.org Date: Mon, 4 Jun 2018 15:03:35 +0800 Message-Id: <20180604070337.164836-3-ruiyu.ni@intel.com> X-Mailer: git-send-email 2.16.1.windows.1 In-Reply-To: <20180604070337.164836-1-ruiyu.ni@intel.com> References: <20180604070337.164836-1-ruiyu.ni@intel.com> Subject: [edk2] [PATCH v2 2/4] MdeModulePkg: Add AtaAtapiPolicy protocol definition X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Star Zeng MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The patch adds AtaAtapiPolicy protocol which is produced by platform and consumed by AtaAtapiPassThruDxe driver. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni Cc: Star Zeng Reviewed-by: Star Zeng --- MdeModulePkg/Include/Protocol/AtaAtapiPolicy.h | 59 ++++++++++++++++++++++= ++++ MdeModulePkg/MdeModulePkg.dec | 2 + 2 files changed, 61 insertions(+) create mode 100644 MdeModulePkg/Include/Protocol/AtaAtapiPolicy.h diff --git a/MdeModulePkg/Include/Protocol/AtaAtapiPolicy.h b/MdeModulePkg/= Include/Protocol/AtaAtapiPolicy.h new file mode 100644 index 0000000000..12657d749e --- /dev/null +++ b/MdeModulePkg/Include/Protocol/AtaAtapiPolicy.h @@ -0,0 +1,59 @@ +/** @file + ATA ATAPI Policy protocol is produced by platform and consumed by AtaAta= piPassThruDxe + driver. + + Copyright (c) 2018, Intel Corporation. All rights reserved.
+ This program and the accompanying materials + are licensed and made available under the terms and conditions of the BS= D License + which accompanies this distribution. The full text of the license may b= e found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. + +**/ +#ifndef __ATA_ATAPI_POLICY_H__ +#define __ATA_ATAPI_POLICY_H__ + +#define EDKII_ATA_ATAPI_POLICY_PROTOCOL_GUID \ + { \ + 0xe59cd769, 0x5083, 0x4f26,{ 0x90, 0x94, 0x6c, 0x91, 0x9f, 0x91, 0x6c,= 0x4e } \ + } + +typedef struct { + /// + /// Protocol version. + /// + UINT32 Version; + + /// + /// 0: Disable Power-up in Standby; + /// 1: Enable Power-up in Standby; + /// others: Since PUIS setting is non-volatile, platform can use other v= alue than 0/1 to keep hardware PUIS setting. + /// + UINT8 PuisEnable; + + /// + /// 0: Disable Device Sleep; + /// 1: Enable Device Sleep; + /// others: Ignored. + /// + UINT8 DeviceSleepEnable; + + /// + /// 0: Disable Aggressive Device Sleep; + /// 1: Enable Aggressive Device Sleep; + /// others: Ignored. + /// + UINT8 AggressiveDeviceSleepEnable; + + UINT8 Reserved; +} EDKII_ATA_ATAPI_POLICY_PROTOCOL; + +#define EDKII_ATA_ATAPI_POLICY_VERSION 0x00010000 + + +extern EFI_GUID gEdkiiAtaAtapiPolicyProtocolGuid; + +#endif + diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec index 97ec87e1cf..3802b6e0b8 100644 --- a/MdeModulePkg/MdeModulePkg.dec +++ b/MdeModulePkg/MdeModulePkg.dec @@ -606,6 +606,8 @@ [Protocols] ## Include/Protocol/FirmwareManagementProgress.h gEdkiiFirmwareManagementProgressProtocolGuid =3D { 0x1849bda2, 0x6952, 0= x4e86, { 0xa1, 0xdb, 0x55, 0x9a, 0x3c, 0x47, 0x9d, 0xf1 } } =20 + ## Include/Protocol/AtaAtapiPolicy.h + gEdkiiAtaAtapiPolicyProtocolGuid =3D { 0xe59cd769, 0x5083, 0x4f26,{ 0x90= , 0x94, 0x6c, 0x91, 0x9f, 0x91, 0x6c, 0x4e } } # # [Error.gEfiMdeModulePkgTokenSpaceGuid] # 0x80000001 | Invalid value provided. --=20 2.16.1.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sat May 4 17:30:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail(p=none dis=none) header.from=intel.com Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1528095816355518.2271906650075; Mon, 4 Jun 2018 00:03:36 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 7CA93209605D4; Mon, 4 Jun 2018 00:03:31 -0700 (PDT) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 3497B209688E9 for ; Mon, 4 Jun 2018 00:03:28 -0700 (PDT) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Jun 2018 00:03:27 -0700 Received: from ray-dev.ccr.corp.intel.com ([10.239.9.4]) by fmsmga001.fm.intel.com with ESMTP; 04 Jun 2018 00:03:26 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.126; helo=mga18.intel.com; envelope-from=ruiyu.ni@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,475,1520924400"; d="scan'208";a="61027605" From: Ruiyu Ni To: edk2-devel@lists.01.org Date: Mon, 4 Jun 2018 15:03:36 +0800 Message-Id: <20180604070337.164836-4-ruiyu.ni@intel.com> X-Mailer: git-send-email 2.16.1.windows.1 In-Reply-To: <20180604070337.164836-1-ruiyu.ni@intel.com> References: <20180604070337.164836-1-ruiyu.ni@intel.com> Subject: [edk2] [PATCH v2 3/4] MdeModulePkg/AtaAtapiPassThru: enable/disable PUIS per policy X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Star Zeng MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni Cc: Star Zeng Cc: Chasel Chiu Reviewed-by: Star Zeng --- MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c | 48 ++++++++++++++++++= ++++ .../Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c | 19 ++++++++- .../Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.h | 3 ++ .../Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf | 3 +- 4 files changed, 71 insertions(+), 2 deletions(-) diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c b/MdeModulePk= g/Bus/Ata/AtaAtapiPassThru/AhciMode.c index 14578c0f94..841b6a0e60 100644 --- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c +++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c @@ -2316,6 +2316,38 @@ AhciSpinUpDisk ( return EFI_SUCCESS; } =20 +/** + Enable/disable/skip PUIS of the disk according to policy. + + @param PciIo The PCI IO protocol instance. + @param AhciRegisters The pointer to the EFI_AHCI_REGISTERS. + @param Port The number of port. + @param PortMultiplier The multiplier of port. + +**/ +EFI_STATUS +AhciPuisEnable ( + IN EFI_PCI_IO_PROTOCOL *PciIo, + IN EFI_AHCI_REGISTERS *AhciRegisters, + IN UINT8 Port, + IN UINT8 PortMultiplier + ) +{ + EFI_STATUS Status; + + Status =3D EFI_SUCCESS; + if (mAtaAtapiPolicy->PuisEnable =3D=3D 0) { + Status =3D AhciDeviceSetFeature (PciIo, AhciRegisters, Port, PortMulti= plier, ATA_SUB_CMD_DISABLE_PUIS, 0x00, ATA_ATAPI_TIMEOUT); + } else if (mAtaAtapiPolicy->PuisEnable =3D=3D 1) { + Status =3D AhciDeviceSetFeature (PciIo, AhciRegisters, Port, PortMulti= plier, ATA_SUB_CMD_ENABLE_PUIS, 0x00, ATA_ATAPI_TIMEOUT); + } + DEBUG ((DEBUG_INFO, "%a PUIS feature at port [%d] PortMultiplier [%d] - = %r!\n", + (mAtaAtapiPolicy->PuisEnable =3D=3D 0) ? "Disable" : ( + (mAtaAtapiPolicy->PuisEnable =3D=3D 1) ? "Enable" : "Skip" + ), Port, PortMultiplier, Status)); + return Status; +} + /** Initialize ATA host controller at AHCI mode. =20 @@ -2658,6 +2690,22 @@ AhciModeInitialization ( if (DeviceType =3D=3D EfiIdeHarddisk) { REPORT_STATUS_CODE (EFI_PROGRESS_CODE, (EFI_PERIPHERAL_FIXED_MEDIA= | EFI_P_PC_ENABLE)); } + + // + // Enable/disable PUIS according to policy setting if PUIS is capabl= e (Word[83].BIT5 is set). + // + if ((Buffer.AtaData.command_set_supported_83 & BIT5) !=3D 0) { + Status =3D AhciPuisEnable ( + PciIo, + AhciRegisters, + Port, + 0 + ); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "PUIS enable/disable failed, Status =3D %r\= n", Status)); + continue; + } + } } } =20 diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c b/Mde= ModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c index a48b295d26..aab704bcd3 100644 --- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c +++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c @@ -2,7 +2,7 @@ This file implements ATA_PASSTHRU_PROCTOCOL and EXT_SCSI_PASSTHRU_PROTOC= OL interfaces for managed ATA controllers. =20 - Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License which accompanies this distribution. The full text of the license may b= e found at @@ -142,6 +142,15 @@ UINT8 mScsiId[TARGET_MAX_BYTES] =3D { 0xFF, 0xFF, 0xFF, 0xFF }; =20 +EDKII_ATA_ATAPI_POLICY_PROTOCOL *mAtaAtapiPolicy; +EDKII_ATA_ATAPI_POLICY_PROTOCOL mDefaultAtaAtapiPolicy =3D { + EDKII_ATA_ATAPI_POLICY_VERSION, + 2, // PuisEnable + 0, // DeviceSleepEnable + 0, // AggressiveDeviceSleepEnable + 0 // Reserved +}; + /** Sends an ATA command to an ATA device that is attached to the ATA contro= ller. This function supports both blocking I/O and non-blocking I/O. The blocking I/O functi= onality is required, @@ -739,6 +748,14 @@ AtaAtapiPassThruStart ( goto ErrorExit; } =20 + Status =3D gBS->LocateProtocol (&gEdkiiAtaAtapiPolicyProtocolGuid, NULL,= (VOID **)&mAtaAtapiPolicy); + if (EFI_ERROR (Status)) { + // + // If there is no AtaAtapiPolicy exposed, use the default policy. + // + mAtaAtapiPolicy =3D &mDefaultAtaAtapiPolicy; + } + // // Allocate a buffer to store the ATA_ATAPI_PASS_THRU_INSTANCE data stru= cture // diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.h b/Mde= ModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.h index 31b005f2f6..b07bcbbb3e 100644 --- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.h +++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.h @@ -24,6 +24,7 @@ #include #include #include +#include =20 #include #include @@ -45,6 +46,8 @@ extern EFI_DRIVER_BINDING_PROTOCOL gAtaAtapiPassThruDriv= erBinding; extern EFI_COMPONENT_NAME_PROTOCOL gAtaAtapiPassThruComponentName; extern EFI_COMPONENT_NAME2_PROTOCOL gAtaAtapiPassThruComponentName2; =20 +extern EDKII_ATA_ATAPI_POLICY_PROTOCOL *mAtaAtapiPolicy; + #define ATA_ATAPI_PASS_THRU_SIGNATURE SIGNATURE_32 ('a', 'a', 'p', 't') #define ATA_ATAPI_DEVICE_SIGNATURE SIGNATURE_32 ('a', 'd', 'e', 'v') #define ATA_NONBLOCKING_TASK_SIGNATURE SIGNATURE_32 ('a', 't', 's', 'k') diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf b/M= deModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf index 82d5f7a46c..d1ce859091 100644 --- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf +++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf @@ -4,7 +4,7 @@ # This driver installs AtaPassThru and ExtScsiPassThru protocol in each i= de/sata controller # to access to all attached Ata/Atapi devices. # -# Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.
+# Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
# # This program and the accompanying materials # are licensed and made available under the terms and conditions of the B= SD License @@ -67,6 +67,7 @@ [Protocols] gEfiIdeControllerInitProtocolGuid ## TO_START gEfiDevicePathProtocolGuid ## TO_START gEfiPciIoProtocolGuid ## TO_START + gEdkiiAtaAtapiPolicyProtocolGuid ## CONSUMES =20 [Pcd] gEfiMdeModulePkgTokenSpaceGuid.PcdAtaSmartEnable ## SOMETIMES_CONSUMES --=20 2.16.1.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sat May 4 17:30:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail(p=none dis=none) header.from=intel.com Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 152809581929811.914033986315758; Mon, 4 Jun 2018 00:03:39 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id B8DE72096890F; Mon, 4 Jun 2018 00:03:31 -0700 (PDT) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 4E1AD20968906 for ; Mon, 4 Jun 2018 00:03:29 -0700 (PDT) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Jun 2018 00:03:29 -0700 Received: from ray-dev.ccr.corp.intel.com ([10.239.9.4]) by fmsmga001.fm.intel.com with ESMTP; 04 Jun 2018 00:03:28 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.126; helo=mga18.intel.com; envelope-from=ruiyu.ni@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,475,1520924400"; d="scan'208";a="61027616" From: Ruiyu Ni To: edk2-devel@lists.01.org Date: Mon, 4 Jun 2018 15:03:37 +0800 Message-Id: <20180604070337.164836-5-ruiyu.ni@intel.com> X-Mailer: git-send-email 2.16.1.windows.1 In-Reply-To: <20180604070337.164836-1-ruiyu.ni@intel.com> References: <20180604070337.164836-1-ruiyu.ni@intel.com> Subject: [edk2] [PATCH v2 4/4] MdeModulePkg/Ata/AtaAtapiPassThru: Enable/disable DEVSLP per policy X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Hao A Wu MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni Cc: Chasel Chiu Cc: Hao A Wu Reviewed-by: Hao Wu --- MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c | 214 +++++++++++++++++++= ++++ MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.h | 23 ++- 2 files changed, 235 insertions(+), 2 deletions(-) diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c b/MdeModulePk= g/Bus/Ata/AtaAtapiPassThru/AhciMode.c index 841b6a0e60..1bae1e8e0c 100644 --- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c +++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c @@ -2218,6 +2218,213 @@ Error6: return Status; } =20 +/** + Read logs from SATA device. + + @param PciIo The PCI IO protocol instance. + @param AhciRegisters The pointer to the EFI_AHCI_REGISTERS. + @param Port The number of port. + @param PortMultiplier The multiplier of port. + @param Buffer The data buffer to store SATA logs. + @param LogNumber The address of the log. + @param PageNumber The page number of the log. + + @retval EFI_INVALID_PARAMETER PciIo, AhciRegisters or Buffer is NULL. + @retval others Return status of AhciPioTransfer(). +**/ +EFI_STATUS +AhciReadLogExt ( + IN EFI_PCI_IO_PROTOCOL *PciIo, + IN EFI_AHCI_REGISTERS *AhciRegisters, + IN UINT8 Port, + IN UINT8 PortMultiplier, + IN OUT UINT8 *Buffer, + IN UINT8 LogNumber, + IN UINT8 PageNumber + ) +{ + EFI_ATA_COMMAND_BLOCK AtaCommandBlock; + EFI_ATA_STATUS_BLOCK AtaStatusBlock; + + if (PciIo =3D=3D NULL || AhciRegisters =3D=3D NULL || Buffer =3D=3D NULL= ) { + return EFI_INVALID_PARAMETER; + } + + /// + /// Read log from device + /// + ZeroMem (&AtaCommandBlock, sizeof (EFI_ATA_COMMAND_BLOCK)); + ZeroMem (&AtaStatusBlock, sizeof (EFI_ATA_STATUS_BLOCK)); + ZeroMem (Buffer, 512); + + AtaCommandBlock.AtaCommand =3D ATA_CMD_READ_LOG_EXT; + AtaCommandBlock.AtaSectorCount =3D 1; + AtaCommandBlock.AtaSectorNumber =3D LogNumber; + AtaCommandBlock.AtaCylinderLow =3D PageNumber; + + return AhciPioTransfer ( + PciIo, + AhciRegisters, + Port, + PortMultiplier, + NULL, + 0, + TRUE, + &AtaCommandBlock, + &AtaStatusBlock, + Buffer, + 512, + ATA_ATAPI_TIMEOUT, + NULL + ); +} + +/** + Enable DEVSLP of the disk if supported. + + @param PciIo The PCI IO protocol instance. + @param AhciRegisters The pointer to the EFI_AHCI_REGISTERS. + @param Port The number of port. + @param PortMultiplier The multiplier of port. + @param IdentifyData A pointer to data buffer which is used to co= ntain IDENTIFY data. + + @retval EFI_SUCCESS The DEVSLP is enabled per policy successfull= y. + @retval EFI_UNSUPPORTED The DEVSLP isn't supported by the controller= /device and policy requires to enable it. +**/ +EFI_STATUS +AhciEnableDevSlp ( + IN EFI_PCI_IO_PROTOCOL *PciIo, + IN EFI_AHCI_REGISTERS *AhciRegisters, + IN UINT8 Port, + IN UINT8 PortMultiplier, + IN EFI_IDENTIFY_DATA *IdentifyData + ) +{ + EFI_STATUS Status; + UINT32 Offset; + UINT32 Capability2; + UINT8 LogData[512]; + DEVSLP_TIMING_VARIABLES DevSlpTiming; + UINT32 PortCmd; + UINT32 PortDevSlp; + + if (mAtaAtapiPolicy->DeviceSleepEnable !=3D 1) { + return EFI_SUCCESS; + } + + // + // Do not enable DevSlp if DevSlp is not supported. + // + Capability2 =3D AhciReadReg (PciIo, AHCI_CAPABILITY2_OFFSET); + DEBUG ((DEBUG_INFO, "AHCI CAPABILITY2 =3D %08x\n", Capability2)); + if ((Capability2 & AHCI_CAP2_SDS) =3D=3D 0) { + return EFI_UNSUPPORTED; + } + + // + // Do not enable DevSlp if DevSlp is not present + // Do not enable DevSlp if Hot Plug or Mechanical Presence Switch is sup= ported + // + Offset =3D EFI_AHCI_PORT_START + Port * EFI_AHCI_PORT_REG_WIDTH; + PortCmd =3D AhciReadReg (PciIo, Offset + EFI_AHCI_PORT_CMD); + PortDevSlp =3D AhciReadReg (PciIo, Offset + AHCI_PORT_DEVSLP); + DEBUG ((DEBUG_INFO, "Port CMD/DEVSLP =3D %08x / %08x\n", PortCmd, PortDe= vSlp)); + if (((PortDevSlp & AHCI_PORT_DEVSLP_DSP) =3D=3D 0) || + ((PortCmd & (EFI_AHCI_PORT_CMD_HPCP | EFI_AHCI_PORT_CMD_MPSP)) !=3D = 0) + ) { + return EFI_UNSUPPORTED; + } + + // + // Do not enable DevSlp if the device doesn't support DevSlp + // + DEBUG ((DEBUG_INFO, "IDENTIFY DEVICE: [77] =3D %04x, [78] =3D %04x, [79]= =3D %04x\n", + IdentifyData->AtaData.reserved_77, + IdentifyData->AtaData.serial_ata_features_supported, IdentifyDat= a->AtaData.serial_ata_features_enabled)); + if ((IdentifyData->AtaData.serial_ata_features_supported & BIT8) =3D=3D = 0) { + DEBUG ((DEBUG_INFO, "DevSlp feature is not supported for device at por= t [%d] PortMultiplier [%d]!\n", + Port, PortMultiplier)); + return EFI_UNSUPPORTED; + } + + // + // Enable DevSlp when it is not enabled. + // + if ((IdentifyData->AtaData.serial_ata_features_enabled & BIT8) !=3D 0) { + Status =3D AhciDeviceSetFeature ( + PciIo, AhciRegisters, Port, 0, ATA_SUB_CMD_ENABLE_SATA_FEATURE, 0x09= , ATA_ATAPI_TIMEOUT + ); + DEBUG ((DEBUG_INFO, "DevSlp set feature for device at port [%d] PortMu= ltiplier [%d] - %r\n", + Port, PortMultiplier, Status)); + if (EFI_ERROR (Status)) { + return Status; + } + } + + Status =3D AhciReadLogExt(PciIo, AhciRegisters, Port, PortMultiplier, Lo= gData, 0x30, 0x08); + + // + // Clear PxCMD.ST and PxDEVSLP.ADSE before updating PxDEVSLP.DITO and Px= DEVSLP.MDAT. + // + AhciWriteReg (PciIo, Offset + EFI_AHCI_PORT_CMD, PortCmd & ~EFI_AHCI_POR= T_CMD_ST); + PortDevSlp &=3D ~AHCI_PORT_DEVSLP_ADSE; + AhciWriteReg (PciIo, Offset + AHCI_PORT_DEVSLP, PortDevSlp); + + // + // Set PxDEVSLP.DETO and PxDEVSLP.MDAT to 0. + // + PortDevSlp &=3D ~AHCI_PORT_DEVSLP_DETO_MASK; + PortDevSlp &=3D ~AHCI_PORT_DEVSLP_MDAT_MASK; + AhciWriteReg (PciIo, Offset + AHCI_PORT_DEVSLP, PortDevSlp); + DEBUG ((DEBUG_INFO, "Read Log Ext at port [%d] PortMultiplier [%d] - %r\= n", Port, PortMultiplier, Status)); + if (EFI_ERROR (Status)) { + // + // Assume DEVSLP TIMING VARIABLES is not supported if the Identify Dev= ice Data log (30h, 8) fails + // + DevSlpTiming.Supported =3D 0; + } else { + CopyMem (&DevSlpTiming, &LogData[48], sizeof (DevSlpTiming)); + DEBUG ((DEBUG_INFO, "DevSlpTiming: Supported(%d), Deto(%d), Madt(%d)\n= ", + DevSlpTiming.Supported, DevSlpTiming.Deto, DevSlpTiming.Madt)); + } + + // + // Use 20ms as default DETO when DEVSLP TIMING VARIABLES is not supporte= d or the DETO is 0. + // + if ((DevSlpTiming.Supported =3D=3D 0) || (DevSlpTiming.Deto =3D=3D 0)) { + DevSlpTiming.Deto =3D 20; + } + + // + // Use 10ms as default MADT when DEVSLP TIMING VARIABLES is not supporte= d or the MADT is 0. + // + if ((DevSlpTiming.Supported =3D=3D 0) || (DevSlpTiming.Madt =3D=3D 0)) { + DevSlpTiming.Madt =3D 10; + } + + PortDevSlp |=3D DevSlpTiming.Deto << 2; + PortDevSlp |=3D DevSlpTiming.Madt << 10; + AhciOrReg (PciIo, Offset + AHCI_PORT_DEVSLP, PortDevSlp); + + if (mAtaAtapiPolicy->AggressiveDeviceSleepEnable =3D=3D 1) { + if ((Capability2 & AHCI_CAP2_SADM) !=3D 0) { + PortDevSlp &=3D ~AHCI_PORT_DEVSLP_DITO_MASK; + PortDevSlp |=3D (625 << 15); + AhciWriteReg (PciIo, Offset + AHCI_PORT_DEVSLP, PortDevSlp); + + PortDevSlp |=3D AHCI_PORT_DEVSLP_ADSE; + AhciWriteReg (PciIo, Offset + AHCI_PORT_DEVSLP, PortDevSlp); + } + } + + + AhciWriteReg (PciIo, Offset + EFI_AHCI_PORT_CMD, PortCmd); + + DEBUG ((DEBUG_INFO, "Enabled DevSlp feature at port [%d] PortMultiplier = [%d], Port CMD/DEVSLP =3D %08x / %08x\n", + Port, PortMultiplier, PortCmd, PortDevSlp)); + + return EFI_SUCCESS; +} =20 /** Spin-up disk if IDD was incomplete or PUIS feature is enabled @@ -2689,6 +2896,13 @@ AhciModeInitialization ( CreateNewDeviceInfo (Instance, Port, 0xFFFF, DeviceType, &Buffer); if (DeviceType =3D=3D EfiIdeHarddisk) { REPORT_STATUS_CODE (EFI_PROGRESS_CODE, (EFI_PERIPHERAL_FIXED_MEDIA= | EFI_P_PC_ENABLE)); + AhciEnableDevSlp ( + PciIo, + AhciRegisters, + Port, + 0, + &Buffer + ); } =20 // diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.h b/MdeModulePk= g/Bus/Ata/AtaAtapiPassThru/AhciMode.h index 809bcc307f..0ef749b4c7 100644 --- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.h +++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.h @@ -1,7 +1,7 @@ /** @file Header file for AHCI mode of ATA host controller. =20 - Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials =20 are licensed and made available under the terms and conditions of the BS= D License =20 which accompanies this distribution. The full text of the license may b= e found at =20 @@ -29,6 +29,10 @@ =20 #define EFI_AHCI_MAX_PORTS 32 =20 +#define AHCI_CAPABILITY2_OFFSET 0x0024 +#define AHCI_CAP2_SDS BIT3 +#define AHCI_CAP2_SADM BIT4 + typedef struct { UINT32 Lower32; UINT32 Upper32; @@ -182,7 +186,13 @@ typedef union { #define EFI_AHCI_PORT_SACT 0x0034 #define EFI_AHCI_PORT_CI 0x0038 #define EFI_AHCI_PORT_SNTF 0x003C - +#define AHCI_PORT_DEVSLP 0x0044 +#define AHCI_PORT_DEVSLP_ADSE BIT0 +#define AHCI_PORT_DEVSLP_DSP BIT1 +#define AHCI_PORT_DEVSLP_DETO_MASK 0x000003FC +#define AHCI_PORT_DEVSLP_MDAT_MASK 0x00007C00 +#define AHCI_PORT_DEVSLP_DITO_MASK 0x01FF8000 +#define AHCI_PORT_DEVSLP_DM_MASK 0x1E000000 =20 #pragma pack(1) // @@ -283,6 +293,15 @@ typedef struct { UINT8 AhciUnknownFisRsvd[0x60]; =20 } EFI_AHCI_RECEIVED_FIS;=20 =20 +typedef struct { + UINT8 Madt : 5; + UINT8 Reserved_5 : 3; + UINT8 Deto; + UINT16 Reserved_16; + UINT32 Reserved_32 : 31; + UINT32 Supported : 1; +} DEVSLP_TIMING_VARIABLES; + #pragma pack() =20 typedef struct { --=20 2.16.1.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel