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#include "plat_gpio.h"
21
22#define DC_ON_DELAY5_SEC 5
23#define VR_READY_DELAY_SEC 7
24#define CXL_READY_SECONDS 30
25#define CXL_READY_RETRY_TIMES 10
26#define CXL1_HEART_BEAT_LABEL "HB0"
27#define CXL2_HEART_BEAT_LABEL "HB1"
28#define CXL_READY_INTERVAL_SECONDS 3
29#define SWITCH_IOE_MUX_TIMEOUT_SECONDS 1
30#define CHK_PWR_DELAY_MSEC 1
31#define SYS_CLK_STABLE_DELAY_MSEC 25
32#define PWR_RST_DELAY_MSEC 25
33#define P1V8_POWER_OFF_DELAY_MSEC 3500
34
35#define POWER_SEQ_CTRL_STACK_SIZE 1000
36
53
54typedef struct _cxl_power_good_gpio {
67
68enum CXL_NUM {
72};
73
83};
84
94};
95
96void set_mb_dc_status(uint8_t gpio_num);
97void enable_asic1_rst();
98void enable_asic2_rst();
99bool is_power_controlled(int cxl_id, int power_pin, uint8_t check_power_status, char *power_name);
100int check_powers_enabled(int cxl_id, int pwr_stage);
101int check_powers_disabled(int cxl_id, int pwr_stage);
102void enable_powers(int cxl_id, int pwr_stage);
103void disable_powers(int cxl_id, int pwr_stage);
104int power_on_handler(int cxl_id, int power_stage);
105int power_off_handler(int cxl_id, int power_stage);
108void cxl1_ready_handler();
109void cxl2_ready_handler();
110void set_cxl_ready_status(uint8_t cxl_id, bool value);
111bool get_cxl_ready_status(uint8_t cxl_id);
112bool cxl1_ready_access(uint8_t sensor_num);
113bool cxl2_ready_access(uint8_t sensor_num);
114void set_cxl_vr_access(uint8_t cxl_id, bool value);
117bool cxl1_vr_access(uint8_t sensor_num);
118bool cxl2_vr_access(uint8_t sensor_num);
120
121#endif
bool power_on_handler(uint8_t initial_stage)
Definition: plat_power_seq.c:817
POWER_OFF_STAGE
Definition: plat_power_seq.h:50
bool power_off_handler(uint8_t initial_stage)
Definition: plat_power_seq.c:983
POWER_ON_STAGE
Definition: plat_power_seq.h:38
uint8_t sensor_num
Definition: storage_handler.h:6
Definition: plat_power_seq.h:37
int p1v2_asic_en
Definition: plat_power_seq.h:42
int enclk_100m_osc
Definition: plat_power_seq.h:38
int pvddq_ab_dimm_en
Definition: plat_power_seq.h:48
int p1v8_asic_en
Definition: plat_power_seq.h:43
int sys_rst
Definition: plat_power_seq.h:44
int p075v_asic_en
Definition: plat_power_seq.h:39
int pvtt_cd_dimm_en
Definition: plat_power_seq.h:51
int pvpp_ab_dimm_en
Definition: plat_power_seq.h:46
int p08v_asic_en
Definition: plat_power_seq.h:40
int p085v_asic_en
Definition: plat_power_seq.h:41
int pwr_on_rst
Definition: plat_power_seq.h:45
int pvpp_cd_dimm_en
Definition: plat_power_seq.h:47
int pvddq_cd_dimm_en
Definition: plat_power_seq.h:49
int pvtt_ab_dimm_en
Definition: plat_power_seq.h:50
Definition: plat_power_seq.h:54
int pvtt_cd_dimm_pg
Definition: plat_power_seq.h:65
int p085v_asic_pg
Definition: plat_power_seq.h:57
int pvpp_cd_dimm_pg
Definition: plat_power_seq.h:61
int pvtt_ab_dimm_pg
Definition: plat_power_seq.h:64
int p1v2_asic_pg
Definition: plat_power_seq.h:58
int p08v_asic_pg
Definition: plat_power_seq.h:56
int pvpp_ab_dimm_pg
Definition: plat_power_seq.h:60
int p075v_asic_pg
Definition: plat_power_seq.h:55
int pvddq_ab_dimm_pg
Definition: plat_power_seq.h:62
int pvddq_cd_dimm_pg
Definition: plat_power_seq.h:63
int p1v8_asic_pg
Definition: plat_power_seq.h:59
int check_power_status(uint8_t power_status, uint8_t power_seq)
Definition: plat_power_seq.c:402
void execute_power_off_sequence()
Definition: plat_power_seq.c:97
void execute_power_on_sequence()
Definition: plat_power_seq.c:87
int check_powers_enabled(uint8_t pwr_stage)
Definition: plat_power_seq.c:234
@ ASIC_POWER_OFF_STAGE_2
Definition: plat_power_seq.h:47
@ ASIC_POWER_OFF_STAGE_3
Definition: plat_power_seq.h:48
@ DIMM_POWER_OFF_STAGE_1
Definition: plat_power_seq.h:43
@ DIMM_POWER_OFF_STAGE_3
Definition: plat_power_seq.h:45
@ DIMM_POWER_OFF_STAGE_2
Definition: plat_power_seq.h:44
@ MAX_POWER_OFF_STAGES
Definition: plat_power_seq.h:50
@ CLK_POWER_OFF_STAGE
Definition: plat_power_seq.h:49
@ ASIC_POWER_OFF_STAGE_1
Definition: plat_power_seq.h:46
bool is_power_controlled(uint8_t power_pin, uint8_t check_power_status, char *power_name)
Definition: plat_power_seq.c:360
int check_powers_disabled(uint8_t pwr_stage)
Definition: plat_power_seq.c:297
void enable_powers(uint8_t pwr_stage)
Definition: plat_power_seq.c:151
void disable_powers(uint8_t pwr_stage)
Definition: plat_power_seq.c:188
bool get_cxl_ready_status()
Definition: plat_power_seq.c:403
@ ASIC_POWER_ON_STAGE_2
Definition: plat_power_seq.h:35
@ ASIC_POWER_ON_STAGE_1
Definition: plat_power_seq.h:34
@ DIMM_POWER_ON_STAGE_2
Definition: plat_power_seq.h:37
@ DIMM_POWER_ON_STAGE_3
Definition: plat_power_seq.h:38
@ DIMM_POWER_ON_STAGE_1
Definition: plat_power_seq.h:36
@ MAX_POWER_ON_STAGES
Definition: plat_power_seq.h:39
@ CLK_POWER_ON_STAGE
Definition: plat_power_seq.h:33
void set_mb_dc_status(uint8_t gpio_num)
Definition: plat_power_seq.c:41
bool cxl1_ready_access(uint8_t sensor_num)
Definition: plat_power_seq.c:722
bool cxl2_ready_access(uint8_t sensor_num)
Definition: plat_power_seq.c:727
struct _cxl_power_good_gpio cxl_power_good_gpio
void set_cxl1_vr_access_delayed_status()
Definition: plat_power_seq.c:691
void set_cxl2_vr_access_delayed_status()
Definition: plat_power_seq.c:696
bool cxl1_vr_access(uint8_t sensor_num)
Definition: plat_power_seq.c:701
void enable_asic2_rst()
Definition: plat_power_seq.c:122
void set_cxl_vr_access(uint8_t cxl_id, bool value)
Definition: plat_power_seq.c:679
bool cxl2_vr_access(uint8_t sensor_num)
Definition: plat_power_seq.c:706
void set_cxl_ready_status(uint8_t cxl_id, bool value)
Definition: plat_power_seq.c:711
void enable_asic1_rst()
Definition: plat_power_seq.c:116
void create_check_cxl_ready_thread()
Definition: plat_power_seq.c:184
@ ASIC_POWER_ON_STAGE_3
Definition: plat_power_seq.h:78
void cxl2_ready_handler()
Definition: plat_power_seq.c:634
CXL_NUM
Definition: plat_power_seq.h:68
@ CXL_ID_2
Definition: plat_power_seq.h:70
@ MAX_CXL_ID
Definition: plat_power_seq.h:71
@ CXL_ID_1
Definition: plat_power_seq.h:69
struct _cxl_power_control_gpio cxl_power_control_gpio
void cxl1_ready_handler()
Definition: plat_power_seq.c:589