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
21enum {
25};
26
27enum {
31};
32
33enum {
37};
38
39enum {
44};
45
46#endif
47
50bool find_cpld_lv1_time_window_idx_by_value(uint8_t *idx, uint16_t value);
51uint16_t get_power_capping_avg_power(uint8_t vr_idx, uint8_t lv);
53void set_power_capping_method(uint8_t value);
55void set_power_capping_source(uint8_t value);
56uint16_t get_power_capping_current_threshold(uint8_t vr_idx);
57uint16_t get_power_capping_time_w(uint8_t vr_idx, uint8_t lv);
58void set_power_capping_time_w(uint8_t vr_idx, uint8_t lv, uint16_t value);
59uint16_t get_power_capping_threshold(uint8_t vr_idx, uint8_t lv);
60void 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:273
void set_power_capping_source(uint8_t value)
Definition: plat_power_capping.c:313
void plat_power_capping_give_sem()
Definition: plat_power_capping.c:494
void set_power_capping_method(uint8_t value)
Definition: plat_power_capping.c:278
@ CAPPING_VR_IDX_MAX
Definition: plat_power_capping.h:36
@ CAPPING_VR_IDX_MEDHA0
Definition: plat_power_capping.h:34
@ CAPPING_VR_IDX_MEDHA1
Definition: plat_power_capping.h:35
uint8_t get_power_capping_source()
Definition: plat_power_capping.c:308
uint16_t get_power_capping_threshold(uint8_t vr_idx, uint8_t lv)
Definition: plat_power_capping.c:412
uint16_t get_power_capping_avg_power(uint8_t vr_idx, uint8_t lv)
Definition: plat_power_capping.c:230
bool find_cpld_lv1_time_window_idx_by_value(uint8_t *idx, uint16_t value)
Definition: plat_power_capping.c:219
uint16_t get_power_capping_time_w(uint8_t vr_idx, uint8_t lv)
Definition: plat_power_capping.c:338
@ CAPPING_LV_IDX_LV1
Definition: plat_power_capping.h:40
@ CAPPING_LV_IDX_LV3
Definition: plat_power_capping.h:42
@ CAPPING_LV_IDX_LV2
Definition: plat_power_capping.h:41
@ CAPPING_LV_IDX_MAX
Definition: plat_power_capping.h:43
uint16_t get_power_capping_current_threshold(uint8_t vr_idx)
Definition: plat_power_capping.c:328
@ CAPPING_SOURCE_MAX
Definition: plat_power_capping.h:30
@ CAPPING_SOURCE_VR
Definition: plat_power_capping.h:28
@ CAPPING_SOURCE_ADC
Definition: plat_power_capping.h:29
@ CAPPING_M_CREDIT_BASE
Definition: plat_power_capping.h:23
@ CAPPING_M_MAX
Definition: plat_power_capping.h:24
@ CAPPING_M_LOOK_UP_TABLE
Definition: plat_power_capping.h:22
void add_sync_oc_warn_to_work()
Definition: plat_power_capping.c:130
void plat_power_capping_init()
Definition: plat_power_capping.c:499
void set_power_capping_threshold(uint8_t vr_idx, uint8_t lv, uint16_t value)
Definition: plat_power_capping.c:427
void set_power_capping_time_w(uint8_t vr_idx, uint8_t lv, uint16_t value)
Definition: plat_power_capping.c:353
void power_capping_syn_vr_oc_warn_limit()
Definition: plat_power_capping.c:54