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 RETIMER_UNKNOWN_VERSION -1
24#define RETIMER_VERSION_MAX_LENGTH 5
25#define CLOCK_BUFFER_ADDR 0x6B
26#define CLOCK_BUFFER_REG_LOC 0x01
27#define CLOCK_BUFFER_BYPASS_DATA_1 0x08
28#define CLOCK_BUFFER_BYPASS_DATA_2 0x2E
29
36};
37
42};
43
48};
49
54};
55
62};
63
65 EVT_STAGE = 0b000,
66 DVT_STAGE = 0b001,
67 PVT_STAGE = 0b010,
68 MP_STAGE = 0b011,
70};
71
73uint8_t get_card_type();
74uint8_t get_card_position();
75uint16_t get_i3c_hub_type();
77uint8_t get_pcie_retimer_type(void);
78uint8_t get_board_revision();
84
85#endif
uint8_t get_board_revision()
Definition: plat_class.c:431
BOARD_REVISION_ID
Definition: plat_class.h:76
@ PVT_STAGE
Definition: plat_class.h:81
@ MP_STAGE
Definition: plat_class.h:82
@ DVT_STAGE
Definition: plat_class.h:80
@ UNKNOWN_STAGE
Definition: plat_class.h:83
int init_platform_config()
Definition: expansion_board.c:43
uint8_t get_pcie_retimer_type(void)
Definition: plat_class.c:56
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
int check_pcie_retimer_type(void)
Definition: plat_class.c:111
@ EVT_STAGE
Definition: plat_class.h:65
uint16_t get_i3c_hub_type()
Definition: plat_class.c:51
void cache_pcie_retimer_version()
Definition: plat_class.c:136
uint32_t get_pcie_retimer_version()
Definition: plat_class.c:66
CARD_TYPE
Definition: plat_class.h:38
@ CARD_TYPE_OPA
Definition: plat_class.h:39
@ CARD_TYPE_UNKNOWN
Definition: plat_class.h:41
@ CARD_TYPE_OPB
Definition: plat_class.h:40
void init_board_revision()
Definition: plat_class.c:167
uint8_t get_card_position()
Definition: plat_class.c:41
CARD_POSITION
Definition: plat_class.h:30
@ CARD_POSITION_3OU
Definition: plat_class.h:33
@ CARD_POSITION_2OU
Definition: plat_class.h:32
@ CARD_POSITION_1OU
Definition: plat_class.h:31
@ CARD_POSITION_4OU
Definition: plat_class.h:34
@ CARD_POSITION_UNKNOWN
Definition: plat_class.h:35
RETIMER_TYPE
Definition: plat_class.h:44
@ RETIMER_TYPE_M88RT51632
Definition: plat_class.h:46
@ RETIMER_TYPE_UNKNOWN
Definition: plat_class.h:47
@ RETIMER_TYPE_PT5161L
Definition: plat_class.h:45
void set_clock_buffer_bypass_mode()
Definition: plat_class.c:193
uint8_t get_card_type()
Definition: plat_class.c:46
E1S_NUMBER
Definition: plat_class.h:56
@ E1S_0
Definition: plat_class.h:57
@ E1S_1
Definition: plat_class.h:58
@ E1S_3
Definition: plat_class.h:60
@ E1S_4
Definition: plat_class.h:61
@ E1S_2
Definition: plat_class.h:59
void init_i3c_hub_type()
Definition: plat_class.c:180