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
22 #include <console/console.h>
23 #include <device/device.h>
24 #include <device/pci.h>
26 #include <cpu/amd/microcode.h>
28 static uint8_t microcode_updates[] __attribute__ ((aligned(16))) = {
30 #if CONFIG_K8_REV_F_SUPPORT == 0
31 #include "microcode_rev_c.h"
32 #include "microcode_rev_d.h"
33 #include "microcode_rev_e.h"
36 #if CONFIG_K8_REV_F_SUPPORT == 1
37 // #include "microcode_rev_f.h"
39 /* Dummy terminator */
46 static unsigned get_equivalent_processor_rev_id(unsigned orig_id) {
47 static unsigned id_mapping_table[] = {
48 #if CONFIG_K8_REV_F_SUPPORT == 0
71 #if CONFIG_K8_REV_F_SUPPORT == 1
82 for(i=0; i<sizeof(id_mapping_table); i+=2 ) {
83 if(id_mapping_table[i]==orig_id) {
84 new_id = id_mapping_table[i+1];
92 void model_fxx_update_microcode(unsigned cpu_deviceid)
94 unsigned equivalent_processor_rev_id;
96 /* Update the microcode */
97 equivalent_processor_rev_id = get_equivalent_processor_rev_id(cpu_deviceid );
98 if(equivalent_processor_rev_id != 0)
99 amd_update_microcode(microcode_updates, equivalent_processor_rev_id);