AGESA F15: AMD family15 AGESA code
[coreboot.git] / src / vendorcode / amd / agesa / f15 / Proc / CPU / Family / 0x10 / cpuF10BrandId.c
1 /* $NoKeywords:$ */
2 /**
3  * @file
4  *
5  * AMD CPU BrandId related functions and structures.
6  *
7  * Contains code that provides CPU BrandId information
8  *
9  * @xrefitem bom "File Content Label" "Release Content"
10  * @e project:      AGESA
11  * @e sub-project:  CPU
12  * @e \$Revision: 56279 $   @e \$Date: 2011-07-11 13:11:28 -0600 (Mon, 11 Jul 2011) $
13  *
14  */
15 /*
16  ******************************************************************************
17  *
18  * Copyright (C) 2012 Advanced Micro Devices, Inc.
19  * All rights reserved.
20  *
21  * Redistribution and use in source and binary forms, with or without
22  * modification, are permitted provided that the following conditions are met:
23  *     * Redistributions of source code must retain the above copyright
24  *       notice, this list of conditions and the following disclaimer.
25  *     * Redistributions in binary form must reproduce the above copyright
26  *       notice, this list of conditions and the following disclaimer in the
27  *       documentation and/or other materials provided with the distribution.
28  *     * Neither the name of Advanced Micro Devices, Inc. nor the names of
29  *       its contributors may be used to endorse or promote products derived
30  *       from this software without specific prior written permission.
31  *
32  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
33  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
34  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
35  * DISCLAIMED. IN NO EVENT SHALL ADVANCED MICRO DEVICES, INC. BE LIABLE FOR ANY
36  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
37  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
38  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
39  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
40  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
41  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
42  *
43  ******************************************************************************
44  */
45
46 /*----------------------------------------------------------------------------------------
47  *                             M O D U L E S    U S E D
48  *----------------------------------------------------------------------------------------
49  */
50 #include "AGESA.h"
51 #include "cpuRegisters.h"
52 #include "cpuEarlyInit.h"
53 #include "cpuFamilyTranslation.h"
54 #include "Filecode.h"
55 CODE_GROUP (G1_PEICC)
56 RDATA_GROUP (G2_PEI)
57
58 #define FILECODE PROC_CPU_FAMILY_0X10_CPUF10BRANDID_FILECODE
59
60 /*----------------------------------------------------------------------------------------
61  *                   D E F I N I T I O N S    A N D    M A C R O S
62  *----------------------------------------------------------------------------------------
63  */
64
65 /*----------------------------------------------------------------------------------------
66  *                  T Y P E D E F S     A N D     S T R U C T U R E S
67  *----------------------------------------------------------------------------------------
68  */
69
70 /*----------------------------------------------------------------------------------------
71  *           P R O T O T Y P E S     O F     L O C A L     F U N C T I O N S
72  *----------------------------------------------------------------------------------------
73  */
74
75 /*----------------------------------------------------------------------------------------
76  *                          E X P O R T E D    F U N C T I O N S
77  *----------------------------------------------------------------------------------------
78  */
79 VOID
80 GetF10BrandIdString1 (
81   IN       CPU_SPECIFIC_SERVICES *FamilySpecificServices,
82      OUT   CONST VOID **BrandString1Ptr,
83      OUT   UINT8 *NumberOfElements,
84   IN       AMD_CONFIG_PARAMS *StdHeader
85   );
86
87 VOID
88 GetF10BrandIdString2 (
89   IN       CPU_SPECIFIC_SERVICES *FamilySpecificServices,
90      OUT   CONST VOID **BrandString2Ptr,
91      OUT   UINT8 *NumberOfElements,
92   IN       AMD_CONFIG_PARAMS *StdHeader
93   );
94
95 extern CPU_BRAND_TABLE *F10BrandIdString1Tables[];
96 extern CPU_BRAND_TABLE *F10BrandIdString2Tables[];
97 extern CONST UINT8 F10BrandIdString1TableCount;
98 extern CONST UINT8 F10BrandIdString2TableCount;
99
100 /*---------------------------------------------------------------------------------------
101  *               T Y P E D E F S,   S T R U C T U R E S,    E N U M S
102  *---------------------------------------------------------------------------------------
103  */
104
105
106 /*---------------------------------------------------------------------------------------*/
107 /**
108  *  Returns a table containing the appropriate beginnings of the CPU brandstring.
109  *
110  *  @CpuServiceMethod{::F_CPU_GET_FAMILY_SPECIFIC_ARRAY}.
111  *
112  *  @param[in]   FamilySpecificServices   The current Family Specific Services.
113  *  @param[out]  BrandString1Ptr          Points to the first entry in the table.
114  *  @param[out]  NumberOfElements         Number of valid entries in the table.
115  *  @param[in]   StdHeader                Header for library and services.
116  *
117  */
118 VOID
119 GetF10BrandIdString1 (
120   IN       CPU_SPECIFIC_SERVICES *FamilySpecificServices,
121      OUT   CONST VOID **BrandString1Ptr,
122      OUT   UINT8 *NumberOfElements,
123   IN       AMD_CONFIG_PARAMS *StdHeader
124   )
125 {
126   CPU_BRAND_TABLE **TableEntryPtr;
127
128   TableEntryPtr = &F10BrandIdString1Tables[0];
129   *BrandString1Ptr = TableEntryPtr;
130   *NumberOfElements = F10BrandIdString1TableCount;
131 }
132
133
134 /*---------------------------------------------------------------------------------------*/
135 /**
136  *  Returns a table containing the appropriate endings of the CPU brandstring.
137  *
138  *  @CpuServiceMethod{::F_CPU_GET_FAMILY_SPECIFIC_ARRAY}.
139  *
140  *  @param[in]   FamilySpecificServices   The current Family Specific Services.
141  *  @param[out]  BrandString2Ptr          Points to the first entry in the table.
142  *  @param[out]  NumberOfElements         Number of valid entries in the table.
143  *  @param[in]   StdHeader                Header for library and services.
144  *
145  */
146 VOID
147 GetF10BrandIdString2 (
148   IN       CPU_SPECIFIC_SERVICES *FamilySpecificServices,
149      OUT   CONST VOID **BrandString2Ptr,
150      OUT   UINT8 *NumberOfElements,
151   IN       AMD_CONFIG_PARAMS *StdHeader
152   )
153 {
154   CPU_BRAND_TABLE **TableEntryPtr;
155
156   TableEntryPtr = &F10BrandIdString2Tables[0];
157   *BrandString2Ptr = TableEntryPtr;
158   *NumberOfElements = F10BrandIdString2TableCount;
159 }
160