OpenBIC
OpenSource Bridge-IC
plat_dimm.h File Reference
#include <stdint.h>
#include <stdbool.h>
#include "plat_i3c.h"
Include dependency graph for plat_dimm.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  dimm_info
 

Macros

#define MAX_COUNT_DIMM   6
 
#define I3C_MUX_TO_BIC   0x1
 
#define I3C_MUX_TO_CPU   0x0
 
#define DIMM_MUX_TO_DIMM_A0A1A3   0x0
 
#define DIMM_MUX_TO_DIMM_A4A6A7   0x1
 
#define I3C_DIMM_MUX_MUTEX_TIMEOUT_MS   1000
 
#define GET_DIMM_INFO_TIME_MS   1000
 
#define GET_DIMM_INFO_STACK_SIZE   2304
 
#define MAX_LEN_ME_GET_PMIC_ERR   6
 
#define MAX_LEN_I3C_GET_PMIC_ERR   47
 
#define MAX_LEN_I3C_GET_PMIC_PWR   1
 
#define MAX_LEN_I3C_GET_SPD_TEMP   2
 
#define DIMM_I3C_MUX_CONTROL_OFFSET   0x0B
 

Typedefs

typedef struct dimm_info dimm_info
 

Enumerations

enum  DIMM_ID {
  DIMM_ID_A0 = 0 , DIMM_ID_A2 , DIMM_ID_A3 , DIMM_ID_A4 ,
  DIMM_ID_A6 , DIMM_ID_A7 , DIMM_ID_UNKNOWN = 0xff , DIMM_ID_A0 = 0 ,
  DIMM_ID_A1 , DIMM_ID_A2 , DIMM_ID_A3 , DIMM_ID_A4 ,
  DIMM_ID_A5 , DIMM_ID_A6 , DIMM_ID_A7 , DIMM_ID_UNKNOWN = 0xff ,
  DIMM_ID_A , DIMM_ID_B , DIMM_ID_C , DIMM_ID_D ,
  DIMM_ID_E , DIMM_ID_F , DIMM_ID_G , DIMM_ID_H ,
  DIMM_ID_I , DIMM_ID_J , DIMM_ID_K , DIMM_ID_L ,
  DIMM_ID_MAX , DIMM_ID_UNKNOWN = 0xff
}
 
enum  I3C_PMIC_ADDR {
  PMIC_A0_A4_ADDR = 0x48 , PMIC_A2_A6_ADDR = 0x4c , PMIC_A3_A7_ADDR = 0x4e , PMIC_A0_A4_ADDR = 0x48 ,
  PMIC_A1_A5_ADDR = 0x4a , PMIC_A2_A6_ADDR = 0x4c , PMIC_A3_A7_ADDR = 0x4e
}
 
enum  I3C_DIMM_SPD_ADDR {
  DIMM_SPD_A0_A4_ADDR = 0x50 , DIMM_SPD_A2_A6_ADDR = 0x54 , DIMM_SPD_A3_A7_ADDR = 0x56 , DIMM_SPD_A0_A4_ADDR = 0x50 ,
  DIMM_SPD_A1_A5_ADDR = 0x52 , DIMM_SPD_A2_A6_ADDR = 0x54 , DIMM_SPD_A3_A7_ADDR = 0x56
}
 
enum  DIMM_DEVICE_TYPE {
  DIMM_SPD = 0x00 , DIMM_SPD_NVM = 0x01 , DIMM_PMIC = 0x02 , DIMM_SPD = 0x00 ,
  DIMM_SPD_NVM = 0x01 , DIMM_PMIC = 0x02 , DIMM_SPD = 0x00 , DIMM_SPD_NVM = 0x01 ,
  DIMM_PMIC = 0x02
}
 

Functions

void start_get_dimm_info_thread ()
 
void get_dimm_info_handler ()
 
void init_i3c_dimm ()
 
void init_i3c_dimm_data ()
 
void clear_unaccessible_dimm_data (uint8_t dimm_id)
 
int switch_i3c_dimm_mux (uint8_t i3c_mux_position, uint8_t dimm_mux_position)
 
bool is_i3c_mux_to_bic ()
 
int all_brocast_ccc (I3C_MSG *i3c_msg)
 
bool is_dimm_present (uint8_t dimm_id)
 
bool is_dimm_init ()
 
uint8_t sensor_num_map_dimm_id (uint8_t sensor_num)
 
int get_pmic_error_raw_data (int dimm_index, uint8_t *data)
 
void get_pmic_power_raw_data (int dimm_index, uint8_t *data)
 
void get_spd_temp_raw_data (int dimm_index, uint8_t *data)
 

Variables

struct k_mutex i3c_dimm_mux_mutex
 
uint8_t pmic_i3c_addr_list [MAX_COUNT_DIMM/2]
 
uint8_t spd_i3c_addr_list [MAX_COUNT_DIMM/2]
 
dimm_info dimm_data [MAX_COUNT_DIMM]
 

Macro Definition Documentation

◆ DIMM_I3C_MUX_CONTROL_OFFSET

#define DIMM_I3C_MUX_CONTROL_OFFSET   0x0B

◆ DIMM_MUX_TO_DIMM_A0A1A3

#define DIMM_MUX_TO_DIMM_A0A1A3   0x0

◆ DIMM_MUX_TO_DIMM_A4A6A7

#define DIMM_MUX_TO_DIMM_A4A6A7   0x1

