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
30
enum
CARD_POSITION
{
31
CARD_POSITION_1OU
,
32
CARD_POSITION_2OU
,
33
CARD_POSITION_3OU
,
34
CARD_POSITION_4OU
,
35
CARD_POSITION_UNKNOWN
,
36
};
37
38
enum
CARD_TYPE
{
39
CARD_TYPE_OPA
,
40
CARD_TYPE_OPB
,
41
CARD_TYPE_UNKNOWN
,
42
};
43
44
enum
RETIMER_TYPE
{
45
RETIMER_TYPE_PT5161L
,
46
RETIMER_TYPE_M88RT51632
,
47
RETIMER_TYPE_UNKNOWN
,
48
};
49
50
enum
I3C_HUB_TYPE
{
51
I3C_HUB_TYPE_RNS
,
52
I3C_HUB_TYPE_NXP
,
53
I3C_HUB_TYPE_UNKNOWN
,
54
};
55
56
enum
E1S_NUMBER
{
57
E1S_0
,
58
E1S_1
,
59
E1S_2
,
60
E1S_3
,
61
E1S_4
,
62
};
63
64
enum
BOARD_REVISION_ID
{
65
EVT_STAGE
= 0b000,
66
DVT_STAGE
= 0b001,
67
PVT_STAGE
= 0b010,
68
MP_STAGE
= 0b011,
69
UNKNOWN_STAGE
= 0xFF,
70
};
71
72
int
init_platform_config
();
73
uint8_t
get_card_type
();
74
uint8_t
get_card_position
();
75
uint16_t
get_i3c_hub_type
();
76
int
check_pcie_retimer_type
(
void
);
77
uint8_t
get_pcie_retimer_type
(
void
);
78
uint8_t
get_board_revision
();
79
void
init_board_revision
();
80
void
init_i3c_hub_type
();
81
uint32_t
get_pcie_retimer_version
();
82
void
cache_pcie_retimer_version
();
83
void
set_clock_buffer_bypass_mode
();
84
85
#endif
get_board_revision
uint8_t get_board_revision()
Definition:
plat_class.c:431
BOARD_REVISION_ID
BOARD_REVISION_ID
Definition:
plat_class.h:76
PVT_STAGE
@ PVT_STAGE
Definition:
plat_class.h:81
MP_STAGE
@ MP_STAGE
Definition:
plat_class.h:82
DVT_STAGE
@ DVT_STAGE
Definition:
plat_class.h:80
UNKNOWN_STAGE
@ UNKNOWN_STAGE
Definition:
plat_class.h:83
init_platform_config
int init_platform_config()
Definition:
expansion_board.c:43
get_pcie_retimer_type
uint8_t get_pcie_retimer_type(void)
Definition:
plat_class.c:56
I3C_HUB_TYPE
I3C_HUB_TYPE
Definition:
plat_class.h:50
I3C_HUB_TYPE_RNS
@ I3C_HUB_TYPE_RNS
Definition:
plat_class.h:51
I3C_HUB_TYPE_UNKNOWN
@ I3C_HUB_TYPE_UNKNOWN
Definition:
plat_class.h:53
I3C_HUB_TYPE_NXP
@ I3C_HUB_TYPE_NXP
Definition:
plat_class.h:52
check_pcie_retimer_type
int check_pcie_retimer_type(void)
Definition:
plat_class.c:111
EVT_STAGE
@ EVT_STAGE
Definition:
plat_class.h:65
get_i3c_hub_type
uint16_t get_i3c_hub_type()
Definition:
plat_class.c:51
cache_pcie_retimer_version
void cache_pcie_retimer_version()
Definition:
plat_class.c:136
get_pcie_retimer_version
uint32_t get_pcie_retimer_version()
Definition:
plat_class.c:66
CARD_TYPE
CARD_TYPE
Definition:
plat_class.h:38
CARD_TYPE_OPA
@ CARD_TYPE_OPA
Definition:
plat_class.h:39
CARD_TYPE_UNKNOWN
@ CARD_TYPE_UNKNOWN
Definition:
plat_class.h:41
CARD_TYPE_OPB
@ CARD_TYPE_OPB
Definition:
plat_class.h:40
init_board_revision
void init_board_revision()
Definition:
plat_class.c:167
get_card_position
uint8_t get_card_position()
Definition:
plat_class.c:41
CARD_POSITION
CARD_POSITION
Definition:
plat_class.h:30
CARD_POSITION_3OU
@ CARD_POSITION_3OU
Definition:
plat_class.h:33
CARD_POSITION_2OU
@ CARD_POSITION_2OU
Definition:
plat_class.h:32
CARD_POSITION_1OU
@ CARD_POSITION_1OU
Definition:
plat_class.h:31
CARD_POSITION_4OU
@ CARD_POSITION_4OU
Definition:
plat_class.h:34
CARD_POSITION_UNKNOWN
@ CARD_POSITION_UNKNOWN
Definition:
plat_class.h:35
RETIMER_TYPE
RETIMER_TYPE
Definition:
plat_class.h:44
RETIMER_TYPE_M88RT51632
@ RETIMER_TYPE_M88RT51632
Definition:
plat_class.h:46
RETIMER_TYPE_UNKNOWN
@ RETIMER_TYPE_UNKNOWN
Definition:
plat_class.h:47
RETIMER_TYPE_PT5161L
@ RETIMER_TYPE_PT5161L
Definition:
plat_class.h:45
set_clock_buffer_bypass_mode
void set_clock_buffer_bypass_mode()
Definition:
plat_class.c:193
get_card_type
uint8_t get_card_type()
Definition:
plat_class.c:46
E1S_NUMBER
E1S_NUMBER
Definition:
plat_class.h:56
E1S_0
@ E1S_0
Definition:
plat_class.h:57
E1S_1
@ E1S_1
Definition:
plat_class.h:58
E1S_3
@ E1S_3
Definition:
plat_class.h:60
E1S_4
@ E1S_4
Definition:
plat_class.h:61
E1S_2
@ E1S_2
Definition:
plat_class.h:59
init_i3c_hub_type
void init_i3c_hub_type()
Definition:
plat_class.c:180
meta-facebook
op2-op
src
platform
plat_class.h
Generated by
1.9.2