OpenBIC
OpenSource Bridge-IC
plat_power_seq.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_PWR_SEQ_H
18
#define PLAT_PWR_SEQ_H
19
20
#define POWER_SEQ_HANDLER_STACK_SIZE 1000
21
#define CHECKK_POWER_DELAY_MS 100
22
23
enum
POWER_ON_STAGE
{
24
ASIC_POWER_ON_STAGE1
= 0x00,
25
ASIC_POWER_ON_STAGE2
,
26
DIMM_POWER_ON_STAGE1
,
27
DIMM_POWER_ON_STAGE2
,
28
DIMM_POWER_ON_STAGE3
,
29
};
30
31
enum
POWER_OFF_STAGE
{
32
DIMM_POWER_OFF_STAGE1
= 0x00,
33
DIMM_POWER_OFF_STAGE2
,
34
DIMM_POWER_OFF_STAGE3
,
35
ASIC_POWER_OFF_STAGE1
,
36
ASIC_POWER_OFF_STAGE2
,
37
BOARD_POWER_OFF_STAGE
,
38
};
39
40
enum
CONTROL_POWER_SEQ_PIN_MAPPING
{
41
CONTROL_POWER_SEQ_01
= P0V75_ASIC_EN_BIC,
42
CONTROL_POWER_SEQ_02
= P0V8_BIC_ASIC_EN,
43
CONTROL_POWER_SEQ_03
= P0V85_BIC_ASIC_EN,
44
CONTROL_POWER_SEQ_04
= P1V2_BIC_ASIC_EN,
45
CONTROL_POWER_SEQ_05
= P1V8_BIC_ASIC_EN,
46
CONTROL_POWER_SEQ_06
= PVPP_AB_BIC_DIMM_EN,
47
CONTROL_POWER_SEQ_07
= PVPP_CD_BIC_DIMM_EN,
48
CONTROL_POWER_SEQ_08
= PVDDQ_AB_EN_BIC,
49
CONTROL_POWER_SEQ_09
= PVDDQ_CD_EN_BIC,
50
CONTROL_POWER_SEQ_10
= PVTT_AB_BIC_DIMM_EN,
51
CONTROL_POWER_SEQ_11
= PVTT_CD_BIC_DIMM_EN,
52
};
53
54
enum
CHECK_POWER_SEQ_PIN_MAPPING
{
55
CHECK_POWER_SEQ_01
= PWRGD_P0V75_ASIC_BIC,
56
CHECK_POWER_SEQ_02
= PWRGD_P0V8_ASIC,
57
CHECK_POWER_SEQ_03
= PWRGD_P0V85_ASIC,
58
CHECK_POWER_SEQ_04
= PWRGD_P1V2_ASIC,
59
CHECK_POWER_SEQ_05
= PWRGD_P1V8_ASIC,
60
CHECK_POWER_SEQ_06
= PWRGD_PVPP_AB,
61
CHECK_POWER_SEQ_07
= PWRGD_PVPP_CD,
62
CHECK_POWER_SEQ_08
= PWRGD_PVDDQ_AB_BIC,
63
CHECK_POWER_SEQ_09
= PWRGD_PVDDQ_CD_BIC,
64
CHECK_POWER_SEQ_10
= PWRGD_PVTT_AB,
65
CHECK_POWER_SEQ_11
= PWRGD_PVTT_CD,
66
};
67
68
void
set_MB_DC_status
(uint8_t gpio_num);
69
void
control_power_sequence
();
70
void
init_power_thread
(uint8_t power_status);
71
void
abort_power_thread
();
72
void
execute_power_on_sequence
();
73
void
execute_power_off_sequence
();
74
int
power_on_handler
(uint8_t control_stage);
75
int
power_off_handler
(uint8_t control_stage);
76
int
enable_power
(uint8_t control_stage);
77
int
disable_power
(uint8_t control_stage);
78
int
check_power_enable
(uint8_t control_stage);
79
int
check_power_disable
(uint8_t control_stage);
80
int
check_power_status
(uint8_t power_status, uint8_t power_seq);
81
82
#endif
power_on_handler
bool power_on_handler(uint8_t initial_stage)
Definition:
plat_power_seq.c:817
POWER_OFF_STAGE
POWER_OFF_STAGE
Definition:
plat_power_seq.h:50
power_off_handler
bool power_off_handler(uint8_t initial_stage)
Definition:
plat_power_seq.c:983
POWER_ON_STAGE
POWER_ON_STAGE
Definition:
plat_power_seq.h:38
CHECK_POWER_SEQ_03
@ CHECK_POWER_SEQ_03
Definition:
plat_power_seq.h:66
CHECK_POWER_SEQ_01
@ CHECK_POWER_SEQ_01
Definition:
plat_power_seq.h:64
CHECK_POWER_SEQ_06
@ CHECK_POWER_SEQ_06
Definition:
plat_power_seq.h:69
CHECK_POWER_SEQ_05
@ CHECK_POWER_SEQ_05
Definition:
plat_power_seq.h:68
CHECK_POWER_SEQ_07
@ CHECK_POWER_SEQ_07
Definition:
plat_power_seq.h:70
CHECK_POWER_SEQ_02
@ CHECK_POWER_SEQ_02
Definition:
plat_power_seq.h:65
CHECK_POWER_SEQ_08
@ CHECK_POWER_SEQ_08
Definition:
plat_power_seq.h:71
CHECK_POWER_SEQ_04
@ CHECK_POWER_SEQ_04
Definition:
plat_power_seq.h:67
init_power_thread
void init_power_thread(uint8_t power_status)
Definition:
plat_power_seq.c:65
check_power_status
int check_power_status(uint8_t power_status, uint8_t power_seq)
Definition:
plat_power_seq.c:402
CONTROL_POWER_SEQ_PIN_MAPPING
CONTROL_POWER_SEQ_PIN_MAPPING
Definition:
plat_power_seq.h:40
CONTROL_POWER_SEQ_08
@ CONTROL_POWER_SEQ_08
Definition:
plat_power_seq.h:48
CONTROL_POWER_SEQ_09
@ CONTROL_POWER_SEQ_09
Definition:
plat_power_seq.h:49
CONTROL_POWER_SEQ_02
@ CONTROL_POWER_SEQ_02
Definition:
plat_power_seq.h:42
CONTROL_POWER_SEQ_10
@ CONTROL_POWER_SEQ_10
Definition:
plat_power_seq.h:50
CONTROL_POWER_SEQ_07
@ CONTROL_POWER_SEQ_07
Definition:
plat_power_seq.h:47
CONTROL_POWER_SEQ_11
@ CONTROL_POWER_SEQ_11
Definition:
plat_power_seq.h:51
CONTROL_POWER_SEQ_06
@ CONTROL_POWER_SEQ_06
Definition:
plat_power_seq.h:46
CONTROL_POWER_SEQ_03
@ CONTROL_POWER_SEQ_03
Definition:
plat_power_seq.h:43
CONTROL_POWER_SEQ_05
@ CONTROL_POWER_SEQ_05
Definition:
plat_power_seq.h:45
CONTROL_POWER_SEQ_01
@ CONTROL_POWER_SEQ_01
Definition:
plat_power_seq.h:41
CONTROL_POWER_SEQ_04
@ CONTROL_POWER_SEQ_04
Definition:
plat_power_seq.h:44
execute_power_off_sequence
void execute_power_off_sequence()
Definition:
plat_power_seq.c:97
ASIC_POWER_OFF_STAGE1
@ ASIC_POWER_OFF_STAGE1
Definition:
plat_power_seq.h:35
BOARD_POWER_OFF_STAGE
@ BOARD_POWER_OFF_STAGE
Definition:
plat_power_seq.h:37
ASIC_POWER_OFF_STAGE2
@ ASIC_POWER_OFF_STAGE2
Definition:
plat_power_seq.h:36
DIMM_POWER_OFF_STAGE3
@ DIMM_POWER_OFF_STAGE3
Definition:
plat_power_seq.h:34
DIMM_POWER_OFF_STAGE2
@ DIMM_POWER_OFF_STAGE2
Definition:
plat_power_seq.h:33
DIMM_POWER_OFF_STAGE1
@ DIMM_POWER_OFF_STAGE1
Definition:
plat_power_seq.h:32
abort_power_thread
void abort_power_thread()
Definition:
plat_isr.c:161
execute_power_on_sequence
void execute_power_on_sequence()
Definition:
plat_power_seq.c:87
control_power_sequence
void control_power_sequence()
Definition:
plat_isr.c:116
set_MB_DC_status
void set_MB_DC_status(uint8_t gpio_num)
Definition:
plat_power_seq.c:37
CHECK_POWER_SEQ_PIN_MAPPING
CHECK_POWER_SEQ_PIN_MAPPING
Definition:
plat_power_seq.h:54
CHECK_POWER_SEQ_10
@ CHECK_POWER_SEQ_10
Definition:
plat_power_seq.h:64
CHECK_POWER_SEQ_11
@ CHECK_POWER_SEQ_11
Definition:
plat_power_seq.h:65
CHECK_POWER_SEQ_09
@ CHECK_POWER_SEQ_09
Definition:
plat_power_seq.h:63
check_power_enable
int check_power_enable(uint8_t control_stage)
Definition:
plat_power_seq.c:216
enable_power
int enable_power(uint8_t control_stage)
Definition:
plat_power_seq.c:180
DIMM_POWER_ON_STAGE1
@ DIMM_POWER_ON_STAGE1
Definition:
plat_power_seq.h:26
ASIC_POWER_ON_STAGE1
@ ASIC_POWER_ON_STAGE1
Definition:
plat_power_seq.h:24
ASIC_POWER_ON_STAGE2
@ ASIC_POWER_ON_STAGE2
Definition:
plat_power_seq.h:25
DIMM_POWER_ON_STAGE3
@ DIMM_POWER_ON_STAGE3
Definition:
plat_power_seq.h:28
DIMM_POWER_ON_STAGE2
@ DIMM_POWER_ON_STAGE2
Definition:
plat_power_seq.h:27
disable_power
int disable_power(uint8_t control_stage)
Definition:
plat_power_seq.c:291
check_power_disable
int check_power_disable(uint8_t control_stage)
Definition:
plat_power_seq.c:331
meta-facebook
yv35-nf
src
platform
plat_power_seq.h
Generated by
1.9.2