OpenBIC
OpenSource Bridge-IC
shell_rainbow_asic.c File Reference
#include <stdlib.h>
#include <shell/shell.h>
#include <string.h>
#include <limits.h>
#include <stdio.h>
#include "hal_i2c.h"
#include "plat_i2c.h"
Include dependency graph for shell_rainbow_asic.c:

Macros

#define ASIC_I2C_BUS   I2C_BUS12
 
#define ASIC_I2C_ADDR   0x32
 
#define I2C_MAX_RETRY   3
 
#define ASIC_REG_STATUS_REG   0x00
 
#define ASIC_MONITOR_HBM_TEMP_REG   0x8F
 
#define ASIC_MONITOR_TEMP_REG   0x70
 
#define ASIC_VERSION_REG   0x68
 
#define ASIC_STATUS_REG_LEN   8
 
#define ASIC_VERSION_REG_LEN   11
 
#define ASIC_MONITOR_TEMP_REG_LEN   10
 
#define ASIC_MONITOR_HBM_TEMP_REG_LEN   10
 

Functions

int asic_read_cmd (const struct shell *shell, uint8_t reg, uint8_t *data, uint8_t len)
 
void asic_boot_status_cmd (const struct shell *shell)
 
void asic_version_cmd (const struct shell *shell)
 
void max_asic_temp_history_cmd (const struct shell *shell)
 
void asic_read_all_cmd (const struct shell *shell, size_t argc, char **argv)
 
void asic_help_cmd (const struct shell *shell, size_t argc, char **argv)
 Display help information for all Asic commands. More...
 
 SHELL_STATIC_SUBCMD_SET_CREATE (sub_asic_cmds, SHELL_CMD(read_all, NULL, "read all Asic system data", asic_read_all_cmd), SHELL_CMD(help, NULL, "display help information for Asic commands", asic_help_cmd), SHELL_SUBCMD_SET_END)
 
 SHELL_CMD_REGISTER (rb_asic, &sub_asic_cmds, "Rainbow Asic low-level commands", NULL)
 

Macro Definition Documentation

◆ ASIC_I2C_ADDR

#define ASIC_I2C_ADDR   0x32

◆ ASIC_I2C_BUS

#define ASIC_I2C_BUS   I2C_BUS12

◆ ASIC_MONITOR_HBM_TEMP_REG

#define ASIC_MONITOR_HBM_TEMP_REG   0x8F

◆ ASIC_MONITOR_HBM_TEMP_REG_LEN

#define ASIC_MONITOR_HBM_TEMP_REG_LEN   10

◆ ASIC_MONITOR_TEMP_REG

#define ASIC_MONITOR_TEMP_REG   0x70

◆ ASIC_MONITOR_TEMP_REG_LEN

#define ASIC_MONITOR_TEMP_REG_LEN   10

◆ ASIC_REG_STATUS_REG

#define ASIC_REG_STATUS_REG   0x00

◆ ASIC_STATUS_REG_LEN

#define ASIC_STATUS_REG_LEN   8

◆ ASIC_VERSION_REG

#define ASIC_VERSION_REG   0x68

◆ ASIC_VERSION_REG_LEN

#define ASIC_VERSION_REG_LEN   11

◆ I2C_MAX_RETRY

#define I2C_MAX_RETRY   3

Function Documentation

◆ asic_boot_status_cmd()

void asic_boot_status_cmd ( const struct shell *  shell)
Here is the call graph for this function:

◆ asic_help_cmd()

void asic_help_cmd ( const struct shell *  shell,
size_t  argc,
char **  argv 
)

Display help information for all Asic commands.

Parameters
shellShell instance
argcArgument count
argvArgument values

◆ asic_read_all_cmd()

void asic_read_all_cmd ( const struct shell *  shell,
size_t  argc,
char **  argv 
)
Here is the call graph for this function:

◆ asic_read_cmd()

int asic_read_cmd ( const struct shell *  shell,
uint8_t  reg,
uint8_t *  data,
uint8_t  len 
)
Here is the call graph for this function:

◆ asic_version_cmd()

void asic_version_cmd ( const struct shell *  shell)
Here is the call graph for this function:

◆ max_asic_temp_history_cmd()

void max_asic_temp_history_cmd ( const struct shell *  shell)
Here is the call graph for this function:

◆ SHELL_CMD_REGISTER()

SHELL_CMD_REGISTER ( rb_asic  ,
sub_asic_cmds,
"Rainbow Asic low-level commands"  ,
NULL   
)

◆ SHELL_STATIC_SUBCMD_SET_CREATE()

SHELL_STATIC_SUBCMD_SET_CREATE ( sub_asic_cmds  ,
SHELL_CMD(read_all, NULL, "read all Asic system data", asic_read_all_cmd)  ,
SHELL_CMD(help, NULL, "display help information for Asic commands", asic_help_cmd)  ,
SHELL_SUBCMD_SET_END   
)