OpenBIC
OpenSource Bridge-IC
plat_class.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) Meta Platforms, Inc. and affiliates.
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
16
17
#ifndef PLAT_CLASS_H
18
#define PLAT_CLASS_H
19
20
#include <stdbool.h>
21
#include <stdint.h>
22
23
/* ADC channel number */
24
enum
GT_COMPONENT_TYPE_ADC_CHANNEL
{
25
HSC_TYPE_ADC_CHANNEL
= 11,
26
VR_TYPE_ADC_CHANNEL
= 12,
27
POWER_IC_TYPE_ADC_CHANNEL
= 13,
28
};
29
30
typedef
enum
{
31
GT_STAGE_PO
= 0,
32
GT_STAGE_EVT
= 1,
33
GT_STAGE_EVT2
= 2,
34
GT_STAGE_DVT
= 3,
35
GT_STAGE_PVT
= 4,
36
GT_STAGE_PVT2_OP2
= 5,
37
GT_STAGE_PVT2_OP1
= 6,
38
GT_STAGE_PILOT
= 7,
39
GT_STAGE_MP
= 8,
40
}
GT_STAGE_REVISION_ID
;
41
42
typedef
enum
{
43
VR_UNKNOWN
,
44
VR_RNS_ISL69259
,
45
VR_INF_XDPE12284
,
46
VR_MPS_MPS2971
,
47
}
gt_vr_type_t
;
48
49
typedef
enum
{
50
POWER_IC_UNKNOWN
,
51
POWER_IC_ISL28022
,
52
POWER_IC_INA230
,
53
}
gt_power_monitor_ic_type_t
;
54
55
typedef
enum
{
56
HSC_UNKNOWN
,
57
HSC_MP5990
,
58
HSC_LTC4282
,
59
HSC_LTC4286
,
60
}
gt_hsc_type_t
;
61
62
enum
GT_FIRMWARE_COMPONENT
{
63
GT_COMPNT_VR0
,
64
GT_COMPNT_VR1
,
65
GT_COMPNT_BIC
,
66
GT_COMPNT_PEX0
,
67
GT_COMPNT_PEX1
,
68
GT_COMPNT_PEX2
,
69
GT_COMPNT_PEX3
,
70
GT_COMPNT_CPLD
,
71
GT_COMPNT_NIC0
,
72
GT_COMPNT_NIC1
,
73
GT_COMPNT_NIC2
,
74
GT_COMPNT_NIC3
,
75
GT_COMPNT_NIC4
,
76
GT_COMPNT_NIC5
,
77
GT_COMPNT_NIC6
,
78
GT_COMPNT_NIC7
,
79
GT_COMPNT_MAX
,
80
};
81
82
bool
get_adc_voltage
(
int
channel,
float
*voltage);
83
GT_STAGE_REVISION_ID
get_stage_by_rev_id
();
84
uint8_t
get_hsc_type
();
85
uint8_t
get_vr_type
();
86
uint8_t
get_power_moniter_ic_type
();
87
void
init_platform_config
();
88
89
#endif
VR_UNKNOWN
@ VR_UNKNOWN
Definition:
plat_class.h:95
init_platform_config
int init_platform_config()
Definition:
expansion_board.c:43
GT_STAGE_REVISION_ID
GT_STAGE_REVISION_ID
Definition:
plat_class.h:30
GT_STAGE_PVT2_OP1
@ GT_STAGE_PVT2_OP1
Definition:
plat_class.h:37
GT_STAGE_MP
@ GT_STAGE_MP
Definition:
plat_class.h:39
GT_STAGE_PVT
@ GT_STAGE_PVT
Definition:
plat_class.h:35
GT_STAGE_EVT2
@ GT_STAGE_EVT2
Definition:
plat_class.h:33
GT_STAGE_PVT2_OP2
@ GT_STAGE_PVT2_OP2
Definition:
plat_class.h:36
GT_STAGE_PO
@ GT_STAGE_PO
Definition:
plat_class.h:31
GT_STAGE_PILOT
@ GT_STAGE_PILOT
Definition:
plat_class.h:38
GT_STAGE_DVT
@ GT_STAGE_DVT
Definition:
plat_class.h:34
GT_STAGE_EVT
@ GT_STAGE_EVT
Definition:
plat_class.h:32
gt_hsc_type_t
gt_hsc_type_t
Definition:
plat_class.h:55
HSC_MP5990
@ HSC_MP5990
Definition:
plat_class.h:57
HSC_LTC4286
@ HSC_LTC4286
Definition:
plat_class.h:59
HSC_LTC4282
@ HSC_LTC4282
Definition:
plat_class.h:58
HSC_UNKNOWN
@ HSC_UNKNOWN
Definition:
plat_class.h:56
get_power_moniter_ic_type
uint8_t get_power_moniter_ic_type()
Definition:
plat_class.c:115
get_stage_by_rev_id
GT_STAGE_REVISION_ID get_stage_by_rev_id()
Definition:
plat_class.c:99
get_hsc_type
uint8_t get_hsc_type()
Definition:
plat_class.c:105
GT_FIRMWARE_COMPONENT
GT_FIRMWARE_COMPONENT
Definition:
plat_class.h:62
GT_COMPNT_PEX2
@ GT_COMPNT_PEX2
Definition:
plat_class.h:68
GT_COMPNT_VR1
@ GT_COMPNT_VR1
Definition:
plat_class.h:64
GT_COMPNT_CPLD
@ GT_COMPNT_CPLD
Definition:
plat_class.h:70
GT_COMPNT_NIC3
@ GT_COMPNT_NIC3
Definition:
plat_class.h:74
GT_COMPNT_NIC2
@ GT_COMPNT_NIC2
Definition:
plat_class.h:73
GT_COMPNT_NIC1
@ GT_COMPNT_NIC1
Definition:
plat_class.h:72
GT_COMPNT_PEX3
@ GT_COMPNT_PEX3
Definition:
plat_class.h:69
GT_COMPNT_NIC4
@ GT_COMPNT_NIC4
Definition:
plat_class.h:75
GT_COMPNT_NIC7
@ GT_COMPNT_NIC7
Definition:
plat_class.h:78
GT_COMPNT_NIC5
@ GT_COMPNT_NIC5
Definition:
plat_class.h:76
GT_COMPNT_MAX
@ GT_COMPNT_MAX
Definition:
plat_class.h:79
GT_COMPNT_PEX1
@ GT_COMPNT_PEX1
Definition:
plat_class.h:67
GT_COMPNT_VR0
@ GT_COMPNT_VR0
Definition:
plat_class.h:63
GT_COMPNT_BIC
@ GT_COMPNT_BIC
Definition:
plat_class.h:65
GT_COMPNT_NIC6
@ GT_COMPNT_NIC6
Definition:
plat_class.h:77
GT_COMPNT_PEX0
@ GT_COMPNT_PEX0
Definition:
plat_class.h:66
GT_COMPNT_NIC0
@ GT_COMPNT_NIC0
Definition:
plat_class.h:71
get_vr_type
uint8_t get_vr_type()
Definition:
plat_class.c:110
gt_vr_type_t
gt_vr_type_t
Definition:
plat_class.h:42
VR_INF_XDPE12284
@ VR_INF_XDPE12284
Definition:
plat_class.h:45
VR_RNS_ISL69259
@ VR_RNS_ISL69259
Definition:
plat_class.h:44
VR_MPS_MPS2971
@ VR_MPS_MPS2971
Definition:
plat_class.h:46
gt_power_monitor_ic_type_t
gt_power_monitor_ic_type_t
Definition:
plat_class.h:49
POWER_IC_ISL28022
@ POWER_IC_ISL28022
Definition:
plat_class.h:51
POWER_IC_INA230
@ POWER_IC_INA230
Definition:
plat_class.h:52
POWER_IC_UNKNOWN
@ POWER_IC_UNKNOWN
Definition:
plat_class.h:50
get_adc_voltage
bool get_adc_voltage(int channel, float *voltage)
Definition:
plat_class.c:58
GT_COMPONENT_TYPE_ADC_CHANNEL
GT_COMPONENT_TYPE_ADC_CHANNEL
Definition:
plat_class.h:24
POWER_IC_TYPE_ADC_CHANNEL
@ POWER_IC_TYPE_ADC_CHANNEL
Definition:
plat_class.h:27
VR_TYPE_ADC_CHANNEL
@ VR_TYPE_ADC_CHANNEL
Definition:
plat_class.h:26
HSC_TYPE_ADC_CHANNEL
@ HSC_TYPE_ADC_CHANNEL
Definition:
plat_class.h:25
meta-facebook
gt-cc
src
platform
plat_class.h
Generated by
1.9.2