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
#define SYS_CLASS_1 1
24
#define SYS_CLASS_2 2
25
#define NUMBER_OF_ADC_CHANNEL 16
26
#define AST1030_ADC_BASE_ADDR 0x7e6e9000
27
28
#define I3C_BUS4 3
29
30
enum
BIC_BOARD_REVISION
{
31
SYS_BOARD_POC
= 0x0,
32
SYS_BOARD_EVT
,
33
// ID 02h is reserved
34
SYS_BOARD_DVT
= 0x03,
35
// ID 04h is reserved
36
SYS_BOARD_PVT
= 0x05,
37
SYS_BOARD_MP
,
38
};
39
40
typedef
struct
_CARD_STATUS_
{
41
bool
present
;
42
uint8_t
card_type
;
43
}
CARD_STATUS
;
44
45
enum
_1OU_CARD_TYPE_
{
46
TYPE_1OU_SI_TEST_CARD
= 0x0,
47
TYPE_1OU_EXP_WITH_6_M2
,
48
TYPE_1OU_RAINBOW_FALLS
,
49
TYPE_1OU_VERNAL_FALLS_WITH_TI
,
// TI BIC
50
TYPE_1OU_VERNAL_FALLS_WITH_AST
,
// AST1030 BIC
51
TYPE_1OU_KAHUNA_FALLS
,
52
TYPE_1OU_WAIMANO_FALLS
,
53
TYPE_1OU_EXP_WITH_NIC
,
54
TYPE_1OU_OLMSTED_POINT
,
55
TYPE_1OU_NIAGARA_FALLS
= 0x09,
56
TYPE_1OU_EXP_WITH_E1S
,
57
TYPE_1OU_ABSENT
= 0xFE,
58
TYPE_1OU_UNKNOWN
= 0xFF,
59
};
60
61
enum
_2OU_CARD_TYPE_
{
62
TYPE_2OU_DPV2_8
= 0x07,
// DPV2x8
63
TYPE_2OU_DPV2_16
= 0x70,
// DPV2x16
64
TYPE_2OU_ABSENT
= 0xFE,
65
TYPE_2OU_UNKNOWN
= 0xFF,
66
};
67
68
enum
HSC_MODULE
{
69
HSC_MODULE_ADM1278
= 0b00,
70
HSC_MODULE_MP5990
= 0b01,
71
HSC_MODULE_UNKNOWN
,
72
};
73
74
enum
I3C_HUB_TYPE
{
75
I3C_HUB_TYPE_RNS
,
76
I3C_HUB_TYPE_NXP
,
77
I3C_HUB_TYPE_UNKNOWN
,
78
};
79
80
/* ADC channel number */
81
enum
ADC_CHANNEL
{
82
CHANNEL_6
= 6,
83
CHANNEL_7
= 7,
84
};
85
86
uint8_t
get_system_class
();
87
CARD_STATUS
get_1ou_status
();
88
CARD_STATUS
get_2ou_status
();
89
uint8_t
get_hsc_module
();
90
bool
get_adc_voltage
(
int
channel,
float
*voltage);
91
uint8_t
get_board_revision
();
92
void
init_platform_config
();
93
uint16_t
get_i3c_hub_type
();
94
uint16_t
get_exp_i3c_hub_type
();
95
void
init_i3c_hub_type
();
96
97
#endif
get_hsc_module
uint8_t get_hsc_module()
Definition:
plat_class.c:30
HSC_MODULE
HSC_MODULE
Definition:
plat_class.h:23
HSC_MODULE_UNKNOWN
@ HSC_MODULE_UNKNOWN
Definition:
plat_class.h:26
get_board_revision
uint8_t get_board_revision()
Definition:
plat_class.c:431
init_platform_config
int init_platform_config()
Definition:
expansion_board.c:43
get_adc_voltage
bool get_adc_voltage(int channel, float *voltage)
Definition:
plat_class.c:58
I3C_HUB_TYPE
I3C_HUB_TYPE
Definition:
plat_class.h:50
I3C_HUB_TYPE_RNS
@ I3C_HUB_TYPE_RNS
Definition:
plat_class.h:51
I3C_HUB_TYPE_UNKNOWN
@ I3C_HUB_TYPE_UNKNOWN
Definition:
plat_class.h:53
I3C_HUB_TYPE_NXP
@ I3C_HUB_TYPE_NXP
Definition:
plat_class.h:52
get_i3c_hub_type
uint16_t get_i3c_hub_type()
Definition:
plat_class.c:51
init_i3c_hub_type
void init_i3c_hub_type()
Definition:
plat_class.c:180
_CARD_STATUS_
Definition:
plat_class.h:33
_CARD_STATUS_::card_type
uint8_t card_type
Definition:
plat_class.h:35
_CARD_STATUS_::present
bool present
Definition:
plat_class.h:34
get_system_class
uint8_t get_system_class()
Definition:
util_sys.c:146
ADC_CHANNEL
ADC_CHANNEL
Definition:
plat_class.c:80
CARD_STATUS
struct _CARD_STATUS_ CARD_STATUS
get_1ou_status
CARD_STATUS get_1ou_status()
Definition:
plat_class.c:137
get_2ou_status
CARD_STATUS get_2ou_status()
Definition:
plat_class.c:142
_1OU_CARD_TYPE_
_1OU_CARD_TYPE_
Definition:
plat_class.h:38
TYPE_1OU_EXP_WITH_6_M2
@ TYPE_1OU_EXP_WITH_6_M2
Definition:
plat_class.h:40
TYPE_1OU_RAINBOW_FALLS
@ TYPE_1OU_RAINBOW_FALLS
Definition:
plat_class.h:41
TYPE_1OU_EXP_WITH_NIC
@ TYPE_1OU_EXP_WITH_NIC
Definition:
plat_class.h:44
TYPE_1OU_VERNAL_FALLS_WITH_AST
@ TYPE_1OU_VERNAL_FALLS_WITH_AST
Definition:
plat_class.h:43
TYPE_1OU_SI_TEST_CARD
@ TYPE_1OU_SI_TEST_CARD
Definition:
plat_class.h:39
TYPE_1OU_ABSENT
@ TYPE_1OU_ABSENT
Definition:
plat_class.h:45
TYPE_1OU_VERNAL_FALLS_WITH_TI
@ TYPE_1OU_VERNAL_FALLS_WITH_TI
Definition:
plat_class.h:42
TYPE_1OU_UNKNOWN
@ TYPE_1OU_UNKNOWN
Definition:
plat_class.h:46
HSC_MODULE_ADM1278
@ HSC_MODULE_ADM1278
Definition:
plat_class.h:58
HSC_MODULE_MP5990
@ HSC_MODULE_MP5990
Definition:
plat_class.h:60
_2OU_CARD_TYPE_
_2OU_CARD_TYPE_
Definition:
plat_class.h:49
TYPE_2OU_ABSENT
@ TYPE_2OU_ABSENT
Definition:
plat_class.h:53
TYPE_2OU_UNKNOWN
@ TYPE_2OU_UNKNOWN
Definition:
plat_class.h:54
TYPE_1OU_WAIMANO_FALLS
@ TYPE_1OU_WAIMANO_FALLS
Definition:
plat_class.h:67
TYPE_1OU_KAHUNA_FALLS
@ TYPE_1OU_KAHUNA_FALLS
Definition:
plat_class.h:66
TYPE_2OU_DPV2_8
@ TYPE_2OU_DPV2_8
Definition:
plat_class.h:74
TYPE_2OU_DPV2_16
@ TYPE_2OU_DPV2_16
Definition:
plat_class.h:75
CHANNEL_7
@ CHANNEL_7
Definition:
plat_class.h:83
CHANNEL_6
@ CHANNEL_6
Definition:
plat_class.h:82
BIC_BOARD_REVISION
BIC_BOARD_REVISION
Definition:
plat_class.h:39
SYS_BOARD_POC
@ SYS_BOARD_POC
Definition:
plat_class.h:40
SYS_BOARD_EVT
@ SYS_BOARD_EVT
Definition:
plat_class.h:41
get_exp_i3c_hub_type
uint16_t get_exp_i3c_hub_type()
Definition:
plat_class.c:73
TYPE_1OU_EXP_WITH_E1S
@ TYPE_1OU_EXP_WITH_E1S
Definition:
plat_class.h:56
TYPE_1OU_NIAGARA_FALLS
@ TYPE_1OU_NIAGARA_FALLS
Definition:
plat_class.h:55
TYPE_1OU_OLMSTED_POINT
@ TYPE_1OU_OLMSTED_POINT
Definition:
plat_class.h:54
SYS_BOARD_PVT
@ SYS_BOARD_PVT
Definition:
plat_class.h:36
SYS_BOARD_MP
@ SYS_BOARD_MP
Definition:
plat_class.h:37
SYS_BOARD_DVT
@ SYS_BOARD_DVT
Definition:
plat_class.h:34
meta-facebook
yv35-gl
src
platform
plat_class.h
Generated by
1.9.2