OpenBIC
OpenSource Bridge-IC
plat_power_seq.c File Reference
#include <stdio.h>
#include <zephyr.h>
#include <logging/log.h>
#include <drivers/sensor.h>
#include <drivers/pwm.h>
#include "libutil.h"
#include "power_status.h"
#include "plat_class.h"
#include "plat_gpio.h"
#include "plat_isr.h"
#include "plat_power_seq.h"
Include dependency graph for plat_power_seq.c:

Macros

#define CXL_READY_HANDLER_STACK_SIZE   1024
 

Functions

 LOG_MODULE_REGISTER (plat_power_seq)
 
 K_WORK_DELAYABLE_DEFINE (set_dc_on_5s_work, set_DC_on_delayed_status)
 
 K_WORK_DELAYABLE_DEFINE (set_cxl1_vr_ready_work, set_cxl1_vr_access_delayed_status)
 
 K_WORK_DELAYABLE_DEFINE (set_cxl2_vr_ready_work, set_cxl2_vr_access_delayed_status)
 
 K_WORK_DELAYABLE_DEFINE (cxl1_ready_thread, cxl1_ready_handler)
 
 K_WORK_DELAYABLE_DEFINE (cxl2_ready_thread, cxl2_ready_handler)
 
 K_WORK_DELAYABLE_DEFINE (enable_asic1_rst_work, enable_asic1_rst)
 
 K_WORK_DELAYABLE_DEFINE (enable_asic2_rst_work, enable_asic2_rst)
 
 K_THREAD_STACK_DEFINE (cxl1_stack_area, CXL_READY_HANDLER_STACK_SIZE)
 
 K_THREAD_STACK_DEFINE (cxl2_stack_area, CXL_READY_HANDLER_STACK_SIZE)
 
 K_MUTEX_DEFINE (switch_ioe_mux_mutex)
 
void enable_asic1_rst ()
 
void enable_asic2_rst ()
 
void set_mb_dc_status (uint8_t gpio_num)
 
void execute_power_on_sequence ()
 
void create_check_cxl_ready_thread ()
 
int power_on_handler (int cxl_id, int power_stage)
 
void enable_powers (int cxl_id, int pwr_stage)
 
int check_powers_enabled (int cxl_id, int pwr_stage)
 
bool is_power_controlled (int cxl_id, int power_pin, uint8_t check_power_status, char *power_name)
 
void execute_power_off_sequence ()
 
int power_off_handler (int cxl_id, int power_stage)
 
void disable_powers (int cxl_id, int pwr_stage)
 
int check_powers_disabled (int cxl_id, int pwr_stage)
 
void switch_mux_to_bic (uint8_t value_to_write)
 
void cxl1_ready_handler ()
 
void cxl2_ready_handler ()
 
void set_cxl_vr_access (uint8_t cxl_id, bool value)
 
void set_cxl1_vr_access_delayed_status ()
 
void set_cxl2_vr_access_delayed_status ()
 
bool cxl1_vr_access (uint8_t sensor_num)
 
bool cxl2_vr_access (uint8_t sensor_num)
 
void set_cxl_ready_status (uint8_t cxl_id, bool value)
 
bool get_cxl_ready_status (uint8_t cxl_id)
 
bool cxl1_ready_access (uint8_t sensor_num)
 
bool cxl2_ready_access (uint8_t sensor_num)
 

Variables

struct k_thread cxl1_thread_data
 
struct k_thread cxl2_thread_data
 
cxl_power_control_gpio cxl_power_ctrl_pin [MAX_CXL_ID]
 
cxl_power_good_gpio cxl_power_good_pin [MAX_CXL_ID]
 

Macro Definition Documentation

◆ CXL_READY_HANDLER_STACK_SIZE

#define CXL_READY_HANDLER_STACK_SIZE   1024

Function Documentation

◆ check_powers_disabled()

int check_powers_disabled ( int  cxl_id,
int  pwr_stage 
)
Here is the call graph for this function:

◆ check_powers_enabled()

int check_powers_enabled ( int  cxl_id,
int  pwr_stage 
)
Here is the call graph for this function:

◆ create_check_cxl_ready_thread()

void create_check_cxl_ready_thread ( )

◆ cxl1_ready_access()

bool cxl1_ready_access ( uint8_t  sensor_num)
Here is the call graph for this function:

◆ cxl1_ready_handler()

void cxl1_ready_handler ( )

◆ cxl1_vr_access()

bool cxl1_vr_access ( uint8_t  sensor_num)

◆ cxl2_ready_access()

bool cxl2_ready_access ( uint8_t  sensor_num)
Here is the call graph for this function:

◆ cxl2_ready_handler()

void cxl2_ready_handler ( )

◆ cxl2_vr_access()

bool cxl2_vr_access ( uint8_t  sensor_num)

◆ disable_powers()

void disable_powers ( int  cxl_id,
int  pwr_stage 
)
Here is the call graph for this function:

◆ enable_asic1_rst()

void enable_asic1_rst ( )
Here is the call graph for this function:

◆ enable_asic2_rst()

void enable_asic2_rst ( )
Here is the call graph for this function:

◆ enable_powers()

void enable_powers ( int  cxl_id,
int  pwr_stage 
)
Here is the call graph for this function:

◆ execute_power_off_sequence()

void execute_power_off_sequence ( )
Here is the call graph for this function:

◆ execute_power_on_sequence()

void execute_power_on_sequence ( )
Here is the call graph for this function:

◆ get_cxl_ready_status()

bool get_cxl_ready_status ( uint8_t  cxl_id)

