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
/** @file
 *
 *  PEP device defines
 *
 *  Copyright (c) 2019, ARM Ltd. All rights reserved.
 *  Copyright (c) 2018, Andrei Warkentin <andrey.warkentin@gmail.com>
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *
 *  SPDX-License-Identifier: BSD-2-Clause-Patent
 *
 **/
 
/*
 * Note: Not everything is here. At least SOC_STATE_TYPE is missing.
 */
 
#ifndef _RPI_PEP_H_INCLUDED_
#define _RPI_PEP_H_INCLUDED_
 
#include <IndustryStandard/Acpi.h>
 
#define PEP_MAX_DEPENDENCIES_PER_STATE 16
#define MAX_PROCESSOR_PATH_LENGTH 16
#define MAX_DEVICE_PATH_LENGTH 32
#define MAX_COMPONENT_COUNT 8
#define P_NUMBER_PROCESSORS 1
#define P_NUMBER_IDLE_STATES 1
#define P_NUMBER_PERF_STATES 0
#define P_NUMBER_DEVICES 1
#define P_NUMBER_COORDINATED_STATS 1
 
typedef struct _PEP_PROCESSOR_IDLE_STATE_INFO {
  UINT32 Ulong;
  UINT32 Latency;
  UINT32 BreakEvenDuration;
} PEP_PROCESSOR_IDLE_STATE_INFO, *PEP_PROCESSOR_IDLE_STATE_INFO;
 
typedef struct _PEP_PROCESSOR_IDLE_INFO_PLAT {
  //
  // Processor idle states.
  //
  PEP_PROCESSOR_IDLE_STATE_INFO IdleStates[P_NUMBER_IDLE_STATES];
} PEP_PROCESSOR_IDLE_INFO_PLAT, *PPEP_PROCESSOR_IDLE_INFO_PLAT;
 
typedef struct COORDINATED_DEPENDENCY_INFO {
  UINT32 ExpectedState;
  UINT32 TargetProcessor;
  UINT32 Ulong;
} COORDINATED_DEPENDENCY_INFO, *PCOORDINATED_DEPENDENCY_INFO;
 
typedef struct {
  COORDINATED_DEPENDENCY_INFO DependencyInfo[PEP_MAX_DEPENDENCIES_PER_STATE];
  UINT32 StateType;
  UINT32 Ulong;
  UINT32 Latency;
  UINT32 BreakEvenDuration;
  UINT32 DependencyCount;
  UINT32 MaximumDependencySize;
} COORDINATED_STATE_INFO;
 
typedef struct {
  UINT32 Unused;
} PEP_PROCESSOR_PERF_INFO;
 
typedef struct {
  UINT32 FState[MAX_COMPONENT_COUNT];
} COORDINATED_FSTATE_REQUIREMENT;
 
typedef struct {
  UINT32 DState;
} COORDINATED_DSTATE_REQUIREMENT;
 
//
// Top level device table
// *N.B. The exact length of the structure is determined by the NumberIdleStates/NumberPerfStates variables.
//
 
typedef struct _PEP_PROCESSOR_INFO_PLAT {
  WCHAR DevicePath[MAX_PROCESSOR_PATH_LENGTH]; // Null-terminated ACPI name
  ULONG FeedbackCounterCount;
  ULONG Flags;
 
  //
  // We are putting the idle/perf state count here (instead
  // of the PEP_PROCESSOR_xxx_INFO structure for the ease of parsing.
  //
  ULONG NumberIdleStates;
  ULONG NumberPerfStates;
 
  PEP_PROCESSOR_IDLE_INFO_PLAT IdleInfo;
  PEP_PROCESSOR_PERF_INFO PerfInfo;
} PEP_PROCESSOR_INFO_PLAT, *PPEP_PROCESSOR_INFO_PLAT;
 
typedef struct _PEP_PROCESSOR_TABLE_PLAT {
  UINT32 Version;
  UINT32 NumberProcessors;
  PEP_PROCESSOR_INFO_PLAT ProcessorInfo[P_NUMBER_PROCESSORS];
} PEP_PROCESSOR_TABLE_PLAT;
 
typedef struct _PEP_COORDINATED_STATE_TABLE_PLAT {
  ULONG Version;
  ULONG CoordinatedStateCount;
  COORDINATED_STATE_INFO CoordinatedStates[P_NUMBER_COORDINATED_STATS];
} PEP_COORDINATED_STATE_TABLE_PLAT, *PPEP_COORDINATED_STATE_TABLE_PLAT;
 
typedef struct _PEP_DEVICE_INFO_PLAT {
  WCHAR DevicePath[MAX_DEVICE_PATH_LENGTH]; // Null-terminated ACPI name
  ULONG DStateSupportMask;
  ULONG NumberComponents;
 
  COORDINATED_DSTATE_REQUIREMENT DStateRequirement[P_NUMBER_COORDINATED_STATS];
  COORDINATED_FSTATE_REQUIREMENT FStateRequirement[P_NUMBER_COORDINATED_STATS];
} PEP_DEVICE_INFO_PLAT, *PPEP_DEVICE_INFO_PLAT;
 
typedef struct _PEP_DEVICE_TABLE_PLAT {
  ULONG Version;
  ULONG NumberDevices;
  PEP_DEVICE_INFO_PLAT DeviceInfo[P_NUMBER_DEVICES];
} PEP_DEVICE_TABLE_PLAT, *PPEP_DEVICE_TABLE_PLAT;
 
#endif // _RPI_PEP_H_INCLUDED_