Add Tper Reset Logic by using MOR bit.

Signed-off-by: Ouyang, Qian <Qian.Ouyang@intel.com>
Reviewed-by: Tian, Feng <feng.tian@intel.com>
             Dong, Guo <Guo.dong@intel.com>


git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13727 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
qianouyang
2012-09-12 10:19:50 +00:00
parent ad84df72c7
commit 90398d5558
3 changed files with 244 additions and 1 deletions

View File

@@ -20,6 +20,7 @@
#include <Uefi.h>
#include <Guid/MemoryOverwriteControl.h>
#include <Protocol/AtaPassThru.h>
#include <Protocol/BlockIo.h>
#include <Protocol/BlockIo2.h>
@@ -35,6 +36,7 @@
#include <Library/MemoryAllocationLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/DevicePathLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Library/TimerLib.h>
#include <IndustryStandard/Atapi.h>
@@ -82,6 +84,21 @@
#define ATA_SUB_TASK_SIGNATURE SIGNATURE_32 ('A', 'S', 'T', 'S')
#define IS_ALIGNED(addr, size) (((UINTN) (addr) & (size - 1)) == 0)
#define ROUNDUP512(x) (((x) % 512 == 0) ? (x) : ((x) / 512 + 1) * 512)
#define SECURITY_PROTOCOL_TCG 0x02
#define SECURITY_PROTOCOL_IEEE1667 0xEE
//
// ATA Supported Security Protocols List Description.
// Refer to ATA8-ACS Spec 7.57.6.2 Table 69.
//
typedef struct {
UINT8 Reserved1[6];
UINT8 SupportedSecurityListLength[2];
UINT8 SupportedSecurityProtocol[1];
} SUPPORTED_SECURITY_PROTOCOLS_PARAMETER_DATA;
//
// ATA bus data structure for ATA controller
//
@@ -1042,4 +1059,20 @@ AtaStorageSecuritySendData (
IN VOID *PayloadBuffer
);
/**
Send TPer Reset command to reset eDrive to lock all protected bands.
Typically, there are 2 mechanism for resetting eDrive. They are:
1. TPer Reset through IEEE 1667 protocol.
2. TPer Reset through native TCG protocol.
This routine will detect what protocol the attached eDrive comform to, TCG or
IEEE 1667 protocol. Then send out TPer Reset command separately.
@param[in] AtaDevice ATA_DEVICE pointer.
**/
VOID
InitiateTPerReset (
IN ATA_DEVICE *AtaDevice
);
#endif