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/cpu/via/nano/update_ucode.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/cpu/via/nano') diff --git a/src/cpu/via/nano/update_ucode.c b/src/cpu/via/nano/update_ucode.c index 7471928641..aa0adeb8dc 100644 --- a/src/cpu/via/nano/update_ucode.c +++ b/src/cpu/via/nano/update_ucode.c @@ -102,24 +102,24 @@ unsigned int nano_update_ucode(void) { size_t i; unsigned int n_updates = 0; - const struct cbfs_file *cbfs_ucode; u32 fms = cpuid_eax(0x1); + /* Considering we are running with eXecute-In-Place (XIP), there's no + * need to worry that accessing data from ROM will slow us down. + * Microcode data should be aligned to a 4-byte boundary, but CBFS + * already does that for us (Do you, CBFS?) */ + u32 *ucode_data; + size_t ucode_len; - cbfs_ucode = cbfs_get_file(CBFS_DEFAULT_MEDIA, "cpu_microcode_blob.bin"); + ucode_data = cbfs_get_file_content(CBFS_DEFAULT_MEDIA, + "cpu_microcode_blob.bin", + CBFS_TYPE_MICROCODE, &ucode_len); /* Oops, did you forget to include the microcode ? */ - if(cbfs_ucode == NULL) { + if(ucode_data == NULL) { printk(BIOS_ALERT, "WARNING: No microcode file found in CBFS. " "Aborting microcode updates\n"); return 0; } - /* Considering we are running with eXecute-In-Place (XIP), there's no - * need to worry that accessing data from ROM will slow us down. - * Microcode data should be aligned to a 4-byte boundary, but CBFS - * already does that for us (Do you, CBFS?) */ - const u32 *ucode_data = CBFS_SUBHEADER(cbfs_ucode); - const u32 ucode_len = ntohl(cbfs_ucode->len); - /* We might do a lot of loops searching for the microcode updates, but * keep in mind, nano_ucode_is_valid searches for the signature before * doing anything else. */ -- cgit v1.2.3