2 * This file is part of the coreboot project.
4 * Copyright (C) 2013 Google Inc.
5 * Copyright (C) 2013 Sage Electronic Engineering, LLC.
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; version 2 of the License.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
21 #include <arch/cbfs.h>
22 #include <arch/stages.h>
23 #include <console/console.h>
25 #include <cpu/x86/mtrr.h>
26 #include <romstage_handoff.h>
27 #include <timestamp.h>
28 #include <baytrail/gpio.h>
29 #include <baytrail/iomap.h>
30 #include <baytrail/lpc.h>
31 #include <baytrail/pci_devs.h>
32 #include <baytrail/romstage.h>
33 #include <baytrail/acpi.h>
34 #include <baytrail/baytrail.h>
35 #include <drivers/intel/fsp1_0/fsp_util.h>
36 #include "modhwinfo.h"
39 * /brief mainboard call for setup that needs to be done before fsp init
42 void early_mainboard_romstage_entry()
48 * Get function disables - most of these will be done automatically
52 void get_func_disables(uint32_t *fd_mask
, uint32_t *fd2_mask
)
58 * /brief mainboard call for setup that needs to be done after fsp init
61 void late_mainboard_romstage_entry()
66 const uint32_t mAzaliaVerbTableData13
[] = {
68 *ALC262 Verb Table - 10EC0262
70 /* Pin Complex (NID 0x11 ) */
75 /* Pin Complex (NID 0x12 ) */
80 /* Pin Complex (NID 0x14 ) */
85 /* Pin Complex (NID 0x15 ) */
90 /* Pin Complex (NID 0x16 ) */
95 /* Pin Complex (NID 0x18 ) */
100 /* Pin Complex (NID 0x19 ) */
105 /* Pin Complex (NID 0x1A ) */
110 /* Pin Complex (NID 0x1B ) */
115 /* Pin Complex (NID 0x1C ) */
120 /* Pin Complex (NID 0x1D ) */
125 /* Pin Complex (NID 0x1E ) */
130 /* Pin Complex (NID 0x1F ) */
136 const PCH_AZALIA_VERB_TABLE mAzaliaVerbTable
[] = { {
138 * VerbTable: (RealTek ALC262)
139 * Revision ID = 0xFF, support all steps
140 * Codec Verb Table For AZALIA
141 * Codec Address: CAd value (0/1/2)
142 * Codec Vendor: 0x10EC0262
145 0x10EC0262, /* Vendor ID/Device IDA */
146 0x0000, /* SubSystem ID */
147 0xFF, /* Revision IDA */
148 0x01, /* Front panel support (1=yes, 2=no) */
149 0x000B, /* Number of Rear Jacks = 11 */
150 0x0002 /* Number of Front Jacks = 2 */
152 (uint32_t *)mAzaliaVerbTableData13
} };
154 const PCH_AZALIA_CONFIG mainboard_AzaliaConfig
= {
161 .AzaliaVerbTableNum
= 1,
162 .AzaliaVerbTable
= (PCH_AZALIA_VERB_TABLE
*)mAzaliaVerbTable
,
163 .ResetWaitTimer
= 300 };
165 /** /brief customize fsp parameters here if needed
167 void romstage_fsp_rt_buffer_callback(FSP_INIT_RT_BUFFER
*FspRtBuffer
)
169 struct hwinfo
*hwi_main
;
170 UPD_DATA_REGION
*UpdData
= FspRtBuffer
->Common
.UpdDataRgnPtr
;
172 /* Initialize the Azalia Verb Tables to mainboard specific version */
173 UpdData
->AzaliaConfigPtr
= (UINT32
)&mainboard_AzaliaConfig
;
175 /* Disable 2nd DIMM on Bakersport*/
176 #if IS_ENABLED(BOARD_INTEL_BAKERSPORT_FSP)
177 UpdData
->PcdMrcInitSPDAddr2
= 0x00; /* cannot use SPD_ADDR_DISABLED at this point */
179 /* Get SPD data from hardware information block and setup memory down */
180 /* parameters for FSP accordingly */
181 hwi_main
= get_hwinfo((char*)"hwinfo.hex");
183 UpdData
->PcdMemoryParameters
.EnableMemoryDown
= 1;
184 UpdData
->PcdMemoryParameters
.DRAMType
= hwi_main
->SPD
[2];
185 UpdData
->PcdMemoryParameters
.DIMM0Enable
= hwi_main
->SPD
[3] & 0x01;
186 UpdData
->PcdMemoryParameters
.DIMM1Enable
= (hwi_main
->SPD
[3] >> 1) & 0x01;
187 UpdData
->PcdMemoryParameters
.DIMMDensity
= hwi_main
->SPD
[4];
188 UpdData
->PcdMemoryParameters
.DIMMDWidth
= hwi_main
->SPD
[5];
189 UpdData
->PcdMemoryParameters
.DIMMSides
= hwi_main
->SPD
[7];
190 UpdData
->PcdMemoryParameters
.DIMMBusWidth
= hwi_main
->SPD
[8];
191 UpdData
->PcdMemoryParameters
.DRAMSpeed
= hwi_main
->SPD
[12];
192 UpdData
->PcdMemoryParameters
.DIMMtCL
= hwi_main
->SPD
[14];
193 UpdData
->PcdMemoryParameters
.DIMMtWR
= hwi_main
->SPD
[17];
194 UpdData
->PcdMemoryParameters
.DIMMtRPtRCD
= hwi_main
->SPD
[18];
195 UpdData
->PcdMemoryParameters
.DIMMtRRD
= hwi_main
->SPD
[19];
196 UpdData
->PcdMemoryParameters
.DIMMtWTR
= hwi_main
->SPD
[26];
197 UpdData
->PcdMemoryParameters
.DIMMtRTP
= hwi_main
->SPD
[27];
198 UpdData
->PcdMemoryParameters
.DIMMtFAW
= hwi_main
->SPD
[28];
199 /*If one need output from MRC to be used in Intel RMT, simply */
200 /*enable the following line */
201 //UpdData->PcdMrcDebugMsg = 1;
203 printk(BIOS_ERR
, "HWInfo not found, leave default timings for DDR3.\n");