blob: 90ee850cd9bb506b6977e1698b797276f8abd128 [file] [log] [blame]
Lee Leahy77ff0b12015-05-05 15:07:29 -07001/*
2 * This file is part of the coreboot project.
3 *
Lee Leahy77ff0b12015-05-05 15:07:29 -07004 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; version 2 of the License.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
Lee Leahy77ff0b12015-05-05 15:07:29 -070013 */
14
15#include <console/console.h>
16#include <device/device.h>
17#include <device/pci.h>
Kyösti Mälkkif1b58b72019-03-01 13:43:02 +020018#include <device/pci_ops.h>
Aaron Durbin789f2b62015-09-09 17:05:06 -050019#include <fsp/util.h>
Lee Leahy77ff0b12015-05-05 15:07:29 -070020#include <soc/pci_devs.h>
21#include <soc/ramstage.h>
Lee Leahy77ff0b12015-05-05 15:07:29 -070022
Elyes HAOUASc3385072019-03-21 15:38:06 +010023#include "chip.h"
24
Elyes HAOUASb13fac32018-05-24 22:29:44 +020025static void pci_domain_set_resources(struct device *dev)
Lee Leahy77ff0b12015-05-05 15:07:29 -070026{
Angel Ponsaee7ab22020-03-19 00:31:58 +010027 printk(BIOS_SPEW, "%s/%s (%s)\n", __FILE__, __func__, dev_name(dev));
Lee Leahy77ff0b12015-05-05 15:07:29 -070028 assign_resources(dev->link_list);
29}
30
31static struct device_operations pci_domain_ops = {
32 .read_resources = pci_domain_read_resources,
33 .set_resources = pci_domain_set_resources,
34 .enable_resources = NULL,
35 .init = NULL,
36 .scan_bus = pci_domain_scan_bus,
Lee Leahy77ff0b12015-05-05 15:07:29 -070037};
38
39static struct device_operations cpu_bus_ops = {
Elyes HAOUASb6fa7a22018-12-07 12:21:18 +010040 .read_resources = DEVICE_NOOP,
41 .set_resources = DEVICE_NOOP,
42 .enable_resources = DEVICE_NOOP,
Lee Leahy32471722015-04-20 15:20:28 -070043 .init = soc_init_cpus
Lee Leahy77ff0b12015-05-05 15:07:29 -070044};
45
46
Elyes HAOUASb13fac32018-05-24 22:29:44 +020047static void enable_dev(struct device *dev)
Lee Leahy77ff0b12015-05-05 15:07:29 -070048{
Angel Ponsaee7ab22020-03-19 00:31:58 +010049 printk(BIOS_SPEW, "----------\n%s/%s (%s), type: %d\n", __FILE__, __func__,
Lee Leahy32471722015-04-20 15:20:28 -070050 dev_name(dev), dev->path.type);
Angel Ponsaee7ab22020-03-19 00:31:58 +010051
Lee Leahy32471722015-04-20 15:20:28 -070052 printk(BIOS_SPEW, "vendor: 0x%04x. device: 0x%04x\n",
53 pci_read_config16(dev, PCI_VENDOR_ID),
54 pci_read_config16(dev, PCI_DEVICE_ID));
Angel Ponsaee7ab22020-03-19 00:31:58 +010055
56 printk(BIOS_SPEW, "class: 0x%02x %s\nsubclass: 0x%02x %s\n"
57 "prog: 0x%02x\nrevision: 0x%02x\n",
Lee Leahy32471722015-04-20 15:20:28 -070058 pci_read_config16(dev, PCI_CLASS_DEVICE) >> 8,
59 get_pci_class_name(dev),
60 pci_read_config16(dev, PCI_CLASS_DEVICE) & 0xff,
61 get_pci_subclass_name(dev),
62 pci_read_config8(dev, PCI_CLASS_PROG),
63 pci_read_config8(dev, PCI_REVISION_ID));
64
Lee Leahy77ff0b12015-05-05 15:07:29 -070065 /* Set the operations if it is a special bus type */
66 if (dev->path.type == DEVICE_PATH_DOMAIN) {
67 dev->ops = &pci_domain_ops;
Angel Ponsaee7ab22020-03-19 00:31:58 +010068
Lee Leahy77ff0b12015-05-05 15:07:29 -070069 } else if (dev->path.type == DEVICE_PATH_CPU_CLUSTER) {
70 dev->ops = &cpu_bus_ops;
Angel Ponsaee7ab22020-03-19 00:31:58 +010071
Lee Leahy77ff0b12015-05-05 15:07:29 -070072 } else if (dev->path.type == DEVICE_PATH_PCI) {
73 /* Handle south cluster enablement. */
74 if (PCI_SLOT(dev->path.pci.devfn) > GFX_DEV &&
75 (dev->ops == NULL || dev->ops->enable == NULL)) {
76 southcluster_enable_dev(dev);
77 }
78 }
79}
80
Aaron Durbin64031672018-04-21 14:45:32 -060081__weak void board_silicon_USB2_override(SILICON_INIT_UPD *params)
Matt DeVillier2c8ac222017-08-26 04:53:35 -050082{
83}
84
Lee Leahy32471722015-04-20 15:20:28 -070085void soc_silicon_init_params(SILICON_INIT_UPD *params)
86{
Kyösti Mälkkic70eed12018-05-22 02:18:00 +030087 struct device *dev = pcidev_on_root(LPC_DEV, LPC_FUNC);
Ravi Sarawadid077b582015-09-09 14:12:16 -070088 struct soc_intel_braswell_config *config;
89
90 if (!dev) {
Angel Ponsaee7ab22020-03-19 00:31:58 +010091 printk(BIOS_ERR, "Error! Device (%s) not found, soc_silicon_init_params!\n",
92 dev_path(dev));
Ravi Sarawadid077b582015-09-09 14:12:16 -070093 return;
94 }
95
Kyösti Mälkki8950cfb2019-07-13 22:16:25 +030096 config = config_of(dev);
Lee Leahy32471722015-04-20 15:20:28 -070097
98 /* Set the parameters for SiliconInit */
99 printk(BIOS_DEBUG, "Updating UPD values for SiliconInit\n");
Angel Ponsaee7ab22020-03-19 00:31:58 +0100100 params->PcdSdcardMode = config->PcdSdcardMode;
101 params->PcdEnableHsuart0 = config->PcdEnableHsuart0;
102 params->PcdEnableHsuart1 = config->PcdEnableHsuart1;
103 params->PcdEnableAzalia = config->PcdEnableAzalia;
104 params->PcdEnableSata = config->PcdEnableSata;
105 params->PcdEnableXhci = config->PcdEnableXhci;
106 params->PcdEnableLpe = config->PcdEnableLpe;
107 params->PcdEnableDma0 = config->PcdEnableDma0;
108 params->PcdEnableDma1 = config->PcdEnableDma1;
109 params->PcdEnableI2C0 = config->PcdEnableI2C0;
110 params->PcdEnableI2C1 = config->PcdEnableI2C1;
111 params->PcdEnableI2C2 = config->PcdEnableI2C2;
112 params->PcdEnableI2C3 = config->PcdEnableI2C3;
113 params->PcdEnableI2C4 = config->PcdEnableI2C4;
114 params->PcdEnableI2C5 = config->PcdEnableI2C5;
115 params->PcdEnableI2C6 = config->PcdEnableI2C6;
116 params->GraphicsConfigPtr = 0;
117 params->AzaliaConfigPtr = 0;
118 params->PunitPwrConfigDisable = config->PunitPwrConfigDisable;
119 params->ChvSvidConfig = config->ChvSvidConfig;
120 params->DptfDisable = config->DptfDisable;
121 params->PcdEmmcMode = config->PcdEmmcMode;
122 params->PcdUsb3ClkSsc = config->PcdUsb3ClkSsc;
123 params->PcdDispClkSsc = config->PcdDispClkSsc;
124 params->PcdSataClkSsc = config->PcdSataClkSsc;
Kevin Chiu348a6d52016-06-30 14:50:52 +0800125
Angel Ponsaee7ab22020-03-19 00:31:58 +0100126 params->Usb2Port0PerPortPeTxiSet = config->Usb2Port0PerPortPeTxiSet;
127 params->Usb2Port0PerPortTxiSet = config->Usb2Port0PerPortTxiSet;
128 params->Usb2Port0IUsbTxEmphasisEn = config->Usb2Port0IUsbTxEmphasisEn;
129 params->Usb2Port0PerPortTxPeHalf = config->Usb2Port0PerPortTxPeHalf;
Kevin Chiu348a6d52016-06-30 14:50:52 +0800130
Angel Ponsaee7ab22020-03-19 00:31:58 +0100131 params->Usb2Port1PerPortPeTxiSet = config->Usb2Port1PerPortPeTxiSet;
132 params->Usb2Port1PerPortTxiSet = config->Usb2Port1PerPortTxiSet;
133 params->Usb2Port1IUsbTxEmphasisEn = config->Usb2Port1IUsbTxEmphasisEn;
134 params->Usb2Port1PerPortTxPeHalf = config->Usb2Port1PerPortTxPeHalf;
Kevin Chiu348a6d52016-06-30 14:50:52 +0800135
Angel Ponsaee7ab22020-03-19 00:31:58 +0100136 params->Usb2Port2PerPortPeTxiSet = config->Usb2Port2PerPortPeTxiSet;
137 params->Usb2Port2PerPortTxiSet = config->Usb2Port2PerPortTxiSet;
138 params->Usb2Port2IUsbTxEmphasisEn = config->Usb2Port2IUsbTxEmphasisEn;
139 params->Usb2Port2PerPortTxPeHalf = config->Usb2Port2PerPortTxPeHalf;
Kevin Chiu348a6d52016-06-30 14:50:52 +0800140
Angel Ponsaee7ab22020-03-19 00:31:58 +0100141 params->Usb2Port3PerPortPeTxiSet = config->Usb2Port3PerPortPeTxiSet;
142 params->Usb2Port3PerPortTxiSet = config->Usb2Port3PerPortTxiSet;
143 params->Usb2Port3IUsbTxEmphasisEn = config->Usb2Port3IUsbTxEmphasisEn;
144 params->Usb2Port3PerPortTxPeHalf = config->Usb2Port3PerPortTxPeHalf;
Kevin Chiu348a6d52016-06-30 14:50:52 +0800145
Angel Ponsaee7ab22020-03-19 00:31:58 +0100146 params->Usb2Port4PerPortPeTxiSet = config->Usb2Port4PerPortPeTxiSet;
147 params->Usb2Port4PerPortTxiSet = config->Usb2Port4PerPortTxiSet;
148 params->Usb2Port4IUsbTxEmphasisEn = config->Usb2Port4IUsbTxEmphasisEn;
149 params->Usb2Port4PerPortTxPeHalf = config->Usb2Port4PerPortTxPeHalf;
150
151 params->Usb3Lane0Ow2tapgen2deemph3p5 = config->Usb3Lane0Ow2tapgen2deemph3p5;
152 params->Usb3Lane1Ow2tapgen2deemph3p5 = config->Usb3Lane1Ow2tapgen2deemph3p5;
153 params->Usb3Lane2Ow2tapgen2deemph3p5 = config->Usb3Lane2Ow2tapgen2deemph3p5;
154 params->Usb3Lane3Ow2tapgen2deemph3p5 = config->Usb3Lane3Ow2tapgen2deemph3p5;
155
156 params->PcdSataInterfaceSpeed = config->PcdSataInterfaceSpeed;
157 params->PcdPchUsbSsicPort = config->PcdPchUsbSsicPort;
158 params->PcdPchUsbHsicPort = config->PcdPchUsbHsicPort;
159 params->PcdPcieRootPortSpeed = config->PcdPcieRootPortSpeed;
160 params->PcdPchSsicEnable = config->PcdPchSsicEnable;
161 params->PcdLogoPtr = config->PcdLogoPtr;
162 params->PcdLogoSize = config->PcdLogoSize;
163 params->PcdRtcLock = config->PcdRtcLock;
164 params->PMIC_I2CBus = config->PMIC_I2CBus;
165 params->ISPEnable = config->ISPEnable;
166 params->ISPPciDevConfig = config->ISPPciDevConfig;
167 params->PcdSdDetectChk = config->PcdSdDetectChk;
168 params->I2C0Frequency = config->I2C0Frequency;
169 params->I2C1Frequency = config->I2C1Frequency;
170 params->I2C2Frequency = config->I2C2Frequency;
171 params->I2C3Frequency = config->I2C3Frequency;
172 params->I2C4Frequency = config->I2C4Frequency;
173 params->I2C5Frequency = config->I2C5Frequency;
174 params->I2C6Frequency = config->I2C6Frequency;
Matt DeVillier143a8362017-08-26 04:47:15 -0500175
Matt DeVillier2c8ac222017-08-26 04:53:35 -0500176 board_silicon_USB2_override(params);
Lee Leahy32471722015-04-20 15:20:28 -0700177}
178
Wim Vervoorn67117c32019-12-16 14:21:09 +0100179const struct cbmem_entry *soc_load_logo(SILICON_INIT_UPD *params)
180{
181 return fsp_load_logo(&params->PcdLogoPtr, &params->PcdLogoSize);
182}
183
Angel Ponsaee7ab22020-03-19 00:31:58 +0100184void soc_display_silicon_init_params(const SILICON_INIT_UPD *old, SILICON_INIT_UPD *new)
Lee Leahy32471722015-04-20 15:20:28 -0700185{
186 /* Display the parameters for SiliconInit */
187 printk(BIOS_SPEW, "UPD values for SiliconInit:\n");
Angel Ponsaee7ab22020-03-19 00:31:58 +0100188
189 fsp_display_upd_value("PcdSdcardMode", 1,
190 old->PcdSdcardMode,
191 new->PcdSdcardMode);
192 fsp_display_upd_value("PcdEnableHsuart0", 1,
193 old->PcdEnableHsuart0,
194 new->PcdEnableHsuart0);
195 fsp_display_upd_value("PcdEnableHsuart1", 1,
196 old->PcdEnableHsuart1,
197 new->PcdEnableHsuart1);
198 fsp_display_upd_value("PcdEnableAzalia", 1,
199 old->PcdEnableAzalia,
200 new->PcdEnableAzalia);
Lee Leahy66208bd2015-10-15 16:17:58 -0700201 fsp_display_upd_value("AzaliaConfigPtr", 4,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100202 (uint32_t)old->AzaliaConfigPtr,
203 (uint32_t)new->AzaliaConfigPtr);
204
205 fsp_display_upd_value("PcdEnableSata", 1, old->PcdEnableSata, new->PcdEnableSata);
206 fsp_display_upd_value("PcdEnableXhci", 1, old->PcdEnableXhci, new->PcdEnableXhci);
207 fsp_display_upd_value("PcdEnableLpe", 1, old->PcdEnableLpe, new->PcdEnableLpe);
208 fsp_display_upd_value("PcdEnableDma0", 1, old->PcdEnableDma0, new->PcdEnableDma0);
209 fsp_display_upd_value("PcdEnableDma1", 1, old->PcdEnableDma1, new->PcdEnableDma1);
210 fsp_display_upd_value("PcdEnableI2C0", 1, old->PcdEnableI2C0, new->PcdEnableI2C0);
211 fsp_display_upd_value("PcdEnableI2C1", 1, old->PcdEnableI2C1, new->PcdEnableI2C1);
212 fsp_display_upd_value("PcdEnableI2C2", 1, old->PcdEnableI2C2, new->PcdEnableI2C2);
213 fsp_display_upd_value("PcdEnableI2C3", 1, old->PcdEnableI2C3, new->PcdEnableI2C3);
214 fsp_display_upd_value("PcdEnableI2C4", 1, old->PcdEnableI2C4, new->PcdEnableI2C4);
215 fsp_display_upd_value("PcdEnableI2C5", 1, old->PcdEnableI2C5, new->PcdEnableI2C5);
216 fsp_display_upd_value("PcdEnableI2C6", 1, old->PcdEnableI2C6, new->PcdEnableI2C6);
217
Lee Leahy66208bd2015-10-15 16:17:58 -0700218 fsp_display_upd_value("PcdGraphicsConfigPtr", 4,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100219 old->GraphicsConfigPtr,
220 new->GraphicsConfigPtr);
Lee Leahy66208bd2015-10-15 16:17:58 -0700221 fsp_display_upd_value("GpioFamilyInitTablePtr", 4,
Lee Leahy32471722015-04-20 15:20:28 -0700222 (uint32_t)old->GpioFamilyInitTablePtr,
223 (uint32_t)new->GpioFamilyInitTablePtr);
Lee Leahy66208bd2015-10-15 16:17:58 -0700224 fsp_display_upd_value("GpioPadInitTablePtr", 4,
Lee Leahy32471722015-04-20 15:20:28 -0700225 (uint32_t)old->GpioPadInitTablePtr,
226 (uint32_t)new->GpioPadInitTablePtr);
Lee Leahy66208bd2015-10-15 16:17:58 -0700227 fsp_display_upd_value("PunitPwrConfigDisable", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100228 old->PunitPwrConfigDisable,
229 new->PunitPwrConfigDisable);
230
231 fsp_display_upd_value("ChvSvidConfig", 1, old->ChvSvidConfig, new->ChvSvidConfig);
232 fsp_display_upd_value("DptfDisable", 1, old->DptfDisable, new->DptfDisable);
233 fsp_display_upd_value("PcdEmmcMode", 1, old->PcdEmmcMode, new->PcdEmmcMode);
234 fsp_display_upd_value("PcdUsb3ClkSsc", 1, old->PcdUsb3ClkSsc, new->PcdUsb3ClkSsc);
235 fsp_display_upd_value("PcdDispClkSsc", 1, old->PcdDispClkSsc, new->PcdDispClkSsc);
236 fsp_display_upd_value("PcdSataClkSsc", 1, old->PcdSataClkSsc, new->PcdSataClkSsc);
237
Lee Leahy66208bd2015-10-15 16:17:58 -0700238 fsp_display_upd_value("Usb2Port0PerPortPeTxiSet", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100239 old->Usb2Port0PerPortPeTxiSet,
240 new->Usb2Port0PerPortPeTxiSet);
Lee Leahy66208bd2015-10-15 16:17:58 -0700241 fsp_display_upd_value("Usb2Port0PerPortTxiSet", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100242 old->Usb2Port0PerPortTxiSet,
243 new->Usb2Port0PerPortTxiSet);
Lee Leahy66208bd2015-10-15 16:17:58 -0700244 fsp_display_upd_value("Usb2Port0IUsbTxEmphasisEn", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100245 old->Usb2Port0IUsbTxEmphasisEn,
246 new->Usb2Port0IUsbTxEmphasisEn);
Lee Leahy66208bd2015-10-15 16:17:58 -0700247 fsp_display_upd_value("Usb2Port0PerPortTxPeHalf", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100248 old->Usb2Port0PerPortTxPeHalf,
249 new->Usb2Port0PerPortTxPeHalf);
Lee Leahy66208bd2015-10-15 16:17:58 -0700250 fsp_display_upd_value("Usb2Port1PerPortPeTxiSet", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100251 old->Usb2Port1PerPortPeTxiSet,
252 new->Usb2Port1PerPortPeTxiSet);
Lee Leahy66208bd2015-10-15 16:17:58 -0700253 fsp_display_upd_value("Usb2Port1PerPortTxiSet", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100254 old->Usb2Port1PerPortTxiSet,
255 new->Usb2Port1PerPortTxiSet);
Lee Leahy66208bd2015-10-15 16:17:58 -0700256 fsp_display_upd_value("Usb2Port1IUsbTxEmphasisEn", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100257 old->Usb2Port1IUsbTxEmphasisEn,
258 new->Usb2Port1IUsbTxEmphasisEn);
Lee Leahy66208bd2015-10-15 16:17:58 -0700259 fsp_display_upd_value("Usb2Port1PerPortTxPeHalf", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100260 old->Usb2Port1PerPortTxPeHalf,
261 new->Usb2Port1PerPortTxPeHalf);
Lee Leahy66208bd2015-10-15 16:17:58 -0700262 fsp_display_upd_value("Usb2Port2PerPortPeTxiSet", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100263 old->Usb2Port2PerPortPeTxiSet,
264 new->Usb2Port2PerPortPeTxiSet);
Lee Leahy66208bd2015-10-15 16:17:58 -0700265 fsp_display_upd_value("Usb2Port2PerPortTxiSet", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100266 old->Usb2Port2PerPortTxiSet,
267 new->Usb2Port2PerPortTxiSet);
Lee Leahy66208bd2015-10-15 16:17:58 -0700268 fsp_display_upd_value("Usb2Port2IUsbTxEmphasisEn", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100269 old->Usb2Port2IUsbTxEmphasisEn,
270 new->Usb2Port2IUsbTxEmphasisEn);
Lee Leahy66208bd2015-10-15 16:17:58 -0700271 fsp_display_upd_value("Usb2Port2PerPortTxPeHalf", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100272 old->Usb2Port2PerPortTxPeHalf,
273 new->Usb2Port2PerPortTxPeHalf);
Lee Leahy66208bd2015-10-15 16:17:58 -0700274 fsp_display_upd_value("Usb2Port3PerPortPeTxiSet", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100275 old->Usb2Port3PerPortPeTxiSet,
276 new->Usb2Port3PerPortPeTxiSet);
Lee Leahy66208bd2015-10-15 16:17:58 -0700277 fsp_display_upd_value("Usb2Port3PerPortTxiSet", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100278 old->Usb2Port3PerPortTxiSet,
279 new->Usb2Port3PerPortTxiSet);
Lee Leahy66208bd2015-10-15 16:17:58 -0700280 fsp_display_upd_value("Usb2Port3IUsbTxEmphasisEn", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100281 old->Usb2Port3IUsbTxEmphasisEn,
282 new->Usb2Port3IUsbTxEmphasisEn);
Lee Leahy66208bd2015-10-15 16:17:58 -0700283 fsp_display_upd_value("Usb2Port3PerPortTxPeHalf", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100284 old->Usb2Port3PerPortTxPeHalf,
285 new->Usb2Port3PerPortTxPeHalf);
Lee Leahy66208bd2015-10-15 16:17:58 -0700286 fsp_display_upd_value("Usb2Port4PerPortPeTxiSet", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100287 old->Usb2Port4PerPortPeTxiSet,
288 new->Usb2Port4PerPortPeTxiSet);
Lee Leahy66208bd2015-10-15 16:17:58 -0700289 fsp_display_upd_value("Usb2Port4PerPortTxiSet", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100290 old->Usb2Port4PerPortTxiSet,
291 new->Usb2Port4PerPortTxiSet);
Lee Leahy66208bd2015-10-15 16:17:58 -0700292 fsp_display_upd_value("Usb2Port4IUsbTxEmphasisEn", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100293 old->Usb2Port4IUsbTxEmphasisEn,
294 new->Usb2Port4IUsbTxEmphasisEn);
Lee Leahy66208bd2015-10-15 16:17:58 -0700295 fsp_display_upd_value("Usb2Port4PerPortTxPeHalf", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100296 old->Usb2Port4PerPortTxPeHalf,
297 new->Usb2Port4PerPortTxPeHalf);
Lee Leahy66208bd2015-10-15 16:17:58 -0700298 fsp_display_upd_value("Usb3Lane0Ow2tapgen2deemph3p5", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100299 old->Usb3Lane0Ow2tapgen2deemph3p5,
300 new->Usb3Lane0Ow2tapgen2deemph3p5);
Lee Leahy66208bd2015-10-15 16:17:58 -0700301 fsp_display_upd_value("Usb3Lane1Ow2tapgen2deemph3p5", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100302 old->Usb3Lane1Ow2tapgen2deemph3p5,
303 new->Usb3Lane1Ow2tapgen2deemph3p5);
Lee Leahy66208bd2015-10-15 16:17:58 -0700304 fsp_display_upd_value("Usb3Lane2Ow2tapgen2deemph3p5", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100305 old->Usb3Lane2Ow2tapgen2deemph3p5,
306 new->Usb3Lane2Ow2tapgen2deemph3p5);
Lee Leahy66208bd2015-10-15 16:17:58 -0700307 fsp_display_upd_value("Usb3Lane3Ow2tapgen2deemph3p5", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100308 old->Usb3Lane3Ow2tapgen2deemph3p5,
309 new->Usb3Lane3Ow2tapgen2deemph3p5);
Lee Leahy66208bd2015-10-15 16:17:58 -0700310 fsp_display_upd_value("PcdSataInterfaceSpeed", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100311 old->PcdSataInterfaceSpeed,
312 new->PcdSataInterfaceSpeed);
Lee Leahy66208bd2015-10-15 16:17:58 -0700313 fsp_display_upd_value("PcdPchUsbSsicPort", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100314 old->PcdPchUsbSsicPort,
315 new->PcdPchUsbSsicPort);
Lee Leahy66208bd2015-10-15 16:17:58 -0700316 fsp_display_upd_value("PcdPchUsbHsicPort", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100317 old->PcdPchUsbHsicPort,
318 new->PcdPchUsbHsicPort);
Lee Leahy66208bd2015-10-15 16:17:58 -0700319 fsp_display_upd_value("PcdPcieRootPortSpeed", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100320 old->PcdPcieRootPortSpeed,
321 new->PcdPcieRootPortSpeed);
322 fsp_display_upd_value("PcdPchSsicEnable", 1,
323 old->PcdPchSsicEnable,
324 new->PcdPchSsicEnable);
325
326 fsp_display_upd_value("PcdLogoPtr", 4, old->PcdLogoPtr, new->PcdLogoPtr);
327 fsp_display_upd_value("PcdLogoSize", 4, old->PcdLogoSize, new->PcdLogoSize);
328 fsp_display_upd_value("PcdRtcLock", 1, old->PcdRtcLock, new->PcdRtcLock);
329 fsp_display_upd_value("PMIC_I2CBus", 1, old->PMIC_I2CBus, new->PMIC_I2CBus);
330 fsp_display_upd_value("ISPEnable", 1, old->ISPEnable, new->ISPEnable);
331 fsp_display_upd_value("ISPPciDevConfig", 1, old->ISPPciDevConfig, new->ISPPciDevConfig);
332 fsp_display_upd_value("PcdSdDetectChk", 1, old->PcdSdDetectChk, new->PcdSdDetectChk);
Lee Leahy32471722015-04-20 15:20:28 -0700333}
334
Lee Leahy77ff0b12015-05-05 15:07:29 -0700335/* Called at BS_DEV_INIT_CHIPS time -- very early. Just after BS_PRE_DEVICE. */
336static void soc_init(void *chip_info)
337{
Lee Leahy32471722015-04-20 15:20:28 -0700338 printk(BIOS_SPEW, "%s/%s\n", __FILE__, __func__);
339 soc_init_pre_device(chip_info);
Lee Leahy77ff0b12015-05-05 15:07:29 -0700340}
341
Lee Leahy32471722015-04-20 15:20:28 -0700342struct chip_operations soc_intel_braswell_ops = {
343 CHIP_NAME("Intel Braswell SoC")
Lee Leahy77ff0b12015-05-05 15:07:29 -0700344 .enable_dev = enable_dev,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100345 .init = soc_init,
Lee Leahy77ff0b12015-05-05 15:07:29 -0700346};
347
Lee Leahy77ff0b12015-05-05 15:07:29 -0700348struct pci_operations soc_pci_ops = {
Subrata Banik4a0f0712019-03-20 14:29:47 +0530349 .set_subsystem = &pci_dev_set_subsystem,
Lee Leahy77ff0b12015-05-05 15:07:29 -0700350};
Matt DeVillier143a8362017-08-26 04:47:15 -0500351
352/**
353 Return SoC stepping type
354
355 @retval SOC_STEPPING SoC stepping type
356**/
357int SocStepping(void)
358{
Kyösti Mälkkic70eed12018-05-22 02:18:00 +0300359 struct device *dev = pcidev_on_root(LPC_DEV, LPC_FUNC);
Angel Ponsaee7ab22020-03-19 00:31:58 +0100360 const u8 revid = pci_read_config8(dev, 0x8);
Matt DeVillier143a8362017-08-26 04:47:15 -0500361
362 switch (revid & B_PCH_LPC_RID_STEPPING_MASK) {
363 case V_PCH_LPC_RID_A0:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100364 return SocA0;
Matt DeVillier143a8362017-08-26 04:47:15 -0500365 case V_PCH_LPC_RID_A1:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100366 return SocA1;
Matt DeVillier143a8362017-08-26 04:47:15 -0500367 case V_PCH_LPC_RID_A2:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100368 return SocA2;
Matt DeVillier143a8362017-08-26 04:47:15 -0500369 case V_PCH_LPC_RID_A3:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100370 return SocA3;
Matt DeVillier143a8362017-08-26 04:47:15 -0500371 case V_PCH_LPC_RID_A4:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100372 return SocA4;
Matt DeVillier143a8362017-08-26 04:47:15 -0500373 case V_PCH_LPC_RID_A5:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100374 return SocA5;
Matt DeVillier143a8362017-08-26 04:47:15 -0500375 case V_PCH_LPC_RID_A6:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100376 return SocA6;
Matt DeVillier143a8362017-08-26 04:47:15 -0500377 case V_PCH_LPC_RID_A7:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100378 return SocA7;
Matt DeVillier143a8362017-08-26 04:47:15 -0500379 case V_PCH_LPC_RID_B0:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100380 return SocB0;
Matt DeVillier143a8362017-08-26 04:47:15 -0500381 case V_PCH_LPC_RID_B1:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100382 return SocB1;
Matt DeVillier143a8362017-08-26 04:47:15 -0500383 case V_PCH_LPC_RID_B2:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100384 return SocB2;
Matt DeVillier143a8362017-08-26 04:47:15 -0500385 case V_PCH_LPC_RID_B3:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100386 return SocB3;
Matt DeVillier143a8362017-08-26 04:47:15 -0500387 case V_PCH_LPC_RID_B4:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100388 return SocB4;
Matt DeVillier143a8362017-08-26 04:47:15 -0500389 case V_PCH_LPC_RID_B5:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100390 return SocB5;
Matt DeVillier143a8362017-08-26 04:47:15 -0500391 case V_PCH_LPC_RID_B6:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100392 return SocB6;
Matt DeVillier143a8362017-08-26 04:47:15 -0500393 case V_PCH_LPC_RID_B7:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100394 return SocB7;
Matt DeVillier143a8362017-08-26 04:47:15 -0500395 case V_PCH_LPC_RID_C0:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100396 return SocC0;
Matt DeVillier143a8362017-08-26 04:47:15 -0500397 case V_PCH_LPC_RID_C1:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100398 return SocC1;
Matt DeVillier143a8362017-08-26 04:47:15 -0500399 case V_PCH_LPC_RID_C2:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100400 return SocC2;
Matt DeVillier143a8362017-08-26 04:47:15 -0500401 case V_PCH_LPC_RID_C3:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100402 return SocC3;
Matt DeVillier143a8362017-08-26 04:47:15 -0500403 case V_PCH_LPC_RID_C4:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100404 return SocC4;
Matt DeVillier143a8362017-08-26 04:47:15 -0500405 case V_PCH_LPC_RID_C5:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100406 return SocC5;
Matt DeVillier143a8362017-08-26 04:47:15 -0500407 case V_PCH_LPC_RID_C6:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100408 return SocC6;
Matt DeVillier143a8362017-08-26 04:47:15 -0500409 case V_PCH_LPC_RID_C7:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100410 return SocC7;
Matt DeVillier143a8362017-08-26 04:47:15 -0500411 case V_PCH_LPC_RID_D0:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100412 return SocD0;
Matt DeVillier143a8362017-08-26 04:47:15 -0500413 case V_PCH_LPC_RID_D1:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100414 return SocD1;
Matt DeVillier143a8362017-08-26 04:47:15 -0500415 case V_PCH_LPC_RID_D2:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100416 return SocD2;
Matt DeVillier143a8362017-08-26 04:47:15 -0500417 case V_PCH_LPC_RID_D3:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100418 return SocD3;
Matt DeVillier143a8362017-08-26 04:47:15 -0500419 case V_PCH_LPC_RID_D4:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100420 return SocD4;
Matt DeVillier143a8362017-08-26 04:47:15 -0500421 case V_PCH_LPC_RID_D5:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100422 return SocD5;
Matt DeVillier143a8362017-08-26 04:47:15 -0500423 case V_PCH_LPC_RID_D6:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100424 return SocD6;
Matt DeVillier143a8362017-08-26 04:47:15 -0500425 case V_PCH_LPC_RID_D7:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100426 return SocD7;
Matt DeVillier143a8362017-08-26 04:47:15 -0500427 default:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100428 return SocSteppingMax;
Matt DeVillier143a8362017-08-26 04:47:15 -0500429 }
430}