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
26#define CPLD_CLASS_TYPE_REG 0x05
27#define CPLD_2OU_EXPANSION_CARD_REG 0x06
28#define CPLD_BOARD_REV_ID_REG 0x08
29#define CPLD_1OU_CARD_DETECTION 0x09
30#define CPLD_1OU_VPP_POWER_STATUS 0x11
31#define I2C_DATA_SIZE 5
32#define NUMBER_OF_ADC_CHANNEL 16
33#define AST1030_ADC_BASE_ADDR 0x7e6e9000
34#define HSC_TYPE_ADC_TOLERANCE 0.2 // V
35
36#define MAX_1OU_M2_COUNT 4
37
47};
48
49typedef struct _CARD_STATUS_ {
50 bool present;
51 uint8_t card_type;
53
65};
66
68 TYPE_2OU_DPV2_8 = 0x07, // DPV2x8
69 TYPE_2OU_DPV2_16 = 0x70, // DPV2x16
72};
73
74/* ADC channel number */
78};
79
84};
85
90};
91
96};
97
101};
102
113};
114
115uint8_t get_system_class();
118uint8_t get_board_revision();
119uint8_t get_hsc_module();
120uint8_t get_retimer_module();
121void set_retimer_module(uint8_t module);
122uint8_t get_oth_module();
123bool get_adc_voltage(int channel, float *voltage);
124void init_hsc_module(uint8_t board_revision);
126
127#endif
uint8_t get_hsc_module()
Definition: plat_class.c:30
HSC_MODULE
Definition: plat_class.h:23
@ HSC_MODULE_UNKNOWN
Definition: plat_class.h:26
uint8_t get_board_revision()
Definition: plat_class.c:431
int init_platform_config()
Definition: expansion_board.c:43
uint8_t board_revision
Definition: plat_class.c:40
bool get_adc_voltage(int channel, float *voltage)
Definition: plat_class.c:58
Definition: plat_class.h:33
uint8_t card_type
Definition: plat_class.h:35
bool present
Definition: plat_class.h:34
uint8_t get_system_class()
Definition: util_sys.c:146
ADC_CHANNEL
Definition: plat_class.c:80
struct _CARD_STATUS_ CARD_STATUS
void init_hsc_module()
Definition: plat_class.c:152
CARD_STATUS get_1ou_status()
Definition: plat_class.c:137
BIC_CARD_PRESENT
Definition: plat_class.h:65
@ CARD_PRESENT
Definition: plat_class.h:67
@ CARD_UNPRESENT
Definition: plat_class.h:66
CARD_STATUS get_2ou_status()
Definition: plat_class.c:142
_1OU_CARD_TYPE_
Definition: plat_class.h:38
@ TYPE_1OU_EXP_WITH_6_M2
Definition: plat_class.h:40
@ TYPE_1OU_RAINBOW_FALLS
Definition: plat_class.h:41
@ TYPE_1OU_EXP_WITH_NIC
Definition: plat_class.h:44
@ TYPE_1OU_VERNAL_FALLS_WITH_AST
Definition: plat_class.h:43
@ TYPE_1OU_SI_TEST_CARD
Definition: plat_class.h:39
@ TYPE_1OU_ABSENT
Definition: plat_class.h:45
@ TYPE_1OU_VERNAL_FALLS_WITH_TI
Definition: plat_class.h:42
@ TYPE_1OU_UNKNOWN
Definition: plat_class.h:46
@ HSC_MODULE_MP5990
Definition: plat_class.h:60
_2OU_CARD_TYPE_
Definition: plat_class.h:49
@ TYPE_2OU_ABSENT
Definition: plat_class.h:53
@ TYPE_2OU_UNKNOWN
Definition: plat_class.h:54
@ TYPE_1OU_WAIMANO_FALLS
Definition: plat_class.h:67
@ TYPE_1OU_KAHUNA_FALLS
Definition: plat_class.h:66
@ TYPE_2OU_DPV2_8
Definition: plat_class.h:74
@ TYPE_2OU_DPV2_16
Definition: plat_class.h:75
@ CHANNEL_7
Definition: plat_class.h:83
@ CHANNEL_6
Definition: plat_class.h:82
BIC_BOARD_REVISION
Definition: plat_class.h:39
@ SYS_BOARD_EVT2
Definition: plat_class.h:42
@ SYS_BOARD_POC
Definition: plat_class.h:40
@ SYS_BOARD_EVT
Definition: plat_class.h:41
@ SYS_BOARD_PVT
Definition: plat_class.h:36
@ SYS_BOARD_MP
Definition: plat_class.h:37
@ SYS_BOARD_DVT
Definition: plat_class.h:34
RETIMER_MODULE
Definition: plat_class.h:86
@ RETIMER_MODULE_DS160PT801
Definition: plat_class.h:88
@ RETIMER_MODULE_PT4080L
Definition: plat_class.h:87
@ RETIMER_MODULE_UNKNOWN
Definition: plat_class.h:89
OTHER_MODULE
Definition: plat_class.h:92
@ OTH_MODULE_SECOND
Definition: plat_class.h:94
@ OTH_MODULE_PRIMARY
Definition: plat_class.h:93
@ OTH_MODULE_UNKNOWN
Definition: plat_class.h:95
void set_retimer_module(uint8_t module)
Definition: plat_class.c:80
FIRMWARE_COMPONENT_ID
Definition: plat_class.h:103
@ JI_COMPNT_RETIMER
Definition: plat_class.h:109
@ JI_COMPNT_CPUVDD
Definition: plat_class.h:107
@ JI_COMPNT_1V2
Definition: plat_class.h:111
@ JI_COMPNT_SOCVDD
Definition: plat_class.h:108
@ JI_COMPNT_CPUDVDD
Definition: plat_class.h:106
@ JI_COMPNT_MAX
Definition: plat_class.h:112
@ JI_COMPNT_CPLD
Definition: plat_class.h:104
@ JI_COMPNT_BIC
Definition: plat_class.h:105
@ JI_COMPNT_FBVDDP2
Definition: plat_class.h:110
@ HSC_MODULE_RS31380R
Definition: plat_class.h:82
uint8_t get_retimer_module()
Definition: plat_class.c:75
@ SYS_BOARD_PVT2_5
Definition: plat_class.h:45
@ SYS_BOARD_PVT2
Definition: plat_class.h:44
uint8_t get_oth_module()
Definition: plat_class.c:70