summaryrefslogtreecommitdiff
path: root/ReferenceCode/Chipset/LynxPoint/Ppi/PchInit/PchInit.h
blob: 9021a286f3c8ebb5c7e5c08a5b1c82684cfe5064 (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
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
/** @file
  This file defines the PCH Init PPI

@copyright
  Copyright (c) 2006 - 2012 Intel Corporation. All rights reserved
  This software and associated documentation (if any) is furnished
  under a license and may only be used or copied in accordance
  with the terms of the license. Except as permitted by such
  license, no part of this software or documentation may be
  reproduced, stored in a retrieval system, or transmitted in any
  form or by any means without the express written consent of
  Intel Corporation.

  This file contains a 'Sample Driver' and is licensed as such
  under the terms of your license agreement with Intel or your
  vendor.  This file may be modified by the user, subject to
  the additional terms of the license agreement
**/
#ifndef _PCH_INIT_H_
#define _PCH_INIT_H_

///
/// Define the PCH Init PPI GUID
///
///
/// EDK and EDKII have different GUID formats
///
#if !defined(EDK_RELEASE_VERSION) || (EDK_RELEASE_VERSION < 0x00020000)
#define PCH_INIT_PPI_GUID \
  { \
    0x908c7f8b, 0x5c48, 0x47fb, 0x83, 0x57, 0xf5, 0xfd, 0x4e, 0x23, 0x52, 0x76 \
  }
#else
#define PCH_INIT_PPI_GUID \
  { \
    0x908c7f8b, 0x5c48, 0x47fb, \
    { \
      0x83, 0x57, 0xf5, 0xfd, 0x4e, 0x23, 0x52, 0x76 \
    } \
  }
#endif
//
// Extern the GUID for PPI users.
//
extern EFI_GUID               gPchInitPpiGuid;

//
// Forward reference for ANSI C compatibility
//
typedef struct _PCH_INIT_PPI  PCH_INIT_PPI;

//
// Data structure definitions
//
typedef enum _CPU_STRAP_OPERATION
{
  GetCpuStrapSetData,
  SetCpuStrapSetData,
  LockCpuStrapSetData
} CPU_STRAP_OPERATION;

/**
  The function performing USB init in PEI phase. This could be used by USB recovery
  or debug features that need USB initialization during PEI phase.
  Note: Before executing this function, please be sure that PCH_INIT_PPI.Initialize
  has been done and PchUsbPolicyPpi has been installed.

  @param[in] PeiServices    General purpose services available to every PEIM

  @retval EFI_SUCCESS       The function completed successfully
  @retval Others            All other error conditions encountered result in an ASSERT.
**/
typedef
EFI_STATUS
(EFIAPI *PCH_USB_INIT) (
  IN  EFI_PEI_SERVICES            **PeiServices
  );

/**
  The function performing TC/VC mapping program, and poll all PCH Virtual Channel
  until negotiation completion

  @param[in] PeiServices          General purpose services available to every PEIM.

  @retval EFI_SUCCESS             The function completed successfully
  @retval Others                  All other error conditions encountered result in an ASSERT.
**/
typedef
EFI_STATUS
(EFIAPI *PCH_DMI_TCVC_PROGPOLL) (
  IN  EFI_PEI_SERVICES            **PeiServices
  );

/**
  The function set the Target Link Speed in PCH to DMI GEN 2.

  @param[in] PeiServices          General purpose services available to every PEIM.

  @retval None
**/
typedef
VOID
(EFIAPI *PCH_DMI_GEN2_PROG) (
  IN  EFI_PEI_SERVICES            **PeiServices
  );

/**
  The function is used while doing CPU Only Reset, where PCH may be required
  to initialize strap data before soft reset.

  @param[in] PeiServices          General purpose services available to every PEIM
  @param[in] Operation            Get/Set Cpu Strap Set Data
  @param[in] CpuStrapSet          Cpu Strap Set Data

  @retval EFI_SUCCESS             The function completed successfully.
  @exception EFI_UNSUPPORTED      The function is not supported.
**/
typedef
EFI_STATUS
(EFIAPI *PCH_CPU_STRAP_SET) (
  IN      EFI_PEI_SERVICES            **PeiServices,
  IN      CPU_STRAP_OPERATION         Operation,
  IN OUT  UINT16                      *CpuStrapSet
  );

///
/// PCH_INIT_PPI Structure Definition
///
struct _PCH_INIT_PPI {
  ///
  /// The function performs USB init in PEI phase. This could be used by USB recovery
  /// or debug function that USB initialization needs to be done in PEI phase.
  /// Note: Before executing this function, please be sure that PCH_PLATFORM_POLICY_PPI
  /// and PCH_USB_POLICY_PPI have been installed.
  ///
  PCH_USB_INIT          UsbInit;
  ///
  /// The function performing TC/VC mapping program, and poll all PCH Virtual Channel
  /// until negotiation completion.
  ///
  PCH_DMI_TCVC_PROGPOLL DmiTcVcProgPoll;
  ///
  ///  The function changes the PCH target link speed to DMI Gen 2
  ///
  PCH_DMI_GEN2_PROG     DmiGen2Prog;
  ///
  /// The function provides a way to initialize PCH strap data before soft reset
  /// while doing CPU Only Reset
  ///
  PCH_CPU_STRAP_SET     CpuStrapSet;
};

#endif