Kyösti Mälkki (kyosti.malkki@gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/4534
-gerrit
commit 470b1c4b905b6ae3cf31522d958e7668460e5558 Author: Kyösti Mälkki kyosti.malkki@gmail.com Date: Mon Dec 16 07:19:09 2013 +0200
cpu/amd (non-AGESA): Remove terminator from microcode blob
Change-Id: I6370e971922dee5e8d476a883c5f0f32fbbc8911 Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- src/cpu/amd/microcode/microcode.c | 14 +++++--------- src/cpu/amd/model_10xxx/microcode_blob.c | 6 ------ src/cpu/amd/model_fxx/microcode_blob.c | 6 ------ 3 files changed, 5 insertions(+), 21 deletions(-)
diff --git a/src/cpu/amd/microcode/microcode.c b/src/cpu/amd/microcode/microcode.c index c9e2dcf..7278bf6 100644 --- a/src/cpu/amd/microcode/microcode.c +++ b/src/cpu/amd/microcode/microcode.c @@ -55,24 +55,20 @@ struct microcode { static void amd_update_microcode(const void *microcode_updates, u32 microcode_len, u32 equivalent_processor_rev_id) { u32 new_patch_id; - const struct microcode *m; - const char *c; msr_t msr; + const void *c = microcode_updates; + const void *ucode_end = microcode_updates + microcode_len;
- m = microcode_updates; - - for(c = microcode_updates; m->date_code; m = (struct microcode *)c) { - + while ((c < ucode_end) && (c + 2048 <= ucode_end)) { + const struct microcode *m = c; if (m->processor_rev_id == equivalent_processor_rev_id) { //apply patch
+ printk(BIOS_DEBUG, "microcode: patch id to apply = 0x%08x\n", m->patch_id); msr.hi = 0; msr.lo = (u32)m; - wrmsr(0xc0010020, msr);
- printk(BIOS_DEBUG, "microcode: patch id to apply = 0x%08x\n", m->patch_id); - //read the patch_id again msr = rdmsr(0x8b); new_patch_id = msr.lo; diff --git a/src/cpu/amd/model_10xxx/microcode_blob.c b/src/cpu/amd/model_10xxx/microcode_blob.c index 6544a2a..b99bb6b 100644 --- a/src/cpu/amd/model_10xxx/microcode_blob.c +++ b/src/cpu/amd/model_10xxx/microcode_blob.c @@ -25,10 +25,4 @@ unsigned char microcode[] __attribute__ ((aligned(16))) = { #include "mc_patch_010000b6.h" #include "mc_patch_010000bf.h" #include "mc_patch_010000c4.h" - - /* Dummy terminator */ - 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, }; diff --git a/src/cpu/amd/model_fxx/microcode_blob.c b/src/cpu/amd/model_fxx/microcode_blob.c index 3210f62..b4c4bf1 100644 --- a/src/cpu/amd/model_fxx/microcode_blob.c +++ b/src/cpu/amd/model_fxx/microcode_blob.c @@ -25,10 +25,4 @@ unsigned char microcode[] __attribute__ ((aligned(16))) = { #include "microcode_rev_d.h" #include "microcode_rev_e.h" #endif - - /* Dummy terminator */ - 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, };