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
33 // ID 02h is reserved
35 // ID 04h is reserved
38};
39
40typedef struct _CARD_STATUS_ {
41 bool present;
42 uint8_t card_type;
44
59};
60
62 TYPE_2OU_DPV2_8 = 0x07, // DPV2x8
63 TYPE_2OU_DPV2_16 = 0x70, // DPV2x16
66};
67
72};
73
78};
79
80/* ADC channel number */
84};
85
86uint8_t get_system_class();
89uint8_t get_hsc_module();
90bool get_adc_voltage(int channel, float *voltage);
91uint8_t get_board_revision();
93uint16_t get_i3c_hub_type();
94uint16_t get_exp_i3c_hub_type();
96
97#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
bool get_adc_voltage(int channel, float *voltage)
Definition: plat_class.c:58
I3C_HUB_TYPE
Definition: plat_class.h:50
@ I3C_HUB_TYPE_RNS
Definition: plat_class.h:51
@ I3C_HUB_TYPE_UNKNOWN
Definition: plat_class.h:53
@ I3C_HUB_TYPE_NXP
Definition: plat_class.h:52
uint16_t get_i3c_hub_type()
Definition: plat_class.c:51
void init_i3c_hub_type()
Definition: plat_class.c:180
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
CARD_STATUS get_1ou_status()
Definition: plat_class.c:137
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_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_POC
Definition: plat_class.h:40
@ SYS_BOARD_EVT
Definition: plat_class.h:41
uint16_t get_exp_i3c_hub_type()
Definition: plat_class.c:73
@ TYPE_1OU_EXP_WITH_E1S
Definition: plat_class.h:56
@ TYPE_1OU_NIAGARA_FALLS
Definition: plat_class.h:55
@ TYPE_1OU_OLMSTED_POINT
Definition: plat_class.h:54
@ SYS_BOARD_PVT
Definition: plat_class.h:36
@ SYS_BOARD_MP
Definition: plat_class.h:37
@ SYS_BOARD_DVT
Definition: plat_class.h:34