blob: ce394d0baa1043143ef147519ee7d500742aa847 [file] [log] [blame]
Angel Ponsba38f372020-04-05 15:46:45 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Lee Leahy77ff0b12015-05-05 15:07:29 -07002
3#include <console/console.h>
4#include <device/device.h>
5#include <device/pci.h>
Kyösti Mälkkif1b58b72019-03-01 13:43:02 +02006#include <device/pci_ops.h>
Aaron Durbin789f2b62015-09-09 17:05:06 -05007#include <fsp/util.h>
Lee Leahy77ff0b12015-05-05 15:07:29 -07008#include <soc/pci_devs.h>
9#include <soc/ramstage.h>
Lee Leahy77ff0b12015-05-05 15:07:29 -070010
Elyes HAOUASc3385072019-03-21 15:38:06 +010011#include "chip.h"
12
Lee Leahy77ff0b12015-05-05 15:07:29 -070013static struct device_operations pci_domain_ops = {
14 .read_resources = pci_domain_read_resources,
15 .set_resources = pci_domain_set_resources,
Arthur Heymans0b0113f2023-08-31 17:09:28 +020016 .scan_bus = pci_host_bridge_scan_bus,
Lee Leahy77ff0b12015-05-05 15:07:29 -070017};
18
19static struct device_operations cpu_bus_ops = {
Nico Huber2f8ba692020-04-05 14:05:24 +020020 .read_resources = noop_read_resources,
21 .set_resources = noop_set_resources,
Felix Helde8601f42021-10-20 23:56:18 +020022 .init = mp_cpu_bus_init,
Lee Leahy77ff0b12015-05-05 15:07:29 -070023};
24
Elyes HAOUASb13fac32018-05-24 22:29:44 +020025static void enable_dev(struct device *dev)
Lee Leahy77ff0b12015-05-05 15:07:29 -070026{
27 /* Set the operations if it is a special bus type */
28 if (dev->path.type == DEVICE_PATH_DOMAIN) {
29 dev->ops = &pci_domain_ops;
Angel Ponsaee7ab22020-03-19 00:31:58 +010030
Lee Leahy77ff0b12015-05-05 15:07:29 -070031 } else if (dev->path.type == DEVICE_PATH_CPU_CLUSTER) {
32 dev->ops = &cpu_bus_ops;
Angel Ponsaee7ab22020-03-19 00:31:58 +010033
Lee Leahy77ff0b12015-05-05 15:07:29 -070034 } else if (dev->path.type == DEVICE_PATH_PCI) {
35 /* Handle south cluster enablement. */
36 if (PCI_SLOT(dev->path.pci.devfn) > GFX_DEV &&
37 (dev->ops == NULL || dev->ops->enable == NULL)) {
38 southcluster_enable_dev(dev);
39 }
40 }
41}
42
Aaron Durbin64031672018-04-21 14:45:32 -060043__weak void board_silicon_USB2_override(SILICON_INIT_UPD *params)
Matt DeVillier2c8ac222017-08-26 04:53:35 -050044{
45}
46
Lee Leahy32471722015-04-20 15:20:28 -070047void soc_silicon_init_params(SILICON_INIT_UPD *params)
48{
Kyösti Mälkkic70eed12018-05-22 02:18:00 +030049 struct device *dev = pcidev_on_root(LPC_DEV, LPC_FUNC);
Ravi Sarawadid077b582015-09-09 14:12:16 -070050 struct soc_intel_braswell_config *config;
51
52 if (!dev) {
Elyes HAOUAS1e4779e2021-01-16 17:31:40 +010053 printk(BIOS_ERR, "Error! Device (%s) not found, %s!\n",
54 dev_path(dev), __func__);
Ravi Sarawadid077b582015-09-09 14:12:16 -070055 return;
56 }
57
Kyösti Mälkki8950cfb2019-07-13 22:16:25 +030058 config = config_of(dev);
Lee Leahy32471722015-04-20 15:20:28 -070059
60 /* Set the parameters for SiliconInit */
61 printk(BIOS_DEBUG, "Updating UPD values for SiliconInit\n");
Angel Ponsaee7ab22020-03-19 00:31:58 +010062 params->PcdSdcardMode = config->PcdSdcardMode;
63 params->PcdEnableHsuart0 = config->PcdEnableHsuart0;
64 params->PcdEnableHsuart1 = config->PcdEnableHsuart1;
65 params->PcdEnableAzalia = config->PcdEnableAzalia;
66 params->PcdEnableSata = config->PcdEnableSata;
67 params->PcdEnableXhci = config->PcdEnableXhci;
68 params->PcdEnableLpe = config->PcdEnableLpe;
69 params->PcdEnableDma0 = config->PcdEnableDma0;
70 params->PcdEnableDma1 = config->PcdEnableDma1;
71 params->PcdEnableI2C0 = config->PcdEnableI2C0;
72 params->PcdEnableI2C1 = config->PcdEnableI2C1;
73 params->PcdEnableI2C2 = config->PcdEnableI2C2;
74 params->PcdEnableI2C3 = config->PcdEnableI2C3;
75 params->PcdEnableI2C4 = config->PcdEnableI2C4;
76 params->PcdEnableI2C5 = config->PcdEnableI2C5;
77 params->PcdEnableI2C6 = config->PcdEnableI2C6;
78 params->GraphicsConfigPtr = 0;
79 params->AzaliaConfigPtr = 0;
80 params->PunitPwrConfigDisable = config->PunitPwrConfigDisable;
81 params->ChvSvidConfig = config->ChvSvidConfig;
82 params->DptfDisable = config->DptfDisable;
83 params->PcdEmmcMode = config->PcdEmmcMode;
Angel Pons233ae192020-12-11 17:20:16 +010084 params->PcdUsb3ClkSsc = 1;
85 params->PcdDispClkSsc = 1;
86 params->PcdSataClkSsc = 1;
Kevin Chiu348a6d52016-06-30 14:50:52 +080087
Angel Ponsaee7ab22020-03-19 00:31:58 +010088 params->Usb2Port0PerPortPeTxiSet = config->Usb2Port0PerPortPeTxiSet;
89 params->Usb2Port0PerPortTxiSet = config->Usb2Port0PerPortTxiSet;
90 params->Usb2Port0IUsbTxEmphasisEn = config->Usb2Port0IUsbTxEmphasisEn;
91 params->Usb2Port0PerPortTxPeHalf = config->Usb2Port0PerPortTxPeHalf;
Kevin Chiu348a6d52016-06-30 14:50:52 +080092
Angel Ponsaee7ab22020-03-19 00:31:58 +010093 params->Usb2Port1PerPortPeTxiSet = config->Usb2Port1PerPortPeTxiSet;
94 params->Usb2Port1PerPortTxiSet = config->Usb2Port1PerPortTxiSet;
95 params->Usb2Port1IUsbTxEmphasisEn = config->Usb2Port1IUsbTxEmphasisEn;
96 params->Usb2Port1PerPortTxPeHalf = config->Usb2Port1PerPortTxPeHalf;
Kevin Chiu348a6d52016-06-30 14:50:52 +080097
Angel Ponsaee7ab22020-03-19 00:31:58 +010098 params->Usb2Port2PerPortPeTxiSet = config->Usb2Port2PerPortPeTxiSet;
99 params->Usb2Port2PerPortTxiSet = config->Usb2Port2PerPortTxiSet;
100 params->Usb2Port2IUsbTxEmphasisEn = config->Usb2Port2IUsbTxEmphasisEn;
101 params->Usb2Port2PerPortTxPeHalf = config->Usb2Port2PerPortTxPeHalf;
Kevin Chiu348a6d52016-06-30 14:50:52 +0800102
Angel Ponsaee7ab22020-03-19 00:31:58 +0100103 params->Usb2Port3PerPortPeTxiSet = config->Usb2Port3PerPortPeTxiSet;
104 params->Usb2Port3PerPortTxiSet = config->Usb2Port3PerPortTxiSet;
105 params->Usb2Port3IUsbTxEmphasisEn = config->Usb2Port3IUsbTxEmphasisEn;
106 params->Usb2Port3PerPortTxPeHalf = config->Usb2Port3PerPortTxPeHalf;
Kevin Chiu348a6d52016-06-30 14:50:52 +0800107
Angel Ponsaee7ab22020-03-19 00:31:58 +0100108 params->Usb2Port4PerPortPeTxiSet = config->Usb2Port4PerPortPeTxiSet;
109 params->Usb2Port4PerPortTxiSet = config->Usb2Port4PerPortTxiSet;
110 params->Usb2Port4IUsbTxEmphasisEn = config->Usb2Port4IUsbTxEmphasisEn;
111 params->Usb2Port4PerPortTxPeHalf = config->Usb2Port4PerPortTxPeHalf;
112
113 params->Usb3Lane0Ow2tapgen2deemph3p5 = config->Usb3Lane0Ow2tapgen2deemph3p5;
114 params->Usb3Lane1Ow2tapgen2deemph3p5 = config->Usb3Lane1Ow2tapgen2deemph3p5;
115 params->Usb3Lane2Ow2tapgen2deemph3p5 = config->Usb3Lane2Ow2tapgen2deemph3p5;
116 params->Usb3Lane3Ow2tapgen2deemph3p5 = config->Usb3Lane3Ow2tapgen2deemph3p5;
117
Angel Pons233ae192020-12-11 17:20:16 +0100118 params->PcdSataInterfaceSpeed = 3;
Angel Ponsaee7ab22020-03-19 00:31:58 +0100119 params->PcdPchUsbSsicPort = config->PcdPchUsbSsicPort;
120 params->PcdPchUsbHsicPort = config->PcdPchUsbHsicPort;
Angel Pons233ae192020-12-11 17:20:16 +0100121 params->PcdPcieRootPortSpeed = 0;
Angel Ponsaee7ab22020-03-19 00:31:58 +0100122 params->PcdPchSsicEnable = config->PcdPchSsicEnable;
Angel Pons233ae192020-12-11 17:20:16 +0100123 params->PcdRtcLock = 0;
Angel Ponsaee7ab22020-03-19 00:31:58 +0100124 params->PMIC_I2CBus = config->PMIC_I2CBus;
125 params->ISPEnable = config->ISPEnable;
126 params->ISPPciDevConfig = config->ISPPciDevConfig;
127 params->PcdSdDetectChk = config->PcdSdDetectChk;
128 params->I2C0Frequency = config->I2C0Frequency;
129 params->I2C1Frequency = config->I2C1Frequency;
130 params->I2C2Frequency = config->I2C2Frequency;
131 params->I2C3Frequency = config->I2C3Frequency;
132 params->I2C4Frequency = config->I2C4Frequency;
133 params->I2C5Frequency = config->I2C5Frequency;
134 params->I2C6Frequency = config->I2C6Frequency;
Matt DeVillier143a8362017-08-26 04:47:15 -0500135
Matt DeVillier2c8ac222017-08-26 04:53:35 -0500136 board_silicon_USB2_override(params);
Lee Leahy32471722015-04-20 15:20:28 -0700137}
138
Angel Ponsaee7ab22020-03-19 00:31:58 +0100139void soc_display_silicon_init_params(const SILICON_INIT_UPD *old, SILICON_INIT_UPD *new)
Lee Leahy32471722015-04-20 15:20:28 -0700140{
141 /* Display the parameters for SiliconInit */
142 printk(BIOS_SPEW, "UPD values for SiliconInit:\n");
Angel Ponsaee7ab22020-03-19 00:31:58 +0100143
144 fsp_display_upd_value("PcdSdcardMode", 1,
145 old->PcdSdcardMode,
146 new->PcdSdcardMode);
147 fsp_display_upd_value("PcdEnableHsuart0", 1,
148 old->PcdEnableHsuart0,
149 new->PcdEnableHsuart0);
150 fsp_display_upd_value("PcdEnableHsuart1", 1,
151 old->PcdEnableHsuart1,
152 new->PcdEnableHsuart1);
153 fsp_display_upd_value("PcdEnableAzalia", 1,
154 old->PcdEnableAzalia,
155 new->PcdEnableAzalia);
Lee Leahy66208bd2015-10-15 16:17:58 -0700156 fsp_display_upd_value("AzaliaConfigPtr", 4,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100157 (uint32_t)old->AzaliaConfigPtr,
158 (uint32_t)new->AzaliaConfigPtr);
159
160 fsp_display_upd_value("PcdEnableSata", 1, old->PcdEnableSata, new->PcdEnableSata);
161 fsp_display_upd_value("PcdEnableXhci", 1, old->PcdEnableXhci, new->PcdEnableXhci);
162 fsp_display_upd_value("PcdEnableLpe", 1, old->PcdEnableLpe, new->PcdEnableLpe);
163 fsp_display_upd_value("PcdEnableDma0", 1, old->PcdEnableDma0, new->PcdEnableDma0);
164 fsp_display_upd_value("PcdEnableDma1", 1, old->PcdEnableDma1, new->PcdEnableDma1);
165 fsp_display_upd_value("PcdEnableI2C0", 1, old->PcdEnableI2C0, new->PcdEnableI2C0);
166 fsp_display_upd_value("PcdEnableI2C1", 1, old->PcdEnableI2C1, new->PcdEnableI2C1);
167 fsp_display_upd_value("PcdEnableI2C2", 1, old->PcdEnableI2C2, new->PcdEnableI2C2);
168 fsp_display_upd_value("PcdEnableI2C3", 1, old->PcdEnableI2C3, new->PcdEnableI2C3);
169 fsp_display_upd_value("PcdEnableI2C4", 1, old->PcdEnableI2C4, new->PcdEnableI2C4);
170 fsp_display_upd_value("PcdEnableI2C5", 1, old->PcdEnableI2C5, new->PcdEnableI2C5);
171 fsp_display_upd_value("PcdEnableI2C6", 1, old->PcdEnableI2C6, new->PcdEnableI2C6);
172
Lee Leahy66208bd2015-10-15 16:17:58 -0700173 fsp_display_upd_value("PcdGraphicsConfigPtr", 4,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100174 old->GraphicsConfigPtr,
175 new->GraphicsConfigPtr);
Lee Leahy66208bd2015-10-15 16:17:58 -0700176 fsp_display_upd_value("GpioFamilyInitTablePtr", 4,
Lee Leahy32471722015-04-20 15:20:28 -0700177 (uint32_t)old->GpioFamilyInitTablePtr,
178 (uint32_t)new->GpioFamilyInitTablePtr);
Lee Leahy66208bd2015-10-15 16:17:58 -0700179 fsp_display_upd_value("GpioPadInitTablePtr", 4,
Lee Leahy32471722015-04-20 15:20:28 -0700180 (uint32_t)old->GpioPadInitTablePtr,
181 (uint32_t)new->GpioPadInitTablePtr);
Lee Leahy66208bd2015-10-15 16:17:58 -0700182 fsp_display_upd_value("PunitPwrConfigDisable", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100183 old->PunitPwrConfigDisable,
184 new->PunitPwrConfigDisable);
185
186 fsp_display_upd_value("ChvSvidConfig", 1, old->ChvSvidConfig, new->ChvSvidConfig);
187 fsp_display_upd_value("DptfDisable", 1, old->DptfDisable, new->DptfDisable);
188 fsp_display_upd_value("PcdEmmcMode", 1, old->PcdEmmcMode, new->PcdEmmcMode);
189 fsp_display_upd_value("PcdUsb3ClkSsc", 1, old->PcdUsb3ClkSsc, new->PcdUsb3ClkSsc);
190 fsp_display_upd_value("PcdDispClkSsc", 1, old->PcdDispClkSsc, new->PcdDispClkSsc);
191 fsp_display_upd_value("PcdSataClkSsc", 1, old->PcdSataClkSsc, new->PcdSataClkSsc);
192
Lee Leahy66208bd2015-10-15 16:17:58 -0700193 fsp_display_upd_value("Usb2Port0PerPortPeTxiSet", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100194 old->Usb2Port0PerPortPeTxiSet,
195 new->Usb2Port0PerPortPeTxiSet);
Lee Leahy66208bd2015-10-15 16:17:58 -0700196 fsp_display_upd_value("Usb2Port0PerPortTxiSet", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100197 old->Usb2Port0PerPortTxiSet,
198 new->Usb2Port0PerPortTxiSet);
Lee Leahy66208bd2015-10-15 16:17:58 -0700199 fsp_display_upd_value("Usb2Port0IUsbTxEmphasisEn", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100200 old->Usb2Port0IUsbTxEmphasisEn,
201 new->Usb2Port0IUsbTxEmphasisEn);
Lee Leahy66208bd2015-10-15 16:17:58 -0700202 fsp_display_upd_value("Usb2Port0PerPortTxPeHalf", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100203 old->Usb2Port0PerPortTxPeHalf,
204 new->Usb2Port0PerPortTxPeHalf);
Lee Leahy66208bd2015-10-15 16:17:58 -0700205 fsp_display_upd_value("Usb2Port1PerPortPeTxiSet", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100206 old->Usb2Port1PerPortPeTxiSet,
207 new->Usb2Port1PerPortPeTxiSet);
Lee Leahy66208bd2015-10-15 16:17:58 -0700208 fsp_display_upd_value("Usb2Port1PerPortTxiSet", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100209 old->Usb2Port1PerPortTxiSet,
210 new->Usb2Port1PerPortTxiSet);
Lee Leahy66208bd2015-10-15 16:17:58 -0700211 fsp_display_upd_value("Usb2Port1IUsbTxEmphasisEn", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100212 old->Usb2Port1IUsbTxEmphasisEn,
213 new->Usb2Port1IUsbTxEmphasisEn);
Lee Leahy66208bd2015-10-15 16:17:58 -0700214 fsp_display_upd_value("Usb2Port1PerPortTxPeHalf", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100215 old->Usb2Port1PerPortTxPeHalf,
216 new->Usb2Port1PerPortTxPeHalf);
Lee Leahy66208bd2015-10-15 16:17:58 -0700217 fsp_display_upd_value("Usb2Port2PerPortPeTxiSet", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100218 old->Usb2Port2PerPortPeTxiSet,
219 new->Usb2Port2PerPortPeTxiSet);
Lee Leahy66208bd2015-10-15 16:17:58 -0700220 fsp_display_upd_value("Usb2Port2PerPortTxiSet", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100221 old->Usb2Port2PerPortTxiSet,
222 new->Usb2Port2PerPortTxiSet);
Lee Leahy66208bd2015-10-15 16:17:58 -0700223 fsp_display_upd_value("Usb2Port2IUsbTxEmphasisEn", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100224 old->Usb2Port2IUsbTxEmphasisEn,
225 new->Usb2Port2IUsbTxEmphasisEn);
Lee Leahy66208bd2015-10-15 16:17:58 -0700226 fsp_display_upd_value("Usb2Port2PerPortTxPeHalf", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100227 old->Usb2Port2PerPortTxPeHalf,
228 new->Usb2Port2PerPortTxPeHalf);
Lee Leahy66208bd2015-10-15 16:17:58 -0700229 fsp_display_upd_value("Usb2Port3PerPortPeTxiSet", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100230 old->Usb2Port3PerPortPeTxiSet,
231 new->Usb2Port3PerPortPeTxiSet);
Lee Leahy66208bd2015-10-15 16:17:58 -0700232 fsp_display_upd_value("Usb2Port3PerPortTxiSet", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100233 old->Usb2Port3PerPortTxiSet,
234 new->Usb2Port3PerPortTxiSet);
Lee Leahy66208bd2015-10-15 16:17:58 -0700235 fsp_display_upd_value("Usb2Port3IUsbTxEmphasisEn", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100236 old->Usb2Port3IUsbTxEmphasisEn,
237 new->Usb2Port3IUsbTxEmphasisEn);
Lee Leahy66208bd2015-10-15 16:17:58 -0700238 fsp_display_upd_value("Usb2Port3PerPortTxPeHalf", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100239 old->Usb2Port3PerPortTxPeHalf,
240 new->Usb2Port3PerPortTxPeHalf);
Lee Leahy66208bd2015-10-15 16:17:58 -0700241 fsp_display_upd_value("Usb2Port4PerPortPeTxiSet", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100242 old->Usb2Port4PerPortPeTxiSet,
243 new->Usb2Port4PerPortPeTxiSet);
Lee Leahy66208bd2015-10-15 16:17:58 -0700244 fsp_display_upd_value("Usb2Port4PerPortTxiSet", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100245 old->Usb2Port4PerPortTxiSet,
246 new->Usb2Port4PerPortTxiSet);
Lee Leahy66208bd2015-10-15 16:17:58 -0700247 fsp_display_upd_value("Usb2Port4IUsbTxEmphasisEn", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100248 old->Usb2Port4IUsbTxEmphasisEn,
249 new->Usb2Port4IUsbTxEmphasisEn);
Lee Leahy66208bd2015-10-15 16:17:58 -0700250 fsp_display_upd_value("Usb2Port4PerPortTxPeHalf", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100251 old->Usb2Port4PerPortTxPeHalf,
252 new->Usb2Port4PerPortTxPeHalf);
Lee Leahy66208bd2015-10-15 16:17:58 -0700253 fsp_display_upd_value("Usb3Lane0Ow2tapgen2deemph3p5", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100254 old->Usb3Lane0Ow2tapgen2deemph3p5,
255 new->Usb3Lane0Ow2tapgen2deemph3p5);
Lee Leahy66208bd2015-10-15 16:17:58 -0700256 fsp_display_upd_value("Usb3Lane1Ow2tapgen2deemph3p5", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100257 old->Usb3Lane1Ow2tapgen2deemph3p5,
258 new->Usb3Lane1Ow2tapgen2deemph3p5);
Lee Leahy66208bd2015-10-15 16:17:58 -0700259 fsp_display_upd_value("Usb3Lane2Ow2tapgen2deemph3p5", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100260 old->Usb3Lane2Ow2tapgen2deemph3p5,
261 new->Usb3Lane2Ow2tapgen2deemph3p5);
Lee Leahy66208bd2015-10-15 16:17:58 -0700262 fsp_display_upd_value("Usb3Lane3Ow2tapgen2deemph3p5", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100263 old->Usb3Lane3Ow2tapgen2deemph3p5,
264 new->Usb3Lane3Ow2tapgen2deemph3p5);
Lee Leahy66208bd2015-10-15 16:17:58 -0700265 fsp_display_upd_value("PcdSataInterfaceSpeed", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100266 old->PcdSataInterfaceSpeed,
267 new->PcdSataInterfaceSpeed);
Lee Leahy66208bd2015-10-15 16:17:58 -0700268 fsp_display_upd_value("PcdPchUsbSsicPort", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100269 old->PcdPchUsbSsicPort,
270 new->PcdPchUsbSsicPort);
Lee Leahy66208bd2015-10-15 16:17:58 -0700271 fsp_display_upd_value("PcdPchUsbHsicPort", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100272 old->PcdPchUsbHsicPort,
273 new->PcdPchUsbHsicPort);
Lee Leahy66208bd2015-10-15 16:17:58 -0700274 fsp_display_upd_value("PcdPcieRootPortSpeed", 1,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100275 old->PcdPcieRootPortSpeed,
276 new->PcdPcieRootPortSpeed);
277 fsp_display_upd_value("PcdPchSsicEnable", 1,
278 old->PcdPchSsicEnable,
279 new->PcdPchSsicEnable);
280
281 fsp_display_upd_value("PcdLogoPtr", 4, old->PcdLogoPtr, new->PcdLogoPtr);
282 fsp_display_upd_value("PcdLogoSize", 4, old->PcdLogoSize, new->PcdLogoSize);
283 fsp_display_upd_value("PcdRtcLock", 1, old->PcdRtcLock, new->PcdRtcLock);
284 fsp_display_upd_value("PMIC_I2CBus", 1, old->PMIC_I2CBus, new->PMIC_I2CBus);
285 fsp_display_upd_value("ISPEnable", 1, old->ISPEnable, new->ISPEnable);
286 fsp_display_upd_value("ISPPciDevConfig", 1, old->ISPPciDevConfig, new->ISPPciDevConfig);
287 fsp_display_upd_value("PcdSdDetectChk", 1, old->PcdSdDetectChk, new->PcdSdDetectChk);
Lee Leahy32471722015-04-20 15:20:28 -0700288}
289
Lee Leahy77ff0b12015-05-05 15:07:29 -0700290/* Called at BS_DEV_INIT_CHIPS time -- very early. Just after BS_PRE_DEVICE. */
291static void soc_init(void *chip_info)
292{
Lee Leahy32471722015-04-20 15:20:28 -0700293 soc_init_pre_device(chip_info);
Lee Leahy77ff0b12015-05-05 15:07:29 -0700294}
295
Lee Leahy32471722015-04-20 15:20:28 -0700296struct chip_operations soc_intel_braswell_ops = {
297 CHIP_NAME("Intel Braswell SoC")
Lee Leahy77ff0b12015-05-05 15:07:29 -0700298 .enable_dev = enable_dev,
Angel Ponsaee7ab22020-03-19 00:31:58 +0100299 .init = soc_init,
Lee Leahy77ff0b12015-05-05 15:07:29 -0700300};
301
Lee Leahy77ff0b12015-05-05 15:07:29 -0700302struct pci_operations soc_pci_ops = {
Subrata Banik4a0f0712019-03-20 14:29:47 +0530303 .set_subsystem = &pci_dev_set_subsystem,
Lee Leahy77ff0b12015-05-05 15:07:29 -0700304};
Matt DeVillier143a8362017-08-26 04:47:15 -0500305
306/**
307 Return SoC stepping type
308
309 @retval SOC_STEPPING SoC stepping type
310**/
311int SocStepping(void)
312{
Kyösti Mälkkic70eed12018-05-22 02:18:00 +0300313 struct device *dev = pcidev_on_root(LPC_DEV, LPC_FUNC);
Angel Ponsaee7ab22020-03-19 00:31:58 +0100314 const u8 revid = pci_read_config8(dev, 0x8);
Matt DeVillier143a8362017-08-26 04:47:15 -0500315
316 switch (revid & B_PCH_LPC_RID_STEPPING_MASK) {
317 case V_PCH_LPC_RID_A0:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100318 return SocA0;
Matt DeVillier143a8362017-08-26 04:47:15 -0500319 case V_PCH_LPC_RID_A1:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100320 return SocA1;
Matt DeVillier143a8362017-08-26 04:47:15 -0500321 case V_PCH_LPC_RID_A2:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100322 return SocA2;
Matt DeVillier143a8362017-08-26 04:47:15 -0500323 case V_PCH_LPC_RID_A3:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100324 return SocA3;
Matt DeVillier143a8362017-08-26 04:47:15 -0500325 case V_PCH_LPC_RID_A4:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100326 return SocA4;
Matt DeVillier143a8362017-08-26 04:47:15 -0500327 case V_PCH_LPC_RID_A5:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100328 return SocA5;
Matt DeVillier143a8362017-08-26 04:47:15 -0500329 case V_PCH_LPC_RID_A6:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100330 return SocA6;
Matt DeVillier143a8362017-08-26 04:47:15 -0500331 case V_PCH_LPC_RID_A7:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100332 return SocA7;
Matt DeVillier143a8362017-08-26 04:47:15 -0500333 case V_PCH_LPC_RID_B0:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100334 return SocB0;
Matt DeVillier143a8362017-08-26 04:47:15 -0500335 case V_PCH_LPC_RID_B1:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100336 return SocB1;
Matt DeVillier143a8362017-08-26 04:47:15 -0500337 case V_PCH_LPC_RID_B2:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100338 return SocB2;
Matt DeVillier143a8362017-08-26 04:47:15 -0500339 case V_PCH_LPC_RID_B3:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100340 return SocB3;
Matt DeVillier143a8362017-08-26 04:47:15 -0500341 case V_PCH_LPC_RID_B4:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100342 return SocB4;
Matt DeVillier143a8362017-08-26 04:47:15 -0500343 case V_PCH_LPC_RID_B5:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100344 return SocB5;
Matt DeVillier143a8362017-08-26 04:47:15 -0500345 case V_PCH_LPC_RID_B6:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100346 return SocB6;
Matt DeVillier143a8362017-08-26 04:47:15 -0500347 case V_PCH_LPC_RID_B7:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100348 return SocB7;
Matt DeVillier143a8362017-08-26 04:47:15 -0500349 case V_PCH_LPC_RID_C0:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100350 return SocC0;
Matt DeVillier143a8362017-08-26 04:47:15 -0500351 case V_PCH_LPC_RID_C1:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100352 return SocC1;
Matt DeVillier143a8362017-08-26 04:47:15 -0500353 case V_PCH_LPC_RID_C2:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100354 return SocC2;
Matt DeVillier143a8362017-08-26 04:47:15 -0500355 case V_PCH_LPC_RID_C3:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100356 return SocC3;
Matt DeVillier143a8362017-08-26 04:47:15 -0500357 case V_PCH_LPC_RID_C4:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100358 return SocC4;
Matt DeVillier143a8362017-08-26 04:47:15 -0500359 case V_PCH_LPC_RID_C5:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100360 return SocC5;
Matt DeVillier143a8362017-08-26 04:47:15 -0500361 case V_PCH_LPC_RID_C6:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100362 return SocC6;
Matt DeVillier143a8362017-08-26 04:47:15 -0500363 case V_PCH_LPC_RID_C7:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100364 return SocC7;
Matt DeVillier143a8362017-08-26 04:47:15 -0500365 case V_PCH_LPC_RID_D0:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100366 return SocD0;
Matt DeVillier143a8362017-08-26 04:47:15 -0500367 case V_PCH_LPC_RID_D1:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100368 return SocD1;
Matt DeVillier143a8362017-08-26 04:47:15 -0500369 case V_PCH_LPC_RID_D2:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100370 return SocD2;
Matt DeVillier143a8362017-08-26 04:47:15 -0500371 case V_PCH_LPC_RID_D3:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100372 return SocD3;
Matt DeVillier143a8362017-08-26 04:47:15 -0500373 case V_PCH_LPC_RID_D4:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100374 return SocD4;
Matt DeVillier143a8362017-08-26 04:47:15 -0500375 case V_PCH_LPC_RID_D5:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100376 return SocD5;
Matt DeVillier143a8362017-08-26 04:47:15 -0500377 case V_PCH_LPC_RID_D6:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100378 return SocD6;
Matt DeVillier143a8362017-08-26 04:47:15 -0500379 case V_PCH_LPC_RID_D7:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100380 return SocD7;
Matt DeVillier143a8362017-08-26 04:47:15 -0500381 default:
Angel Ponsaee7ab22020-03-19 00:31:58 +0100382 return SocSteppingMax;
Matt DeVillier143a8362017-08-26 04:47:15 -0500383 }
384}