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
/** @file
  Platform Info Driver.
 
  @copyright
  Copyright 1999 - 2021 Intel Corporation. <BR>
 
  SPDX-License-Identifier: BSD-2-Clause-Patent
**/
 
#ifndef _PLATFORM_INFO_INTERNAL_H_
#define _PLATFORM_INFO_INTERNAL_H_
 
#include <PiPei.h>
#include <Ppi/CpuIo.h>
#include <Ppi/Spi.h>
#include <Ppi/ReadOnlyVariable2.h>
#include <Library/IoLib.h>
#include <Library/PcdLib.h>
#include <Library/DebugLib.h>
#include <Library/HobLib.h>
#include <Library/PlatformHooksLib.h>
#include <Library/DebugLib.h>
#include <Library/BaseMemoryLib.h>
#include <Guid/SocketVariable.h>
#include <Guid/SetupVariable.h>
#include <Guid/PlatformInfo.h>
#include <IndustryStandard/Pci22.h>
#include <GpioPinsSklH.h>
#include <Library/GpioLib.h>
#include <Platform.h>
#include "SioRegs.h"
#include <Register/PchRegsSpi.h>
#include <PchAccess.h>
#include <Register/PchRegsLpc.h>
#include <Library/ReportStatusCodeLib.h>
#include <Register/Cpuid.h>
 
#define EFI_PLATFORMINFO_DRIVER_PRIVATE_SIGNATURE SIGNATURE_32 ('P', 'I', 'N', 'F')
 
//
// CPU Model
//
#define  INVALID_MODEL             0x0
 
#define R_SB_SPI_FDOC         0xB0
#define R_SB_SPI_FDOD         0xB4
#define SPI_OPCODE_READ_INDEX            4
#define PDR_REGION_START_OFFSET    0x0
 
typedef union BOARD_ID
{
   struct{
      UINT8  BoardID0            :1;
      UINT8  BoardID1            :1;
      UINT8  BoardID2            :1;
      UINT8  BoardID3            :1;
      UINT8  BoardID4            :1;
      UINT8  BoardRev0           :1;
      UINT8  BoardRev1           :1;
      UINT8  Rsvd                :1;
   }BoardID;
}BOARD_ID;
 
typedef union RISER_ID
{
   struct{
      UINT8  RiserID0            :1;
      UINT8  RiserID1            :1;
      UINT8  RiserID2            :1;
      UINT8  RiserID3            :1;
      UINT8  Rsvd                :4;
   }RiserID;
}RISER_ID;
 
 
 
EFI_STATUS
PdrGetPlatformInfo (
  IN CONST EFI_PEI_SERVICES     **PeiServices,
  OUT EFI_PLATFORM_INFO   *PlatformInfoHob
  );
 
EFI_STATUS
GPIOGetPlatformInfo (
  IN CONST EFI_PEI_SERVICES     **PeiServices,
  OUT EFI_PLATFORM_INFO   *PlatformInfoHob
);
 
#endif