blob: 7af782f0f3b79b70b8573193d67fb02a0c338339 [file] [log] [blame]
Martin Rothd75800c2014-05-12 21:56:27 -06001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2013 Google Inc.
5 * Copyright (C) 2013 Sage Electronic Engineering, LLC.
6 *
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.
10 *
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.
Martin Rothd75800c2014-05-12 21:56:27 -060015 */
16
17#include <stddef.h>
18#include <arch/cpu.h>
19#include <lib.h>
20#include <arch/io.h>
21#include <arch/cbfs.h>
22#include <arch/stages.h>
23#include <console/console.h>
24#include <cbmem.h>
25#include <cpu/x86/mtrr.h>
26#include <romstage_handoff.h>
27#include <timestamp.h>
Ben Gardnerfa6014a2015-12-08 21:20:25 -060028#include <soc/gpio.h>
29#include <soc/iomap.h>
30#include <soc/lpc.h>
31#include <soc/pci_devs.h>
32#include <soc/romstage.h>
33#include <soc/acpi.h>
34#include <soc/baytrail.h>
Marc Jones78687972015-04-22 23:16:31 -060035#include <drivers/intel/fsp1_0/fsp_util.h>
Martin Rothd75800c2014-05-12 21:56:27 -060036
37/**
38 * /brief mainboard call for setup that needs to be done before fsp init
39 *
40 */
41void early_mainboard_romstage_entry()
42{
43
44}
45
46/**
47 * Get function disables - most of these will be done automatically
48 * @param fd_mask
49 * @param fd2_mask
50 */
51void get_func_disables(uint32_t *fd_mask, uint32_t *fd2_mask)
52{
53
54}
55
56/**
57 * /brief mainboard call for setup that needs to be done after fsp init
58 *
59 */
60void late_mainboard_romstage_entry()
61{
62
63}
64
65const uint32_t mAzaliaVerbTableData13[] = {
66/*
67 *ALC262 Verb Table - 10EC0262
68 */
69 /* Pin Complex (NID 0x11 ) */
70 0x01171CF0,
71 0x01171D11,
72 0x01171E11,
73 0x01171F41,
74 /* Pin Complex (NID 0x12 ) */
75 0x01271CF0,
76 0x01271D11,
77 0x01271E11,
78 0x01271F41,
79 /* Pin Complex (NID 0x14 ) */
80 0x01471C10,
81 0x01471D40,
82 0x01471E01,
83 0x01471F01,
84 /* Pin Complex (NID 0x15 ) */
85 0x01571CF0,
86 0x01571D11,
87 0x01571E11,
88 0x01571F41,
89 /* Pin Complex (NID 0x16 ) */
90 0x01671CF0,
91 0x01671D11,
92 0x01671E11,
93 0x01671F41,
94 /* Pin Complex (NID 0x18 ) */
95 0x01871C20,
96 0x01871D98,
97 0x01871EA1,
98 0x01871F01,
99 /* Pin Complex (NID 0x19 ) */
100 0x01971C21,
101 0x01971D98,
102 0x01971EA1,
103 0x01971F02,
104 /* Pin Complex (NID 0x1A ) */
105 0x01A71C2F,
106 0x01A71D30,
107 0x01A71E81,
108 0x01A71F01,
109 /* Pin Complex (NID 0x1B ) */
110 0x01B71C1F,
111 0x01B71D40,
112 0x01B71E21,
113 0x01B71F02,
114 /* Pin Complex (NID 0x1C ) */
115 0x01C71CF0,
116 0x01C71D11,
117 0x01C71E11,
118 0x01C71F41,
119 /* Pin Complex (NID 0x1D ) */
120 0x01D71C01,
121 0x01D71DC6,
122 0x01D71E14,
123 0x01D71F40,
124 /* Pin Complex (NID 0x1E ) */
125 0x01E71CF0,
126 0x01E71D11,
127 0x01E71E11,
128 0x01E71F41,
129 /* Pin Complex (NID 0x1F ) */
130 0x01F71CF0,
131 0x01F71D11,
132 0x01F71E11,
133 0x01F71F41 };
134
135const PCH_AZALIA_VERB_TABLE mAzaliaVerbTable[] = { {
136/*
137 * VerbTable: (RealTek ALC262)
138 * Revision ID = 0xFF, support all steps
139 * Codec Verb Table For AZALIA
140 * Codec Address: CAd value (0/1/2)
141 * Codec Vendor: 0x10EC0262
142 */
143 {
144 0x10EC0262, /* Vendor ID/Device IDA */
145 0x0000, /* SubSystem ID */
146 0xFF, /* Revision IDA */
147 0x01, /* Front panel support (1=yes, 2=no) */
148 0x000B, /* Number of Rear Jacks = 11 */
149 0x0002 /* Number of Front Jacks = 2 */
150 },
151 (uint32_t *)mAzaliaVerbTableData13 } };
152
153const PCH_AZALIA_CONFIG mainboard_AzaliaConfig = {
154 .Pme = 1,
155 .DS = 1,
156 .DA = 0,
157 .HdmiCodec = 1,
158 .AzaliaVCi = 1,
159 .Rsvdbits = 0,
160 .AzaliaVerbTableNum = 1,
161 .AzaliaVerbTable = (PCH_AZALIA_VERB_TABLE *)mAzaliaVerbTable,
162 .ResetWaitTimer = 300 };
163
164/** /brief customize fsp parameters here if needed
165 */
166void romstage_fsp_rt_buffer_callback(FSP_INIT_RT_BUFFER *FspRtBuffer)
167{
168 UPD_DATA_REGION *UpdData = FspRtBuffer->Common.UpdDataRgnPtr;
169
170 /* Initialize the Azalia Verb Tables to mainboard specific version */
171 UpdData->AzaliaConfigPtr = (UINT32)&mainboard_AzaliaConfig;
Martin Roth3ab015c2014-06-12 12:08:26 -0600172
173 /* Disable 2nd DIMM on Bakersport*/
174#if IS_ENABLED(BOARD_INTEL_BAKERSPORT_FSP)
175 UpdData->PcdMrcInitSPDAddr2 = 0x00; /* cannot use SPD_ADDR_DISABLED at this point */
176#endif
Martin Rothd75800c2014-05-12 21:56:27 -0600177}