◆ is_power_controlled()

bool is_power_controlled ( int  cxl_id,
int  power_pin,
uint8_t  check_power_status,
char *  power_name 
)
Here is the call graph for this function:

◆ K_MUTEX_DEFINE()

K_MUTEX_DEFINE ( switch_ioe_mux_mutex  )

◆ K_THREAD_STACK_DEFINE() [1/2]

K_THREAD_STACK_DEFINE ( cxl1_stack_area  ,
CXL_READY_HANDLER_STACK_SIZE   
)

◆ K_THREAD_STACK_DEFINE() [2/2]

K_THREAD_STACK_DEFINE ( cxl2_stack_area  ,
CXL_READY_HANDLER_STACK_SIZE   
)

◆ K_WORK_DELAYABLE_DEFINE() [1/7]

K_WORK_DELAYABLE_DEFINE ( cxl1_ready_thread  ,
cxl1_ready_handler   
)

◆ K_WORK_DELAYABLE_DEFINE() [2/7]

K_WORK_DELAYABLE_DEFINE ( cxl2_ready_thread  ,
cxl2_ready_handler   
)

◆ K_WORK_DELAYABLE_DEFINE() [3/7]

K_WORK_DELAYABLE_DEFINE ( enable_asic1_rst_work  ,
enable_asic1_rst   
)

◆ K_WORK_DELAYABLE_DEFINE() [4/7]

K_WORK_DELAYABLE_DEFINE ( enable_asic2_rst_work  ,
enable_asic2_rst   
)

◆ K_WORK_DELAYABLE_DEFINE() [5/7]

K_WORK_DELAYABLE_DEFINE ( set_cxl1_vr_ready_work  ,
set_cxl1_vr_access_delayed_status   
)

◆ K_WORK_DELAYABLE_DEFINE() [6/7]

K_WORK_DELAYABLE_DEFINE ( set_cxl2_vr_ready_work  ,
set_cxl2_vr_access_delayed_status   
)

◆ K_WORK_DELAYABLE_DEFINE() [7/7]

K_WORK_DELAYABLE_DEFINE ( set_dc_on_5s_work  ,
set_DC_on_delayed_status   
)

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( plat_power_seq  )

◆ power_off_handler()

int power_off_handler ( int  cxl_id,
int  power_stage 
)
Here is the call graph for this function:

◆ power_on_handler()

int power_on_handler ( int  cxl_id,
int  power_stage 
)
Here is the call graph for this function:

◆ set_cxl1_vr_access_delayed_status()

void set_cxl1_vr_access_delayed_status ( )
Here is the call graph for this function:

◆ set_cxl2_vr_access_delayed_status()

void set_cxl2_vr_access_delayed_status ( )
Here is the call graph for this function:

◆ set_cxl_ready_status()

void set_cxl_ready_status ( uint8_t  cxl_id,
bool  value 
)

◆ set_cxl_vr_access()

void set_cxl_vr_access ( uint8_t  cxl_id,
bool  value 
)

◆ set_mb_dc_status()

void set_mb_dc_status ( uint8_t  gpio_num)
Here is the call graph for this function:

◆ switch_mux_to_bic()

void switch_mux_to_bic ( uint8_t  value_to_write)
Here is the call graph for this function:

Variable Documentation

◆ cxl1_thread_data

struct k_thread cxl1_thread_data

◆ cxl2_thread_data

struct k_thread cxl2_thread_data

◆ cxl_power_ctrl_pin

cxl_power_control_gpio cxl_power_ctrl_pin[MAX_CXL_ID]

◆ cxl_power_good_pin

cxl_power_good_gpio cxl_power_good_pin[MAX_CXL_ID]
Initial value:
= {
[0] = {
.p075v_asic_pg = PWRGD_P0V75_ASIC1,
.p08v_asic_pg = PWRGD_P0V8_ASIC1,
.p085v_asic_pg = PWRGD_P0V85_ASIC1,
.p1v2_asic_pg = PWRGD_P1V2_ASIC1,
.p1v8_asic_pg = PWRGD_P1V8_ASIC1,
.pvpp_ab_dimm_pg = PWRGD_PVPP_AB_ASIC1,
.pvpp_cd_dimm_pg = PWRGD_PVPP_CD_ASIC1,
.pvddq_ab_dimm_pg = PWRGD_PVDDQ_AB_ASIC1,
.pvddq_cd_dimm_pg = PWRGD_PVDDQ_CD_ASIC1,
.pvtt_ab_dimm_pg = PWRGD_PVTT_AB_ASIC1,
.pvtt_cd_dimm_pg = PWRGD_PVTT_AB_ASIC1, },
[1] = {
.p075v_asic_pg = PWRGD_P0V75_ASIC2,
.p08v_asic_pg = PWRGD_P0V8_ASIC2,
.p085v_asic_pg = PWRGD_P0V85_ASIC2,
.p1v2_asic_pg = PWRGD_P1V2_ASIC2,
.p1v8_asic_pg = PWRGD_P1V8_ASIC2,
.pvpp_ab_dimm_pg = PWRGD_PVPP_AB_ASIC2,
.pvpp_cd_dimm_pg = PWRGD_PVPP_CD_ASIC2,
.pvddq_ab_dimm_pg = PWRGD_PVDDQ_AB_ASIC2,
.pvddq_cd_dimm_pg = PWRGD_PVDDQ_CD_ASIC2,
.pvtt_ab_dimm_pg = PWRGD_PVTT_AB_ASIC2,
.pvtt_cd_dimm_pg = PWRGD_PVTT_AB_ASIC2, },
}