OpenBIC
OpenSource Bridge-IC
mpro.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 MPRO_H
18#define MPRO_H
19
20#include "plat_def.h"
21#ifdef ENABLE_MPRO
22
23#include <stdint.h>
24#include "pldm_monitor.h"
25
26#define MAX_MPRO_DIMM_NUM 16
27
28enum mpro_sensor_num_table {
29 /* DIMM sensor 1 ~ 70 */
30 MPRO_SENSOR_NUM_PWR_DRAM = 1, // total power consumed by all DRAMs
31
32 MPRO_SENSOR_NUM_TMP_DIMM0 = 3,
33 MPRO_SENSOR_NUM_STA_DIMM0,
34 MPRO_SENSOR_NUM_TMP_DIMM1,
35 MPRO_SENSOR_NUM_STA_DIMM1,
36 MPRO_SENSOR_NUM_TMP_DIMM2,
37 MPRO_SENSOR_NUM_STA_DIMM2,
38 MPRO_SENSOR_NUM_TMP_DIMM3,
39 MPRO_SENSOR_NUM_STA_DIMM3,
40 MPRO_SENSOR_NUM_TMP_DIMM4,
41 MPRO_SENSOR_NUM_STA_DIMM4,
42 MPRO_SENSOR_NUM_TMP_DIMM5,
43 MPRO_SENSOR_NUM_STA_DIMM5,
44 MPRO_SENSOR_NUM_TMP_DIMM6,
45 MPRO_SENSOR_NUM_STA_DIMM6,
46 MPRO_SENSOR_NUM_TMP_DIMM7,
47 MPRO_SENSOR_NUM_STA_DIMM7,
48 MPRO_SENSOR_NUM_TMP_DIMM8,
49 MPRO_SENSOR_NUM_STA_DIMM8,
50 MPRO_SENSOR_NUM_TMP_DIMM9,
51 MPRO_SENSOR_NUM_STA_DIMM9,
52 MPRO_SENSOR_NUM_TMP_DIMM10,
53 MPRO_SENSOR_NUM_STA_DIMM10,
54 MPRO_SENSOR_NUM_TMP_DIMM11,
55 MPRO_SENSOR_NUM_STA_DIMM11,
56 MPRO_SENSOR_NUM_TMP_DIMM12,
57 MPRO_SENSOR_NUM_STA_DIMM12,
58 MPRO_SENSOR_NUM_TMP_DIMM13,
59 MPRO_SENSOR_NUM_STA_DIMM13,
60 MPRO_SENSOR_NUM_TMP_DIMM14,
61 MPRO_SENSOR_NUM_STA_DIMM14,
62 MPRO_SENSOR_NUM_TMP_DIMM15,
63 MPRO_SENSOR_NUM_STA_DIMM15,
64
65 MPRO_SENSOR_NUM_STA_DDR = 51, // DDR initialization status at the system level
66
67 /* VRD sensor 71 ~ 140 */
68 MPRO_SENSOR_NUM_TMP_VRD0 = 71,
69 MPRO_SENSOR_NUM_PWR_VRD0,
70 MPRO_SENSOR_NUM_VOL_VRD0,
71 MPRO_SENSOR_NUM_CUR_VRD0,
72 MPRO_SENSOR_NUM_STA_VRD0,
73
74 MPRO_SENSOR_NUM_TMP_VRD1,
75 MPRO_SENSOR_NUM_PWR_VRD1,
76 MPRO_SENSOR_NUM_VOL_VRD1,
77 MPRO_SENSOR_NUM_CUR_VRD1,
78 MPRO_SENSOR_NUM_STA_VRD1,
79
80 MPRO_SENSOR_NUM_TMP_VRD2,
81 MPRO_SENSOR_NUM_PWR_VRD2,
82 MPRO_SENSOR_NUM_VOL_VRD2,
83 MPRO_SENSOR_NUM_CUR_VRD2,
84 MPRO_SENSOR_NUM_STA_VRD2,
85
86 MPRO_SENSOR_NUM_TMP_VRD3,
87 MPRO_SENSOR_NUM_PWR_VRD3,
88 MPRO_SENSOR_NUM_VOL_VRD3,
89 MPRO_SENSOR_NUM_CUR_VRD3,
90 MPRO_SENSOR_NUM_STA_VRD3,
91
92 MPRO_SENSOR_NUM_TMP_VRD4,
93 MPRO_SENSOR_NUM_PWR_VRD4,
94 MPRO_SENSOR_NUM_VOL_VRD4,
95 MPRO_SENSOR_NUM_CUR_VRD4,
96 MPRO_SENSOR_NUM_STA_VRD4,
97
98 MPRO_SENSOR_NUM_TMP_VRD5,
99 MPRO_SENSOR_NUM_PWR_VRD5,
100 MPRO_SENSOR_NUM_VOL_VRD5,
101 MPRO_SENSOR_NUM_CUR_VRD5,
102 MPRO_SENSOR_NUM_STA_VRD5,
103
104 MPRO_SENSOR_NUM_TMP_VRD6,
105 MPRO_SENSOR_NUM_PWR_VRD6,
106 MPRO_SENSOR_NUM_VOL_VRD6,
107 MPRO_SENSOR_NUM_CUR_VRD6,
108 MPRO_SENSOR_NUM_STA_VRD6,
109
110 MPRO_SENSOR_NUM_TMP_VRD7,
111 MPRO_SENSOR_NUM_PWR_VRD7,
112 MPRO_SENSOR_NUM_VOL_VRD7,
113 MPRO_SENSOR_NUM_CUR_VRD7,
114 MPRO_SENSOR_NUM_STA_VRD7,
115
116 MPRO_SENSOR_NUM_TMP_VRD8,
117 MPRO_SENSOR_NUM_PWR_VRD8,
118 MPRO_SENSOR_NUM_VOL_VRD8,
119 MPRO_SENSOR_NUM_CUR_VRD8,
120 MPRO_SENSOR_NUM_STA_VRD8,
121
122 /* SOC sensor 151 ~ 170 */
123 MPRO_SENSOR_NUM_PWR_SOC_PKG = 151,
124 MPRO_SENSOR_NUM_TMP_SOC_PKG = 153,
125
126 /* BOOT sensor 171 ~ 190 */
127 MPRO_SENSOR_NUM_STA_OVERALL_BOOT = 175,
128
129 /* RAS sensor 191 ~ 210 */
130
131 /* reserved 211 ~ 249 */
132
133 /* MISC sensor 250 ~ 300 */
134 MPRO_EFFECTER_NUM_I2C_PROXY_CTRL = 250, // Support after CPU PV2
135 MPRO_EFFECTER_NUM_I2C_CNT = 251,
136 MPRO_EFFECTER_NUM_I2C_PROXY_DATA = 252,
137};
138
139/* Y = (mX + b) * 10^r */
140struct plat_mpro_sensor_mapping {
141 uint8_t sensor_num;
142 uint16_t mpro_sensor_num;
143 pldm_sensor_pdr_parm cal_parm;
144};
145
146extern struct plat_mpro_sensor_mapping mpro_sensor_map[];
147extern const int MPRO_MAP_TAB_SIZE;
148
149uint16_t copy_mpro_read_buffer(uint16_t start, uint16_t length, uint8_t *buffer,
150 uint16_t buffer_len);
151void mpro_postcode_read_init();
152void mpro_postcode_insert(uint32_t postcode);
153void reset_mpro_postcode_buffer();
154bool get_4byte_postcode_ok();
155void reset_4byte_postcode_ok();
156
157#endif /* ENABLE_MPRO */
158
159#endif /* MPRO_H */
ipmi_msg buffer
Definition: ipmb.h:0
uint32_t length
Definition: pldm_firmware_update.h:1
uint8_t sensor_num
Definition: storage_handler.h:6
Definition: pldm_monitor.h:202
const int MPRO_MAP_TAB_SIZE
Definition: plat_sensor_table.c:85
struct plat_mpro_sensor_mapping mpro_sensor_map[]
Definition: plat_sensor_table.c:33