OpenBIC
OpenSource Bridge-IC
plat_pldm_sensor.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_PLDM_SENSOR_H
18#define PLAT_PLDM_SENSOR_H
19
20#include "pdr.h"
21
22#define ADDR_TMP75_INLET (0x92 >> 1)
23#define ADDR_TMP75_OUTLET (0x98 >> 1)
24#define ADDR_TMP75_FIO (0x90 >> 1)
25#define ADDR_VR_CPU0 (0XEC >> 1)
26#define ADDR_VR_SOC (0XEC >> 1)
27#define ADDR_VR_CPU1 (0XC6 >> 1)
28#define ADDR_VR_PVDDIO (0XC6 >> 1)
29#define ADDR_VR_PVDD11 (0XE4 >> 1)
30
31#define ADDR_X8_INA233 (0x8A >> 1)
32#define ADDR_X16_INA233 (0x82 >> 1)
33#define ADDR_E1S_BOOT_INA233 (0x8A >> 1)
34#define ADDR_E1S_DATA_INA233 (0x80 >> 1)
35#define ADDR_X8_RETIMER (0x46 >> 1)
36#define ADDR_X16_RETIMER (0x40 >> 1)
37#define ADDR_NVME (0xD4 >> 1)
38
39#define OFFSET_TMP75_TEMP 0x00
40#define OFFSET_NVME_TEMP 0x00
41
42#define NUM_SOC_PACKAGE_PWR 0x0055
43
44#define UPDATE_INTERVAL_1S 1
45#define UPDATE_INTERVAL_3S 3
46#define UPDATA_INTERNAL_1HR 3600
47
48#define VR_DEVICE_UNKNOWN 0xFF
49
50#define SENSOR_NUM_MB_INA233_E1S_DATA_VOLT_V 0x0033
51#define SENSOR_NUM_MB_INA233_X8_RTM_CURR_A 0x0045
52#define SENSOR_NUM_MB_INA233_E1S_DATA_CURR_A 0x0048
53#define SENSOR_NUM_MB_INA233_X8_RTM_PWR_W 0x0062
54#define SENSOR_NUM_MB_INA233_E1S_DATA_PWR_W 0x0065
55
64};
65
69};
70
71int plat_pldm_sensor_get_sensor_count(int thread_id);
72uint8_t plat_pldm_sensor_get_vr_dev(uint8_t *vr_dev);
82void plat_pldm_sensor_clear_vr_fault(uint8_t vr_addr, uint8_t vr_bus, uint8_t page_cnt);
83
84#endif
GET_VR_DEV_STATUS
Definition: plat_pldm_sensor.h:228
@ GET_VR_DEV_FAILED
Definition: plat_pldm_sensor.h:230
@ GET_VR_DEV_SUCCESS
Definition: plat_pldm_sensor.h:229
int plat_pldm_sensor_get_sensor_count(int thread_id)
Definition: plat_pldm_sensor.c:9074
SENSOR_THREAD_LIST
Definition: plat_pldm_sensor.h:221
@ MAX_SENSOR_THREAD_ID
Definition: plat_pldm_sensor.h:225
@ VR_SENSOR_THREAD_ID
Definition: plat_pldm_sensor.h:223
void plat_pldm_sensor_change_cpu_bus()
Definition: plat_pldm_sensor.c:6718
void plat_pldm_sensor_change_retimer_dev()
Definition: plat_pldm_sensor.c:6762
void plat_pldm_sensor_change_vr_dev()
Definition: plat_pldm_sensor.c:9301
uint8_t plat_pldm_sensor_get_vr_dev(uint8_t *vr_dev)
Definition: plat_pldm_sensor.c:6884
@ DIMM_SENSOR_THREAD_ID
Definition: plat_pldm_sensor.h:48
@ INA233_SENSOR_THREAD_ID
Definition: plat_pldm_sensor.h:46
@ ADC_SENSOR_THREAD_ID
Definition: plat_pldm_sensor.h:45
void plat_pldm_sensor_clear_vr_fault(uint8_t vr_addr, uint8_t vr_bus, uint8_t page_cnt)
Definition: plat_pldm_sensor.c:6927
void plat_init_pldm_sensor_table()
Definition: plat_pldm_sensor.c:6352
void plat_pldm_sensor_change_ina_dev()
Definition: plat_pldm_sensor.c:6801
void plat_pldm_sensor_change_ssd_dev()
Definition: plat_pldm_sensor.c:6677
@ CPU_SENSOR_THREAD_ID
Definition: plat_pldm_sensor.h:60
@ MB_TEMP_SENSOR_THREAD_ID
Definition: plat_pldm_sensor.h:59
void plat_pldm_sensor_change_dimm_dev()
Definition: plat_pldm_sensor.c:6849
void plat_init_pldm_disabled_sensors()
Definition: plat_pldm_sensor.c:6374
uint8_t plat_pldm_sensor_get_ina_dev()
Definition: plat_pldm_sensor.c:6959