From 128741682250e196ccc9ff0bf9e7a5db5dfcdbd3 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Sun, 12 Jan 2014 14:12:15 +0100 Subject: CBFS: use cbfs_get_file_content whenever possible rather than cbfs_get_file Number one reason to use cbfs_get_file was to get file length. With previous patch no more need for this. Change-Id: I330dda914d800c991757c5967b11963276ba9e00 Signed-off-by: Vladimir Serbinenko Reviewed-on: http://review.coreboot.org/4674 Reviewed-by: Patrick Georgi Tested-by: build bot (Jenkins) --- src/mainboard/gizmosphere/gizmo/BiosCallOuts.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/mainboard/gizmosphere/gizmo') diff --git a/src/mainboard/gizmosphere/gizmo/BiosCallOuts.c b/src/mainboard/gizmosphere/gizmo/BiosCallOuts.c index bd593d885d..ada78530f2 100755 --- a/src/mainboard/gizmosphere/gizmo/BiosCallOuts.c +++ b/src/mainboard/gizmosphere/gizmo/BiosCallOuts.c @@ -444,16 +444,18 @@ AGESA_STATUS BiosReadSpd (UINT32 Func, UINT32 Data, VOID *ConfigPtr) if (info->DimmId != 0) return AGESA_UNSUPPORTED; - struct cbfs_file *spd_file; + char *spd_file; + size_t spd_file_len; printk(BIOS_DEBUG, "read SPD\n"); - spd_file = cbfs_get_file(CBFS_DEFAULT_MEDIA, "spd.bin"); + spd_file = cbfs_get_file_content(CBFS_DEFAULT_MEDIA, "spd.bin", 0xab, + &spd_file_len); if (!spd_file) die("file [spd.bin] not found in CBFS"); - if (spd_file->len < SPD_SIZE) + if (spd_file_len < SPD_SIZE) die("Missing SPD data."); - memcpy((char*)info->Buffer, (char*)CBFS_SUBHEADER(spd_file), SPD_SIZE); + memcpy((char*)info->Buffer, spd_file, SPD_SIZE); u16 crc = spd_ddr3_calc_crc(info->Buffer, SPD_SIZE); -- cgit v1.2.3