blob: 0ca61ecd6c9ce193aafd268ad735ac4805d0faad [file] [log] [blame]
Frank Vibrans2b4c8312011-02-14 18:30:54 +00001/* $NoKeywords:$ */
2/**
3 * @file
4 *
5 * Initialize the 'common' way of running early initialization.
6 *
7 * Returns the table of initialization steps to perform at
8 * AmdInitEarly.
9 *
10 * @xrefitem bom "File Content Label" "Release Content"
11 * @e project: AGESA
12 * @e sub-project: CPU
13 * @e \$Revision: 35136 $ @e \$Date: 2010-07-16 11:29:48 +0800 (Fri, 16 Jul 2010) $
14 *
15 */
16/*
17 *****************************************************************************
18 *
19 * Copyright (c) 2011, Advanced Micro Devices, Inc.
20 * All rights reserved.
Edward O'Callaghan1542a6f2014-07-06 19:24:06 +100021 *
Frank Vibrans2b4c8312011-02-14 18:30:54 +000022 * Redistribution and use in source and binary forms, with or without
23 * modification, are permitted provided that the following conditions are met:
24 * * Redistributions of source code must retain the above copyright
25 * notice, this list of conditions and the following disclaimer.
26 * * Redistributions in binary form must reproduce the above copyright
27 * notice, this list of conditions and the following disclaimer in the
28 * documentation and/or other materials provided with the distribution.
Edward O'Callaghan1542a6f2014-07-06 19:24:06 +100029 * * Neither the name of Advanced Micro Devices, Inc. nor the names of
30 * its contributors may be used to endorse or promote products derived
Frank Vibrans2b4c8312011-02-14 18:30:54 +000031 * from this software without specific prior written permission.
Edward O'Callaghan1542a6f2014-07-06 19:24:06 +100032 *
Frank Vibrans2b4c8312011-02-14 18:30:54 +000033 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
34 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
35 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
36 * DISCLAIMED. IN NO EVENT SHALL ADVANCED MICRO DEVICES, INC. BE LIABLE FOR ANY
37 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
38 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
39 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
40 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
41 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
42 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Edward O'Callaghan1542a6f2014-07-06 19:24:06 +100043 *
Frank Vibrans2b4c8312011-02-14 18:30:54 +000044 * ***************************************************************************
45 *
46 */
47
48/*----------------------------------------------------------------------------------------
49 * M O D U L E S U S E D
50 *----------------------------------------------------------------------------------------
51 */
52#include "AGESA.h"
53#include "cpuFamilyTranslation.h"
54#include "Filecode.h"
55#include "cpuEarlyInit.h"
56CODE_GROUP (G1_PEICC)
57RDATA_GROUP (G1_PEICC)
58
59#define FILECODE PROC_CPU_CPUINITEARLYTABLE_FILECODE
60
61
62/*----------------------------------------------------------------------------------------
63 * D E F I N I T I O N S A N D M A C R O S
64 *----------------------------------------------------------------------------------------
65 */
66
67/*----------------------------------------------------------------------------------------
68 * T Y P E D E F S A N D S T R U C T U R E S
69 *----------------------------------------------------------------------------------------
70 */
71
72/*----------------------------------------------------------------------------------------
73 * 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
74 *----------------------------------------------------------------------------------------
75 */
76
efdesign9884cbce22011-08-04 12:09:17 -060077VOID
78GetCommonEarlyInitOnCoreTable (
79 IN CPU_SPECIFIC_SERVICES *FamilyServices,
80 OUT CONST S_PERFORM_EARLY_INIT_ON_CORE **Table,
81 IN AMD_CPU_EARLY_PARAMS *EarlyParams,
82 IN AMD_CONFIG_PARAMS *StdHeader
83 );
84
Frank Vibrans2b4c8312011-02-14 18:30:54 +000085/*----------------------------------------------------------------------------------------
86 * E X P O R T E D F U N C T I O N S
87 *----------------------------------------------------------------------------------------
88 */
89extern F_PERFORM_EARLY_INIT_ON_CORE McaInitializationAtEarly;
90extern F_PERFORM_EARLY_INIT_ON_CORE SetRegistersFromTablesAtEarly;
91extern F_PERFORM_EARLY_INIT_ON_CORE SetBrandIdRegistersAtEarly;
92extern F_PERFORM_EARLY_INIT_ON_CORE LocalApicInitializationAtEarly;
93extern F_PERFORM_EARLY_INIT_ON_CORE LoadMicrocodePatchAtEarly;
94
95CONST S_PERFORM_EARLY_INIT_ON_CORE ROMDATA CommonEarlyInitOnCoreTable[] =
96{
97 {McaInitializationAtEarly, PERFORM_EARLY_ANY_CONDITION},
98 {SetRegistersFromTablesAtEarly, PERFORM_EARLY_ANY_CONDITION},
99 {SetBrandIdRegistersAtEarly, PERFORM_EARLY_ANY_CONDITION},
100 {LocalApicInitializationAtEarly, PERFORM_EARLY_ANY_CONDITION},
101 {LoadMicrocodePatchAtEarly, PERFORM_EARLY_ANY_CONDITION},
102 {NULL, 0}
103};
104
105/*------------------------------------------------------------------------------------*/
106/**
107 * Initializer routine that may be invoked at AmdCpuEarly to return the steps that a
108 * processor that uses the standard initialization steps should take.
109 *
110 * @CpuServiceMethod{::F_GET_EARLY_INIT_TABLE}.
111 *
112 * @param[in] FamilyServices The current Family Specific Services.
113 * @param[out] Table Table of appropriate init steps for the executing core.
114 * @param[in] EarlyParams Service Interface structure to initialize.
115 * @param[in] StdHeader Opaque handle to standard config header.
116 *
117 */
118VOID
119GetCommonEarlyInitOnCoreTable (
120 IN CPU_SPECIFIC_SERVICES *FamilyServices,
121 OUT CONST S_PERFORM_EARLY_INIT_ON_CORE **Table,
122 IN AMD_CPU_EARLY_PARAMS *EarlyParams,
123 IN AMD_CONFIG_PARAMS *StdHeader
124 )
125{
126 *Table = CommonEarlyInitOnCoreTable;
127}