OpenBIC
OpenSource Bridge-IC
plat_m2.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#include <stdbool.h>
18
19#define PREFIX_MASK 0xF8
20
21#define PREFIX_M2A 0x60
22#define PREFIX_M2B 0x68
23#define PREFIX_M2C 0x70
24#define PREFIX_M2D 0x78
25
26#define DEV_PWR_ON 0x01
27#define DEV_PWR_CTRL 0x02
28#define DEV_PRSNT_SET 0x04
29#define DEV_PCIE_RST 0x08
30#define DEV_CHK_DISABLE 0x20
31#define DEV_FORCE_3V3 0x40
32#define DEV_PWRDIS_EN 0x80
33
40};
41
42uint8_t m2_bus2idx(uint8_t bus);
43uint8_t m2_bus2rst(uint8_t bus);
44uint8_t m2_idx2bus(uint8_t idx);
45uint8_t m2_idx2sensornum(uint8_t idx);
46uint8_t m2_sensornum2idx(uint8_t sensor_num);
47uint8_t m2_pwrgd(uint8_t idx);
48uint8_t m2_get_prefix_sen_num(uint8_t idx);
49uint8_t m2_prsnt(uint8_t idx);
50uint8_t rst_edsff(uint8_t idx, uint8_t val);
51bool is_m2_sen_readable(uint8_t sen_num);
52bool is_nvme_temp_readable(uint8_t sen_num);
53uint8_t exchange_m2_idx(uint8_t idx);
uint8_t idx
Definition: plat_util.c:39
uint32_t val
Definition: plat_util.c:40
bool is_nvme_temp_readable(uint8_t sen_num)
Definition: plat_m2.c:171
uint8_t rst_edsff(uint8_t idx, uint8_t val)
Definition: plat_m2.c:143
M2_IDX_E
Definition: plat_m2.h:34
@ M2_IDX_E_B
Definition: plat_m2.h:36
@ M2_IDX_E_A
Definition: plat_m2.h:35
@ M2_IDX_E_MAX
Definition: plat_m2.h:39
@ M2_IDX_E_D
Definition: plat_m2.h:38
@ M2_IDX_E_C
Definition: plat_m2.h:37
uint8_t m2_prsnt(uint8_t idx)
Definition: plat_m2.c:129
uint8_t m2_pwrgd(uint8_t idx)
Definition: plat_m2.c:79
uint8_t m2_get_prefix_sen_num(uint8_t idx)
Definition: plat_m2.c:120
uint8_t m2_idx2bus(uint8_t idx)
Definition: plat_m2.c:44
bool is_m2_sen_readable(uint8_t sen_num)
Definition: plat_m2.c:158
uint8_t m2_sensornum2idx(uint8_t sensor_num)
Definition: plat_m2.c:62
uint8_t exchange_m2_idx(uint8_t idx)
Definition: plat_m2.c:195
uint8_t m2_bus2rst(uint8_t bus)
Definition: plat_m2.c:35
uint8_t m2_idx2sensornum(uint8_t idx)
Definition: plat_m2.c:53
uint8_t m2_bus2idx(uint8_t bus)
Definition: plat_m2.c:26
uint8_t sensor_num
Definition: storage_handler.h:6