]> git.proxmox.com Git - mirror_edk2.git/blame - Vlv2DeviceRefCodePkg/ValleyView2Soc/SouthCluster/Include/Protocol/PchS3Support.h
Vlv2DeviceRefCodePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / Vlv2DeviceRefCodePkg / ValleyView2Soc / SouthCluster / Include / Protocol / PchS3Support.h
CommitLineData
3cbfba02
DW
1/**\r
2**/\r
3/**\r
4\r
5Copyright (c) 2012 - 2014, Intel Corporation. All rights reserved\r
6\r
7ede8060 7 SPDX-License-Identifier: BSD-2-Clause-Patent\r
3cbfba02
DW
8\r
9\r
10\r
11 @file\r
12 PchS3Support.h\r
13\r
14 @brief\r
15 This file defines the PCH S3 support Protocol.\r
16\r
17**/\r
18#ifndef _PCH_S3_SUPPORT_PROTOCOL_H_\r
19#define _PCH_S3_SUPPORT_PROTOCOL_H_\r
20\r
21#ifndef ECP_FLAG\r
22#include <Pi/PiS3BootScript.h>\r
23#endif\r
24\r
25#define EFI_PCH_S3_SUPPORT_PROTOCOL_GUID \\r
26 { \\r
27 0xe287d20b, 0xd897, 0x4e1e, 0xa5, 0xd9, 0x97, 0x77, 0x63, 0x93, 0x6a, 0x4 \\r
28 }\r
29\r
30#include <Protocol/PchPlatformPolicy.h>\r
31\r
32///\r
33/// Extern the GUID for protocol users.\r
34///\r
35extern EFI_GUID gEfiPchS3SupportProtocolGuid;\r
36\r
37///\r
38/// Forward reference for ANSI C compatibility\r
39///\r
40typedef struct _EFI_PCH_S3_SUPPORT_PROTOCOL EFI_PCH_S3_SUPPORT_PROTOCOL;\r
41\r
42typedef enum {\r
43 PchS3ItemTypeSendCodecCommand,\r
44 PchS3ItemTypePollStatus,\r
45 PchS3ItemTypeInitPcieRootPortDownstream,\r
46 PchS3ItemTypePcieSetPm,\r
47 PchS3ItemTypePmTimerStall,\r
48 PchS3ItemTypeMax\r
49} EFI_PCH_S3_DISPATCH_ITEM_TYPE;\r
50\r
51///\r
52/// It's better not to use pointer here because the size of pointer in DXE is 8, but it's 4 in PEI\r
53/// plug 4 to ParameterSize in PEIM if you really need it\r
54///\r
55typedef struct {\r
56 UINT32 HdaBar;\r
57 UINT32 CodecCmdData;\r
58} EFI_PCH_S3_PARAMETER_SEND_CODEC_COMMAND;\r
59\r
60typedef struct {\r
61 UINT64 MmioAddress;\r
62 EFI_BOOT_SCRIPT_WIDTH Width;\r
63 UINT64 Mask;\r
64 UINT64 Value;\r
65 UINT32 Timeout; // us\r
66} EFI_PCH_S3_PARAMETER_POLL_STATUS;\r
67\r
68typedef struct {\r
69 UINT8 RootPortBus;\r
70 UINT8 RootPortDevice;\r
71 UINT8 RootPortFunc;\r
72 UINT8 TempBusNumberMin;\r
73 UINT8 TempBusNumberMax;\r
74} EFI_PCH_S3_PARAMETER_INIT_PCIE_ROOT_PORT_DOWNSTREAM;\r
75\r
76typedef struct {\r
77 UINT8 RootPortBus;\r
78 UINT8 RootPortDevice;\r
79 UINT8 RootPortFunc;\r
80 PCH_PCI_EXPRESS_ASPM_CONTROL RootPortAspm;\r
81 UINT8 NumOfDevAspmOverride;\r
82 UINT32 DevAspmOverrideAddr;\r
83 UINT8 TempBusNumberMin;\r
84 UINT8 TempBusNumberMax;\r
85 UINT8 NumOfDevLtrOverride;\r
86 UINT32 DevLtrOverrideAddr;\r
87} EFI_PCH_S3_PARAMETER_PCIE_SET_PM;\r
88\r
89typedef struct {\r
90 UINT32 DelayTime; // us\r
91} EFI_PCH_S3_PARAMETER_PM_TIMER_STALL;\r
92\r
93typedef struct {\r
94 EFI_PCH_S3_DISPATCH_ITEM_TYPE Type;\r
95 VOID *Parameter;\r
96} EFI_PCH_S3_DISPATCH_ITEM;\r
97\r
98///\r
99/// Member functions\r
100///\r
101typedef\r
102EFI_STATUS\r
103(EFIAPI *EFI_PCH_S3_SUPPORT_SET_S3_DISPATCH_ITEM) (\r
104 IN EFI_PCH_S3_SUPPORT_PROTOCOL * This,\r
105 IN EFI_PCH_S3_DISPATCH_ITEM * DispatchItem,\r
106 OUT EFI_PHYSICAL_ADDRESS * S3DispatchEntryPoint\r
107 );\r
108\r
109/**\r
110\r
111 @brief\r
112 Set an item to be dispatched at S3 resume time. At the same time, the entry point\r
113 of the PCH S3 support image is returned to be used in subsequent boot script save\r
114 call\r
115\r
116 @param[in] This Pointer to the protocol instance.\r
117 @param[in] DispatchItem The item to be dispatched.\r
118 @param[in] S3DispatchEntryPoint The entry point of the PCH S3 support image.\r
119\r
120 @retval EFI_STATUS Successfully completed.\r
121 @retval EFI_OUT_OF_RESOURCES Out of resources.\r
122\r
123**/\r
124\r
125///\r
126/// Protocol definition\r
127///\r
128struct _EFI_PCH_S3_SUPPORT_PROTOCOL {\r
129 EFI_PCH_S3_SUPPORT_SET_S3_DISPATCH_ITEM SetDispatchItem;\r
130};\r
131\r
132#endif\r