|
OpenBIC
OpenSource Bridge-IC
|
#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 "sideband_commands_athena_open.h"
Classes | |
| struct | efuse_target_offsets_t |
| struct | vtmon_data |
| VTMON data structure containing all monitoring values. More... | |
| struct | temp_monitor_data |
| Temperature monitoring data structure. More... | |
| struct | hbm_temp_data |
| HBM temperature data structure. More... | |
| struct | efuse_data |
| Efuse data structure containing all efuse information. More... | |
Functions | |
| int | read_efuse_data (int target_idx, struct efuse_data *efuse_data) |
| Read efuse data from specified target. More... | |
| void | print_efuse_field (const struct shell *shell, const char *field_name, const void *raw_data, size_t size, char format_type, uint64_t value) |
| Print efuse field with raw hex and interpreted value. More... | |
| void | print_efuse_data (const struct shell *shell, const char *target_name, const struct efuse_data *efuse_data) |
| Print efuse data with formatted output. More... | |
| void | athena_read_cmd (const struct shell *shell, size_t argc, char **argv) |
| void | athena_owl_vtmon_cmd (const struct shell *shell, size_t argc, char **argv) |
| void | athena_temp_monitor_cmd (const struct shell *shell, size_t argc, char **argv) |
| void | athena_hbm_temp_cmd (const struct shell *shell, size_t argc, char **argv) |
| void | athena_boot_status_cmd (const struct shell *shell, size_t argc, char **argv) |
| void | athena_efuse_cmd (const struct shell *shell, size_t argc, char **argv) |
| void | athena_version_cmd (const struct shell *shell, size_t argc, char **argv) |
| void | athena_current_temp_cmd (const struct shell *shell, size_t argc, char **argv) |
| void | athena_max_asic_temp_cmd (const struct shell *shell, size_t argc, char **argv) |
| void | athena_read_all_cmd (const struct shell *shell, size_t argc, char **argv) |
| void | athena_help_cmd (const struct shell *shell, size_t argc, char **argv) |
| Display help information for all Athena commands. More... | |
| SHELL_STATIC_SUBCMD_SET_CREATE (sub_athena_cmds, SHELL_CMD(read, NULL, "low-level read command", athena_read_cmd), SHELL_CMD(owl_vtmon, NULL, "read OWL VTMON data command", athena_owl_vtmon_cmd), SHELL_CMD(temp_monitor, NULL, "read temperature monitoring data", athena_temp_monitor_cmd), SHELL_CMD(hbm_temp, NULL, "read HBM temperature data", athena_hbm_temp_cmd), SHELL_CMD(boot_status, NULL, "check Athena boot status", athena_boot_status_cmd), SHELL_CMD(efuse, NULL, "read efuse data", athena_efuse_cmd), SHELL_CMD(version, NULL, "read Athena version data", athena_version_cmd), SHELL_CMD(current_temp, NULL, "read Athena current temperature", athena_current_temp_cmd), SHELL_CMD(max_asic_temp, NULL, "read Athena max ASIC temperature", athena_max_asic_temp_cmd), SHELL_CMD(read_all, NULL, "read all Athena system data", athena_read_all_cmd), SHELL_CMD(help, NULL, "display help information for Athena commands", athena_help_cmd), SHELL_SUBCMD_SET_END) | |
| SHELL_CMD_REGISTER (athena, &sub_athena_cmds, "athena low-level commands", NULL) | |
| #define ATHENA_I2C_ADDR_READ 0x6C |
| #define ATHENA_I2C_ADDR_WRITE 0x6A |
| #define ATHENA_I2C_BUS I2C_BUS6 |
| #define ATHENA_INDIRECT_ACCESS_ALL_REGION 0xFF |
| #define ATHENA_INDIRECT_ACCESS_MONITORING_REGION 0x03 |
| #define ATHENA_INDIRECT_ACCESS_SETTING_FLUSH_NO_INCR 0x10 |
| #define ATHENA_INDIRECT_ACCESS_SETTING_LENGTH 0x06 |
| #define ATHENA_INDIRECT_ACCESS_SETTING_PEC_BYTE 0xFF |
| #define ATHENA_MAX_READ_LENGTH 0xFF |
| #define ATHENA_NVME_MI_INDIRECT_ACCESS_SETTING_OFFSET 0xD3 |
| #define CMD_STATUS_FLAGS_NOT_READY_BIT 6 |
| #define CMD_STATUS_FLAGS_NOT_READY_OFFSET BRCMLIB_SB_STATUS_FLAGS_W_OFF |
| #define EFUSE_MAX_TARGETS 3 |
| #define HBM0_DATA_OFFSET BRCMLIB__MONITORING_DETAILS_HBM__0_THERMAL_HBM_SEL_TWO_REG__OFFSET |
| #define HBM1_DATA_OFFSET BRCMLIB__MONITORING_DETAILS_HBM__1_THERMAL_HBM_SEL_TWO_REG__OFFSET |
| #define HBM2_DATA_OFFSET BRCMLIB__MONITORING_DETAILS_HBM__2_THERMAL_HBM_SEL_TWO_REG__OFFSET |
| #define HBM3_DATA_OFFSET BRCMLIB__MONITORING_DETAILS_HBM__3_THERMAL_HBM_SEL_TWO_REG__OFFSET |
| #define HBM4_DATA_OFFSET BRCMLIB__MONITORING_DETAILS_HBM__4_THERMAL_HBM_SEL_TWO_REG__OFFSET |
| #define HBM5_DATA_OFFSET BRCMLIB__MONITORING_DETAILS_HBM__5_THERMAL_HBM_SEL_TWO_REG__OFFSET |
| #define HBM_CHANNEL_DATA_SIZE 8 |
| #define HBM_MAX_CHANNELS 16 |
| #define HBM_MAX_HBMS 6 |
| #define HBM_TEMP_MAX_COUNT 6 |
| #define MONITORING_DETAILS_BASE_OFFSET 0xD07C4000 |
| #define OWL_MAX_COUNT 2 |
| #define TEMP_VAL_BELOW_MINUS60 0xC4 |
| #define TEMP_VAL_MAX 0x7E |
| #define TEMP_VAL_MIN 0x00 |
| #define TEMP_VAL_NO_DATA 0x80 |
| #define TEMP_VAL_OVER127 0x7F |
| #define TEMP_VAL_RESERVED_END 0xC3 |
| #define TEMP_VAL_RESERVED_START 0x82 |
| #define TEMP_VAL_SENSOR_FAIL 0x81 |
| #define TEMP_VAL_TWOS_COMPLEMENT 0xC5 |
| #define TEMP_VAL_TWOS_COMPLEMENT_END 0xFF |
| #define VTMON_MAX_COUNT 2 |
| void athena_boot_status_cmd | ( | const struct shell * | shell, |
| size_t | argc, | ||
| char ** | argv | ||
| ) |
| void athena_current_temp_cmd | ( | const struct shell * | shell, |
| size_t | argc, | ||
| char ** | argv | ||
| ) |
| void athena_efuse_cmd | ( | const struct shell * | shell, |
| size_t | argc, | ||
| char ** | argv | ||
| ) |

