summaryrefslogtreecommitdiff
path: root/Silicon/Intel/LewisburgPkg/Include/Protocol/PchReset.h
blob: d967de3b68b483dbc1381a46f8cc21285d1ffae0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/** @file

Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that accompanies this distribution.
The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php.

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.

**/

#ifndef _PCH_RESET_H_
#define _PCH_RESET_H_

#include <Ppi/PchReset.h>

#define EFI_CAPSULE_VARIABLE_NAME           L"CapsuleUpdateData"
extern EFI_GUID                             gEfiCapsuleVendorGuid;

//
// Extern the GUID for protocol users.
//
extern EFI_GUID                             gPchResetProtocolGuid;
extern EFI_GUID                             gPchResetCallbackProtocolGuid;
extern EFI_GUID                             gPchPowerCycleResetGuid;
extern EFI_GUID                             gPchGlobalResetGuid;
extern EFI_GUID                             gPchGlobalResetWithEcGuid;
//
// Forward reference for ANSI C compatibility
//
typedef struct _PCH_RESET_PROTOCOL     PCH_RESET_PROTOCOL;

typedef        PCH_RESET_CALLBACK_PPI  PCH_RESET_CALLBACK_PROTOCOL;

//
// Related Definitions
//
//
// PCH Platform Specific ResetData
//
#define PCH_POWER_CYCLE_RESET_GUID \
  { \
    0x8d8ee25b, 0x66dd, 0x4ed8, { 0x8a, 0xbd, 0x14, 0x16, 0xe8, 0x8e, 0x1d, 0x24 } \
  }
 
#define PCH_GLOBAL_RESET_GUID \
  { \
    0x9db31b4c, 0xf5ef, 0x48bb, { 0x94, 0x2b, 0x18, 0x1f, 0x7e, 0x3a, 0x3e, 0x40 } \
  }
  
#define PCH_GLOBAL_RESET_WITH_EC_GUID \
  { \
    0xd22e6b72, 0x53cd, 0x4158, { 0x83, 0x3f, 0x6f, 0xd8, 0x7e, 0xbe, 0xa9, 0x93 } \
  }

#define PCH_PLATFORM_SPECIFIC_RESET_STRING L"PCH_RESET"
#define PCH_RESET_DATA_STRING_MAX_LENGTH   sizeof (PCH_PLATFORM_SPECIFIC_RESET_STRING)

typedef struct _RESET_DATA {
  CHAR16   Description[PCH_RESET_DATA_STRING_MAX_LENGTH];
  EFI_GUID Guid;
} PCH_RESET_DATA;


//
// Member functions
//
/**
  Execute Pch Reset from the host controller.

  @param[in] This                 Pointer to the PCH_RESET_PROTOCOL instance.
  @param[in] ResetType            UEFI defined reset type.
  @param[in] DataSize             The size of ResetData in bytes.
  @param[in] ResetData            Optional element used to introduce a platform specific reset.
                                  The exact type of the reset is defined by the EFI_GUID that follows
                                  the Null-terminated Unicode string.

  @retval EFI_SUCCESS             Successfully completed.
  @retval EFI_INVALID_PARAMETER   If ResetType is invalid.
**/
typedef
EFI_STATUS
(EFIAPI *PCH_RESET) (
  IN PCH_RESET_PROTOCOL *This,
  IN PCH_RESET_TYPE     ResetType,
  IN UINTN              DataSize,
  IN VOID               *ResetData OPTIONAL
  );

/**
  Retrieve PCH platform specific ResetData

  @param[in]  Guid      PCH platform specific reset GUID.
  @param[out] DataSize  The size of ResetData in bytes.

  @retval ResetData     A platform specific reset that the exact type of 
                        the reset is defined by the EFI_GUID that follows
                        the Null-terminated Unicode string.
  @retval NULL          If Guid is not defined in PCH platform specific reset.
**/
typedef
VOID *
(EFIAPI *PCH_RESET_GET_RESET_DATA) (
  IN  EFI_GUID  *Guid,
  OUT UINTN     *DataSize
  );

/**
  Interface structure to execute Pch Reset from the host controller.
**/
struct _PCH_RESET_PROTOCOL {
  PCH_RESET                Reset;
  PCH_RESET_GET_RESET_DATA GetResetData;
};

#endif