lib/spd: Do not print part number if it is not available

If the DRAM part number is not available in the SPD data (meaning filled
with 0x00) do not print it in the log.

Change-Id: If7224c6e114731b1c03915a2bde80f57369d0cee
Signed-off-by: Werner Zeh <werner.zeh@siemens.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/62699
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
This commit is contained in:
Werner Zeh 2022-03-09 08:17:54 +01:00 committed by Felix Held
parent 69e3cab7f9
commit 9b565de3a0
1 changed files with 4 additions and 2 deletions

View File

@ -167,8 +167,10 @@ static void spd_get_name(const uint8_t spd[], int type, const char **spd_name, s
case SPD_DRAM_DDR5:
case SPD_DRAM_LPDDR4:
case SPD_DRAM_LPDDR4X:
*spd_name = (const char *) &spd[DDR4_SPD_PART_OFF];
*len = DDR4_SPD_PART_LEN;
if (spd[DDR4_SPD_PART_OFF]) {
*spd_name = (const char *) &spd[DDR4_SPD_PART_OFF];
*len = DDR4_SPD_PART_LEN;
}
break;
default:
*len = 0;