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 <matt.devillier@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/88523 Reviewed-by: Maximilian Brune <maximilian.brune@9elements.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
parent
910f111891
commit
1e11bda5d0
1 changed files with 1 additions and 18 deletions
|
|
@ -9,23 +9,6 @@
|
|||
#include <device/smbus_host.h>
|
||||
#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;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue