blob: d1540f844ce41713d8e0a261de5255d8ae08caea [file] [log] [blame]
Angel Ponsba38f372020-04-05 15:46:45 +02001/* SPDX-License-Identifier: GPL-2.0-only */
2/* This file is part of the coreboot project. */
Lee Leahy77ff0b12015-05-05 15:07:29 -07003
4#include <console/console.h>
5#include <device/device.h>
6#include <device/pci.h>
Kyösti Mälkkif1b58b72019-03-01 13:43:02 +02007#include <device/pci_ops.h>
Aaron Durbin789f2b62015-09-09 17:05:06 -05008#include <fsp/util.h>
Lee Leahy77ff0b12015-05-05 15:07:29 -07009#include <soc/pci_devs.h>
10#include <soc/ramstage.h>
Lee Leahy77ff0b12015-05-05 15:07:29 -070011
Elyes HAOUASc3385072019-03-21 15:38:06 +010012#include "chip.h"
13
Elyes HAOUASb13fac32018-05-24 22:29:44 +020014static void pci_domain_set_resources(struct device *dev)
Lee Leahy77ff0b12015-05-05 15:07:29 -070015{
Angel Ponsaee7ab22020-03-19 00:31:58 +010016 printk(BIOS_SPEW, "%s/%s (%s)\n", __FILE__, __func__, dev_name(dev));
Lee Leahy77ff0b12015-05-05 15:07:29 -070017 assign_resources(dev->link_list);
18}
19
20static struct device_operations pci_domain_ops = {
21 .read_resources = pci_domain_read_resources,
22 .set_resources = pci_domain_set_resources,
Lee Leahy77ff0b12015-05-05 15:07:29 -070023 .scan_bus = pci_domain_scan_bus,
Lee Leahy77ff0b12015-05-05 15:07:29 -070024};
25
26static struct device_operations cpu_bus_ops = {
Elyes HAOUASb6fa7a22018-12-07 12:21:18 +010027 .read_resources = DEVICE_NOOP,
28 .set_resources = DEVICE_NOOP,
29 .enable_resources = DEVICE_NOOP,
Lee Leahy32471722015-04-20 15:20:28 -070030 .init = soc_init_cpus
Lee Leahy77ff0b12015-05-05 15:07:29 -070031};
32
33
Elyes HAOUASb13fac32018-05-24 22:29:44 +020034static void enable_dev(struct device *dev)
Lee Leahy77ff0b12015-05-05 15:07:29 -070035{
Angel Ponsaee7ab22020-03-19 00:31:58 +010036 printk(BIOS_SPEW, "----------\n%s/%s (%s), type: %d\n", __FILE__, __func__,
Lee Leahy32471722015-04-20 15:20:28 -070037 dev_name(dev), dev->path.type);
Angel Ponsaee7ab22020-03-19 00:31:58 +010038
Lee Leahy32471722015-04-20 15:20:28 -070039 printk(BIOS_SPEW, "vendor: 0x%04x. device: 0x%04x\n",
40 pci_read_config16(dev, PCI_VENDOR_ID),
41 pci_read_config16(dev, PCI_DEVICE_ID));
Angel Ponsaee7ab22020-03-19 00:31:58 +010042
43 printk(BIOS_SPEW, "class: 0x%02x %s\nsubclass: 0x%02x %s\n"
44 "prog: 0x%02x\nrevision: 0x%02x\n",
Lee Leahy32471722015-04-20 15:20:28 -070045 pci_read_config16(dev, PCI_CLASS_DEVICE) >> 8,
46 get_pci_class_name(dev),
47 pci_read_config16(dev, PCI_CLASS_DEVICE) & 0xff,
48 get_pci_subclass_name(dev),
49 pci_read_config8(dev, PCI_CLASS_PROG),
50 pci_read_config8(dev, PCI_REVISION_ID));
51
Lee Leahy77ff0b12015-05-05 15:07:29 -070052 /* Set the operations if it is a special bus type */
53 if (dev->path.type == DEVICE_PATH_DOMAIN) {
54 dev->ops = &pci_domain_ops;
Angel Ponsaee7ab22020-03-19 00:31:58 +010055
Lee Leahy77ff0b12015-05-05 15:07:29 -070056 } else if (dev->path.type == DEVICE_PATH_CPU_CLUSTER) {
57 dev->ops = &cpu_bus_ops;
Angel Ponsaee7ab22020-03-19 00:31:58 +010058
Lee Leahy77ff0b12015-05-05 15:07:29 -070059 } else if (dev->path.type == DEVICE_PATH_PCI) {
60 /* Handle south cluster enablement. */
61 if (PCI_SLOT(dev->path.pci.devfn) > GFX_DEV &&
62 (dev->ops == NULL || dev->ops->enable == NULL)) {
63 southcluster_enable_dev(dev);
64 }
65 }
66}
67
Aaron Durbin64031672018-04-21 14:45:32 -060068__weak void board_silicon_USB2_override(SILICON_INIT_UPD *params)
Matt DeVillier2c8ac222017-08-26 04:53:35 -050069{
70}
71
Lee Leahy32471722015-04-20 15:20:28 -070072void soc_silicon_init_params(SILICON_INIT_UPD *params)
73{
Kyösti Mälkkic70eed12018-05-22 02:18:00 +030074 struct device *dev = pcidev_on_root(LPC_DEV, LPC_FUNC);
Ravi Sarawadid077b582015-09-09 14:12:16 -070075 struct soc_intel_braswell_config *config;
76
77 if (!dev) {
Angel Ponsaee7ab22020-03-19 00:31:58 +010078 printk(BIOS_ERR, "Error! Device (%s) not found, soc_silicon_init_params!\n",
79 dev_path(dev));
Ravi Sarawadid077b582015-09-09 14:12:16 -070080 return;
81 }
82
Kyösti Mälkki8950cfb2019-07-13 22:16:25 +030083 config = config_of(dev);
Lee Leahy32471722015-04-20 15:20:28 -070084
85 /* Set the parameters for SiliconInit */
86 printk(BIOS_DEBUG, "Updating UPD values for SiliconInit\n");
Angel Ponsaee7ab22020-03-19 00:31:58 +010087 params->PcdSdcardMode = config->PcdSdcardMode;
88 params->PcdEnableHsuart0 = config->PcdEnableHsuart0;
89 params->PcdEnableHsuart1 = config->PcdEnableHsuart1;
90 params->PcdEnableAzalia = config->PcdEnableAzalia;
91 params->PcdEnableSata = config->PcdEnableSata;
92 params->PcdEnableXhci = config->PcdEnableXhci;
93 params->PcdEnableLpe = config->PcdEnableLpe;
94 params->PcdEnableDma0 = config->PcdEnableDma0;
95 params->PcdEnableDma1 = config->PcdEnableDma1;
96 params->PcdEnableI2C0 = config->PcdEnableI2C0;
97 params->PcdEnableI2C1 = config->PcdEnableI2C1;
98 params->PcdEnableI2C2 = config->PcdEnableI2C2;
99 params->PcdEnableI2C3 = config->PcdEnableI2C3;
100 params->PcdEnableI2C4 = config->PcdEnableI2C4;
101 params->PcdEnableI2C5 = config->PcdEnableI2C5;
102 params->PcdEnableI2C6 = config->PcdEnableI2C6;
103 params->GraphicsConfigPtr = 0;
104 params->AzaliaConfigPtr = 0;
105 params->PunitPwrConfigDisable = config->PunitPwrConfigDisable;
106 params->ChvSvidConfig = config->ChvSvidConfig;
107 params->DptfDisable = config->DptfDisable;
108 params->PcdEmmcMode = config->PcdEmmcMode;
109 params->PcdUsb3ClkSsc = config->PcdUsb3ClkSsc;
110 params->PcdDispClkSsc = config->PcdDispClkSsc;
111 params->PcdSataClkSsc = config->PcdSataClkSsc;
Kevin Chiu348a6d52016-06-30 14:50:52 +0800112
Angel Ponsaee7ab22020-03-19 00:31:58 +0100113 params->Usb2Port0PerPortPeTxiSet = config->Usb2Port0PerPortPeTxiSet;
114 params->Usb2Port0PerPortTxiSet = config->Usb2Port0PerPortTxiSet;
115 params->Usb2Port0IUsbTxEmphasisEn = config->Usb2Port0IUsbTxEmphasisEn;
116 params->Usb2Port0PerPortTxPeHalf = config->Usb2Port0PerPortTxPeHalf;
Kevin Chiu348a6d52016-06-30 14:50:52 +0800117
Angel Ponsaee7ab22020-03-19 00:31:58 +0100118 params->Usb2Port1PerPortPeTxiSet = config->Usb2Port1PerPortPeTxiSet;
119 params->Usb2Port1PerPortTxiSet = config->Usb2Port1PerPortTxiSet;
120 params->Usb2Port1IUsbTxEmphasisEn = config->Usb2Port1IUsbTxEmphasisEn;
121 params->Usb2Port1PerPortTxPeHalf = config->Usb2Port1PerPortTxPeHalf;
Kevin Chiu348a6d52016-06-30 14:50:52 +0800122
Angel Ponsaee7ab22020-03-19 00:31:58 +0100123 params->Usb2Port2PerPortPeTxiSet = config->Usb2Port2PerPortPeTxiSet;
124 params->Usb2Port2PerPortTxiSet = config->Usb2Port2PerPortTxiSet;
125 params->Usb2Port2IUsbTxEmphasisEn = config->Usb2Port2IUsbTxEmphasisEn;
126 params->Usb2Port2PerPortTxPeHalf = config->Usb2Port2PerPortTxPeHalf;
Kevin Chiu348a6d52016-06-30 14:50:52 +0800127
Angel Ponsaee7ab22020-03-19 00:31:58 +0100128 params->Usb2Port3PerPortPeTxiSet = config->Usb2Port3PerPortPeTxiSet;
129 params->Usb2Port3PerPortTxiSet = config->Usb2Port3PerPortTxiSet;
130 params->Usb2Port3IUsbTxEmphasisEn = config->Usb2Port3IUsbTxEmphasisEn;
131 params->Usb2Port3PerPortTxPeHalf = config->Usb2Port3PerPortTxPeHalf;
Kevin Chiu348a6d52016-06-30 14:50:52 +0800132
Angel Ponsaee7ab22020-03-19 00:31:58 +0100133 params->Usb2Port4PerPortPeTxiSet = config->Usb2Port4PerPortPeTxiSet;
134 params->Usb2Port4PerPortTxiSet = config->Usb2Port4PerPortTxiSet;
135 params->Usb2Port4IUsbTxEmphasisEn = config->Usb2Port4IUsbTxEmphasisEn;
136 params->Usb2Port4PerPortTxPeHalf = config->Usb2Port4PerPortTxPeHalf;
137
138 params->Usb3Lane0Ow2tapgen2deemph3p5 = config->Usb3Lane0Ow2tapgen2deemph3p5;
139 params->Usb3Lane1Ow2tapgen2deemph3p5 = config->Usb3Lane1Ow2tapgen2deemph3p5;
140 params->Usb3Lane2Ow2tapgen2deemph3p5 = config->Usb3Lane2Ow2tapgen2deemph3p5;
141 params->Usb3Lane3Ow2tapgen2deemph3p5 = config->Usb3Lane3Ow2tapgen2deemph3p5;
142
143 params->PcdSataInterfaceSpeed = config->PcdSataInterfaceSpeed;
144 params->PcdPchUsbSsicPort = config->PcdPchUsbSsicPort;
145 params->PcdPchUsbHsicPort = config->PcdPchUsbHsicPort;
146 params->PcdPcieRootPortSpeed = config->PcdPcieRootPortSpeed;
147 params->PcdPchSsicEnable = config->PcdPchSsicEnable;
148 params->PcdLogoPtr = config->PcdLogoPtr;
149 params->PcdLogoSize = config->PcdLogoSize;
150 params->PcdRtcLock = config->PcdRtcLock;
151 params->PMIC_I2CBus = config->PMIC_I2CBus;
152 params->ISPEnable = config->ISPEnable;
153 params->ISPPciDevConfig = config->ISPPciDevConfig;
154 params->PcdSdDetectChk = config->PcdSdDetectChk;
155 params->I2C0Frequency = config->I2C0Frequency;
156 params->I2C1Frequency = config->I2C1Frequency;
157 params->I2C2Frequency = config->I2C2Frequency;
158 params->I2C3Frequency = config->I2C3Frequency;
159 params->I2C4Frequency = config->I2C4Frequency;
160 params->I2C5Frequency = config->I2C5Frequency;
161 params->I2C6Frequency = config->I2C6Frequency;
Matt DeVillier143a8362017-08-26 04:47:15 -0500162
Matt DeVillier2c8ac222017-08-26 04:53:35 -0500163 board_silicon_USB2_override(params);
Lee Leahy32471722015-04-20 15:20:28 -0700164}
165
Wim Vervoorn67117c32019-12-16 14:21:09 +0100166const struct cbmem_entry *soc_load_logo(SILICON_INIT_UPD *params)
167{
168 return fsp_load_logo(&params->PcdLogoPtr, &params->PcdLogoSize);
169}
170
Angel Ponsaee7ab22020-03-19 00:31:58 +0100171void soc_display_silicon_init_params(const SILICON_INIT_UPD *old, SILICON_INIT_UPD *new)
Lee Leahy32471722015-04-20 15:20:28 -0700172{
173 /* Display the parameters for SiliconInit */
174 printk(BIOS_SPEW, "UPD values for SiliconInit:\n");
Angel Ponsaee7ab22020-03-19 00:31:58 +0100175
176 fsp_display_upd_value("PcdSdcardMode", 1,
177 old->PcdSdcardMode,
178 new->PcdSdcardMode);
179 fsp_display_upd_value("PcdEnableHsuart0", 1,
180 old->PcdEnableHsuart0,
181 new->PcdEnableHsuart0);
182 fsp_display_upd_value("PcdEnableHsuart1", 1,
183 old->PcdEnableHsuart1,
184 new->PcdEnableHsuart1);
185 fsp_display_upd_value("PcdEnableAzalia", 1,
186 old->PcdEnableAzalia,
187 new->PcdEnableAzalia);
Lee Leahy66208bd2015-10-15 16:17:58 -0700188 fsp_display_upd_value("AzaliaConfigPtr", 4,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100189 (uint32_t)old->AzaliaConfigPtr,
190 (uint32_t)new->AzaliaConfigPtr);
191
192 fsp_display_upd_value("PcdEnableSata", 1, old->PcdEnableSata, new->PcdEnableSata);
193 fsp_display_upd_value("PcdEnableXhci", 1, old->PcdEnableXhci, new->PcdEnableXhci);
194 fsp_display_upd_value("PcdEnableLpe", 1, old->PcdEnableLpe, new->PcdEnableLpe);
195 fsp_display_upd_value("PcdEnableDma0", 1, old->PcdEnableDma0, new->PcdEnableDma0);
196 fsp_display_upd_value("PcdEnableDma1", 1, old->PcdEnableDma1, new->PcdEnableDma1);
197 fsp_display_upd_value("PcdEnableI2C0", 1, old->PcdEnableI2C0, new->PcdEnableI2C0);
198 fsp_display_upd_value("PcdEnableI2C1", 1, old->PcdEnableI2C1, new->PcdEnableI2C1);
199 fsp_display_upd_value("PcdEnableI2C2", 1, old->PcdEnableI2C2, new->PcdEnableI2C2);
200 fsp_display_upd_value("PcdEnableI2C3", 1, old->PcdEnableI2C3, new->PcdEnableI2C3);
201 fsp_display_upd_value("PcdEnableI2C4", 1, old->PcdEnableI2C4, new->PcdEnableI2C4);
202 fsp_display_upd_value("PcdEnableI2C5", 1, old->PcdEnableI2C5, new->PcdEnableI2C5);
203 fsp_display_upd_value("PcdEnableI2C6", 1, old->PcdEnableI2C6, new->PcdEnableI2C6);
204
Lee Leahy66208bd2015-10-15 16:17:58 -0700205 fsp_display_upd_value("PcdGraphicsConfigPtr", 4,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100206 old->GraphicsConfigPtr,
207 new->GraphicsConfigPtr);
Lee Leahy66208bd2015-10-15 16:17:58 -0700208 fsp_display_upd_value("GpioFamilyInitTablePtr", 4,
Lee Leahy32471722015-04-20 15:20:28 -0700209 (uint32_t)old->GpioFamilyInitTablePtr,
210 (uint32_t)new->GpioFamilyInitTablePtr);
Lee Leahy66208bd2015-10-15 16:17:58 -0700211 fsp_display_upd_value("GpioPadInitTablePtr", 4,
Lee Leahy32471722015-04-20 15:20:28 -0700212 (uint32_t)old->GpioPadInitTablePtr,
213 (uint32_t)new->GpioPadInitTablePtr);
Lee Leahy66208bd2015-10-15 16:17:58 -0700214 fsp_display_upd_value("PunitPwrConfigDisable", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100215 old->PunitPwrConfigDisable,
216 new->PunitPwrConfigDisable);
217
218 fsp_display_upd_value("ChvSvidConfig", 1, old->ChvSvidConfig, new->ChvSvidConfig);
219 fsp_display_upd_value("DptfDisable", 1, old->DptfDisable, new->DptfDisable);
220 fsp_display_upd_value("PcdEmmcMode", 1, old->PcdEmmcMode, new->PcdEmmcMode);
221 fsp_display_upd_value("PcdUsb3ClkSsc", 1, old->PcdUsb3ClkSsc, new->PcdUsb3ClkSsc);
222 fsp_display_upd_value("PcdDispClkSsc", 1, old->PcdDispClkSsc, new->PcdDispClkSsc);
223 fsp_display_upd_value("PcdSataClkSsc", 1, old->PcdSataClkSsc, new->PcdSataClkSsc);
224
Lee Leahy66208bd2015-10-15 16:17:58 -0700225 fsp_display_upd_value("Usb2Port0PerPortPeTxiSet", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100226 old->Usb2Port0PerPortPeTxiSet,
227 new->Usb2Port0PerPortPeTxiSet);
Lee Leahy66208bd2015-10-15 16:17:58 -0700228 fsp_display_upd_value("Usb2Port0PerPortTxiSet", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100229 old->Usb2Port0PerPortTxiSet,
230 new->Usb2Port0PerPortTxiSet);
Lee Leahy66208bd2015-10-15 16:17:58 -0700231 fsp_display_upd_value("Usb2Port0IUsbTxEmphasisEn", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100232 old->Usb2Port0IUsbTxEmphasisEn,
233 new->Usb2Port0IUsbTxEmphasisEn);
Lee Leahy66208bd2015-10-15 16:17:58 -0700234 fsp_display_upd_value("Usb2Port0PerPortTxPeHalf", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100235 old->Usb2Port0PerPortTxPeHalf,
236 new->Usb2Port0PerPortTxPeHalf);
Lee Leahy66208bd2015-10-15 16:17:58 -0700237 fsp_display_upd_value("Usb2Port1PerPortPeTxiSet", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100238 old->Usb2Port1PerPortPeTxiSet,
239 new->Usb2Port1PerPortPeTxiSet);
Lee Leahy66208bd2015-10-15 16:17:58 -0700240 fsp_display_upd_value("Usb2Port1PerPortTxiSet", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100241 old->Usb2Port1PerPortTxiSet,
242 new->Usb2Port1PerPortTxiSet);
Lee Leahy66208bd2015-10-15 16:17:58 -0700243 fsp_display_upd_value("Usb2Port1IUsbTxEmphasisEn", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100244 old->Usb2Port1IUsbTxEmphasisEn,
245 new->Usb2Port1IUsbTxEmphasisEn);
Lee Leahy66208bd2015-10-15 16:17:58 -0700246 fsp_display_upd_value("Usb2Port1PerPortTxPeHalf", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100247 old->Usb2Port1PerPortTxPeHalf,
248 new->Usb2Port1PerPortTxPeHalf);
Lee Leahy66208bd2015-10-15 16:17:58 -0700249 fsp_display_upd_value("Usb2Port2PerPortPeTxiSet", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100250 old->Usb2Port2PerPortPeTxiSet,
251 new->Usb2Port2PerPortPeTxiSet);
Lee Leahy66208bd2015-10-15 16:17:58 -0700252 fsp_display_upd_value("Usb2Port2PerPortTxiSet", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100253 old->Usb2Port2PerPortTxiSet,
254 new->Usb2Port2PerPortTxiSet);
Lee Leahy66208bd2015-10-15 16:17:58 -0700255 fsp_display_upd_value("Usb2Port2IUsbTxEmphasisEn", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100256 old->Usb2Port2IUsbTxEmphasisEn,
257 new->Usb2Port2IUsbTxEmphasisEn);
Lee Leahy66208bd2015-10-15 16:17:58 -0700258 fsp_display_upd_value("Usb2Port2PerPortTxPeHalf", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100259 old->Usb2Port2PerPortTxPeHalf,
260 new->Usb2Port2PerPortTxPeHalf);
Lee Leahy66208bd2015-10-15 16:17:58 -0700261 fsp_display_upd_value("Usb2Port3PerPortPeTxiSet", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100262 old->Usb2Port3PerPortPeTxiSet,
263 new->Usb2Port3PerPortPeTxiSet);
Lee Leahy66208bd2015-10-15 16:17:58 -0700264 fsp_display_upd_value("Usb2Port3PerPortTxiSet", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100265 old->Usb2Port3PerPortTxiSet,
266 new->Usb2Port3PerPortTxiSet);
Lee Leahy66208bd2015-10-15 16:17:58 -0700267 fsp_display_upd_value("Usb2Port3IUsbTxEmphasisEn", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100268 old->Usb2Port3IUsbTxEmphasisEn,
269 new->Usb2Port3IUsbTxEmphasisEn);
Lee Leahy66208bd2015-10-15 16:17:58 -0700270 fsp_display_upd_value("Usb2Port3PerPortTxPeHalf", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100271 old->Usb2Port3PerPortTxPeHalf,
272 new->Usb2Port3PerPortTxPeHalf);
Lee Leahy66208bd2015-10-15 16:17:58 -0700273 fsp_display_upd_value("Usb2Port4PerPortPeTxiSet", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100274 old->Usb2Port4PerPortPeTxiSet,
275 new->Usb2Port4PerPortPeTxiSet);
Lee Leahy66208bd2015-10-15 16:17:58 -0700276 fsp_display_upd_value("Usb2Port4PerPortTxiSet", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100277 old->Usb2Port4PerPortTxiSet,
278 new->Usb2Port4PerPortTxiSet);
Lee Leahy66208bd2015-10-15 16:17:58 -0700279 fsp_display_upd_value("Usb2Port4IUsbTxEmphasisEn", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100280 old->Usb2Port4IUsbTxEmphasisEn,
281 new->Usb2Port4IUsbTxEmphasisEn);
Lee Leahy66208bd2015-10-15 16:17:58 -0700282 fsp_display_upd_value("Usb2Port4PerPortTxPeHalf", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100283 old->Usb2Port4PerPortTxPeHalf,
284 new->Usb2Port4PerPortTxPeHalf);
Lee Leahy66208bd2015-10-15 16:17:58 -0700285 fsp_display_upd_value("Usb3Lane0Ow2tapgen2deemph3p5", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100286 old->Usb3Lane0Ow2tapgen2deemph3p5,
287 new->Usb3Lane0Ow2tapgen2deemph3p5);
Lee Leahy66208bd2015-10-15 16:17:58 -0700288 fsp_display_upd_value("Usb3Lane1Ow2tapgen2deemph3p5", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100289 old->Usb3Lane1Ow2tapgen2deemph3p5,
290 new->Usb3Lane1Ow2tapgen2deemph3p5);
Lee Leahy66208bd2015-10-15 16:17:58 -0700291 fsp_display_upd_value("Usb3Lane2Ow2tapgen2deemph3p5", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100292 old->Usb3Lane2Ow2tapgen2deemph3p5,
293 new->Usb3Lane2Ow2tapgen2deemph3p5);
Lee Leahy66208bd2015-10-15 16:17:58 -0700294 fsp_display_upd_value("Usb3Lane3Ow2tapgen2deemph3p5", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100295 old->Usb3Lane3Ow2tapgen2deemph3p5,
296 new->Usb3Lane3Ow2tapgen2deemph3p5);
Lee Leahy66208bd2015-10-15 16:17:58 -0700297 fsp_display_upd_value("PcdSataInterfaceSpeed", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100298 old->PcdSataInterfaceSpeed,
299 new->PcdSataInterfaceSpeed);
Lee Leahy66208bd2015-10-15 16:17:58 -0700300 fsp_display_upd_value("PcdPchUsbSsicPort", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100301 old->PcdPchUsbSsicPort,
302 new->PcdPchUsbSsicPort);
Lee Leahy66208bd2015-10-15 16:17:58 -0700303 fsp_display_upd_value("PcdPchUsbHsicPort", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100304 old->PcdPchUsbHsicPort,
305 new->PcdPchUsbHsicPort);
Lee Leahy66208bd2015-10-15 16:17:58 -0700306 fsp_display_upd_value("PcdPcieRootPortSpeed", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100307 old->PcdPcieRootPortSpeed,
308 new->PcdPcieRootPortSpeed);
309 fsp_display_upd_value("PcdPchSsicEnable", 1,
310 old->PcdPchSsicEnable,
311 new->PcdPchSsicEnable);
312
313 fsp_display_upd_value("PcdLogoPtr", 4, old->PcdLogoPtr, new->PcdLogoPtr);
314 fsp_display_upd_value("PcdLogoSize", 4, old->PcdLogoSize, new->PcdLogoSize);
315 fsp_display_upd_value("PcdRtcLock", 1, old->PcdRtcLock, new->PcdRtcLock);
316 fsp_display_upd_value("PMIC_I2CBus", 1, old->PMIC_I2CBus, new->PMIC_I2CBus);
317 fsp_display_upd_value("ISPEnable", 1, old->ISPEnable, new->ISPEnable);
318 fsp_display_upd_value("ISPPciDevConfig", 1, old->ISPPciDevConfig, new->ISPPciDevConfig);
319 fsp_display_upd_value("PcdSdDetectChk", 1, old->PcdSdDetectChk, new->PcdSdDetectChk);
Lee Leahy32471722015-04-20 15:20:28 -0700320}
321
Lee Leahy77ff0b12015-05-05 15:07:29 -0700322/* Called at BS_DEV_INIT_CHIPS time -- very early. Just after BS_PRE_DEVICE. */
323static void soc_init(void *chip_info)
324{
Lee Leahy32471722015-04-20 15:20:28 -0700325 printk(BIOS_SPEW, "%s/%s\n", __FILE__, __func__);
326 soc_init_pre_device(chip_info);
Lee Leahy77ff0b12015-05-05 15:07:29 -0700327}
328
Lee Leahy32471722015-04-20 15:20:28 -0700329struct chip_operations soc_intel_braswell_ops = {
330 CHIP_NAME("Intel Braswell SoC")
Lee Leahy77ff0b12015-05-05 15:07:29 -0700331 .enable_dev = enable_dev,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100332 .init = soc_init,
Lee Leahy77ff0b12015-05-05 15:07:29 -0700333};
334
Lee Leahy77ff0b12015-05-05 15:07:29 -0700335struct pci_operations soc_pci_ops = {
Subrata Banik4a0f0712019-03-20 14:29:47 +0530336 .set_subsystem = &pci_dev_set_subsystem,
Lee Leahy77ff0b12015-05-05 15:07:29 -0700337};
Matt DeVillier143a8362017-08-26 04:47:15 -0500338
339/**
340 Return SoC stepping type
341
342 @retval SOC_STEPPING SoC stepping type
343**/
344int SocStepping(void)
345{
Kyösti Mälkkic70eed12018-05-22 02:18:00 +0300346 struct device *dev = pcidev_on_root(LPC_DEV, LPC_FUNC);
Angel Ponsaee7ab22020-03-19 00:31:58 +0100347 const u8 revid = pci_read_config8(dev, 0x8);
Matt DeVillier143a8362017-08-26 04:47:15 -0500348
349 switch (revid & B_PCH_LPC_RID_STEPPING_MASK) {
350 case V_PCH_LPC_RID_A0:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100351 return SocA0;
Matt DeVillier143a8362017-08-26 04:47:15 -0500352 case V_PCH_LPC_RID_A1:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100353 return SocA1;
Matt DeVillier143a8362017-08-26 04:47:15 -0500354 case V_PCH_LPC_RID_A2:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100355 return SocA2;
Matt DeVillier143a8362017-08-26 04:47:15 -0500356 case V_PCH_LPC_RID_A3:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100357 return SocA3;
Matt DeVillier143a8362017-08-26 04:47:15 -0500358 case V_PCH_LPC_RID_A4:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100359 return SocA4;
Matt DeVillier143a8362017-08-26 04:47:15 -0500360 case V_PCH_LPC_RID_A5:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100361 return SocA5;
Matt DeVillier143a8362017-08-26 04:47:15 -0500362 case V_PCH_LPC_RID_A6:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100363 return SocA6;
Matt DeVillier143a8362017-08-26 04:47:15 -0500364 case V_PCH_LPC_RID_A7:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100365 return SocA7;
Matt DeVillier143a8362017-08-26 04:47:15 -0500366 case V_PCH_LPC_RID_B0:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100367 return SocB0;
Matt DeVillier143a8362017-08-26 04:47:15 -0500368 case V_PCH_LPC_RID_B1:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100369 return SocB1;
Matt DeVillier143a8362017-08-26 04:47:15 -0500370 case V_PCH_LPC_RID_B2:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100371 return SocB2;
Matt DeVillier143a8362017-08-26 04:47:15 -0500372 case V_PCH_LPC_RID_B3:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100373 return SocB3;
Matt DeVillier143a8362017-08-26 04:47:15 -0500374 case V_PCH_LPC_RID_B4:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100375 return SocB4;
Matt DeVillier143a8362017-08-26 04:47:15 -0500376 case V_PCH_LPC_RID_B5:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100377 return SocB5;
Matt DeVillier143a8362017-08-26 04:47:15 -0500378 case V_PCH_LPC_RID_B6:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100379 return SocB6;
Matt DeVillier143a8362017-08-26 04:47:15 -0500380 case V_PCH_LPC_RID_B7:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100381 return SocB7;
Matt DeVillier143a8362017-08-26 04:47:15 -0500382 case V_PCH_LPC_RID_C0:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100383 return SocC0;
Matt DeVillier143a8362017-08-26 04:47:15 -0500384 case V_PCH_LPC_RID_C1:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100385 return SocC1;
Matt DeVillier143a8362017-08-26 04:47:15 -0500386 case V_PCH_LPC_RID_C2:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100387 return SocC2;
Matt DeVillier143a8362017-08-26 04:47:15 -0500388 case V_PCH_LPC_RID_C3:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100389 return SocC3;
Matt DeVillier143a8362017-08-26 04:47:15 -0500390 case V_PCH_LPC_RID_C4:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100391 return SocC4;
Matt DeVillier143a8362017-08-26 04:47:15 -0500392 case V_PCH_LPC_RID_C5:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100393 return SocC5;
Matt DeVillier143a8362017-08-26 04:47:15 -0500394 case V_PCH_LPC_RID_C6:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100395 return SocC6;
Matt DeVillier143a8362017-08-26 04:47:15 -0500396 case V_PCH_LPC_RID_C7:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100397 return SocC7;
Matt DeVillier143a8362017-08-26 04:47:15 -0500398 case V_PCH_LPC_RID_D0:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100399 return SocD0;
Matt DeVillier143a8362017-08-26 04:47:15 -0500400 case V_PCH_LPC_RID_D1:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100401 return SocD1;
Matt DeVillier143a8362017-08-26 04:47:15 -0500402 case V_PCH_LPC_RID_D2:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100403 return SocD2;
Matt DeVillier143a8362017-08-26 04:47:15 -0500404 case V_PCH_LPC_RID_D3:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100405 return SocD3;
Matt DeVillier143a8362017-08-26 04:47:15 -0500406 case V_PCH_LPC_RID_D4:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100407 return SocD4;
Matt DeVillier143a8362017-08-26 04:47:15 -0500408 case V_PCH_LPC_RID_D5:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100409 return SocD5;
Matt DeVillier143a8362017-08-26 04:47:15 -0500410 case V_PCH_LPC_RID_D6:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100411 return SocD6;
Matt DeVillier143a8362017-08-26 04:47:15 -0500412 case V_PCH_LPC_RID_D7:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100413 return SocD7;
Matt DeVillier143a8362017-08-26 04:47:15 -0500414 default:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100415 return SocSteppingMax;
Matt DeVillier143a8362017-08-26 04:47:15 -0500416 }
417}