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   8
 
#define DIMM_INDEX_BYTE   5
 
#define DIMM_STATUS_BYTE   7
 
#define DIMM_INDEX_MIN   0
 
#define DIMM_INDEX_MAX   7
 
#define DIMM_PRESENT   0x1
 
#define DIMM_I3C_MUX_CONTROL_OFFSET   0x0B
 
#define GET_DIMM_INFO_TIME_MS   1000
 
#define GET_DIMM_INFO_STACK_SIZE   2304
 
#define I3C_MUX_TO_CPU   0x0
 
#define I3C_MUX_TO_BIC   0x1
 
#define I3C_DIMM_MUTEX_TIMEOUT_MS   1000
 
#define I3C_HUB_TO_DIMMABCD   0x7F
 
#define I3C_HUB_TO_DIMMEFGH   0xBF
 
#define MAX_LEN_I3C_GET_PMIC_ERR   47
 
#define MAX_LEN_I3C_GET_PMIC_PWR   1
 
#define MAX_LEN_I3C_GET_SPD_TEMP   2
 

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 ()
 
bool is_dimm_prsnt_inited ()
 
bool is_dimm_ready_monitor (uint8_t dimm_id)
 
void init_i3c_dimm_prsnt_status ()
 
bool get_dimm_presence_status (uint8_t dimm_id)
 
void set_dimm_presence_status (uint8_t index, uint8_t status)
 
uint8_t sensor_num_map_dimm_id (uint8_t sensor_num)
 
int switch_i3c_dimm_mux (uint8_t i3c_mux_position)
 
int all_brocast_ccc (I3C_MSG *i3c_msg)
 
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)
 
void clear_unaccessible_dimm_data (uint8_t dimm_id)
 

Variables

struct k_mutex i3c_dimm_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_INDEX_BYTE

#define DIMM_INDEX_BYTE   5

◆ DIMM_INDEX_MAX

#define DIMM_INDEX_MAX   7

◆ DIMM_INDEX_MIN

#define DIMM_INDEX_MIN   0

◆ DIMM_PRESENT

#define DIMM_PRESENT   0x1

◆ DIMM_STATUS_BYTE

#define DIMM_STATUS_BYTE   7

◆ 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_MUTEX_TIMEOUT_MS

#define I3C_DIMM_MUTEX_TIMEOUT_MS   1000

◆ I3C_HUB_TO_DIMMABCD

#define I3C_HUB_TO_DIMMABCD   0x7F

◆ I3C_HUB_TO_DIMMEFGH

#define I3C_HUB_TO_DIMMEFGH   0xBF

◆ 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   8

◆ 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

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_dimm_presence_status()

bool get_dimm_presence_status ( uint8_t  dimm_id)

◆ 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_prsnt_status()

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

◆ is_dimm_prsnt_inited()

bool is_dimm_prsnt_inited ( )

◆ is_dimm_ready_monitor()

bool is_dimm_ready_monitor ( uint8_t  dimm_id)

◆ sensor_num_map_dimm_id()

uint8_t sensor_num_map_dimm_id ( uint8_t  sensor_num)

◆ set_dimm_presence_status()

void set_dimm_presence_status ( uint8_t  index,
uint8_t  status 
)

◆ 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)

Variable Documentation

◆ dimm_data

dimm_info dimm_data[MAX_COUNT_DIMM]
extern

◆ i3c_dimm_mutex

struct k_mutex i3c_dimm_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