hc
2024-03-22 a0752693d998599af469473b8dc239ef973a012f
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
/** @file
 
  @copyright
  Copyright 2013 - 2021 Intel Corporation. <BR>
 
  SPDX-License-Identifier: BSD-2-Clause-Patent
**/
 
#include "PeiCommonBoardInitLib.h"
#include <GpioPinsSklH.h>
#include <Library/GpioLib.h>
#include <Library/UbaGpioPlatformConfig.h>
#include <Library/PchInfoLib.h>
#include <Ppi/DynamicSiLibraryPpi.h>
 
STATIC PLATFORM_GPIO_CONFIG_TABLE mGpioPlatformConfig = {
 
  PLATFORM_GPIO_CONFIG_SIGNATURE,
  PLATFORM_GPIO_CONFIG_VERSION,
 
  //MFG pad
  {
    GPIO_SKL_H_GPP_C9, //To be verified with the Board schematics
    {GpioPadModeGpio, GpioHostOwnGpio, GpioDirIn, GpioOutDefault, GpioIntDis, GpioPlatformReset, GpioTermNone}
  },
 
  GPIO_SKL_H_GPP_A18,
 
  //Recovery jumper pad
  GPIO_SKL_H_GPP_B14,
 
  //FM ADR Trigger
  GPIO_SKL_H_GPP_E3,
 
  //ADR enable GPIO output
  GPIO_SKL_H_GPP_D4,
 
  // Force to S1 config mode pad
  GPIO_SKL_H_GPP_A17,
 
  //
  // Used by PC Platforms
  //
  GPIO_SKL_H_GPP_B3,
  //
  // Used by PC platforms. This is the first GPIO pad of the pad series to indicate Board ID
  //
  GPIO_SKL_H_GPP_G12,
 
  //
  // WHEA SCI generation pad
  //
  GPIO_SKL_H_GPP_A12,
 
  //
  // Used to generate CPU HP SMI
  //
  GPIO_SKL_H_GPP_E6,
 
  //
  // FPGA error indicator
  //
  GPIO_SKL_H_GPP_E4,
 
  //
  // FPGA error indicator
  //
  GPIO_SKL_H_GPP_E5,
 
  // Flash Security
  UNUSED_GPIO,
};
 
STATIC PLATFORM_GPIO_CONFIG_TABLE mGpioMiniPchPlatformConfig = {
 
  PLATFORM_GPIO_CONFIG_SIGNATURE,
  PLATFORM_GPIO_CONFIG_VERSION,
 
  //MFG pad
  {
    UNUSED_GPIO, //To be verified with the Board schematics
    {0, 0, 0, 0, 0, 0, 0}
  },
 
  UNUSED_GPIO,
 
  //Recovery jumper pad
  UNUSED_GPIO,
 
  //FM ADR Trigger
  UNUSED_GPIO,
 
  //ADR enable GPIO output
  UNUSED_GPIO,
 
  // Force to S1 config mode pad
  UNUSED_GPIO,
 
  //
  // Used by PC Platforms
  //
  UNUSED_GPIO,
  //
  // Used by PC platforms. This is the first GPIO pad of the pad series to indicate Board ID
  //
  UNUSED_GPIO,
 
  //
  // WHEA SCI generation pad
  //
  UNUSED_GPIO,
 
  //
  // Used to generate CPU HP SMI
  //
  UNUSED_GPIO,
 
  //
  // FPGA error indicator
  //
  UNUSED_GPIO,
 
  //
  // FPGA error indicator
  //
  UNUSED_GPIO,
 
};
 
 
EFI_STATUS
InstallGpioPlatformData (
  IN UBA_CONFIG_DATABASE_PPI    *UbaConfigPpi
)
{
  EFI_STATUS                  Status;
  DYNAMIC_SI_LIBARY_PPI       *DynamicSiLibraryPpi = NULL;
 
 
  Status = PeiServicesLocatePpi (&gDynamicSiLibraryPpiGuid, 0, NULL, &DynamicSiLibraryPpi);
  if (EFI_ERROR (Status)) {
    ASSERT_EFI_ERROR (Status);
    return Status;
  }
 
  if (DynamicSiLibraryPpi->GetPchSeries () == PchMini) {
    return UbaConfigPpi->AddData (
                                 UbaConfigPpi,
                                 &gPlatformGpioPlatformConfigDataGuid,
                                 &mGpioMiniPchPlatformConfig,
                                 sizeof(mGpioMiniPchPlatformConfig)
                                 );
  }
 
  Status = UbaConfigPpi->AddData (
                                 UbaConfigPpi,
                                 &gPlatformGpioPlatformConfigDataGuid,
                                 &mGpioPlatformConfig,
                                 sizeof(mGpioPlatformConfig)
                                 );
  ASSERT_EFI_ERROR (Status);
 
  return Status;
}