2 * This file is part of the coreboot project.
4 * Copyright (C) 2005 Advanced Micro Devices, Inc.
5 * Copyright (C) 2010 Advanced Micro Devices, Inc.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 * Description: Microcode patch support for k8 by yhlu
27 #include <console/console.h>
28 #include <device/device.h>
29 #include <device/pci.h>
32 #include <cpu/amd/microcode.h>
34 static uint8_t microcode_updates[] __attribute__ ((aligned(16))) = {
36 #if CONFIG_K8_REV_F_SUPPORT == 0
37 #include "microcode_rev_c.h"
38 #include "microcode_rev_d.h"
39 #include "microcode_rev_e.h"
42 #if CONFIG_K8_REV_F_SUPPORT == 1
43 // #include "microcode_rev_f.h"
45 /* Dummy terminator */
52 static unsigned get_equivalent_processor_rev_id(unsigned orig_id) {
53 static unsigned id_mapping_table[] = {
54 #if CONFIG_K8_REV_F_SUPPORT == 0
77 #if CONFIG_K8_REV_F_SUPPORT == 1
89 for(i=0; i<sizeof(id_mapping_table); i+=2 ) {
90 if(id_mapping_table[i]==orig_id) {
91 new_id = id_mapping_table[i+1];
100 void model_fxx_update_microcode(unsigned cpu_deviceid)
102 unsigned equivalent_processor_rev_id;
104 /* Update the microcode */
105 equivalent_processor_rev_id = get_equivalent_processor_rev_id(cpu_deviceid );
106 if(equivalent_processor_rev_id != 0)
107 amd_update_microcode(microcode_updates, equivalent_processor_rev_id);