summaryrefslogtreecommitdiff
path: root/src/cpu/via/nano
diff options
context:
space:
mode:
authorVladimir Serbinenko <phcoder@gmail.com>2014-01-12 14:12:15 +0100
committerVladimir Serbinenko <phcoder@gmail.com>2014-01-12 17:41:58 +0100
commit128741682250e196ccc9ff0bf9e7a5db5dfcdbd3 (patch)
tree77f3adb8046d81cacd650ad77aa4aaf18cc6d3a7 /src/cpu/via/nano
parent0af61b6c82d7ff02426a26bf435b7c6ee768a602 (diff)
downloadcoreboot-128741682250e196ccc9ff0bf9e7a5db5dfcdbd3.tar.xz
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 <phcoder@gmail.com> Reviewed-on: http://review.coreboot.org/4674 Reviewed-by: Patrick Georgi <patrick@georgi-clan.de> Tested-by: build bot (Jenkins)
Diffstat (limited to 'src/cpu/via/nano')
-rw-r--r--src/cpu/via/nano/update_ucode.c20
1 files changed, 10 insertions, 10 deletions
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. */