2 * 2005.08 yhlu add microcode support
4 /*============================================================================
5 Copyright 2005 ADVANCED MICRO DEVICES, INC. All Rights Reserved.
6 This software and any related documentation (the "Materials") are the
7 confidential proprietary information of AMD. Unless otherwise provided in a
8 software agreement specifically licensing the Materials, the Materials are
9 provided in confidence and may not be distributed, modified, or reproduced in
10 whole or in part by any means.
11 LIMITATION OF LIABILITY: THE MATERIALS ARE PROVIDED "AS IS" WITHOUT ANY
12 EXPRESS OR IMPLIED WARRANTY OF ANY KIND, INCLUDING BUT NOT LIMITED TO
13 WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, TITLE, FITNESS FOR ANY
14 PARTICULAR PURPOSE, OR WARRANTIES ARISING FROM CONDUCT, COURSE OF DEALING, OR
15 USAGE OF TRADE. IN NO EVENT SHALL AMD OR ITS LICENSORS BE LIABLE FOR ANY
16 DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF PROFITS,
17 BUSINESS INTERRUPTION, OR LOSS OF INFORMATION) ARISING OUT OF THE USE OF OR
18 INABILITY TO USE THE MATERIALS, EVEN IF AMD HAS BEEN ADVISED OF THE
19 POSSIBILITY OF SUCH DAMAGES. BECAUSE SOME JURISDICTIONS PROHIBIT THE EXCLUSION
20 OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES, THE ABOVE
21 LIMITATION MAY NOT APPLY TO YOU.
22 AMD does not assume any responsibility for any errors which may appear in the
23 Materials nor any responsibility to support or update the Materials. AMD
24 retains the right to modify the Materials at any time, without notice, and is
25 not obligated to provide such modified Materials to you.
26 NO SUPPORT OBLIGATION: AMD is not obligated to furnish, support, or make any
27 further information, software, technical information, know-how, or show-how
29 U.S. GOVERNMENT RESTRICTED RIGHTS: The Materials are provided with "RESTRICTED
30 RIGHTS." Use, duplication, or disclosure by the Government is subject to the
31 restrictions as set forth in FAR 52.227-14 and DFAR 252.227-7013, et seq., or
32 its successor. Use of the Materials by the Government constitutes
33 acknowledgement of AMD's proprietary rights in them.
34 ============================================================================*/
36 // in model_fxx_update_microcode.c
40 // Description: microcode patch support for k8
43 //============================================================================
46 #include <console/console.h>
47 #include <device/device.h>
48 #include <device/pci.h>
51 #include <cpu/amd/microcode.h>
53 static uint8_t microcode_updates[] __attribute__ ((aligned(16))) = {
55 #if CONFIG_K8_REV_F_SUPPORT == 0
56 #include "microcode_rev_c.h"
57 #include "microcode_rev_d.h"
58 #include "microcode_rev_e.h"
61 #if CONFIG_K8_REV_F_SUPPORT == 1
62 // #include "microcode_rev_f.h"
64 /* Dummy terminator */
71 static unsigned get_equivalent_processor_rev_id(unsigned orig_id) {
72 static unsigned id_mapping_table[] = {
73 #if CONFIG_K8_REV_F_SUPPORT == 0
96 #if CONFIG_K8_REV_F_SUPPORT == 1
108 for(i=0; i<sizeof(id_mapping_table); i+=2 ) {
109 if(id_mapping_table[i]==orig_id) {
110 new_id = id_mapping_table[i+1];
119 void model_fxx_update_microcode(unsigned cpu_deviceid)
121 unsigned equivalent_processor_rev_id;
123 /* Update the microcode */
124 equivalent_processor_rev_id = get_equivalent_processor_rev_id(cpu_deviceid );
125 if(equivalent_processor_rev_id != 0)
126 amd_update_microcode(microcode_updates, equivalent_processor_rev_id);