Skip to content

Commit 65183fa

Browse files
Stanley.Yangalexdeucher
authored andcommitted
drm/amdgpu: Add RAS table v2.1 macro definition
Add RAS EEPROM table version 2.1 macro definition. Signed-off-by: Stanley.Yang <Stanley.Yang@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 71c79a1 commit 65183fa

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,15 @@
8080
#define RAS_MAX_RECORD_COUNT ((RAS_TBL_SIZE_BYTES - RAS_TABLE_HEADER_SIZE) \
8181
/ RAS_TABLE_RECORD_SIZE)
8282

83+
/* EEPROM Table V2_1 */
84+
#define RAS_TABLE_V2_1_INFO_SIZE 256
85+
#define RAS_TABLE_V2_1_INFO_START RAS_TABLE_HEADER_SIZE
86+
#define RAS_RECORD_START_V2_1 (RAS_HDR_START + RAS_TABLE_HEADER_SIZE + \
87+
RAS_TABLE_V2_1_INFO_SIZE)
88+
#define RAS_MAX_RECORD_COUNT_V2_1 ((RAS_TBL_SIZE_BYTES - RAS_TABLE_HEADER_SIZE - \
89+
RAS_TABLE_V2_1_INFO_SIZE) \
90+
/ RAS_TABLE_RECORD_SIZE)
91+
8392
/* Given a zero-based index of an EEPROM RAS record, yields the EEPROM
8493
* offset off of RAS_TABLE_START. That is, this is something you can
8594
* add to control->i2c_address, and then tell I2C layer to read
@@ -102,6 +111,10 @@
102111
#define RAS_NUM_RECS(_tbl_hdr) (((_tbl_hdr)->tbl_size - \
103112
RAS_TABLE_HEADER_SIZE) / RAS_TABLE_RECORD_SIZE)
104113

114+
#define RAS_NUM_RECS_V2_1(_tbl_hdr) (((_tbl_hdr)->tbl_size - \
115+
RAS_TABLE_HEADER_SIZE - \
116+
RAS_TABLE_V2_1_INFO_SIZE) / RAS_TABLE_RECORD_SIZE)
117+
105118
#define to_amdgpu_device(x) (container_of(x, struct amdgpu_ras, eeprom_control))->adev
106119

107120
static bool __is_ras_eeprom_supported(struct amdgpu_device *adev)

drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include <linux/i2c.h>
2828

2929
#define RAS_TABLE_VER_V1 0x00010000
30+
#define RAS_TABLE_VER_V2_1 0x00021000
3031

3132
struct amdgpu_device;
3233

0 commit comments

Comments
 (0)