blob: 026b281881248cded733d224fa980eef3c0d4e36 [file] [log] [blame]
Lee Leahy77ff0b12015-05-05 15:07:29 -07001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2013 Google Inc.
Lee Leahy32471722015-04-20 15:20:28 -07005 * Copyright (C) 2015 Intel Corp.
Lee Leahy77ff0b12015-05-05 15:07:29 -07006 *
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.
Lee Leahy77ff0b12015-05-05 15:07:29 -070015 */
16
17#include <console/console.h>
18#include <device/device.h>
19#include <device/pci.h>
Kyösti Mälkkif1b58b72019-03-01 13:43:02 +020020#include <device/pci_ops.h>
Aaron Durbin789f2b62015-09-09 17:05:06 -050021#include <fsp/util.h>
Lee Leahy77ff0b12015-05-05 15:07:29 -070022#include <soc/pci_devs.h>
23#include <soc/ramstage.h>
Lee Leahy77ff0b12015-05-05 15:07:29 -070024
Elyes HAOUASc3385072019-03-21 15:38:06 +010025#include "chip.h"
26
Elyes HAOUASb13fac32018-05-24 22:29:44 +020027static void pci_domain_set_resources(struct device *dev)
Lee Leahy77ff0b12015-05-05 15:07:29 -070028{
Elyes HAOUASa342f392018-10-17 10:56:26 +020029 printk(BIOS_SPEW, "%s/%s (%s)\n",
Lee Leahy32471722015-04-20 15:20:28 -070030 __FILE__, __func__, dev_name(dev));
Lee Leahy77ff0b12015-05-05 15:07:29 -070031 assign_resources(dev->link_list);
32}
33
34static struct device_operations pci_domain_ops = {
35 .read_resources = pci_domain_read_resources,
36 .set_resources = pci_domain_set_resources,
37 .enable_resources = NULL,
38 .init = NULL,
39 .scan_bus = pci_domain_scan_bus,
Lee Leahy77ff0b12015-05-05 15:07:29 -070040};
41
42static struct device_operations cpu_bus_ops = {
Elyes HAOUASb6fa7a22018-12-07 12:21:18 +010043 .read_resources = DEVICE_NOOP,
44 .set_resources = DEVICE_NOOP,
45 .enable_resources = DEVICE_NOOP,
Lee Leahy32471722015-04-20 15:20:28 -070046 .init = soc_init_cpus
Lee Leahy77ff0b12015-05-05 15:07:29 -070047};
48
49
Elyes HAOUASb13fac32018-05-24 22:29:44 +020050static void enable_dev(struct device *dev)
Lee Leahy77ff0b12015-05-05 15:07:29 -070051{
Elyes HAOUASa342f392018-10-17 10:56:26 +020052 printk(BIOS_SPEW, "----------\n%s/%s (%s), type: %d\n",
Lee Leahy32471722015-04-20 15:20:28 -070053 __FILE__, __func__,
54 dev_name(dev), dev->path.type);
55 printk(BIOS_SPEW, "vendor: 0x%04x. device: 0x%04x\n",
56 pci_read_config16(dev, PCI_VENDOR_ID),
57 pci_read_config16(dev, PCI_DEVICE_ID));
58 printk(BIOS_SPEW, "class: 0x%02x %s\n"
59 "subclass: 0x%02x %s\n"
60 "prog: 0x%02x\n"
61 "revision: 0x%02x\n",
62 pci_read_config16(dev, PCI_CLASS_DEVICE) >> 8,
63 get_pci_class_name(dev),
64 pci_read_config16(dev, PCI_CLASS_DEVICE) & 0xff,
65 get_pci_subclass_name(dev),
66 pci_read_config8(dev, PCI_CLASS_PROG),
67 pci_read_config8(dev, PCI_REVISION_ID));
68
Lee Leahy77ff0b12015-05-05 15:07:29 -070069 /* Set the operations if it is a special bus type */
70 if (dev->path.type == DEVICE_PATH_DOMAIN) {
71 dev->ops = &pci_domain_ops;
72 } else if (dev->path.type == DEVICE_PATH_CPU_CLUSTER) {
73 dev->ops = &cpu_bus_ops;
74 } else if (dev->path.type == DEVICE_PATH_PCI) {
75 /* Handle south cluster enablement. */
76 if (PCI_SLOT(dev->path.pci.devfn) > GFX_DEV &&
77 (dev->ops == NULL || dev->ops->enable == NULL)) {
78 southcluster_enable_dev(dev);
79 }
80 }
81}
82
Aaron Durbin64031672018-04-21 14:45:32 -060083__weak void board_silicon_USB2_override(SILICON_INIT_UPD *params)
Matt DeVillier2c8ac222017-08-26 04:53:35 -050084{
85}
86
Lee Leahy32471722015-04-20 15:20:28 -070087void soc_silicon_init_params(SILICON_INIT_UPD *params)
88{
Kyösti Mälkkic70eed12018-05-22 02:18:00 +030089 struct device *dev = pcidev_on_root(LPC_DEV, LPC_FUNC);
Ravi Sarawadid077b582015-09-09 14:12:16 -070090 struct soc_intel_braswell_config *config;
91
92 if (!dev) {
93 printk(BIOS_ERR,
94 "Error! Device (%s) not found, "
95 "soc_silicon_init_params!\n", dev_path(dev));
96 return;
97 }
98
Kyösti Mälkki8950cfb2019-07-13 22:16:25 +030099 config = config_of(dev);
Lee Leahy32471722015-04-20 15:20:28 -0700100
101 /* Set the parameters for SiliconInit */
102 printk(BIOS_DEBUG, "Updating UPD values for SiliconInit\n");
103 params->PcdSdcardMode = config->PcdSdcardMode;
104 params->PcdEnableHsuart0 = config->PcdEnableHsuart0;
105 params->PcdEnableHsuart1 = config->PcdEnableHsuart1;
106 params->PcdEnableAzalia = config->PcdEnableAzalia;
Lee Leahy32471722015-04-20 15:20:28 -0700107 params->PcdEnableSata = config->PcdEnableSata;
108 params->PcdEnableXhci = config->PcdEnableXhci;
109 params->PcdEnableLpe = config->PcdEnableLpe;
110 params->PcdEnableDma0 = config->PcdEnableDma0;
111 params->PcdEnableDma1 = config->PcdEnableDma1;
112 params->PcdEnableI2C0 = config->PcdEnableI2C0;
113 params->PcdEnableI2C1 = config->PcdEnableI2C1;
114 params->PcdEnableI2C2 = config->PcdEnableI2C2;
115 params->PcdEnableI2C3 = config->PcdEnableI2C3;
116 params->PcdEnableI2C4 = config->PcdEnableI2C4;
117 params->PcdEnableI2C5 = config->PcdEnableI2C5;
118 params->PcdEnableI2C6 = config->PcdEnableI2C6;
Subrata Banik13cd3312015-08-07 18:22:54 +0530119 params->GraphicsConfigPtr = 0;
120 params->AzaliaConfigPtr = 0;
Lee Leahy32471722015-04-20 15:20:28 -0700121 params->PunitPwrConfigDisable = config->PunitPwrConfigDisable;
122 params->ChvSvidConfig = config->ChvSvidConfig;
123 params->DptfDisable = config->DptfDisable;
124 params->PcdEmmcMode = config->PcdEmmcMode;
125 params->PcdUsb3ClkSsc = config->PcdUsb3ClkSsc;
126 params->PcdDispClkSsc = config->PcdDispClkSsc;
127 params->PcdSataClkSsc = config->PcdSataClkSsc;
128 params->Usb2Port0PerPortPeTxiSet = config->Usb2Port0PerPortPeTxiSet;
129 params->Usb2Port0PerPortTxiSet = config->Usb2Port0PerPortTxiSet;
130 params->Usb2Port0IUsbTxEmphasisEn = config->Usb2Port0IUsbTxEmphasisEn;
131 params->Usb2Port0PerPortTxPeHalf = config->Usb2Port0PerPortTxPeHalf;
Kevin Chiu348a6d52016-06-30 14:50:52 +0800132
Lee Leahy32471722015-04-20 15:20:28 -0700133 params->Usb2Port1PerPortPeTxiSet = config->Usb2Port1PerPortPeTxiSet;
134 params->Usb2Port1PerPortTxiSet = config->Usb2Port1PerPortTxiSet;
135 params->Usb2Port1IUsbTxEmphasisEn = config->Usb2Port1IUsbTxEmphasisEn;
136 params->Usb2Port1PerPortTxPeHalf = config->Usb2Port1PerPortTxPeHalf;
Kevin Chiu348a6d52016-06-30 14:50:52 +0800137
Lee Leahy32471722015-04-20 15:20:28 -0700138 params->Usb2Port2PerPortPeTxiSet = config->Usb2Port2PerPortPeTxiSet;
139 params->Usb2Port2PerPortTxiSet = config->Usb2Port2PerPortTxiSet;
140 params->Usb2Port2IUsbTxEmphasisEn = config->Usb2Port2IUsbTxEmphasisEn;
141 params->Usb2Port2PerPortTxPeHalf = config->Usb2Port2PerPortTxPeHalf;
Kevin Chiu348a6d52016-06-30 14:50:52 +0800142
Lee Leahy32471722015-04-20 15:20:28 -0700143 params->Usb2Port3PerPortPeTxiSet = config->Usb2Port3PerPortPeTxiSet;
144 params->Usb2Port3PerPortTxiSet = config->Usb2Port3PerPortTxiSet;
145 params->Usb2Port3IUsbTxEmphasisEn = config->Usb2Port3IUsbTxEmphasisEn;
146 params->Usb2Port3PerPortTxPeHalf = config->Usb2Port3PerPortTxPeHalf;
Kevin Chiu348a6d52016-06-30 14:50:52 +0800147
Lee Leahy32471722015-04-20 15:20:28 -0700148 params->Usb2Port4PerPortPeTxiSet = config->Usb2Port4PerPortPeTxiSet;
149 params->Usb2Port4PerPortTxiSet = config->Usb2Port4PerPortTxiSet;
150 params->Usb2Port4IUsbTxEmphasisEn = config->Usb2Port4IUsbTxEmphasisEn;
151 params->Usb2Port4PerPortTxPeHalf = config->Usb2Port4PerPortTxPeHalf;
Kevin Chiu348a6d52016-06-30 14:50:52 +0800152
Lee Leahy32471722015-04-20 15:20:28 -0700153 params->Usb3Lane0Ow2tapgen2deemph3p5 =
154 config->Usb3Lane0Ow2tapgen2deemph3p5;
155 params->Usb3Lane1Ow2tapgen2deemph3p5 =
156 config->Usb3Lane1Ow2tapgen2deemph3p5;
157 params->Usb3Lane2Ow2tapgen2deemph3p5 =
158 config->Usb3Lane2Ow2tapgen2deemph3p5;
159 params->Usb3Lane3Ow2tapgen2deemph3p5 =
160 config->Usb3Lane3Ow2tapgen2deemph3p5;
161 params->PcdSataInterfaceSpeed = config->PcdSataInterfaceSpeed;
162 params->PcdPchUsbSsicPort = config->PcdPchUsbSsicPort;
163 params->PcdPchUsbHsicPort = config->PcdPchUsbHsicPort;
164 params->PcdPcieRootPortSpeed = config->PcdPcieRootPortSpeed;
165 params->PcdPchSsicEnable = config->PcdPchSsicEnable;
166 params->PcdLogoPtr = config->PcdLogoPtr;
167 params->PcdLogoSize = config->PcdLogoSize;
168 params->PcdRtcLock = config->PcdRtcLock;
169 params->PMIC_I2CBus = config->PMIC_I2CBus;
170 params->ISPEnable = config->ISPEnable;
171 params->ISPPciDevConfig = config->ISPPciDevConfig;
Divya Sasidharan89a66852015-10-28 15:02:35 -0700172 params->PcdSdDetectChk = config->PcdSdDetectChk;
Divagar Mohandass0c685302016-02-08 16:09:21 +0530173 params->I2C0Frequency = config->I2C0Frequency;
174 params->I2C1Frequency = config->I2C1Frequency;
175 params->I2C2Frequency = config->I2C2Frequency;
176 params->I2C3Frequency = config->I2C3Frequency;
177 params->I2C4Frequency = config->I2C4Frequency;
178 params->I2C5Frequency = config->I2C5Frequency;
179 params->I2C6Frequency = config->I2C6Frequency;
Matt DeVillier143a8362017-08-26 04:47:15 -0500180
Matt DeVillier2c8ac222017-08-26 04:53:35 -0500181 board_silicon_USB2_override(params);
Lee Leahy32471722015-04-20 15:20:28 -0700182}
183
Wim Vervoorn67117c32019-12-16 14:21:09 +0100184const struct cbmem_entry *soc_load_logo(SILICON_INIT_UPD *params)
185{
186 return fsp_load_logo(&params->PcdLogoPtr, &params->PcdLogoSize);
187}
188
Lee Leahy32471722015-04-20 15:20:28 -0700189void soc_display_silicon_init_params(const SILICON_INIT_UPD *old,
190 SILICON_INIT_UPD *new)
191{
192 /* Display the parameters for SiliconInit */
193 printk(BIOS_SPEW, "UPD values for SiliconInit:\n");
Lee Leahy66208bd2015-10-15 16:17:58 -0700194 fsp_display_upd_value("PcdSdcardMode", 1, old->PcdSdcardMode,
Lee Leahy32471722015-04-20 15:20:28 -0700195 new->PcdSdcardMode);
Lee Leahy66208bd2015-10-15 16:17:58 -0700196 fsp_display_upd_value("PcdEnableHsuart0", 1, old->PcdEnableHsuart0,
Lee Leahy32471722015-04-20 15:20:28 -0700197 new->PcdEnableHsuart0);
Lee Leahy66208bd2015-10-15 16:17:58 -0700198 fsp_display_upd_value("PcdEnableHsuart1", 1, old->PcdEnableHsuart1,
Lee Leahy32471722015-04-20 15:20:28 -0700199 new->PcdEnableHsuart1);
Lee Leahy66208bd2015-10-15 16:17:58 -0700200 fsp_display_upd_value("PcdEnableAzalia", 1, old->PcdEnableAzalia,
Lee Leahy32471722015-04-20 15:20:28 -0700201 new->PcdEnableAzalia);
Lee Leahy66208bd2015-10-15 16:17:58 -0700202 fsp_display_upd_value("AzaliaConfigPtr", 4,
Subrata Banik13cd3312015-08-07 18:22:54 +0530203 (uint32_t)old->AzaliaConfigPtr,
204 (uint32_t)new->AzaliaConfigPtr);
Lee Leahy66208bd2015-10-15 16:17:58 -0700205 fsp_display_upd_value("PcdEnableSata", 1, old->PcdEnableSata,
Lee Leahy32471722015-04-20 15:20:28 -0700206 new->PcdEnableSata);
Lee Leahy66208bd2015-10-15 16:17:58 -0700207 fsp_display_upd_value("PcdEnableXhci", 1, old->PcdEnableXhci,
Lee Leahy32471722015-04-20 15:20:28 -0700208 new->PcdEnableXhci);
Lee Leahy66208bd2015-10-15 16:17:58 -0700209 fsp_display_upd_value("PcdEnableLpe", 1, old->PcdEnableLpe,
Lee Leahy32471722015-04-20 15:20:28 -0700210 new->PcdEnableLpe);
Lee Leahy66208bd2015-10-15 16:17:58 -0700211 fsp_display_upd_value("PcdEnableDma0", 1, old->PcdEnableDma0,
Lee Leahy32471722015-04-20 15:20:28 -0700212 new->PcdEnableDma0);
Lee Leahy66208bd2015-10-15 16:17:58 -0700213 fsp_display_upd_value("PcdEnableDma1", 1, old->PcdEnableDma1,
Lee Leahy32471722015-04-20 15:20:28 -0700214 new->PcdEnableDma1);
Lee Leahy66208bd2015-10-15 16:17:58 -0700215 fsp_display_upd_value("PcdEnableI2C0", 1, old->PcdEnableI2C0,
Lee Leahy32471722015-04-20 15:20:28 -0700216 new->PcdEnableI2C0);
Lee Leahy66208bd2015-10-15 16:17:58 -0700217 fsp_display_upd_value("PcdEnableI2C1", 1, old->PcdEnableI2C1,
Lee Leahy32471722015-04-20 15:20:28 -0700218 new->PcdEnableI2C1);
Lee Leahy66208bd2015-10-15 16:17:58 -0700219 fsp_display_upd_value("PcdEnableI2C2", 1, old->PcdEnableI2C2,
Lee Leahy32471722015-04-20 15:20:28 -0700220 new->PcdEnableI2C2);
Lee Leahy66208bd2015-10-15 16:17:58 -0700221 fsp_display_upd_value("PcdEnableI2C3", 1, old->PcdEnableI2C3,
Lee Leahy32471722015-04-20 15:20:28 -0700222 new->PcdEnableI2C3);
Lee Leahy66208bd2015-10-15 16:17:58 -0700223 fsp_display_upd_value("PcdEnableI2C4", 1, old->PcdEnableI2C4,
Lee Leahy32471722015-04-20 15:20:28 -0700224 new->PcdEnableI2C4);
Lee Leahy66208bd2015-10-15 16:17:58 -0700225 fsp_display_upd_value("PcdEnableI2C5", 1, old->PcdEnableI2C5,
Lee Leahy32471722015-04-20 15:20:28 -0700226 new->PcdEnableI2C5);
Lee Leahy66208bd2015-10-15 16:17:58 -0700227 fsp_display_upd_value("PcdEnableI2C6", 1, old->PcdEnableI2C6,
Lee Leahy32471722015-04-20 15:20:28 -0700228 new->PcdEnableI2C6);
Lee Leahy66208bd2015-10-15 16:17:58 -0700229 fsp_display_upd_value("PcdGraphicsConfigPtr", 4,
Subrata Banik13cd3312015-08-07 18:22:54 +0530230 old->GraphicsConfigPtr, new->GraphicsConfigPtr);
Lee Leahy66208bd2015-10-15 16:17:58 -0700231 fsp_display_upd_value("GpioFamilyInitTablePtr", 4,
Lee Leahy32471722015-04-20 15:20:28 -0700232 (uint32_t)old->GpioFamilyInitTablePtr,
233 (uint32_t)new->GpioFamilyInitTablePtr);
Lee Leahy66208bd2015-10-15 16:17:58 -0700234 fsp_display_upd_value("GpioPadInitTablePtr", 4,
Lee Leahy32471722015-04-20 15:20:28 -0700235 (uint32_t)old->GpioPadInitTablePtr,
236 (uint32_t)new->GpioPadInitTablePtr);
Lee Leahy66208bd2015-10-15 16:17:58 -0700237 fsp_display_upd_value("PunitPwrConfigDisable", 1,
Lee Leahy32471722015-04-20 15:20:28 -0700238 old->PunitPwrConfigDisable,
239 new->PunitPwrConfigDisable);
Lee Leahy66208bd2015-10-15 16:17:58 -0700240 fsp_display_upd_value("ChvSvidConfig", 1, old->ChvSvidConfig,
Lee Leahy32471722015-04-20 15:20:28 -0700241 new->ChvSvidConfig);
Lee Leahy66208bd2015-10-15 16:17:58 -0700242 fsp_display_upd_value("DptfDisable", 1, old->DptfDisable,
Lee Leahy32471722015-04-20 15:20:28 -0700243 new->DptfDisable);
Lee Leahy66208bd2015-10-15 16:17:58 -0700244 fsp_display_upd_value("PcdEmmcMode", 1, old->PcdEmmcMode,
Lee Leahy32471722015-04-20 15:20:28 -0700245 new->PcdEmmcMode);
Lee Leahy66208bd2015-10-15 16:17:58 -0700246 fsp_display_upd_value("PcdUsb3ClkSsc", 1, old->PcdUsb3ClkSsc,
Lee Leahy32471722015-04-20 15:20:28 -0700247 new->PcdUsb3ClkSsc);
Lee Leahy66208bd2015-10-15 16:17:58 -0700248 fsp_display_upd_value("PcdDispClkSsc", 1, old->PcdDispClkSsc,
Lee Leahy32471722015-04-20 15:20:28 -0700249 new->PcdDispClkSsc);
Lee Leahy66208bd2015-10-15 16:17:58 -0700250 fsp_display_upd_value("PcdSataClkSsc", 1, old->PcdSataClkSsc,
Lee Leahy32471722015-04-20 15:20:28 -0700251 new->PcdSataClkSsc);
Lee Leahy66208bd2015-10-15 16:17:58 -0700252 fsp_display_upd_value("Usb2Port0PerPortPeTxiSet", 1,
Lee Leahy32471722015-04-20 15:20:28 -0700253 old->Usb2Port0PerPortPeTxiSet,
254 new->Usb2Port0PerPortPeTxiSet);
Lee Leahy66208bd2015-10-15 16:17:58 -0700255 fsp_display_upd_value("Usb2Port0PerPortTxiSet", 1,
Lee Leahy32471722015-04-20 15:20:28 -0700256 old->Usb2Port0PerPortTxiSet,
257 new->Usb2Port0PerPortTxiSet);
Lee Leahy66208bd2015-10-15 16:17:58 -0700258 fsp_display_upd_value("Usb2Port0IUsbTxEmphasisEn", 1,
Lee Leahy32471722015-04-20 15:20:28 -0700259 old->Usb2Port0IUsbTxEmphasisEn,
260 new->Usb2Port0IUsbTxEmphasisEn);
Lee Leahy66208bd2015-10-15 16:17:58 -0700261 fsp_display_upd_value("Usb2Port0PerPortTxPeHalf", 1,
Lee Leahy32471722015-04-20 15:20:28 -0700262 old->Usb2Port0PerPortTxPeHalf,
263 new->Usb2Port0PerPortTxPeHalf);
Lee Leahy66208bd2015-10-15 16:17:58 -0700264 fsp_display_upd_value("Usb2Port1PerPortPeTxiSet", 1,
Lee Leahy32471722015-04-20 15:20:28 -0700265 old->Usb2Port1PerPortPeTxiSet,
266 new->Usb2Port1PerPortPeTxiSet);
Lee Leahy66208bd2015-10-15 16:17:58 -0700267 fsp_display_upd_value("Usb2Port1PerPortTxiSet", 1,
Lee Leahy32471722015-04-20 15:20:28 -0700268 old->Usb2Port1PerPortTxiSet,
269 new->Usb2Port1PerPortTxiSet);
Lee Leahy66208bd2015-10-15 16:17:58 -0700270 fsp_display_upd_value("Usb2Port1IUsbTxEmphasisEn", 1,
Lee Leahy32471722015-04-20 15:20:28 -0700271 old->Usb2Port1IUsbTxEmphasisEn,
272 new->Usb2Port1IUsbTxEmphasisEn);
Lee Leahy66208bd2015-10-15 16:17:58 -0700273 fsp_display_upd_value("Usb2Port1PerPortTxPeHalf", 1,
Lee Leahy32471722015-04-20 15:20:28 -0700274 old->Usb2Port1PerPortTxPeHalf,
275 new->Usb2Port1PerPortTxPeHalf);
Lee Leahy66208bd2015-10-15 16:17:58 -0700276 fsp_display_upd_value("Usb2Port2PerPortPeTxiSet", 1,
Lee Leahy32471722015-04-20 15:20:28 -0700277 old->Usb2Port2PerPortPeTxiSet,
278 new->Usb2Port2PerPortPeTxiSet);
Lee Leahy66208bd2015-10-15 16:17:58 -0700279 fsp_display_upd_value("Usb2Port2PerPortTxiSet", 1,
Lee Leahy32471722015-04-20 15:20:28 -0700280 old->Usb2Port2PerPortTxiSet,
281 new->Usb2Port2PerPortTxiSet);
Lee Leahy66208bd2015-10-15 16:17:58 -0700282 fsp_display_upd_value("Usb2Port2IUsbTxEmphasisEn", 1,
Lee Leahy32471722015-04-20 15:20:28 -0700283 old->Usb2Port2IUsbTxEmphasisEn,
284 new->Usb2Port2IUsbTxEmphasisEn);
Lee Leahy66208bd2015-10-15 16:17:58 -0700285 fsp_display_upd_value("Usb2Port2PerPortTxPeHalf", 1,
Lee Leahy32471722015-04-20 15:20:28 -0700286 old->Usb2Port2PerPortTxPeHalf,
287 new->Usb2Port2PerPortTxPeHalf);
Lee Leahy66208bd2015-10-15 16:17:58 -0700288 fsp_display_upd_value("Usb2Port3PerPortPeTxiSet", 1,
Lee Leahy32471722015-04-20 15:20:28 -0700289 old->Usb2Port3PerPortPeTxiSet,
290 new->Usb2Port3PerPortPeTxiSet);
Lee Leahy66208bd2015-10-15 16:17:58 -0700291 fsp_display_upd_value("Usb2Port3PerPortTxiSet", 1,
Lee Leahy32471722015-04-20 15:20:28 -0700292 old->Usb2Port3PerPortTxiSet,
293 new->Usb2Port3PerPortTxiSet);
Lee Leahy66208bd2015-10-15 16:17:58 -0700294 fsp_display_upd_value("Usb2Port3IUsbTxEmphasisEn", 1,
Lee Leahy32471722015-04-20 15:20:28 -0700295 old->Usb2Port3IUsbTxEmphasisEn,
296 new->Usb2Port3IUsbTxEmphasisEn);
Lee Leahy66208bd2015-10-15 16:17:58 -0700297 fsp_display_upd_value("Usb2Port3PerPortTxPeHalf", 1,
Lee Leahy32471722015-04-20 15:20:28 -0700298 old->Usb2Port3PerPortTxPeHalf,
299 new->Usb2Port3PerPortTxPeHalf);
Lee Leahy66208bd2015-10-15 16:17:58 -0700300 fsp_display_upd_value("Usb2Port4PerPortPeTxiSet", 1,
Lee Leahy32471722015-04-20 15:20:28 -0700301 old->Usb2Port4PerPortPeTxiSet,
302 new->Usb2Port4PerPortPeTxiSet);
Lee Leahy66208bd2015-10-15 16:17:58 -0700303 fsp_display_upd_value("Usb2Port4PerPortTxiSet", 1,
Lee Leahy32471722015-04-20 15:20:28 -0700304 old->Usb2Port4PerPortTxiSet,
305 new->Usb2Port4PerPortTxiSet);
Lee Leahy66208bd2015-10-15 16:17:58 -0700306 fsp_display_upd_value("Usb2Port4IUsbTxEmphasisEn", 1,
Lee Leahy32471722015-04-20 15:20:28 -0700307 old->Usb2Port4IUsbTxEmphasisEn,
308 new->Usb2Port4IUsbTxEmphasisEn);
Lee Leahy66208bd2015-10-15 16:17:58 -0700309 fsp_display_upd_value("Usb2Port4PerPortTxPeHalf", 1,
Lee Leahy32471722015-04-20 15:20:28 -0700310 old->Usb2Port4PerPortTxPeHalf,
311 new->Usb2Port4PerPortTxPeHalf);
Lee Leahy66208bd2015-10-15 16:17:58 -0700312 fsp_display_upd_value("Usb3Lane0Ow2tapgen2deemph3p5", 1,
Lee Leahy32471722015-04-20 15:20:28 -0700313 old->Usb3Lane0Ow2tapgen2deemph3p5,
314 new->Usb3Lane0Ow2tapgen2deemph3p5);
Lee Leahy66208bd2015-10-15 16:17:58 -0700315 fsp_display_upd_value("Usb3Lane1Ow2tapgen2deemph3p5", 1,
Lee Leahy32471722015-04-20 15:20:28 -0700316 old->Usb3Lane1Ow2tapgen2deemph3p5,
317 new->Usb3Lane1Ow2tapgen2deemph3p5);
Lee Leahy66208bd2015-10-15 16:17:58 -0700318 fsp_display_upd_value("Usb3Lane2Ow2tapgen2deemph3p5", 1,
Lee Leahy32471722015-04-20 15:20:28 -0700319 old->Usb3Lane2Ow2tapgen2deemph3p5,
320 new->Usb3Lane2Ow2tapgen2deemph3p5);
Lee Leahy66208bd2015-10-15 16:17:58 -0700321 fsp_display_upd_value("Usb3Lane3Ow2tapgen2deemph3p5", 1,
Lee Leahy32471722015-04-20 15:20:28 -0700322 old->Usb3Lane3Ow2tapgen2deemph3p5,
323 new->Usb3Lane3Ow2tapgen2deemph3p5);
Lee Leahy66208bd2015-10-15 16:17:58 -0700324 fsp_display_upd_value("PcdSataInterfaceSpeed", 1,
Lee Leahy32471722015-04-20 15:20:28 -0700325 old->PcdSataInterfaceSpeed,
326 new->PcdSataInterfaceSpeed);
Lee Leahy66208bd2015-10-15 16:17:58 -0700327 fsp_display_upd_value("PcdPchUsbSsicPort", 1,
Lee Leahy32471722015-04-20 15:20:28 -0700328 old->PcdPchUsbSsicPort, new->PcdPchUsbSsicPort);
Lee Leahy66208bd2015-10-15 16:17:58 -0700329 fsp_display_upd_value("PcdPchUsbHsicPort", 1,
Lee Leahy32471722015-04-20 15:20:28 -0700330 old->PcdPchUsbHsicPort, new->PcdPchUsbHsicPort);
Lee Leahy66208bd2015-10-15 16:17:58 -0700331 fsp_display_upd_value("PcdPcieRootPortSpeed", 1,
Lee Leahy32471722015-04-20 15:20:28 -0700332 old->PcdPcieRootPortSpeed, new->PcdPcieRootPortSpeed);
Lee Leahy66208bd2015-10-15 16:17:58 -0700333 fsp_display_upd_value("PcdPchSsicEnable", 1, old->PcdPchSsicEnable,
Lee Leahy32471722015-04-20 15:20:28 -0700334 new->PcdPchSsicEnable);
Lee Leahy66208bd2015-10-15 16:17:58 -0700335 fsp_display_upd_value("PcdLogoPtr", 4, old->PcdLogoPtr,
Lee Leahy32471722015-04-20 15:20:28 -0700336 new->PcdLogoPtr);
Lee Leahy66208bd2015-10-15 16:17:58 -0700337 fsp_display_upd_value("PcdLogoSize", 4, old->PcdLogoSize,
Lee Leahy32471722015-04-20 15:20:28 -0700338 new->PcdLogoSize);
Lee Leahy66208bd2015-10-15 16:17:58 -0700339 fsp_display_upd_value("PcdRtcLock", 1, old->PcdRtcLock,
Lee Leahy32471722015-04-20 15:20:28 -0700340 new->PcdRtcLock);
Lee Leahy66208bd2015-10-15 16:17:58 -0700341 fsp_display_upd_value("PMIC_I2CBus", 1,
Lee Leahy32471722015-04-20 15:20:28 -0700342 old->PMIC_I2CBus, new->PMIC_I2CBus);
Lee Leahy66208bd2015-10-15 16:17:58 -0700343 fsp_display_upd_value("ISPEnable", 1,
Lee Leahy32471722015-04-20 15:20:28 -0700344 old->ISPEnable, new->ISPEnable);
Lee Leahy66208bd2015-10-15 16:17:58 -0700345 fsp_display_upd_value("ISPPciDevConfig", 1,
Lee Leahy32471722015-04-20 15:20:28 -0700346 old->ISPPciDevConfig, new->ISPPciDevConfig);
Divya Sasidharan89a66852015-10-28 15:02:35 -0700347 fsp_display_upd_value("PcdSdDetectChk", 1,
348 old->PcdSdDetectChk, new->PcdSdDetectChk);
Lee Leahy32471722015-04-20 15:20:28 -0700349}
350
Lee Leahy77ff0b12015-05-05 15:07:29 -0700351/* Called at BS_DEV_INIT_CHIPS time -- very early. Just after BS_PRE_DEVICE. */
352static void soc_init(void *chip_info)
353{
Lee Leahy32471722015-04-20 15:20:28 -0700354 printk(BIOS_SPEW, "%s/%s\n", __FILE__, __func__);
355 soc_init_pre_device(chip_info);
Lee Leahy77ff0b12015-05-05 15:07:29 -0700356}
357
Lee Leahy32471722015-04-20 15:20:28 -0700358struct chip_operations soc_intel_braswell_ops = {
359 CHIP_NAME("Intel Braswell SoC")
Lee Leahy77ff0b12015-05-05 15:07:29 -0700360 .enable_dev = enable_dev,
361 .init = soc_init,
362};
363
Lee Leahy77ff0b12015-05-05 15:07:29 -0700364struct pci_operations soc_pci_ops = {
Subrata Banik4a0f0712019-03-20 14:29:47 +0530365 .set_subsystem = &pci_dev_set_subsystem,
Lee Leahy77ff0b12015-05-05 15:07:29 -0700366};
Matt DeVillier143a8362017-08-26 04:47:15 -0500367
368/**
369 Return SoC stepping type
370
371 @retval SOC_STEPPING SoC stepping type
372**/
373int SocStepping(void)
374{
Kyösti Mälkkic70eed12018-05-22 02:18:00 +0300375 struct device *dev = pcidev_on_root(LPC_DEV, LPC_FUNC);
Matt DeVillier143a8362017-08-26 04:47:15 -0500376 u8 revid = pci_read_config8(dev, 0x8);
377
378 switch (revid & B_PCH_LPC_RID_STEPPING_MASK) {
379 case V_PCH_LPC_RID_A0:
380 return SocA0;
381 case V_PCH_LPC_RID_A1:
382 return SocA1;
383 case V_PCH_LPC_RID_A2:
384 return SocA2;
385 case V_PCH_LPC_RID_A3:
386 return SocA3;
387 case V_PCH_LPC_RID_A4:
388 return SocA4;
389 case V_PCH_LPC_RID_A5:
390 return SocA5;
391 case V_PCH_LPC_RID_A6:
392 return SocA6;
393 case V_PCH_LPC_RID_A7:
394 return SocA7;
395 case V_PCH_LPC_RID_B0:
396 return SocB0;
397 case V_PCH_LPC_RID_B1:
398 return SocB1;
399 case V_PCH_LPC_RID_B2:
400 return SocB2;
401 case V_PCH_LPC_RID_B3:
402 return SocB3;
403 case V_PCH_LPC_RID_B4:
404 return SocB4;
405 case V_PCH_LPC_RID_B5:
406 return SocB5;
407 case V_PCH_LPC_RID_B6:
408 return SocB6;
409 case V_PCH_LPC_RID_B7:
410 return SocB7;
411 case V_PCH_LPC_RID_C0:
412 return SocC0;
413 case V_PCH_LPC_RID_C1:
414 return SocC1;
415 case V_PCH_LPC_RID_C2:
416 return SocC2;
417 case V_PCH_LPC_RID_C3:
418 return SocC3;
419 case V_PCH_LPC_RID_C4:
420 return SocC4;
421 case V_PCH_LPC_RID_C5:
422 return SocC5;
423 case V_PCH_LPC_RID_C6:
424 return SocC6;
425 case V_PCH_LPC_RID_C7:
426 return SocC7;
427 case V_PCH_LPC_RID_D0:
428 return SocD0;
429 case V_PCH_LPC_RID_D1:
430 return SocD1;
431 case V_PCH_LPC_RID_D2:
432 return SocD2;
433 case V_PCH_LPC_RID_D3:
434 return SocD3;
435 case V_PCH_LPC_RID_D4:
436 return SocD4;
437 case V_PCH_LPC_RID_D5:
438 return SocD5;
439 case V_PCH_LPC_RID_D6:
440 return SocD6;
441 case V_PCH_LPC_RID_D7:
442 return SocD7;
443 default:
444 return SocSteppingMax;
445 }
446}