aboutsummaryrefslogtreecommitdiff
path: root/arch/x86/cpu/intel_common/microcode.c
diff options
context:
space:
mode:
authorTom Rini2018-07-01 22:13:34 -0400
committerTom Rini2018-07-01 22:13:34 -0400
commitac378bb05fa3cac3197085431f577e0dbddd4b4a (patch)
treeaa16e2990b97bd5d2f1358a63e906963a55bc8ce /arch/x86/cpu/intel_common/microcode.c
parent168de20f3b6ccefef0ff5757fa5310f47a95c2f0 (diff)
parent40144260a9c8c5228500824ad9b7b19597a4bb0b (diff)
Merge git://git.denx.de/u-boot-x86
Diffstat (limited to 'arch/x86/cpu/intel_common/microcode.c')
-rw-r--r--arch/x86/cpu/intel_common/microcode.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/arch/x86/cpu/intel_common/microcode.c b/arch/x86/cpu/intel_common/microcode.c
index 11b1ec89553..c7a539d2819 100644
--- a/arch/x86/cpu/intel_common/microcode.c
+++ b/arch/x86/cpu/intel_common/microcode.c
@@ -43,8 +43,6 @@ static int microcode_decode_node(const void *blob, int node,
update->data = fdt_getprop(blob, node, "data", &update->size);
if (!update->data)
return -ENOENT;
- update->data += UCODE_HEADER_LEN;
- update->size -= UCODE_HEADER_LEN;
update->header_version = fdtdec_get_int(blob, node,
"intel,header-version", 0);
@@ -124,6 +122,7 @@ static void microcode_read_cpu(struct microcode_update *cpu)
int microcode_update_intel(void)
{
struct microcode_update cpu, update;
+ ulong address;
const void *blob = gd->fdt_blob;
int skipped;
int count;
@@ -167,7 +166,8 @@ int microcode_update_intel(void)
skipped++;
continue;
}
- wrmsr(MSR_IA32_UCODE_WRITE, (ulong)update.data, 0);
+ address = (ulong)update.data + UCODE_HEADER_LEN;
+ wrmsr(MSR_IA32_UCODE_WRITE, address, 0);
rev = microcode_read_rev();
debug("microcode: updated to revision 0x%x date=%04x-%02x-%02x\n",
rev, update.date_code & 0xffff,
@@ -178,5 +178,9 @@ int microcode_update_intel(void)
return -EFAULT;
}
count++;
+ if (!ucode_base) {
+ ucode_base = (ulong)update.data;
+ ucode_size = update.size;
+ }
} while (1);
}