]> git.proxmox.com Git - mirror_edk2.git/blob - SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordPei.h
SecurityPkg/OpalPassword: Remove HW init codes and consume SSC PPI
[mirror_edk2.git] / SecurityPkg / Tcg / Opal / OpalPassword / OpalPasswordPei.h
1 /** @file
2 Opal Password PEI driver which is used to unlock Opal Password for S3.
3
4 Copyright (c) 2016 - 2019, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 #ifndef _OPAL_PASSWORD_PEI_H_
16 #define _OPAL_PASSWORD_PEI_H_
17
18 #include <PiPei.h>
19
20 #include <Library/DebugLib.h>
21 #include <Library/IoLib.h>
22 #include <Library/PciLib.h>
23 #include <Library/BaseLib.h>
24 #include <Library/BaseMemoryLib.h>
25 #include <Library/MemoryAllocationLib.h>
26 #include <Library/PeimEntryPoint.h>
27 #include <Library/PeiServicesLib.h>
28 #include <Library/LockBoxLib.h>
29 #include <Library/TcgStorageOpalLib.h>
30 #include <Library/Tcg2PhysicalPresenceLib.h>
31 #include <Library/PeiServicesTablePointerLib.h>
32
33 #include <Protocol/StorageSecurityCommand.h>
34
35 #include <Ppi/IoMmu.h>
36 #include <Ppi/StorageSecurityCommand.h>
37
38 #include "OpalPasswordCommon.h"
39
40
41 //
42 // The generic command timeout value (unit in us) for Storage Security Command
43 // PPI ReceiveData/SendData services
44 //
45 #define SSC_PPI_GENERIC_TIMEOUT 30000000
46
47 #pragma pack(1)
48
49 #define OPAL_PEI_DEVICE_SIGNATURE SIGNATURE_32 ('o', 'p', 'd', 's')
50
51 typedef struct {
52 UINTN Signature;
53 EFI_STORAGE_SECURITY_COMMAND_PROTOCOL Sscp;
54 OPAL_DEVICE_LOCKBOX_DATA *Device;
55 VOID *Context;
56 EDKII_PEI_STORAGE_SECURITY_CMD_PPI *SscPpi;
57 UINTN DeviceIndex;
58 } OPAL_PEI_DEVICE;
59
60 #define OPAL_PEI_DEVICE_FROM_THIS(a) \
61 CR (a, OPAL_PEI_DEVICE, Sscp, OPAL_PEI_DEVICE_SIGNATURE)
62
63 #pragma pack()
64
65 #endif // _OPAL_PASSWORD_PEI_H_
66