Martin Roth has uploaded this change for review. ( https://review.coreboot.org/23085
Change subject: soc/amd/stoneyridge: Ignore SPD address for mainboard_read_spd ......................................................................
soc/amd/stoneyridge: Ignore SPD address for mainboard_read_spd
Currrently the mainboard_read_spd() functions don't actually use the spd address. The spd_addr_lookup table had been removed from grunt's devicetree.cb file, causing the spd address checks to fail.
This patch puts those checks into the if clause where they would actually be used, and just passes a 0 to the mainboard_read_spd function.
BUG=b:71535311 TEST=Build
Change-Id: I43eef260adde4ce6aa4e32e8e0c52e6fd0cd7912 Signed-off-by: Martin Roth martinroth@google.com --- M src/soc/amd/stoneyridge/BiosCallOuts.c 1 file changed, 23 insertions(+), 22 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/85/23085/1
diff --git a/src/soc/amd/stoneyridge/BiosCallOuts.c b/src/soc/amd/stoneyridge/BiosCallOuts.c index f6ac187..dd9f832 100644 --- a/src/soc/amd/stoneyridge/BiosCallOuts.c +++ b/src/soc/amd/stoneyridge/BiosCallOuts.c @@ -95,7 +95,7 @@
AGESA_STATUS agesa_ReadSpd(UINT32 Func, UINTN Data, VOID *ConfigPtr) { - uint8_t spd_address; + uint8_t spd_address = 0; int err; DEVTREE_CONST struct device *dev; DEVTREE_CONST struct soc_amd_stoneyridge_config *conf; @@ -104,33 +104,34 @@ if (!ENV_ROMSTAGE) return AGESA_UNSUPPORTED;
- dev = dev_find_slot(0, DCT_DEVFN); - if (dev == NULL) - return AGESA_ERROR; - - conf = dev->chip_info; - if (conf == NULL) - return AGESA_ERROR; - - if (info->SocketId >= ARRAY_SIZE(conf->spd_addr_lookup)) - return AGESA_ERROR; - if (info->MemChannelId >= ARRAY_SIZE(conf->spd_addr_lookup[0])) - return AGESA_ERROR; - if (info->DimmId >= ARRAY_SIZE(conf->spd_addr_lookup[0][0])) - return AGESA_ERROR; - - spd_address = conf->spd_addr_lookup - [info->SocketId][info->MemChannelId][info->DimmId]; - if (spd_address == 0) - return AGESA_ERROR; - err = mainboard_read_spd(spd_address, (void *)info->Buffer, CONFIG_DIMM_SPD_SIZE);
/* Read the SPD if the mainboard didn't fill the buffer */ - if (err || (*info->Buffer == 0)) + if (err || (*info->Buffer == 0)) { + dev = dev_find_slot(0, DCT_DEVFN); + if (dev == NULL) + return AGESA_ERROR; + + conf = dev->chip_info; + if (conf == NULL) + return AGESA_ERROR; + + if (info->SocketId >= ARRAY_SIZE(conf->spd_addr_lookup)) + return AGESA_ERROR; + if (info->MemChannelId >= ARRAY_SIZE(conf->spd_addr_lookup[0])) + return AGESA_ERROR; + if (info->DimmId >= ARRAY_SIZE(conf->spd_addr_lookup[0][0])) + return AGESA_ERROR; + + spd_address = conf->spd_addr_lookup + [info->SocketId][info->MemChannelId][info->DimmId]; + if (spd_address == 0) + return AGESA_ERROR; + err = sb_read_spd(spd_address, (void *)info->Buffer, CONFIG_DIMM_SPD_SIZE); + }
if (err) return AGESA_ERROR;