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_ADDR 0x21 // 7-bit address
27#define CPLD_CLASS_TYPE_REG 0x05
28#define CPLD_2OU_EXPANSION_CARD_REG 0x06
29#define CPLD_BOARD_REV_ID_REG 0x08
30#define CPLD_1OU_CARD_DETECTION 0x09
31#define CPLD_1OU_VPP_POWER_STATUS 0x11
32#define I2C_DATA_SIZE 5
33#define NUMBER_OF_ADC_CHANNEL 16
34#define AST1030_ADC_BASE_ADDR 0x7e6e9000
35#define HSC_TYPE_ADC_TOLERANCE 0.2 // V
36
37#define MAX_1OU_M2_COUNT 4
38
53};
54
55typedef struct _CARD_STATUS_ {
56 bool present;
57 uint8_t card_type;
59
71};
72
74 TYPE_2OU_DPV2_8 = 0x07, // DPV2x8
75 TYPE_2OU_DPV2_16 = 0x70, // DPV2x16
78};
79
80/* ADC channel number */
84};
85
92};
93
97};
98
99uint8_t get_system_class();
102uint8_t get_board_revision();
103uint8_t get_hsc_module();
104bool get_adc_voltage(int channel, float *voltage);
105void init_hsc_module(uint8_t board_revision);
107
108#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
@ HSC_MODULE_LTC4286
Definition: plat_class.h:88
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_ADM1278
Definition: plat_class.h:58
@ HSC_MODULE_LTC4282
Definition: plat_class.h:59
@ 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_MP_HOTSWAP
Definition: plat_class.h:49
@ SYS_BOARD_DVT_HOTSWAP
Definition: plat_class.h:45
@ SYS_BOARD_MP_2_HOTSWAP
Definition: plat_class.h:51
@ SYS_BOARD_EVT3_EFUSE
Definition: plat_class.h:44
@ SYS_BOARD_DVT_EFUSE
Definition: plat_class.h:46
@ SYS_BOARD_EVT3_HOTSWAP
Definition: plat_class.h:43
@ SYS_BOARD_MP_EFUSE
Definition: plat_class.h:50
@ SYS_BOARD_PVT_HOTSWAP
Definition: plat_class.h:47
@ 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_MP_2_EFUSE
Definition: plat_class.h:52
@ SYS_BOARD_PVT_EFUSE
Definition: plat_class.h:48