[SWDEV-530385] Update aca-decode with parsing fixes (#435)

*Update aca-decode to #4cd539d that fixes some errors in parsing cper files for afid extraction
*Without this fix, we get garbage value for some cper input files relating GFX_poison_cpers

Signed-off-by: Oosman Saeed <oossaeed@amd.com>
Этот коммит содержится в:
Saeed, Oosman
2025-06-04 18:49:05 -05:00
коммит произвёл GitHub
родитель e2692ab533
Коммит 2c3fa591b5
10 изменённых файлов: 399 добавлений и 18 удалений
+48
Просмотреть файл
@@ -0,0 +1,48 @@
#ifndef ACA_API_H
#define ACA_API_H
#include <stdint.h>
#include <stddef.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 */
int afid; /**< AFID value (AMD Field ID) */
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 error_code_ext; /**< Extended error code from status */
} aca_error_info_t;
/**
* @brief Decodes the AFID from a register array
* @param[in] register_array Pointer to an array of 64-bit register values
* @param[in] array_len Size of register array in elements
* @param[in] flag Decoder flags
* @param[in] hw_revision Hardware revision number
* @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);
/**
* @brief Decodes and returns complete error information from a register array
* @param[in] register_array Pointer to an array of 64-bit register values
* @param[in] array_len Size of register array in elements
* @param[in] flag Decoder flags
* @param[in] hw_revision Hardware revision number
* @return Complete error information structure
*/
aca_error_info_t decode_error_info(const uint64_t *register_array, size_t array_len, uint32_t flag, uint16_t hw_revision);
#endif // ACA_API_H
+6 -14
Просмотреть файл
@@ -2,13 +2,15 @@
* @file aca_decode.h
* @brief Internal decoder interface and data structures
*/
#ifndef ACA_DECODE_H
#define ACA_DECODE_H
#ifdef __cplusplus
extern "C" {
#endif
#ifndef ACA_DECODE_H
#define ACA_DECODE_H
#include "aca_api.h"
#include "aca_fields.h"
/**
@@ -17,6 +19,7 @@ extern "C" {
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 */
@@ -33,24 +36,13 @@ typedef struct
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;
/**
* @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 */
int afid; /**< AFID value (AMD Field ID) */
} aca_error_info_t;
/**
* @brief Main decode function that processes raw ACA error data
* @param[in] raw_data Pointer to structure containing raw ACA error data
+17
Просмотреть файл
@@ -79,6 +79,16 @@ typedef struct
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;
} aca_addr_fields_t;
/**
* @brief Reads the raw value from an ACA field structure
* @param[in] fields Pointer to the ACA fields structure
@@ -107,4 +117,11 @@ void aca_ipid_init(aca_ipid_fields_t *fields, uint64_t ipid_reg);
*/
void aca_synd_init(aca_synd_fields_t *fields, uint64_t synd_reg);
/**
* @brief Initializes ACA address fields from a raw address register value
* @param[out] fields Pointer to the address fields structure to initialize
* @param[in] addr_reg Raw 64-bit address register value
*/
void aca_addr_init(aca_addr_fields_t *fields, uint64_t addr_reg);
#endif
+36
Просмотреть файл
@@ -40,6 +40,25 @@ typedef struct
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 */
} 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 */
} aca_instance_entry_t;
// External table declarations
extern const aca_bank_entry_t bank_table[];
extern const aca_error_type_t error_table[];
@@ -81,4 +100,21 @@ int find_error_type_by_bank(const char *bank, uint32_t error_code, const char **
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
* @param[in] instance_id_hi Instance ID low value (0x00-0x0F)
* @param[out] oam_aid Pointer to store OAM and AID values
* @return 0 on success, 1 if not found, -1 on parameter error
*/
int find_oam_aid(uint8_t instance_id_hi, oam_aid_map_t *oam_aid);
/**
* @brief Find instance name based on bank and instance ID
* @param[in] bank Bank name string
* @param[in] instance_id_lo Instance ID (will be masked with 0xFFFFFFFC)
* @param[out] instance_name Pointer to store result string
* @return 0 on success, 1 if not found, -1 on parameter error
*/
int find_instance_name(const char *bank, uint32_t instance_id_lo, const char **instance_name);
#endif