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);
50void fan_pump_pwrgd();
52uint8_t fb_hsc_status(uint8_t idx);
53uint32_t get_threshold_status(uint8_t sensor_num);
54bool pump_fail_check();
57bool hsc_fail_check();
59bool check_rpu_ready();
60void pump_change_threshold(uint8_t sensor_num, uint8_t duty);
61void set_is_rack_level_abnormal(bool flag);
63void set_is_rpu_level_abnormal(bool flag);
65void set_is_press_abnormal(bool flag);
67void set_is_pump_not_access(uint8_t index, bool flag);
68bool get_is_pump_not_access(uint8_t index);
69void set_is_hsc_hsc_fail(bool flag);
71
72#endif // PLAT_THRESHOLD_H
uint8_t idx
Definition: plat_util.c:42
void threshold_poll_init()
Definition: plat_threshold.c:1138
bool system_failure_recovery()
Definition: plat_threshold.c:206
bool get_threshold_poll_enable_flag()
Definition: plat_threshold.c:1065
uint32_t get_threshold_status(uint8_t sensor_num)
Definition: plat_threshold.c:1070
void set_is_pump_not_access(uint8_t index, bool flag)
Definition: plat_threshold.c:822
bool hsc_fail_check()
Definition: plat_threshold.c:200
bool get_is_press_abnormal()
Definition: plat_threshold.c:774
void set_is_rpu_level_abnormal(bool flag)
Definition: plat_threshold.c:601
uint8_t fb_hsc_status(uint8_t idx)
Definition: plat_threshold.c:1046
void set_threshold_poll_enable_flag(bool flag)
Definition: plat_threshold.c:1060
bool get_is_rpu_level_abnormal()
Definition: plat_threshold.c:606
void set_is_press_abnormal(bool flag)
Definition: plat_threshold.c:769
bool pump_fail_check()
Definition: plat_threshold.c:141
void pump_change_threshold(uint8_t sensor_num, uint8_t duty)
Definition: plat_threshold.c:1212
void set_is_hsc_hsc_fail(bool flag)
Definition: plat_threshold.c:1233
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:156
bool get_is_pump_not_access(uint8_t index)
Definition: plat_threshold.c:827
sensor_threshold * find_threshold_tbl_entry(uint8_t sensor_num)
Definition: plat_threshold.c:756
bool check_rpu_ready()
Definition: plat_threshold.c:245
void set_is_rack_level_abnormal(bool flag)
Definition: plat_threshold.c:568
void set_threshold_status_to_normal(void)
Definition: plat_threshold.c:1132
bool hsc_communicate_check()
Definition: plat_threshold.c:170
void fan_pump_pwrgd()
Definition: plat_threshold.c:1432
bool get_is_rack_level_abnormal()
Definition: plat_threshold.c:573
bool get_is_hsc_hsc_fail()
Definition: plat_threshold.c:1238
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