Sync with latest ras-decode @bc6b43c (#770)
Signed-off-by: Oosman Saeed <oossaeed@amd.com>
[ROCm/amdsmi commit: 90f4b8c43d]
Tá an tiomantas seo le fáil i:
tiomanta ag
GitHub
tuismitheoir
2050dde73b
tiomantas
be53750aa3
@@ -27,38 +27,36 @@
|
||||
#ifndef RAS_DECODE_DECODE_H
|
||||
#define RAS_DECODE_DECODE_H
|
||||
|
||||
#include "ras_decode_api.h"
|
||||
#include "aca_fields.h"
|
||||
#include "json_util.h"
|
||||
#include "ras_decode_api.h"
|
||||
|
||||
/**
|
||||
* @brief Internal decoder structure with parsed register fields
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint64_t aca_status; /**< Raw status register value */
|
||||
uint64_t aca_addr; /**< Raw address register value */
|
||||
uint64_t aca_ipid; /**< Raw IPID register value */
|
||||
uint64_t aca_synd; /**< Raw syndrome register value */
|
||||
uint32_t flags; /**< Decoder flags */
|
||||
uint16_t hw_revision; /**< Hardware hw_revision */
|
||||
typedef struct {
|
||||
uint64_t aca_status; /**< Raw status register value */
|
||||
uint64_t aca_addr; /**< Raw address register value */
|
||||
uint64_t aca_ipid; /**< Raw IPID register value */
|
||||
uint64_t aca_synd; /**< Raw syndrome register value */
|
||||
uint32_t flags; /**< Decoder flags */
|
||||
uint16_t hw_revision; /**< Hardware hw_revision */
|
||||
|
||||
aca_status_fields_t status; /**< Parsed status fields */
|
||||
aca_ipid_fields_t ipid; /**< Parsed IPID fields */
|
||||
aca_synd_fields_t synd; /**< Parsed syndrome fields */
|
||||
aca_status_fields_t status; /**< Parsed status fields */
|
||||
aca_ipid_fields_t ipid; /**< Parsed IPID fields */
|
||||
aca_synd_fields_t synd; /**< Parsed syndrome fields */
|
||||
} aca_decoder_t;
|
||||
|
||||
/**
|
||||
* @brief Structure containing raw ACA error data from hardware
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint64_t aca_status; /**< Raw status register value */
|
||||
uint64_t aca_addr; /**< Raw address register value */
|
||||
uint64_t aca_ipid; /**< Raw IPID register value */
|
||||
uint64_t aca_synd; /**< Raw syndrome register value */
|
||||
uint32_t flags; /**< Flags from descriptor */
|
||||
uint16_t hw_revision; /**< Hardware hw_revision number */
|
||||
typedef struct {
|
||||
uint64_t aca_status; /**< Raw status register value */
|
||||
uint64_t aca_addr; /**< Raw address register value */
|
||||
uint64_t aca_ipid; /**< Raw IPID register value */
|
||||
uint64_t aca_synd; /**< Raw syndrome register value */
|
||||
uint32_t flags; /**< Flags from descriptor */
|
||||
uint16_t hw_revision; /**< Hardware hw_revision number */
|
||||
} aca_raw_data_t;
|
||||
|
||||
/**
|
||||
@@ -66,6 +64,6 @@ typedef struct
|
||||
* @param[in] raw_data Pointer to structure containing raw ACA error data
|
||||
* @return JsonValue* containing the decoded error information, or NULL on failure
|
||||
*/
|
||||
JsonValue* aca_decode(const aca_raw_data_t *raw_data);
|
||||
JsonValue* aca_decode(const aca_raw_data_t* raw_data);
|
||||
|
||||
#endif /* RAS_DECODE_DECODE_H */
|
||||
|
||||
@@ -37,78 +37,73 @@
|
||||
/**
|
||||
* @brief Base structure for ACA fields containing raw register value
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint64_t raw_value; /**< Raw 64-bit register value */
|
||||
typedef struct {
|
||||
uint64_t raw_value; /**< Raw 64-bit register value */
|
||||
} aca_fields_t;
|
||||
|
||||
/**
|
||||
* @brief Structure containing decoded ACA status register fields
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
aca_fields_t base;
|
||||
uint16_t error_code;
|
||||
uint8_t error_code_ext;
|
||||
uint8_t reserv22;
|
||||
uint8_t addr_lsb;
|
||||
uint8_t reserv30;
|
||||
uint8_t err_core_id;
|
||||
uint8_t reserv38;
|
||||
uint8_t scrub;
|
||||
uint8_t reserv41;
|
||||
uint8_t poison;
|
||||
uint8_t deferred;
|
||||
uint8_t uecc;
|
||||
uint8_t cecc;
|
||||
uint8_t reserv47;
|
||||
uint8_t synd_v;
|
||||
uint8_t reserv54;
|
||||
uint8_t tcc;
|
||||
uint8_t err_core_id_val;
|
||||
uint8_t pcc;
|
||||
uint8_t addr_v;
|
||||
uint8_t misc_v;
|
||||
uint8_t en;
|
||||
uint8_t uc;
|
||||
uint8_t overflow;
|
||||
uint8_t val;
|
||||
typedef struct {
|
||||
aca_fields_t base;
|
||||
uint16_t error_code;
|
||||
uint8_t error_code_ext;
|
||||
uint8_t reserv22;
|
||||
uint8_t addr_lsb;
|
||||
uint8_t reserv30;
|
||||
uint8_t err_core_id;
|
||||
uint8_t reserv38;
|
||||
uint8_t scrub;
|
||||
uint8_t reserv41;
|
||||
uint8_t poison;
|
||||
uint8_t deferred;
|
||||
uint8_t uecc;
|
||||
uint8_t cecc;
|
||||
uint8_t reserv47;
|
||||
uint8_t synd_v;
|
||||
uint8_t reserv54;
|
||||
uint8_t tcc;
|
||||
uint8_t err_core_id_val;
|
||||
uint8_t pcc;
|
||||
uint8_t addr_v;
|
||||
uint8_t misc_v;
|
||||
uint8_t en;
|
||||
uint8_t uc;
|
||||
uint8_t overflow;
|
||||
uint8_t val;
|
||||
} aca_status_fields_t;
|
||||
|
||||
/**
|
||||
* @brief Structure containing decoded ACA IPID register fields
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
aca_fields_t base;
|
||||
uint32_t instance_id_lo;
|
||||
uint16_t hardware_id;
|
||||
uint16_t aca_type;
|
||||
uint8_t instance_id_hi;
|
||||
typedef struct {
|
||||
aca_fields_t base;
|
||||
uint32_t instance_id_lo;
|
||||
uint16_t hardware_id;
|
||||
uint16_t aca_type;
|
||||
uint8_t instance_id_hi;
|
||||
} aca_ipid_fields_t;
|
||||
|
||||
/**
|
||||
* @brief Structure containing decoded ACA syndrome register fields
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
aca_fields_t base;
|
||||
uint32_t error_information;
|
||||
uint8_t length;
|
||||
uint8_t error_priority;
|
||||
uint8_t reserved27;
|
||||
uint16_t syndrome;
|
||||
uint32_t reserved39;
|
||||
typedef struct {
|
||||
aca_fields_t base;
|
||||
uint32_t error_information;
|
||||
uint8_t length;
|
||||
uint8_t error_priority;
|
||||
uint8_t reserved27;
|
||||
uint16_t syndrome;
|
||||
uint32_t reserved39;
|
||||
} aca_synd_fields_t;
|
||||
|
||||
/**
|
||||
* @brief Structure containing decoded ACA address register fields
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
aca_fields_t base;
|
||||
uint64_t error_addr;
|
||||
uint64_t reserved;
|
||||
typedef struct {
|
||||
aca_fields_t base;
|
||||
uint64_t error_addr;
|
||||
uint64_t reserved;
|
||||
} aca_addr_fields_t;
|
||||
|
||||
/**
|
||||
|
||||
@@ -30,55 +30,50 @@
|
||||
#ifndef RAS_DECODE_TABLES_H
|
||||
#define RAS_DECODE_TABLES_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
/**
|
||||
* @brief Structure mapping hardware ID and ACA type to bank names
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint16_t hw_id; /**< Hardware ID value */
|
||||
uint16_t aca_type; /**< ACA type identifier */
|
||||
const char *name; /**< Bank name string */
|
||||
typedef struct {
|
||||
uint16_t hw_id; /**< Hardware ID value */
|
||||
uint16_t aca_type; /**< ACA type identifier */
|
||||
const char *name; /**< Bank name string */
|
||||
} aca_bank_entry_t;
|
||||
|
||||
/**
|
||||
* @brief Structure mapping bank-specific error codes to error types
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
const char *bank; /**< Bank name string */
|
||||
uint32_t error_code; /**< Error code value */
|
||||
const char *type; /**< Error type string */
|
||||
typedef struct {
|
||||
const char *bank; /**< Bank name string */
|
||||
uint32_t error_code; /**< Error code value */
|
||||
const char *type; /**< Error type string */
|
||||
} aca_error_type_t;
|
||||
|
||||
/**
|
||||
* @brief Structure for generic error code to error type mapping
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint32_t error_code; /**< Error code value */
|
||||
const char *type; /**< Error type string */
|
||||
typedef struct {
|
||||
uint32_t error_code; /**< Error code value */
|
||||
const char *type; /**< Error type string */
|
||||
} aca_error_entry_t;
|
||||
|
||||
/**
|
||||
* @brief Structure mapping instance_id_hi to OAM and AID values
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint8_t oam; /**< OAM value */
|
||||
uint8_t aid; /**< AID value */
|
||||
typedef struct {
|
||||
uint8_t oam; /**< OAM value */
|
||||
uint8_t aid; /**< AID value */
|
||||
} oam_aid_map_t;
|
||||
|
||||
/**
|
||||
* @brief Structure for mapping bank and instance ID LO to instance name
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
const char *bank; /**< Bank name */
|
||||
uint32_t instance_id_lo; /**< Instance ID Lo (masked with 0xFFFFFFFC) */
|
||||
const char *name; /**< Instance name */
|
||||
typedef struct {
|
||||
const char *bank; /**< Bank name */
|
||||
uint32_t instance_id_lo; /**< Instance ID Lo (masked with 0xFFFFFFFC) */
|
||||
const char *name; /**< Instance name */
|
||||
} aca_instance_entry_t;
|
||||
|
||||
// External table declarations
|
||||
@@ -119,8 +114,8 @@ int find_error_type_by_bank(const char *bank, uint32_t error_code, const char **
|
||||
* @param[out] error_type Pointer to store result string
|
||||
* @return 0 on success, 1 if not found, -1 on parameter error
|
||||
*/
|
||||
int find_error_in_table(const aca_error_entry_t *table, size_t table_size,
|
||||
uint32_t error_code, const char **error_type);
|
||||
int find_error_in_table(const aca_error_entry_t *table, size_t table_size, uint32_t error_code,
|
||||
const char **error_type);
|
||||
|
||||
/**
|
||||
* @brief Find OAM and AID values based on instance_id_hi
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
#define RAS_DECODE_VERSION_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -36,7 +35,7 @@ extern "C"
|
||||
*
|
||||
* - MAJOR: Incremented for incompatible API changes
|
||||
* - MINOR: Incremented for backward-compatible functionality additions
|
||||
* - PATCH: Incremented for backward-compatible bug fixes
|
||||
* - PATCH: Incremented for backward-compatible fixes
|
||||
*/
|
||||
|
||||
/* Version Components */
|
||||
@@ -49,51 +48,50 @@ extern "C"
|
||||
#define RAS_DECODE_TOSTRING(x) RAS_DECODE_STRINGIFY(x)
|
||||
|
||||
/* Version String - dynamically constructed from components */
|
||||
#define RAS_DECODE_VERSION_STRING \
|
||||
RAS_DECODE_TOSTRING(RAS_DECODE_VERSION_MAJOR) "." \
|
||||
RAS_DECODE_TOSTRING(RAS_DECODE_VERSION_MINOR) "." \
|
||||
RAS_DECODE_TOSTRING(RAS_DECODE_VERSION_PATCH)
|
||||
#define RAS_DECODE_VERSION_STRING \
|
||||
RAS_DECODE_TOSTRING(RAS_DECODE_VERSION_MAJOR) \
|
||||
"." RAS_DECODE_TOSTRING(RAS_DECODE_VERSION_MINOR) "." RAS_DECODE_TOSTRING( \
|
||||
RAS_DECODE_VERSION_PATCH)
|
||||
|
||||
/**
|
||||
* @brief Structure containing version information
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
int major; /**< Major version number */
|
||||
int minor; /**< Minor version number */
|
||||
int patch; /**< Patch version number */
|
||||
const char *string; /**< Version string (e.g., "1.0.0") */
|
||||
} aca_version_info_t;
|
||||
/**
|
||||
* @brief Structure containing version information
|
||||
*/
|
||||
typedef struct {
|
||||
int major; /**< Major version number */
|
||||
int minor; /**< Minor version number */
|
||||
int patch; /**< Patch version number */
|
||||
const char *string; /**< Version string (e.g., "1.0.0") */
|
||||
} aca_version_info_t;
|
||||
|
||||
/**
|
||||
* @brief Get the major version number
|
||||
* @return Major version number
|
||||
*/
|
||||
int aca_get_version_major(void);
|
||||
/**
|
||||
* @brief Get the major version number
|
||||
* @return Major version number
|
||||
*/
|
||||
int aca_get_version_major(void);
|
||||
|
||||
/**
|
||||
* @brief Get the minor version number
|
||||
* @return Minor version number
|
||||
*/
|
||||
int aca_get_version_minor(void);
|
||||
/**
|
||||
* @brief Get the minor version number
|
||||
* @return Minor version number
|
||||
*/
|
||||
int aca_get_version_minor(void);
|
||||
|
||||
/**
|
||||
* @brief Get the patch version number
|
||||
* @return Patch version number
|
||||
*/
|
||||
int aca_get_version_patch(void);
|
||||
/**
|
||||
* @brief Get the patch version number
|
||||
* @return Patch version number
|
||||
*/
|
||||
int aca_get_version_patch(void);
|
||||
|
||||
/**
|
||||
* @brief Get the version string
|
||||
* @return Pointer to version string (e.g., "1.0.0")
|
||||
*/
|
||||
const char *aca_get_version_string(void);
|
||||
/**
|
||||
* @brief Get the version string
|
||||
* @return Pointer to version string (e.g., "1.0.0")
|
||||
*/
|
||||
const char *aca_get_version_string(void);
|
||||
|
||||
/**
|
||||
* @brief Get complete version information
|
||||
* @return Structure containing all version information
|
||||
*/
|
||||
aca_version_info_t aca_get_version_info(void);
|
||||
/**
|
||||
* @brief Get complete version information
|
||||
* @return Structure containing all version information
|
||||
*/
|
||||
aca_version_info_t aca_get_version_info(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -23,9 +23,10 @@
|
||||
#ifndef BOOT_DECODE_H
|
||||
#define BOOT_DECODE_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "json_util.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -36,7 +37,7 @@ extern "C" {
|
||||
* @brief Boot message structure representing OAM boot message
|
||||
*/
|
||||
typedef struct {
|
||||
uint64_t value; ///< 64-bit boot message value
|
||||
uint64_t value; ///< 64-bit boot message value
|
||||
} OamBootMsg;
|
||||
|
||||
/**
|
||||
@@ -44,44 +45,44 @@ typedef struct {
|
||||
* @param msg Boot message to decode
|
||||
* @return JsonValue containing decoded information or NULL on failure
|
||||
*/
|
||||
typedef JsonValue* (*boot_decoder_func_t)(OamBootMsg *msg);
|
||||
typedef JsonValue *(*boot_decoder_func_t)(OamBootMsg *msg);
|
||||
|
||||
/**
|
||||
* @brief Decoder mapping entry
|
||||
*/
|
||||
typedef struct {
|
||||
uint8_t encoding; ///< Error encoding value
|
||||
boot_decoder_func_t decoder; ///< Decoder function
|
||||
uint8_t encoding; ///< Error encoding value
|
||||
boot_decoder_func_t decoder; ///< Decoder function
|
||||
} boot_decoder_entry_t;
|
||||
|
||||
/**
|
||||
* @brief Boot message constants
|
||||
*/
|
||||
#define BOOT_ERROR_PRESENT_MARKER 0xA4
|
||||
#define BOOT_IN_BOOT_MARKER 0xBA
|
||||
#define BOOT_SUCCESS_ENCODING 0xBA
|
||||
#define BOOT_ERROR_PRESENT_MARKER 0xA4
|
||||
#define BOOT_IN_BOOT_MARKER 0xBA
|
||||
#define BOOT_SUCCESS_ENCODING 0xBA
|
||||
|
||||
/**
|
||||
* @brief Error encoding constants
|
||||
*/
|
||||
#define BOOT_ENCODING_HBM_TRAINING 0x01
|
||||
#define BOOT_ENCODING_FW_LOAD 0x04
|
||||
#define BOOT_ENCODING_WAFL_LINK 0x05
|
||||
#define BOOT_ENCODING_XGMI_LINK 0x06
|
||||
#define BOOT_ENCODING_USR_CP_LINK 0x07
|
||||
#define BOOT_ENCODING_USR_DP_LINK 0x08
|
||||
#define BOOT_ENCODING_HBM_MEM_TEST 0x09
|
||||
#define BOOT_ENCODING_HBM_BIST_TEST 0x0A
|
||||
#define BOOT_ENCODING_BOOT_CTRL_GEN_V0 0x0B
|
||||
#define BOOT_ENCODING_BOOT_CTRL_GEN_V1 0x0C
|
||||
#define BOOT_ENCODING_DATA_ABORT 0x0D
|
||||
#define BOOT_ENCODING_HBM_TRAINING 0x01
|
||||
#define BOOT_ENCODING_FW_LOAD 0x04
|
||||
#define BOOT_ENCODING_WAFL_LINK 0x05
|
||||
#define BOOT_ENCODING_XGMI_LINK 0x06
|
||||
#define BOOT_ENCODING_USR_CP_LINK 0x07
|
||||
#define BOOT_ENCODING_USR_DP_LINK 0x08
|
||||
#define BOOT_ENCODING_HBM_MEM_TEST 0x09
|
||||
#define BOOT_ENCODING_HBM_BIST_TEST 0x0A
|
||||
#define BOOT_ENCODING_BOOT_CTRL_GEN_V0 0x0B
|
||||
#define BOOT_ENCODING_BOOT_CTRL_GEN_V1 0x0C
|
||||
#define BOOT_ENCODING_DATA_ABORT 0x0D
|
||||
|
||||
/**
|
||||
* @brief HBM stack decoder constants
|
||||
*/
|
||||
#define HBM_STACK_0 0x01
|
||||
#define HBM_STACK_1 0x02
|
||||
#define HBM_STACK_UNKNOWN -1
|
||||
#define HBM_STACK_0 0x01
|
||||
#define HBM_STACK_1 0x02
|
||||
#define HBM_STACK_UNKNOWN -1
|
||||
|
||||
/**
|
||||
* @brief Extract specific byte from 64-bit value
|
||||
@@ -90,7 +91,7 @@ typedef struct {
|
||||
* @return Extracted byte value
|
||||
*/
|
||||
static inline uint8_t extract_byte(uint64_t value, int byte_index) {
|
||||
return (uint8_t)((value >> (byte_index * 8)) & 0xFF);
|
||||
return (uint8_t)((value >> (byte_index * 8)) & 0xFF);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -98,9 +99,7 @@ static inline uint8_t extract_byte(uint64_t value, int byte_index) {
|
||||
* @param num_bits Number of bits to extract
|
||||
* @return Bit mask
|
||||
*/
|
||||
static inline uint32_t extract_bits(int num_bits) {
|
||||
return (1U << num_bits) - 1;
|
||||
}
|
||||
static inline uint32_t extract_bits(int num_bits) { return (1U << num_bits) - 1; }
|
||||
|
||||
/**
|
||||
* @brief Get boot version from boot message
|
||||
@@ -159,7 +158,7 @@ int decode_hbm_stack(uint8_t stack);
|
||||
* @param max_links Maximum number of links to check
|
||||
* @return JsonValue array or NULL on failure
|
||||
*/
|
||||
JsonValue* create_failed_links_array(uint8_t byte_value, int max_links);
|
||||
JsonValue *create_failed_links_array(uint8_t byte_value, int max_links);
|
||||
|
||||
/**
|
||||
* @brief Create hex string representation
|
||||
@@ -167,35 +166,35 @@ JsonValue* create_failed_links_array(uint8_t byte_value, int max_links);
|
||||
* @param width Width of hex string (with padding)
|
||||
* @return Dynamically allocated hex string or NULL on failure
|
||||
*/
|
||||
char* create_hex_string(uint64_t value, int width);
|
||||
char *create_hex_string(uint64_t value, int width);
|
||||
|
||||
// Decoder functions for Version 0
|
||||
JsonValue* decode_hbm_training_v0(OamBootMsg *msg);
|
||||
JsonValue* decode_fw_load_v0(OamBootMsg *msg);
|
||||
JsonValue* decode_wafl_link_training_v0(OamBootMsg *msg);
|
||||
JsonValue* decode_xgmi_link_training_v0(OamBootMsg *msg);
|
||||
JsonValue* decode_usr_cp_link_training_v0(OamBootMsg *msg);
|
||||
JsonValue* decode_usr_dp_link_training_v0(OamBootMsg *msg);
|
||||
JsonValue* decode_hbm_mem_test_v0(OamBootMsg *msg);
|
||||
JsonValue* decode_hbm_bist_test_v0(OamBootMsg *msg);
|
||||
JsonValue* decode_boot_controller_generic_v0(OamBootMsg *msg);
|
||||
JsonValue *decode_hbm_training_v0(OamBootMsg *msg);
|
||||
JsonValue *decode_fw_load_v0(OamBootMsg *msg);
|
||||
JsonValue *decode_wafl_link_training_v0(OamBootMsg *msg);
|
||||
JsonValue *decode_xgmi_link_training_v0(OamBootMsg *msg);
|
||||
JsonValue *decode_usr_cp_link_training_v0(OamBootMsg *msg);
|
||||
JsonValue *decode_usr_dp_link_training_v0(OamBootMsg *msg);
|
||||
JsonValue *decode_hbm_mem_test_v0(OamBootMsg *msg);
|
||||
JsonValue *decode_hbm_bist_test_v0(OamBootMsg *msg);
|
||||
JsonValue *decode_boot_controller_generic_v0(OamBootMsg *msg);
|
||||
|
||||
// Decoder functions for Version 1
|
||||
JsonValue* decode_hbm_training_v1(OamBootMsg *msg);
|
||||
JsonValue* decode_fw_load_v1(OamBootMsg *msg);
|
||||
JsonValue* decode_wafl_link_training_v1(OamBootMsg *msg);
|
||||
JsonValue* decode_xgmi_link_training_v1(OamBootMsg *msg);
|
||||
JsonValue* decode_usr_cp_link_training_v1(OamBootMsg *msg);
|
||||
JsonValue* decode_usr_dp_link_training_v1(OamBootMsg *msg);
|
||||
JsonValue* decode_hbm_mem_test_v1(OamBootMsg *msg);
|
||||
JsonValue* decode_hbm_bist_test_v1(OamBootMsg *msg);
|
||||
JsonValue* decode_boot_controller_generic_v1(OamBootMsg *msg);
|
||||
JsonValue* decode_data_abort_v1(OamBootMsg *msg);
|
||||
JsonValue* decode_boot_success_v1(OamBootMsg *msg);
|
||||
JsonValue *decode_hbm_training_v1(OamBootMsg *msg);
|
||||
JsonValue *decode_fw_load_v1(OamBootMsg *msg);
|
||||
JsonValue *decode_wafl_link_training_v1(OamBootMsg *msg);
|
||||
JsonValue *decode_xgmi_link_training_v1(OamBootMsg *msg);
|
||||
JsonValue *decode_usr_cp_link_training_v1(OamBootMsg *msg);
|
||||
JsonValue *decode_usr_dp_link_training_v1(OamBootMsg *msg);
|
||||
JsonValue *decode_hbm_mem_test_v1(OamBootMsg *msg);
|
||||
JsonValue *decode_hbm_bist_test_v1(OamBootMsg *msg);
|
||||
JsonValue *decode_boot_controller_generic_v1(OamBootMsg *msg);
|
||||
JsonValue *decode_data_abort_v1(OamBootMsg *msg);
|
||||
JsonValue *decode_boot_success_v1(OamBootMsg *msg);
|
||||
|
||||
// Unhandled error decoders
|
||||
JsonValue* decode_unhandled_error_v0(OamBootMsg *msg);
|
||||
JsonValue* decode_unhandled_error_v1(OamBootMsg *msg);
|
||||
JsonValue *decode_unhandled_error_v0(OamBootMsg *msg);
|
||||
JsonValue *decode_unhandled_error_v1(OamBootMsg *msg);
|
||||
|
||||
/**
|
||||
* @brief Get appropriate decoder function for boot message
|
||||
@@ -210,7 +209,7 @@ boot_decoder_func_t get_decoder_function(OamBootMsg *msg);
|
||||
* @param count Number of boot messages
|
||||
* @return JsonValue object containing decoded results or NULL on failure
|
||||
*/
|
||||
JsonValue* boot_decode_orchestrator(uint64_t *oam_boot_msgs, size_t count);
|
||||
JsonValue *boot_decode_orchestrator(const uint64_t *oam_boot_msgs, size_t count);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -28,13 +28,12 @@
|
||||
/**
|
||||
* @brief Structure representing an error mapping entry
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint32_t id;
|
||||
const char *error_category;
|
||||
const char *error_type;
|
||||
const char *method;
|
||||
const char *error_severity;
|
||||
typedef struct {
|
||||
uint32_t id;
|
||||
const char *error_category;
|
||||
const char *error_type;
|
||||
const char *method;
|
||||
const char *error_severity;
|
||||
} error_map_entry_t;
|
||||
|
||||
/**
|
||||
|
||||
@@ -33,14 +33,7 @@ extern "C" {
|
||||
/**
|
||||
* @brief JSON value types enumeration
|
||||
*/
|
||||
typedef enum {
|
||||
JSON_NULL,
|
||||
JSON_BOOL,
|
||||
JSON_NUMBER,
|
||||
JSON_STRING,
|
||||
JSON_OBJECT,
|
||||
JSON_ARRAY
|
||||
} JsonType;
|
||||
typedef enum { JSON_NULL, JSON_BOOL, JSON_NUMBER, JSON_STRING, JSON_OBJECT, JSON_ARRAY } JsonType;
|
||||
|
||||
typedef struct JsonValue JsonValue;
|
||||
typedef struct JsonPair JsonPair;
|
||||
@@ -49,67 +42,67 @@ typedef struct JsonPair JsonPair;
|
||||
* @brief JSON key-value pair structure for objects
|
||||
*/
|
||||
struct JsonPair {
|
||||
char *key;
|
||||
JsonValue *value;
|
||||
JsonPair *next;
|
||||
char *key;
|
||||
JsonValue *value;
|
||||
JsonPair *next;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief JSON value structure
|
||||
*/
|
||||
struct JsonValue {
|
||||
JsonType type;
|
||||
union {
|
||||
bool boolean;
|
||||
double number;
|
||||
char *string;
|
||||
JsonPair *object; // Linked list of key-value pairs
|
||||
struct {
|
||||
JsonValue **items;
|
||||
size_t count;
|
||||
size_t capacity;
|
||||
} array;
|
||||
} data;
|
||||
JsonType type;
|
||||
union {
|
||||
bool boolean;
|
||||
double number;
|
||||
char *string;
|
||||
JsonPair *object; // Linked list of key-value pairs
|
||||
struct {
|
||||
JsonValue **items;
|
||||
size_t count;
|
||||
size_t capacity;
|
||||
} array;
|
||||
} data;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Create a null JSON value
|
||||
* @return Pointer to new JsonValue or NULL on failure
|
||||
*/
|
||||
JsonValue* json_create_null(void);
|
||||
JsonValue *json_create_null(void);
|
||||
|
||||
/**
|
||||
* @brief Create a boolean JSON value
|
||||
* @param b Boolean value
|
||||
* @return Pointer to new JsonValue or NULL on failure
|
||||
*/
|
||||
JsonValue* json_create_bool(bool b);
|
||||
JsonValue *json_create_bool(bool b);
|
||||
|
||||
/**
|
||||
* @brief Create a number JSON value
|
||||
* @param num Numeric value
|
||||
* @return Pointer to new JsonValue or NULL on failure
|
||||
*/
|
||||
JsonValue* json_create_number(double num);
|
||||
JsonValue *json_create_number(double num);
|
||||
|
||||
/**
|
||||
* @brief Create a string JSON value
|
||||
* @param str String value (will be copied)
|
||||
* @return Pointer to new JsonValue or NULL on failure
|
||||
*/
|
||||
JsonValue* json_create_string(const char *str);
|
||||
JsonValue *json_create_string(const char *str);
|
||||
|
||||
/**
|
||||
* @brief Create an empty JSON object
|
||||
* @return Pointer to new JsonValue or NULL on failure
|
||||
*/
|
||||
JsonValue* json_create_object(void);
|
||||
JsonValue *json_create_object(void);
|
||||
|
||||
/**
|
||||
* @brief Create an empty JSON array
|
||||
* @return Pointer to new JsonValue or NULL on failure
|
||||
*/
|
||||
JsonValue* json_create_array(void);
|
||||
JsonValue *json_create_array(void);
|
||||
|
||||
/**
|
||||
* @brief Add a key-value pair to a JSON object
|
||||
@@ -125,7 +118,7 @@ void json_object_set(JsonValue *obj, const char *key, JsonValue *value);
|
||||
* @param key Key to search for
|
||||
* @return Pointer to JsonValue or NULL if not found
|
||||
*/
|
||||
JsonValue* json_object_get(JsonValue *obj, const char *key);
|
||||
JsonValue *json_object_get(JsonValue *obj, const char *key);
|
||||
|
||||
/**
|
||||
* @brief Check if a key exists in a JSON object
|
||||
@@ -149,7 +142,7 @@ bool json_array_push(JsonValue *arr, JsonValue *value);
|
||||
* @param index Array index
|
||||
* @return Pointer to JsonValue or NULL if index out of bounds
|
||||
*/
|
||||
JsonValue* json_array_get(JsonValue *arr, size_t index);
|
||||
JsonValue *json_array_get(JsonValue *arr, size_t index);
|
||||
|
||||
/**
|
||||
* @brief Get the size of a JSON array
|
||||
|
||||
@@ -23,31 +23,31 @@
|
||||
#ifndef RAS_DECODE_API_H
|
||||
#define RAS_DECODE_API_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "aca_version.h"
|
||||
#include "json_util.h"
|
||||
|
||||
/**
|
||||
* @brief Structure containing decoded error information
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
const char *bank_ref; /**< Reference to bank name string */
|
||||
const char *error_type_ref; /**< Reference to error type string */
|
||||
const char *severity_ref; /**< Reference to error severity string */
|
||||
const char *category_ref; /**< Reference to error category string */
|
||||
const char *instance_ref; /**< Reference to instance name string */
|
||||
int oam; /**< OAM value */
|
||||
int aid; /**< AID value */
|
||||
uint64_t raw_status; /**< Raw status register value */
|
||||
uint64_t raw_addr; /**< Raw address register value */
|
||||
uint64_t raw_ipid; /**< Raw IPID register value */
|
||||
uint64_t raw_synd; /**< Raw syndrome register value */
|
||||
uint8_t scrub; /**< Scrub bit from status */
|
||||
uint8_t poison; /**< Poison bit from status */
|
||||
uint8_t deferred; /**< Deferred bit from status */
|
||||
uint8_t error_code_ext; /**< Extended error code from status */
|
||||
typedef struct {
|
||||
const char *bank_ref; /**< Reference to bank name string */
|
||||
const char *error_type_ref; /**< Reference to error type string */
|
||||
const char *severity_ref; /**< Reference to error severity string */
|
||||
const char *category_ref; /**< Reference to error category string */
|
||||
const char *instance_ref; /**< Reference to instance name string */
|
||||
int oam; /**< OAM value */
|
||||
int aid; /**< AID value */
|
||||
uint64_t raw_status; /**< Raw status register value */
|
||||
uint64_t raw_addr; /**< Raw address register value */
|
||||
uint64_t raw_ipid; /**< Raw IPID register value */
|
||||
uint64_t raw_synd; /**< Raw syndrome register value */
|
||||
uint8_t scrub; /**< Scrub bit from status */
|
||||
uint8_t poison; /**< Poison bit from status */
|
||||
uint8_t deferred; /**< Deferred bit from status */
|
||||
uint8_t error_code_ext; /**< Extended error code from status */
|
||||
} aca_error_info_t;
|
||||
|
||||
/**
|
||||
@@ -56,10 +56,12 @@ typedef struct
|
||||
* @param[in] array_len Size of register array in elements
|
||||
* @param[in] flag Decoder flags
|
||||
* @param[in] hw_revision Hardware revision number
|
||||
* @param[in] register_context_type Register context type (16-bit): 1 for ACA decode, 9 for boot decode
|
||||
* @param[in] register_context_type Register context type (16-bit): 1 for ACA decode, 9 for boot
|
||||
* decode
|
||||
* @return AFID value or -1 if decoding fails
|
||||
*/
|
||||
int decode_afid(const uint64_t *register_array, size_t array_len, uint32_t flag, uint16_t hw_revision, uint16_t register_context_type);
|
||||
int decode_afid(const uint64_t *register_array, size_t array_len, uint32_t flag,
|
||||
uint16_t hw_revision, uint16_t register_context_type);
|
||||
|
||||
/**
|
||||
* @brief Decodes and returns complete error information from a register array as JSON
|
||||
@@ -67,10 +69,12 @@ int decode_afid(const uint64_t *register_array, size_t array_len, uint32_t flag,
|
||||
* @param[in] array_len Size of register array in elements
|
||||
* @param[in] flag Decoder flags
|
||||
* @param[in] hw_revision Hardware revision number
|
||||
* @param[in] register_context_type Register context type (16-bit): 1 for ACA decode, 9 for boot decode
|
||||
* @param[in] register_context_type Register context type (16-bit): 1 for ACA decode, 9 for boot
|
||||
* decode
|
||||
* @return JsonValue* containing complete error information, or NULL on failure
|
||||
*/
|
||||
JsonValue* decode_error_info(const uint64_t *register_array, size_t array_len, uint32_t flag, uint16_t hw_revision, uint16_t register_context_type);
|
||||
JsonValue *decode_error_info(const uint64_t *register_array, size_t array_len, uint32_t flag,
|
||||
uint16_t hw_revision, uint16_t register_context_type);
|
||||
|
||||
/**
|
||||
* @brief Decodes the AFID from a JSON error object based on error category, type, and severity
|
||||
@@ -79,4 +83,4 @@ JsonValue* decode_error_info(const uint64_t *register_array, size_t array_len, u
|
||||
*/
|
||||
int decode_error_info_afid(JsonValue *error_json);
|
||||
|
||||
#endif // RAS_DECODE_API_H
|
||||
#endif // RAS_DECODE_API_H
|
||||
|
||||
Tagairt in Eagrán Nua
Cuir bac ar úsáideoir