summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorYiPeng Chai <YiPeng.Chai@amd.com>2026-02-27 10:31:49 +0800
committerAlex Deucher <alexander.deucher@amd.com>2026-08-25 18:25:28 -0400
commit46de665683cd7988ff316b802aeb22b7f511f2a1 (patch)
treea4455cb014e740d28c764f65053d2c434d67c887 /drivers/gpu
parent6524030f584f0dc309eb1aac4df0cb0b496e5914 (diff)
drm/amd/ras: Add interface to get ras eeprom table version
Add interface to get ras eeprom table version. Signed-off-by: YiPeng Chai <YiPeng.Chai@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/amd/ras/core/core.c6
-rw-r--r--drivers/gpu/drm/amd/ras/core/eeprom.c10
-rw-r--r--drivers/gpu/drm/amd/ras/core/eeprom.h3
-rw-r--r--drivers/gpu/drm/amd/ras/core/ras.h2
4 files changed, 21 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/ras/core/core.c b/drivers/gpu/drm/amd/ras/core/core.c
index cacb66297538..b2b2b20a04a3 100644
--- a/drivers/gpu/drm/amd/ras/core/core.c
+++ b/drivers/gpu/drm/amd/ras/core/core.c
@@ -733,3 +733,9 @@ int ras_core_check_address_sanity(struct ras_core_context *ras_core,
return 0;
}
+
+int ras_core_get_eeprom_version(struct ras_core_context *ras_core,
+ uint32_t *version)
+{
+ return ras_eeprom_get_version(ras_core, version);
+}
diff --git a/drivers/gpu/drm/amd/ras/core/eeprom.c b/drivers/gpu/drm/amd/ras/core/eeprom.c
index 7afaac81f37a..1bc409048e73 100644
--- a/drivers/gpu/drm/amd/ras/core/eeprom.c
+++ b/drivers/gpu/drm/amd/ras/core/eeprom.c
@@ -1368,3 +1368,13 @@ enum ras_gpu_health_status
return rai->rma_status;
}
+
+int ras_eeprom_get_version(struct ras_core_context *ras_core, uint32_t *version)
+{
+ if (!ras_core || !version)
+ return -EINVAL;
+
+ *version = ras_core->ras_eeprom.tbl_hdr.version;
+
+ return 0;
+}
diff --git a/drivers/gpu/drm/amd/ras/core/eeprom.h b/drivers/gpu/drm/amd/ras/core/eeprom.h
index 32bd1526bc55..c46ce23ea6ee 100644
--- a/drivers/gpu/drm/amd/ras/core/eeprom.h
+++ b/drivers/gpu/drm/amd/ras/core/eeprom.h
@@ -187,4 +187,7 @@ void ras_eeprom_sync_info(struct ras_core_context *ras_core);
int ras_eeprom_check_storage_status(struct ras_core_context *ras_core);
enum ras_gpu_health_status
ras_eeprom_check_gpu_status(struct ras_core_context *ras_core);
+
+int ras_eeprom_get_version(struct ras_core_context *ras_core,
+ uint32_t *version);
#endif
diff --git a/drivers/gpu/drm/amd/ras/core/ras.h b/drivers/gpu/drm/amd/ras/core/ras.h
index f689eefaf257..386315cba504 100644
--- a/drivers/gpu/drm/amd/ras/core/ras.h
+++ b/drivers/gpu/drm/amd/ras/core/ras.h
@@ -413,4 +413,6 @@ int ras_core_check_address_sanity(struct ras_core_context *ras_core, uint64_t ad
int ras_core_set_debug_mode(struct ras_core_context *ras_core, bool enable);
bool ras_core_is_ce_log_disabled(struct ras_core_context *ras_core);
+int ras_core_get_eeprom_version(struct ras_core_context *ras_core,
+ uint32_t *version);
#endif