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 AST1030_ADC_BASE_ADDR 0x7e6e9000
24
26 SLOT1_EID = 0x0A,
27 SLOT2_EID = 0x14,
28 SLOT3_EID = 0x1E,
29 SLOT4_EID = 0x28,
30 SLOT5_EID = 0x32,
31 SLOT6_EID = 0x3C,
32 SLOT7_EID = 0x46,
33 SLOT8_EID = 0x50,
34};
35
37 SLOT1_PID = 0x0000,
38 SLOT2_PID = 0x0005,
39 SLOT3_PID = 0x000A,
40 SLOT4_PID = 0x000F,
41 SLOT5_PID = 0x0014,
42 SLOT6_PID = 0x0019,
43 SLOT7_PID = 0x001E,
44 SLOT8_PID = 0x0023,
45};
46
53};
54
60};
61
66};
67
73};
74
79};
80
81bool get_adc_voltage(int channel, float *voltage);
82bool get_board_rev(uint8_t *board_rev);
83uint8_t get_slot_eid();
84uint8_t get_slot_id();
85bool get_blade_config(uint8_t *blade_config);
87uint8_t get_retimer_type();
89uint16_t get_i3c_hub_type();
91
92#endif
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
RETIMER_TYPE
Definition: plat_class.h:44
void init_i3c_hub_type()
Definition: plat_class.c:180
uint8_t get_slot_id()
Definition: plat_class.c:119
ADC_CHANNEL
Definition: plat_class.c:80
@ NUMBER_OF_ADC_CHANNEL
Definition: plat_class.h:27
BLADE_CONFIG
Definition: plat_class.h:62
@ BLADE_CONFIG_T1C
Definition: plat_class.h:64
@ BLADE_CONFIG_UNKNOWN
Definition: plat_class.h:65
@ BLADE_CONFIG_T1M
Definition: plat_class.h:63
bool get_board_rev(uint8_t *board_rev)
Definition: plat_class.c:135
void init_retimer_type()
Definition: plat_class.c:282
@ RETIMER_TYPE_BROADCOM
Definition: plat_class.h:72
@ RETIMER_TYPE_NO_RETIMER
Definition: plat_class.h:70
@ RETIMER_TYPE_KANDOU
Definition: plat_class.h:71
@ RETIMER_TYPE_ASTERALABS
Definition: plat_class.h:69
uint8_t get_retimer_type()
Definition: plat_class.c:277
bool get_blade_config(uint8_t *blade_config)
Definition: plat_class.c:115
BOARD_REV_ID
Definition: plat_class.h:47
@ BOARD_REV_PVT
Definition: plat_class.h:51
@ BOARD_REV_POC
Definition: plat_class.h:48
@ BOARD_REV_MP
Definition: plat_class.h:52
@ BOARD_REV_EVT
Definition: plat_class.h:49
@ BOARD_REV_DVT
Definition: plat_class.h:50
uint8_t get_slot_eid()
Definition: plat_class.c:94
SLOT_EID
Definition: plat_class.h:25
@ SLOT8_EID
Definition: plat_class.h:33
@ SLOT3_EID
Definition: plat_class.h:28
@ SLOT1_EID
Definition: plat_class.h:26
@ SLOT6_EID
Definition: plat_class.h:31
@ SLOT7_EID
Definition: plat_class.h:32
@ SLOT5_EID
Definition: plat_class.h:30
@ SLOT4_EID
Definition: plat_class.h:29
@ SLOT2_EID
Definition: plat_class.h:27
@ ADC_CHANNEL_12
Definition: plat_class.h:57
@ ADC_CHANNEL_13
Definition: plat_class.h:58
@ ADC_CHANNEL_2
Definition: plat_class.h:56
SLOT_PID
Definition: plat_class.h:36
@ SLOT4_PID
Definition: plat_class.h:40
@ SLOT2_PID
Definition: plat_class.h:38
@ SLOT5_PID
Definition: plat_class.h:41
@ SLOT8_PID
Definition: plat_class.h:44
@ SLOT1_PID
Definition: plat_class.h:37
@ SLOT6_PID
Definition: plat_class.h:42
@ SLOT7_PID
Definition: plat_class.h:43
@ SLOT3_PID
Definition: plat_class.h:39