From 1e11bda5d0c9165a7ea593ba1d1700333afd5ae0 Mon Sep 17 00:00:00 2001 From: Matt DeVillier Date: Mon, 21 Jul 2025 16:54:54 -0500 Subject: [PATCH] soc/intel/cmn/smbus: Drop use of update_spd_len() It doesn't make sense to use CONFIG_DIMM_SPD_SIZE to determine the amount of data to read from the SPD, then override that value. Clean up the mess and simply set the SPD length fror the spd_block struct to CONFIG_DIMM_SPD_SIZE. Change-Id: Ifec6cf1f6d7c931131460ea72440aa236590d0b6 Signed-off-by: Matt DeVillier Reviewed-on: https://review.coreboot.org/c/coreboot/+/88523 Reviewed-by: Maximilian Brune Tested-by: build bot (Jenkins) --- src/soc/intel/common/block/smbus/smbuslib.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/src/soc/intel/common/block/smbus/smbuslib.c b/src/soc/intel/common/block/smbus/smbuslib.c index f7ec63772f..e2955f9c0b 100644 --- a/src/soc/intel/common/block/smbus/smbuslib.c +++ b/src/soc/intel/common/block/smbus/smbuslib.c @@ -9,23 +9,6 @@ #include #include "smbuslib.h" -static void update_spd_len(struct spd_block *blk) -{ - u8 i, j = 0; - for (i = 0 ; i < CONFIG_DIMM_MAX; i++) - if (blk->spd_array[i] != NULL) - j |= blk->spd_array[i][SPD_MEMORY_TYPE]; - - /* If spd used is DDR5, then its length is 1024 byte. */ - if (j == SPD_MEMORY_TYPE_DDR5_SDRAM) - blk->len = CONFIG_DIMM_SPD_SIZE; - /* If spd used is DDR4, then its length is 512 byte. */ - else if (j == SPD_MEMORY_TYPE_DDR4_SDRAM) - blk->len = SPD_SIZE_MAX_DDR4; - else - blk->len = SPD_SIZE_MAX_DDR3; -} - static void spd_read(u8 *spd, u8 addr) { u16 i; @@ -164,7 +147,7 @@ void get_spd_smbus(struct spd_block *blk) blk->spd_array[i] = NULL; } - update_spd_len(blk); + blk->len = CONFIG_DIMM_SPD_SIZE; } /*