◆ GET_DIMM_INFO_STACK_SIZE

#define GET_DIMM_INFO_STACK_SIZE   2304

◆ GET_DIMM_INFO_TIME_MS

#define GET_DIMM_INFO_TIME_MS   1000

◆ I3C_DIMM_MUX_MUTEX_TIMEOUT_MS

#define I3C_DIMM_MUX_MUTEX_TIMEOUT_MS   1000

◆ I3C_MUX_TO_BIC

#define I3C_MUX_TO_BIC   0x1

◆ I3C_MUX_TO_CPU

#define I3C_MUX_TO_CPU   0x0

◆ MAX_COUNT_DIMM

#define MAX_COUNT_DIMM   6

◆ MAX_LEN_I3C_GET_PMIC_ERR

#define MAX_LEN_I3C_GET_PMIC_ERR   47

◆ MAX_LEN_I3C_GET_PMIC_PWR

#define MAX_LEN_I3C_GET_PMIC_PWR   1

◆ MAX_LEN_I3C_GET_SPD_TEMP

#define MAX_LEN_I3C_GET_SPD_TEMP   2

◆ MAX_LEN_ME_GET_PMIC_ERR

#define MAX_LEN_ME_GET_PMIC_ERR   6

Typedef Documentation

◆ dimm_info

typedef struct dimm_info dimm_info

Enumeration Type Documentation

◆ DIMM_DEVICE_TYPE

Enumerator
DIMM_SPD 
DIMM_SPD_NVM 
DIMM_PMIC 
DIMM_SPD 
DIMM_SPD_NVM 
DIMM_PMIC 
DIMM_SPD 
DIMM_SPD_NVM 
DIMM_PMIC 

◆ DIMM_ID

enum DIMM_ID
Enumerator
DIMM_ID_A0 
DIMM_ID_A2 
DIMM_ID_A3 
DIMM_ID_A4 
DIMM_ID_A6 
DIMM_ID_A7 
DIMM_ID_UNKNOWN 
DIMM_ID_A0 
DIMM_ID_A1 
DIMM_ID_A2 
DIMM_ID_A3 
DIMM_ID_A4 
DIMM_ID_A5 
DIMM_ID_A6 
DIMM_ID_A7 
DIMM_ID_UNKNOWN 
DIMM_ID_A 
DIMM_ID_B 
DIMM_ID_C 
DIMM_ID_D 
DIMM_ID_E 
DIMM_ID_F 
DIMM_ID_G 
DIMM_ID_H 
DIMM_ID_I 
DIMM_ID_J 
DIMM_ID_K 
DIMM_ID_L 
DIMM_ID_MAX 
DIMM_ID_UNKNOWN 

◆ I3C_DIMM_SPD_ADDR

Enumerator
DIMM_SPD_A0_A4_ADDR 
DIMM_SPD_A2_A6_ADDR 
DIMM_SPD_A3_A7_ADDR 
DIMM_SPD_A0_A4_ADDR 
DIMM_SPD_A1_A5_ADDR 
DIMM_SPD_A2_A6_ADDR 
DIMM_SPD_A3_A7_ADDR 

◆ I3C_PMIC_ADDR

Enumerator
PMIC_A0_A4_ADDR 
PMIC_A2_A6_ADDR 
PMIC_A3_A7_ADDR 
PMIC_A0_A4_ADDR 
PMIC_A1_A5_ADDR 
PMIC_A2_A6_ADDR 
PMIC_A3_A7_ADDR 

Function Documentation

◆ all_brocast_ccc()

int all_brocast_ccc ( I3C_MSG i3c_msg)

◆ clear_unaccessible_dimm_data()

void clear_unaccessible_dimm_data ( uint8_t  dimm_id)

◆ get_dimm_info_handler()

void get_dimm_info_handler ( )

◆ get_pmic_error_raw_data()

int get_pmic_error_raw_data ( int  dimm_index,
uint8_t *  data 
)

◆ get_pmic_power_raw_data()

void get_pmic_power_raw_data ( int  dimm_index,
uint8_t *  data 
)

◆ get_spd_temp_raw_data()

void get_spd_temp_raw_data ( int  dimm_index,
uint8_t *  data 
)

◆ init_i3c_dimm()

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

◆ init_i3c_dimm_data()

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

◆ is_dimm_init()

bool is_dimm_init ( )

◆ is_dimm_present()

bool is_dimm_present ( uint8_t  dimm_id)

◆ is_i3c_mux_to_bic()

bool is_i3c_mux_to_bic ( )
Here is the call graph for this function:

◆ sensor_num_map_dimm_id()

uint8_t sensor_num_map_dimm_id ( uint8_t  sensor_num)

◆ start_get_dimm_info_thread()

void start_get_dimm_info_thread ( )

◆ switch_i3c_dimm_mux()

int switch_i3c_dimm_mux ( uint8_t  i3c_mux_position,
uint8_t  dimm_mux_position 
)
Here is the call graph for this function:

Variable Documentation

◆ dimm_data

dimm_info dimm_data[MAX_COUNT_DIMM]
extern

◆ i3c_dimm_mux_mutex

struct k_mutex i3c_dimm_mux_mutex
extern

◆ pmic_i3c_addr_list

uint8_t pmic_i3c_addr_list[MAX_COUNT_DIMM/2]
extern

◆ spd_i3c_addr_list

uint8_t spd_i3c_addr_list[MAX_COUNT_DIMM/2]
extern