drm/amd/ras: add uniras smu feature flag init func

add flag to indicate if pmfw eeprom is supported or
not, and initialize it

v2: change copyright from 2025 to 2026

Signed-off-by: Gangliang Xie <ganglxie@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Gangliang Xie 2025-12-12 16:04:30 +08:00 committed by Alex Deucher
parent 689b03a0a2
commit 12f4d4482a
5 changed files with 74 additions and 1 deletions

View File

@ -36,7 +36,8 @@ RAS_CORE_FILES = ras_core.o \
ras_log_ring.o \
ras_cper.o \
ras_psp.o \
ras_psp_v13_0.o
ras_psp_v13_0.o \
ras_eeprom_fw.o
RAS_CORE = $(addprefix $(AMD_GPU_RAS_PATH)/rascore/,$(RAS_CORE_FILES))

View File

@ -36,6 +36,7 @@
#include "ras_mp1.h"
#include "ras_psp.h"
#include "ras_log_ring.h"
#include "ras_eeprom_fw.h"
#define RAS_HW_ERR "[Hardware Error]: "
@ -335,6 +336,8 @@ struct ras_core_context {
spinlock_t seqno_lock;
bool ras_core_enabled;
u64 ras_fw_features;
};
struct ras_core_context *ras_core_create(struct ras_core_config *init_config);

View File

@ -384,6 +384,8 @@ int ras_core_hw_init(struct ras_core_context *ras_core)
if (ret)
goto init_err5;
ras_fw_init_feature_flags(ras_core);
ret = ras_eeprom_hw_init(ras_core);
if (ret)
goto init_err6;

View File

@ -0,0 +1,38 @@
// SPDX-License-Identifier: MIT
/*
* Copyright 2026 Advanced Micro Devices, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
*/
#include "ras.h"
void ras_fw_init_feature_flags(struct ras_core_context *ras_core)
{
struct ras_mp1 *mp1 = &ras_core->ras_mp1;
const struct ras_mp1_sys_func *sys_func = mp1->sys_func;
uint64_t flags = 0ULL;
if (!sys_func || !sys_func->mp1_get_ras_enabled_mask)
return;
if (!sys_func->mp1_get_ras_enabled_mask(ras_core, &flags))
ras_core->ras_fw_features = flags;
}

View File

@ -0,0 +1,29 @@
/* SPDX-License-Identifier: MIT */
/*
* Copyright 2026 Advanced Micro Devices, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
*/
#ifndef __RAS_EEPROM_FW_H__
#define __RAS_EEPROM_FW_H__
void ras_fw_init_feature_flags(struct ras_core_context *ras_core);
#endif