OpenBIC
OpenSource Bridge-IC
plat_power_capping.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#ifndef PLAT_POWER_CAPPING_H
17#define PLAT_POWER_CAPPING_H
18
19#define CPLD_LV1_TIME_WINDOW_NUM 8
20
24};
25
29};
30
34};
35
40};
41
42#endif
43
46bool find_cpld_lv1_time_window_idx_by_value(uint8_t *idx, uint16_t value);
47uint16_t get_power_capping_avg_power(uint8_t vr_idx, uint8_t lv);
49void set_power_capping_method(uint8_t value);
51void set_power_capping_source(uint8_t value);
52uint16_t get_power_capping_current_threshold(uint8_t vr_idx);
53uint16_t get_power_capping_time_w(uint8_t vr_idx, uint8_t lv);
54void set_power_capping_time_w(uint8_t vr_idx, uint8_t lv, uint16_t value);
55uint16_t get_power_capping_threshold(uint8_t vr_idx, uint8_t lv);
56void set_power_capping_threshold(uint8_t vr_idx, uint8_t lv, uint16_t value);
uint8_t idx
Definition: plat_util.c:42
uint8_t get_power_capping_method()
Definition: plat_power_capping.c:274
void set_power_capping_source(uint8_t value)
Definition: plat_power_capping.c:314
void set_power_capping_method(uint8_t value)
Definition: plat_power_capping.c:279
@ CAPPING_VR_IDX_MAX
Definition: plat_power_capping.h:33
@ CAPPING_VR_IDX_MEDHA0
Definition: plat_power_capping.h:31
@ CAPPING_VR_IDX_MEDHA1
Definition: plat_power_capping.h:32
uint8_t get_power_capping_source()
Definition: plat_power_capping.c:309
uint16_t get_power_capping_threshold(uint8_t vr_idx, uint8_t lv)
Definition: plat_power_capping.c:463
uint16_t get_power_capping_avg_power(uint8_t vr_idx, uint8_t lv)
Definition: plat_power_capping.c:231
bool find_cpld_lv1_time_window_idx_by_value(uint8_t *idx, uint16_t value)
Definition: plat_power_capping.c:220
uint16_t get_power_capping_time_w(uint8_t vr_idx, uint8_t lv)
Definition: plat_power_capping.c:389
@ CAPPING_LV_IDX_LV1
Definition: plat_power_capping.h:36
@ CAPPING_LV_IDX_LV3
Definition: plat_power_capping.h:38
@ CAPPING_LV_IDX_LV2
Definition: plat_power_capping.h:37
@ CAPPING_LV_IDX_MAX
Definition: plat_power_capping.h:39
uint16_t get_power_capping_current_threshold(uint8_t vr_idx)
Definition: plat_power_capping.c:379
@ CAPPING_SOURCE_MAX
Definition: plat_power_capping.h:28
@ CAPPING_SOURCE_VR
Definition: plat_power_capping.h:26
@ CAPPING_SOURCE_ADC
Definition: plat_power_capping.h:27
@ CAPPING_M_CREDIT_BASE
Definition: plat_power_capping.h:22
@ CAPPING_M_MAX
Definition: plat_power_capping.h:23
@ CAPPING_M_LOOK_UP_TABLE
Definition: plat_power_capping.h:21
void add_sync_oc_warn_to_work()
Definition: plat_power_capping.c:131
void plat_power_capping_init()
Definition: plat_power_capping.c:545
void set_power_capping_threshold(uint8_t vr_idx, uint8_t lv, uint16_t value)
Definition: plat_power_capping.c:478
void set_power_capping_time_w(uint8_t vr_idx, uint8_t lv, uint16_t value)
Definition: plat_power_capping.c:404
void power_capping_syn_vr_oc_warn_limit()
Definition: plat_power_capping.c:55