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