OpenBIC
OpenSource Bridge-IC
plat_threshold.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_THRESHOLD_H
18#define PLAT_THRESHOLD_H
19
20#define TWO_BYTES_SENSOR_STATUS 0xFF
21
22typedef struct {
23 uint8_t sensor_num;
24 uint8_t type;
25 float lcr;
26 float ucr;
27 void (*fn)(uint32_t, uint32_t); // para: arg, status
28 uint32_t arg0;
29 uint8_t retry;
30
31 // priv data
32 uint32_t last_status; // record the last status
33 uint32_t last_value; // record the last value
34 uint8_t retry_count; // record the last value
36
44};
45
46void set_threshold_poll_enable_flag(bool flag);
49void fan_pump_pwrgd();
51uint8_t fb_hsc_status(uint8_t idx);
52uint32_t get_threshold_status(uint8_t sensor_num);
53bool pump_fail_check();
58void pump_change_threshold(uint8_t sensor_num, uint8_t duty);
59
60#endif // PLAT_THRESHOLD_H
uint8_t idx
Definition: plat_util.c:39
void threshold_poll_init()
Definition: plat_threshold.c:1022
bool system_failure_recovery()
Definition: plat_threshold.c:180
bool get_threshold_poll_enable_flag()
Definition: plat_threshold.c:959
uint32_t get_threshold_status(uint8_t sensor_num)
Definition: plat_threshold.c:964
uint8_t fb_hsc_status(uint8_t idx)
Definition: plat_threshold.c:940
void set_threshold_poll_enable_flag(bool flag)
Definition: plat_threshold.c:954
bool rpu_ready_recovery()
Definition: plat_threshold.c:219
bool pump_fail_check()
Definition: plat_threshold.c:139
void pump_change_threshold(uint8_t sensor_num, uint8_t duty)
Definition: plat_threshold.c:1096
THRESHOLD_STATUS
Definition: plat_threshold.h:37
@ THRESHOLD_STATUS_LCR
Definition: plat_threshold.h:39
@ THRESHOLD_STATUS_UNKNOWN
Definition: plat_threshold.h:43
@ THRESHOLD_STATUS_NORMAL
Definition: plat_threshold.h:38
@ THRESHOLD_STATUS_NOT_ACCESS
Definition: plat_threshold.h:41
@ THRESHOLD_STATUS_UCR
Definition: plat_threshold.h:40
@ THRESHOLD_STATUS_DISCRETE_CHANGED
Definition: plat_threshold.h:42
bool hex_fan_fail_check()
Definition: plat_threshold.c:154
sensor_threshold * find_threshold_tbl_entry(uint8_t sensor_num)
Definition: plat_threshold.c:738
bool hsc_communicate_check()
Definition: plat_threshold.c:168
void fan_pump_pwrgd()
Definition: plat_threshold.c:1286
uint8_t sensor_num
Definition: storage_handler.h:6
Definition: plat_threshold.h:22
uint8_t type
Definition: plat_threshold.h:24
uint8_t sensor_num
Definition: plat_threshold.h:23
uint32_t last_value
Definition: plat_threshold.h:33
float ucr
Definition: plat_threshold.h:26
uint8_t retry
Definition: plat_threshold.h:29
uint32_t last_status
Definition: plat_threshold.h:32
uint32_t arg0
Definition: plat_threshold.h:28
uint8_t retry_count
Definition: plat_threshold.h:34
float lcr
Definition: plat_threshold.h:25