| void athena_hbm_temp_cmd | ( | const struct shell * | shell, |
| size_t | argc, | ||
| char ** | argv | ||
| ) |
| void athena_help_cmd | ( | const struct shell * | shell, |
| size_t | argc, | ||
| char ** | argv | ||
| ) |
Display help information for all Athena commands.
| shell | Shell instance |
| argc | Argument count |
| argv | Argument values |
| void athena_max_asic_temp_cmd | ( | const struct shell * | shell, |
| size_t | argc, | ||
| char ** | argv | ||
| ) |
| void athena_owl_vtmon_cmd | ( | const struct shell * | shell, |
| size_t | argc, | ||
| char ** | argv | ||
| ) |
| void athena_read_all_cmd | ( | const struct shell * | shell, |
| size_t | argc, | ||
| char ** | argv | ||
| ) |

| void athena_read_cmd | ( | const struct shell * | shell, |
| size_t | argc, | ||
| char ** | argv | ||
| ) |
| void athena_temp_monitor_cmd | ( | const struct shell * | shell, |
| size_t | argc, | ||
| char ** | argv | ||
| ) |
| void athena_version_cmd | ( | const struct shell * | shell, |
| size_t | argc, | ||
| char ** | argv | ||
| ) |
| void print_efuse_data | ( | const struct shell * | shell, |
| const char * | target_name, | ||
| const struct efuse_data * | efuse_data | ||
| ) |
Print efuse data with formatted output.
| shell | Shell instance |
| target_name | Target name |
| efuse_data | Efuse data structure |

| void print_efuse_field | ( | const struct shell * | shell, |
| const char * | field_name, | ||
| const void * | raw_data, | ||
| size_t | size, | ||
| char | format_type, | ||
| uint64_t | value | ||
| ) |
Print efuse field with raw hex and interpreted value.
| shell | Shell instance |
| field_name | Field name to display |
| raw_data | Pointer to raw data |
| size | Size of raw data in bytes |
| format_type | Type of formatting: 'c' for ASCII char, 's' for ASCII string, 'd' for decimal, 'M' for MHz |
| value | Optional decimal value for non-ASCII fields |
| int read_efuse_data | ( | int | target_idx, |
| struct efuse_data * | efuse_data | ||
| ) |
Read efuse data from specified target.
| target_idx | Target index (0=athena, 1=owl_0, 2=owl_1) |
| efuse_data | Pointer to efuse data structure |
| SHELL_CMD_REGISTER | ( | athena | , |
| & | sub_athena_cmds, | ||
| "athena low-level commands" | , | ||
| NULL | |||
| ) |
| SHELL_STATIC_SUBCMD_SET_CREATE | ( | sub_athena_cmds | , |
| SHELL_CMD(read, NULL, "low-level read command", athena_read_cmd) | , | ||
| SHELL_CMD(owl_vtmon, NULL, "read OWL VTMON data command", athena_owl_vtmon_cmd) | , | ||
| SHELL_CMD(temp_monitor, NULL, "read temperature monitoring data", athena_temp_monitor_cmd) | , | ||
| SHELL_CMD(hbm_temp, NULL, "read HBM temperature data", athena_hbm_temp_cmd) | , | ||
| SHELL_CMD(boot_status, NULL, "check Athena boot status", athena_boot_status_cmd) | , | ||
| SHELL_CMD(efuse, NULL, "read efuse data", athena_efuse_cmd) | , | ||
| SHELL_CMD(version, NULL, "read Athena version data", athena_version_cmd) | , | ||
| SHELL_CMD(current_temp, NULL, "read Athena current temperature", athena_current_temp_cmd) | , | ||
| SHELL_CMD(max_asic_temp, NULL, "read Athena max ASIC temperature", athena_max_asic_temp_cmd) | , | ||
| SHELL_CMD(read_all, NULL, "read all Athena system data", athena_read_all_cmd) | , | ||
| SHELL_CMD(help, NULL, "display help information for Athena commands", athena_help_cmd) | , | ||
| SHELL_SUBCMD_SET_END | |||
| ) |