From 90398d5558431b733a97ba7e3a2fddcd5f0858f5 Mon Sep 17 00:00:00 2001 From: qianouyang Date: Wed, 12 Sep 2012 10:19:50 +0000 Subject: Add Tper Reset Logic by using MOR bit. Signed-off-by: Ouyang, Qian Reviewed-by: Tian, Feng Dong, Guo git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13727 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.h') diff --git a/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.h b/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.h index b64a3d3928..d6b0ff8f08 100644 --- a/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.h +++ b/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.h @@ -20,6 +20,7 @@ #include +#include #include #include #include @@ -35,6 +36,7 @@ #include #include #include +#include #include #include @@ -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 -- cgit v1.2.3