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
21
enum
{
22
CAPPING_M_LOOK_UP_TABLE
= 0,
23
CAPPING_M_CREDIT_BASE
,
24
CAPPING_M_MAX
,
25
};
26
27
enum
{
28
CAPPING_SOURCE_VR
= 0,
29
CAPPING_SOURCE_ADC
,
30
CAPPING_SOURCE_MAX
,
31
};
32
33
enum
{
34
CAPPING_VR_IDX_MEDHA0
= 0,
35
CAPPING_VR_IDX_MEDHA1
,
36
CAPPING_VR_IDX_MAX
,
37
};
38
39
enum
{
40
CAPPING_LV_IDX_LV1
= 0,
41
CAPPING_LV_IDX_LV2
,
42
CAPPING_LV_IDX_LV3
,
43
CAPPING_LV_IDX_MAX
,
44
};
45
46
#endif
47
48
void
set_power_capping_lv_switch_en_val
(uint8_t
val
);
49
void
power_capping_syn_vr_oc_warn_limit
();
50
void
add_sync_oc_warn_to_work
();
51
bool
find_cpld_lv1_time_window_idx_by_value
(uint8_t *
idx
, uint16_t value);
52
uint16_t
get_power_capping_avg_power
(uint8_t vr_idx, uint8_t lv);
53
uint8_t
get_power_capping_method
();
54
void
set_power_capping_method
(uint8_t value);
55
uint8_t
get_power_capping_source
();
56
void
set_power_capping_source
(uint8_t value);
57
uint16_t
get_power_capping_current_threshold
(uint8_t vr_idx);
58
uint16_t
get_power_capping_time_w
(uint8_t vr_idx, uint8_t lv);
59
void
set_power_capping_time_w
(uint8_t vr_idx, uint8_t lv, uint16_t value);
60
uint16_t
get_power_capping_threshold
(uint8_t vr_idx, uint8_t lv);
61
void
set_power_capping_threshold
(uint8_t vr_idx, uint8_t lv, uint16_t value);
62
void
plat_power_capping_give_sem
();
63
void
plat_power_capping_init
();
idx
uint8_t idx
Definition:
plat_util.c:42
val
uint32_t val
Definition:
plat_util.c:43
get_power_capping_method
uint8_t get_power_capping_method()
Definition:
plat_power_capping.c:280
set_power_capping_source
void set_power_capping_source(uint8_t value)
Definition:
plat_power_capping.c:321
plat_power_capping_give_sem
void plat_power_capping_give_sem()
Definition:
plat_power_capping.c:498
set_power_capping_method
void set_power_capping_method(uint8_t value)
Definition:
plat_power_capping.c:285
CAPPING_VR_IDX_MAX
@ CAPPING_VR_IDX_MAX
Definition:
plat_power_capping.h:36
get_power_capping_source
uint8_t get_power_capping_source()
Definition:
plat_power_capping.c:316
get_power_capping_threshold
uint16_t get_power_capping_threshold(uint8_t vr_idx, uint8_t lv)
Definition:
plat_power_capping.c:420
get_power_capping_avg_power
uint16_t get_power_capping_avg_power(uint8_t vr_idx, uint8_t lv)
Definition:
plat_power_capping.c:237
find_cpld_lv1_time_window_idx_by_value
bool find_cpld_lv1_time_window_idx_by_value(uint8_t *idx, uint16_t value)
Definition:
plat_power_capping.c:226
get_power_capping_time_w
uint16_t get_power_capping_time_w(uint8_t vr_idx, uint8_t lv)
Definition:
plat_power_capping.c:346
CAPPING_LV_IDX_LV1
@ CAPPING_LV_IDX_LV1
Definition:
plat_power_capping.h:40
CAPPING_LV_IDX_LV3
@ CAPPING_LV_IDX_LV3
Definition:
plat_power_capping.h:42
CAPPING_LV_IDX_LV2
@ CAPPING_LV_IDX_LV2
Definition:
plat_power_capping.h:41
CAPPING_LV_IDX_MAX
@ CAPPING_LV_IDX_MAX
Definition:
plat_power_capping.h:43
get_power_capping_current_threshold
uint16_t get_power_capping_current_threshold(uint8_t vr_idx)
Definition:
plat_power_capping.c:336
CAPPING_SOURCE_MAX
@ CAPPING_SOURCE_MAX
Definition:
plat_power_capping.h:30
CAPPING_SOURCE_VR
@ CAPPING_SOURCE_VR
Definition:
plat_power_capping.h:28
CAPPING_SOURCE_ADC
@ CAPPING_SOURCE_ADC
Definition:
plat_power_capping.h:29
CAPPING_M_CREDIT_BASE
@ CAPPING_M_CREDIT_BASE
Definition:
plat_power_capping.h:23
CAPPING_M_MAX
@ CAPPING_M_MAX
Definition:
plat_power_capping.h:24
CAPPING_M_LOOK_UP_TABLE
@ CAPPING_M_LOOK_UP_TABLE
Definition:
plat_power_capping.h:22
add_sync_oc_warn_to_work
void add_sync_oc_warn_to_work()
Definition:
plat_power_capping.c:137
plat_power_capping_init
void plat_power_capping_init()
Definition:
plat_power_capping.c:503
set_power_capping_threshold
void set_power_capping_threshold(uint8_t vr_idx, uint8_t lv, uint16_t value)
Definition:
plat_power_capping.c:435
set_power_capping_lv_switch_en_val
void set_power_capping_lv_switch_en_val(uint8_t val)
Definition:
plat_power_capping.c:56
set_power_capping_time_w
void set_power_capping_time_w(uint8_t vr_idx, uint8_t lv, uint16_t value)
Definition:
plat_power_capping.c:361
power_capping_syn_vr_oc_warn_limit
void power_capping_syn_vr_oc_warn_limit()
Definition:
plat_power_capping.c:61
CAPPING_VR_IDX_MEDHA0
@ CAPPING_VR_IDX_MEDHA0
Definition:
plat_power_capping.h:34
CAPPING_VR_IDX_MEDHA1
@ CAPPING_VR_IDX_MEDHA1
Definition:
plat_power_capping.h:35
meta-facebook
sb-rb
src
platform
plat_power_capping.h
Generated by
1.9.2