Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 4 | * |
| 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 Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 13 | */ |
| 14 | |
| 15 | #include <console/console.h> |
| 16 | #include <device/device.h> |
| 17 | #include <device/pci.h> |
Kyösti Mälkki | f1b58b7 | 2019-03-01 13:43:02 +0200 | [diff] [blame] | 18 | #include <device/pci_ops.h> |
Aaron Durbin | 789f2b6 | 2015-09-09 17:05:06 -0500 | [diff] [blame] | 19 | #include <fsp/util.h> |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 20 | #include <soc/pci_devs.h> |
| 21 | #include <soc/ramstage.h> |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 22 | |
Elyes HAOUAS | c338507 | 2019-03-21 15:38:06 +0100 | [diff] [blame] | 23 | #include "chip.h" |
| 24 | |
Elyes HAOUAS | b13fac3 | 2018-05-24 22:29:44 +0200 | [diff] [blame] | 25 | static void pci_domain_set_resources(struct device *dev) |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 26 | { |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 27 | printk(BIOS_SPEW, "%s/%s (%s)\n", __FILE__, __func__, dev_name(dev)); |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 28 | assign_resources(dev->link_list); |
| 29 | } |
| 30 | |
| 31 | static struct device_operations pci_domain_ops = { |
| 32 | .read_resources = pci_domain_read_resources, |
| 33 | .set_resources = pci_domain_set_resources, |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 34 | .scan_bus = pci_domain_scan_bus, |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 35 | }; |
| 36 | |
| 37 | static struct device_operations cpu_bus_ops = { |
Elyes HAOUAS | b6fa7a2 | 2018-12-07 12:21:18 +0100 | [diff] [blame] | 38 | .read_resources = DEVICE_NOOP, |
| 39 | .set_resources = DEVICE_NOOP, |
| 40 | .enable_resources = DEVICE_NOOP, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 41 | .init = soc_init_cpus |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 42 | }; |
| 43 | |
| 44 | |
Elyes HAOUAS | b13fac3 | 2018-05-24 22:29:44 +0200 | [diff] [blame] | 45 | static void enable_dev(struct device *dev) |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 46 | { |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 47 | printk(BIOS_SPEW, "----------\n%s/%s (%s), type: %d\n", __FILE__, __func__, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 48 | dev_name(dev), dev->path.type); |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 49 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 50 | printk(BIOS_SPEW, "vendor: 0x%04x. device: 0x%04x\n", |
| 51 | pci_read_config16(dev, PCI_VENDOR_ID), |
| 52 | pci_read_config16(dev, PCI_DEVICE_ID)); |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 53 | |
| 54 | printk(BIOS_SPEW, "class: 0x%02x %s\nsubclass: 0x%02x %s\n" |
| 55 | "prog: 0x%02x\nrevision: 0x%02x\n", |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 56 | pci_read_config16(dev, PCI_CLASS_DEVICE) >> 8, |
| 57 | get_pci_class_name(dev), |
| 58 | pci_read_config16(dev, PCI_CLASS_DEVICE) & 0xff, |
| 59 | get_pci_subclass_name(dev), |
| 60 | pci_read_config8(dev, PCI_CLASS_PROG), |
| 61 | pci_read_config8(dev, PCI_REVISION_ID)); |
| 62 | |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 63 | /* Set the operations if it is a special bus type */ |
| 64 | if (dev->path.type == DEVICE_PATH_DOMAIN) { |
| 65 | dev->ops = &pci_domain_ops; |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 66 | |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 67 | } else if (dev->path.type == DEVICE_PATH_CPU_CLUSTER) { |
| 68 | dev->ops = &cpu_bus_ops; |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 69 | |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 70 | } else if (dev->path.type == DEVICE_PATH_PCI) { |
| 71 | /* Handle south cluster enablement. */ |
| 72 | if (PCI_SLOT(dev->path.pci.devfn) > GFX_DEV && |
| 73 | (dev->ops == NULL || dev->ops->enable == NULL)) { |
| 74 | southcluster_enable_dev(dev); |
| 75 | } |
| 76 | } |
| 77 | } |
| 78 | |
Aaron Durbin | 6403167 | 2018-04-21 14:45:32 -0600 | [diff] [blame] | 79 | __weak void board_silicon_USB2_override(SILICON_INIT_UPD *params) |
Matt DeVillier | 2c8ac22 | 2017-08-26 04:53:35 -0500 | [diff] [blame] | 80 | { |
| 81 | } |
| 82 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 83 | void soc_silicon_init_params(SILICON_INIT_UPD *params) |
| 84 | { |
Kyösti Mälkki | c70eed1 | 2018-05-22 02:18:00 +0300 | [diff] [blame] | 85 | struct device *dev = pcidev_on_root(LPC_DEV, LPC_FUNC); |
Ravi Sarawadi | d077b58 | 2015-09-09 14:12:16 -0700 | [diff] [blame] | 86 | struct soc_intel_braswell_config *config; |
| 87 | |
| 88 | if (!dev) { |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 89 | printk(BIOS_ERR, "Error! Device (%s) not found, soc_silicon_init_params!\n", |
| 90 | dev_path(dev)); |
Ravi Sarawadi | d077b58 | 2015-09-09 14:12:16 -0700 | [diff] [blame] | 91 | return; |
| 92 | } |
| 93 | |
Kyösti Mälkki | 8950cfb | 2019-07-13 22:16:25 +0300 | [diff] [blame] | 94 | config = config_of(dev); |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 95 | |
| 96 | /* Set the parameters for SiliconInit */ |
| 97 | printk(BIOS_DEBUG, "Updating UPD values for SiliconInit\n"); |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 98 | params->PcdSdcardMode = config->PcdSdcardMode; |
| 99 | params->PcdEnableHsuart0 = config->PcdEnableHsuart0; |
| 100 | params->PcdEnableHsuart1 = config->PcdEnableHsuart1; |
| 101 | params->PcdEnableAzalia = config->PcdEnableAzalia; |
| 102 | params->PcdEnableSata = config->PcdEnableSata; |
| 103 | params->PcdEnableXhci = config->PcdEnableXhci; |
| 104 | params->PcdEnableLpe = config->PcdEnableLpe; |
| 105 | params->PcdEnableDma0 = config->PcdEnableDma0; |
| 106 | params->PcdEnableDma1 = config->PcdEnableDma1; |
| 107 | params->PcdEnableI2C0 = config->PcdEnableI2C0; |
| 108 | params->PcdEnableI2C1 = config->PcdEnableI2C1; |
| 109 | params->PcdEnableI2C2 = config->PcdEnableI2C2; |
| 110 | params->PcdEnableI2C3 = config->PcdEnableI2C3; |
| 111 | params->PcdEnableI2C4 = config->PcdEnableI2C4; |
| 112 | params->PcdEnableI2C5 = config->PcdEnableI2C5; |
| 113 | params->PcdEnableI2C6 = config->PcdEnableI2C6; |
| 114 | params->GraphicsConfigPtr = 0; |
| 115 | params->AzaliaConfigPtr = 0; |
| 116 | params->PunitPwrConfigDisable = config->PunitPwrConfigDisable; |
| 117 | params->ChvSvidConfig = config->ChvSvidConfig; |
| 118 | params->DptfDisable = config->DptfDisable; |
| 119 | params->PcdEmmcMode = config->PcdEmmcMode; |
| 120 | params->PcdUsb3ClkSsc = config->PcdUsb3ClkSsc; |
| 121 | params->PcdDispClkSsc = config->PcdDispClkSsc; |
| 122 | params->PcdSataClkSsc = config->PcdSataClkSsc; |
Kevin Chiu | 348a6d5 | 2016-06-30 14:50:52 +0800 | [diff] [blame] | 123 | |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 124 | params->Usb2Port0PerPortPeTxiSet = config->Usb2Port0PerPortPeTxiSet; |
| 125 | params->Usb2Port0PerPortTxiSet = config->Usb2Port0PerPortTxiSet; |
| 126 | params->Usb2Port0IUsbTxEmphasisEn = config->Usb2Port0IUsbTxEmphasisEn; |
| 127 | params->Usb2Port0PerPortTxPeHalf = config->Usb2Port0PerPortTxPeHalf; |
Kevin Chiu | 348a6d5 | 2016-06-30 14:50:52 +0800 | [diff] [blame] | 128 | |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 129 | params->Usb2Port1PerPortPeTxiSet = config->Usb2Port1PerPortPeTxiSet; |
| 130 | params->Usb2Port1PerPortTxiSet = config->Usb2Port1PerPortTxiSet; |
| 131 | params->Usb2Port1IUsbTxEmphasisEn = config->Usb2Port1IUsbTxEmphasisEn; |
| 132 | params->Usb2Port1PerPortTxPeHalf = config->Usb2Port1PerPortTxPeHalf; |
Kevin Chiu | 348a6d5 | 2016-06-30 14:50:52 +0800 | [diff] [blame] | 133 | |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 134 | params->Usb2Port2PerPortPeTxiSet = config->Usb2Port2PerPortPeTxiSet; |
| 135 | params->Usb2Port2PerPortTxiSet = config->Usb2Port2PerPortTxiSet; |
| 136 | params->Usb2Port2IUsbTxEmphasisEn = config->Usb2Port2IUsbTxEmphasisEn; |
| 137 | params->Usb2Port2PerPortTxPeHalf = config->Usb2Port2PerPortTxPeHalf; |
Kevin Chiu | 348a6d5 | 2016-06-30 14:50:52 +0800 | [diff] [blame] | 138 | |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 139 | params->Usb2Port3PerPortPeTxiSet = config->Usb2Port3PerPortPeTxiSet; |
| 140 | params->Usb2Port3PerPortTxiSet = config->Usb2Port3PerPortTxiSet; |
| 141 | params->Usb2Port3IUsbTxEmphasisEn = config->Usb2Port3IUsbTxEmphasisEn; |
| 142 | params->Usb2Port3PerPortTxPeHalf = config->Usb2Port3PerPortTxPeHalf; |
Kevin Chiu | 348a6d5 | 2016-06-30 14:50:52 +0800 | [diff] [blame] | 143 | |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 144 | params->Usb2Port4PerPortPeTxiSet = config->Usb2Port4PerPortPeTxiSet; |
| 145 | params->Usb2Port4PerPortTxiSet = config->Usb2Port4PerPortTxiSet; |
| 146 | params->Usb2Port4IUsbTxEmphasisEn = config->Usb2Port4IUsbTxEmphasisEn; |
| 147 | params->Usb2Port4PerPortTxPeHalf = config->Usb2Port4PerPortTxPeHalf; |
| 148 | |
| 149 | params->Usb3Lane0Ow2tapgen2deemph3p5 = config->Usb3Lane0Ow2tapgen2deemph3p5; |
| 150 | params->Usb3Lane1Ow2tapgen2deemph3p5 = config->Usb3Lane1Ow2tapgen2deemph3p5; |
| 151 | params->Usb3Lane2Ow2tapgen2deemph3p5 = config->Usb3Lane2Ow2tapgen2deemph3p5; |
| 152 | params->Usb3Lane3Ow2tapgen2deemph3p5 = config->Usb3Lane3Ow2tapgen2deemph3p5; |
| 153 | |
| 154 | params->PcdSataInterfaceSpeed = config->PcdSataInterfaceSpeed; |
| 155 | params->PcdPchUsbSsicPort = config->PcdPchUsbSsicPort; |
| 156 | params->PcdPchUsbHsicPort = config->PcdPchUsbHsicPort; |
| 157 | params->PcdPcieRootPortSpeed = config->PcdPcieRootPortSpeed; |
| 158 | params->PcdPchSsicEnable = config->PcdPchSsicEnable; |
| 159 | params->PcdLogoPtr = config->PcdLogoPtr; |
| 160 | params->PcdLogoSize = config->PcdLogoSize; |
| 161 | params->PcdRtcLock = config->PcdRtcLock; |
| 162 | params->PMIC_I2CBus = config->PMIC_I2CBus; |
| 163 | params->ISPEnable = config->ISPEnable; |
| 164 | params->ISPPciDevConfig = config->ISPPciDevConfig; |
| 165 | params->PcdSdDetectChk = config->PcdSdDetectChk; |
| 166 | params->I2C0Frequency = config->I2C0Frequency; |
| 167 | params->I2C1Frequency = config->I2C1Frequency; |
| 168 | params->I2C2Frequency = config->I2C2Frequency; |
| 169 | params->I2C3Frequency = config->I2C3Frequency; |
| 170 | params->I2C4Frequency = config->I2C4Frequency; |
| 171 | params->I2C5Frequency = config->I2C5Frequency; |
| 172 | params->I2C6Frequency = config->I2C6Frequency; |
Matt DeVillier | 143a836 | 2017-08-26 04:47:15 -0500 | [diff] [blame] | 173 | |
Matt DeVillier | 2c8ac22 | 2017-08-26 04:53:35 -0500 | [diff] [blame] | 174 | board_silicon_USB2_override(params); |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 175 | } |
| 176 | |
Wim Vervoorn | 67117c3 | 2019-12-16 14:21:09 +0100 | [diff] [blame] | 177 | const struct cbmem_entry *soc_load_logo(SILICON_INIT_UPD *params) |
| 178 | { |
| 179 | return fsp_load_logo(¶ms->PcdLogoPtr, ¶ms->PcdLogoSize); |
| 180 | } |
| 181 | |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 182 | void soc_display_silicon_init_params(const SILICON_INIT_UPD *old, SILICON_INIT_UPD *new) |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 183 | { |
| 184 | /* Display the parameters for SiliconInit */ |
| 185 | printk(BIOS_SPEW, "UPD values for SiliconInit:\n"); |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 186 | |
| 187 | fsp_display_upd_value("PcdSdcardMode", 1, |
| 188 | old->PcdSdcardMode, |
| 189 | new->PcdSdcardMode); |
| 190 | fsp_display_upd_value("PcdEnableHsuart0", 1, |
| 191 | old->PcdEnableHsuart0, |
| 192 | new->PcdEnableHsuart0); |
| 193 | fsp_display_upd_value("PcdEnableHsuart1", 1, |
| 194 | old->PcdEnableHsuart1, |
| 195 | new->PcdEnableHsuart1); |
| 196 | fsp_display_upd_value("PcdEnableAzalia", 1, |
| 197 | old->PcdEnableAzalia, |
| 198 | new->PcdEnableAzalia); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 199 | fsp_display_upd_value("AzaliaConfigPtr", 4, |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 200 | (uint32_t)old->AzaliaConfigPtr, |
| 201 | (uint32_t)new->AzaliaConfigPtr); |
| 202 | |
| 203 | fsp_display_upd_value("PcdEnableSata", 1, old->PcdEnableSata, new->PcdEnableSata); |
| 204 | fsp_display_upd_value("PcdEnableXhci", 1, old->PcdEnableXhci, new->PcdEnableXhci); |
| 205 | fsp_display_upd_value("PcdEnableLpe", 1, old->PcdEnableLpe, new->PcdEnableLpe); |
| 206 | fsp_display_upd_value("PcdEnableDma0", 1, old->PcdEnableDma0, new->PcdEnableDma0); |
| 207 | fsp_display_upd_value("PcdEnableDma1", 1, old->PcdEnableDma1, new->PcdEnableDma1); |
| 208 | fsp_display_upd_value("PcdEnableI2C0", 1, old->PcdEnableI2C0, new->PcdEnableI2C0); |
| 209 | fsp_display_upd_value("PcdEnableI2C1", 1, old->PcdEnableI2C1, new->PcdEnableI2C1); |
| 210 | fsp_display_upd_value("PcdEnableI2C2", 1, old->PcdEnableI2C2, new->PcdEnableI2C2); |
| 211 | fsp_display_upd_value("PcdEnableI2C3", 1, old->PcdEnableI2C3, new->PcdEnableI2C3); |
| 212 | fsp_display_upd_value("PcdEnableI2C4", 1, old->PcdEnableI2C4, new->PcdEnableI2C4); |
| 213 | fsp_display_upd_value("PcdEnableI2C5", 1, old->PcdEnableI2C5, new->PcdEnableI2C5); |
| 214 | fsp_display_upd_value("PcdEnableI2C6", 1, old->PcdEnableI2C6, new->PcdEnableI2C6); |
| 215 | |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 216 | fsp_display_upd_value("PcdGraphicsConfigPtr", 4, |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 217 | old->GraphicsConfigPtr, |
| 218 | new->GraphicsConfigPtr); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 219 | fsp_display_upd_value("GpioFamilyInitTablePtr", 4, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 220 | (uint32_t)old->GpioFamilyInitTablePtr, |
| 221 | (uint32_t)new->GpioFamilyInitTablePtr); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 222 | fsp_display_upd_value("GpioPadInitTablePtr", 4, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 223 | (uint32_t)old->GpioPadInitTablePtr, |
| 224 | (uint32_t)new->GpioPadInitTablePtr); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 225 | fsp_display_upd_value("PunitPwrConfigDisable", 1, |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 226 | old->PunitPwrConfigDisable, |
| 227 | new->PunitPwrConfigDisable); |
| 228 | |
| 229 | fsp_display_upd_value("ChvSvidConfig", 1, old->ChvSvidConfig, new->ChvSvidConfig); |
| 230 | fsp_display_upd_value("DptfDisable", 1, old->DptfDisable, new->DptfDisable); |
| 231 | fsp_display_upd_value("PcdEmmcMode", 1, old->PcdEmmcMode, new->PcdEmmcMode); |
| 232 | fsp_display_upd_value("PcdUsb3ClkSsc", 1, old->PcdUsb3ClkSsc, new->PcdUsb3ClkSsc); |
| 233 | fsp_display_upd_value("PcdDispClkSsc", 1, old->PcdDispClkSsc, new->PcdDispClkSsc); |
| 234 | fsp_display_upd_value("PcdSataClkSsc", 1, old->PcdSataClkSsc, new->PcdSataClkSsc); |
| 235 | |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 236 | fsp_display_upd_value("Usb2Port0PerPortPeTxiSet", 1, |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 237 | old->Usb2Port0PerPortPeTxiSet, |
| 238 | new->Usb2Port0PerPortPeTxiSet); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 239 | fsp_display_upd_value("Usb2Port0PerPortTxiSet", 1, |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 240 | old->Usb2Port0PerPortTxiSet, |
| 241 | new->Usb2Port0PerPortTxiSet); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 242 | fsp_display_upd_value("Usb2Port0IUsbTxEmphasisEn", 1, |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 243 | old->Usb2Port0IUsbTxEmphasisEn, |
| 244 | new->Usb2Port0IUsbTxEmphasisEn); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 245 | fsp_display_upd_value("Usb2Port0PerPortTxPeHalf", 1, |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 246 | old->Usb2Port0PerPortTxPeHalf, |
| 247 | new->Usb2Port0PerPortTxPeHalf); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 248 | fsp_display_upd_value("Usb2Port1PerPortPeTxiSet", 1, |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 249 | old->Usb2Port1PerPortPeTxiSet, |
| 250 | new->Usb2Port1PerPortPeTxiSet); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 251 | fsp_display_upd_value("Usb2Port1PerPortTxiSet", 1, |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 252 | old->Usb2Port1PerPortTxiSet, |
| 253 | new->Usb2Port1PerPortTxiSet); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 254 | fsp_display_upd_value("Usb2Port1IUsbTxEmphasisEn", 1, |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 255 | old->Usb2Port1IUsbTxEmphasisEn, |
| 256 | new->Usb2Port1IUsbTxEmphasisEn); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 257 | fsp_display_upd_value("Usb2Port1PerPortTxPeHalf", 1, |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 258 | old->Usb2Port1PerPortTxPeHalf, |
| 259 | new->Usb2Port1PerPortTxPeHalf); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 260 | fsp_display_upd_value("Usb2Port2PerPortPeTxiSet", 1, |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 261 | old->Usb2Port2PerPortPeTxiSet, |
| 262 | new->Usb2Port2PerPortPeTxiSet); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 263 | fsp_display_upd_value("Usb2Port2PerPortTxiSet", 1, |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 264 | old->Usb2Port2PerPortTxiSet, |
| 265 | new->Usb2Port2PerPortTxiSet); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 266 | fsp_display_upd_value("Usb2Port2IUsbTxEmphasisEn", 1, |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 267 | old->Usb2Port2IUsbTxEmphasisEn, |
| 268 | new->Usb2Port2IUsbTxEmphasisEn); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 269 | fsp_display_upd_value("Usb2Port2PerPortTxPeHalf", 1, |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 270 | old->Usb2Port2PerPortTxPeHalf, |
| 271 | new->Usb2Port2PerPortTxPeHalf); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 272 | fsp_display_upd_value("Usb2Port3PerPortPeTxiSet", 1, |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 273 | old->Usb2Port3PerPortPeTxiSet, |
| 274 | new->Usb2Port3PerPortPeTxiSet); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 275 | fsp_display_upd_value("Usb2Port3PerPortTxiSet", 1, |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 276 | old->Usb2Port3PerPortTxiSet, |
| 277 | new->Usb2Port3PerPortTxiSet); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 278 | fsp_display_upd_value("Usb2Port3IUsbTxEmphasisEn", 1, |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 279 | old->Usb2Port3IUsbTxEmphasisEn, |
| 280 | new->Usb2Port3IUsbTxEmphasisEn); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 281 | fsp_display_upd_value("Usb2Port3PerPortTxPeHalf", 1, |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 282 | old->Usb2Port3PerPortTxPeHalf, |
| 283 | new->Usb2Port3PerPortTxPeHalf); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 284 | fsp_display_upd_value("Usb2Port4PerPortPeTxiSet", 1, |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 285 | old->Usb2Port4PerPortPeTxiSet, |
| 286 | new->Usb2Port4PerPortPeTxiSet); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 287 | fsp_display_upd_value("Usb2Port4PerPortTxiSet", 1, |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 288 | old->Usb2Port4PerPortTxiSet, |
| 289 | new->Usb2Port4PerPortTxiSet); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 290 | fsp_display_upd_value("Usb2Port4IUsbTxEmphasisEn", 1, |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 291 | old->Usb2Port4IUsbTxEmphasisEn, |
| 292 | new->Usb2Port4IUsbTxEmphasisEn); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 293 | fsp_display_upd_value("Usb2Port4PerPortTxPeHalf", 1, |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 294 | old->Usb2Port4PerPortTxPeHalf, |
| 295 | new->Usb2Port4PerPortTxPeHalf); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 296 | fsp_display_upd_value("Usb3Lane0Ow2tapgen2deemph3p5", 1, |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 297 | old->Usb3Lane0Ow2tapgen2deemph3p5, |
| 298 | new->Usb3Lane0Ow2tapgen2deemph3p5); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 299 | fsp_display_upd_value("Usb3Lane1Ow2tapgen2deemph3p5", 1, |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 300 | old->Usb3Lane1Ow2tapgen2deemph3p5, |
| 301 | new->Usb3Lane1Ow2tapgen2deemph3p5); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 302 | fsp_display_upd_value("Usb3Lane2Ow2tapgen2deemph3p5", 1, |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 303 | old->Usb3Lane2Ow2tapgen2deemph3p5, |
| 304 | new->Usb3Lane2Ow2tapgen2deemph3p5); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 305 | fsp_display_upd_value("Usb3Lane3Ow2tapgen2deemph3p5", 1, |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 306 | old->Usb3Lane3Ow2tapgen2deemph3p5, |
| 307 | new->Usb3Lane3Ow2tapgen2deemph3p5); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 308 | fsp_display_upd_value("PcdSataInterfaceSpeed", 1, |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 309 | old->PcdSataInterfaceSpeed, |
| 310 | new->PcdSataInterfaceSpeed); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 311 | fsp_display_upd_value("PcdPchUsbSsicPort", 1, |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 312 | old->PcdPchUsbSsicPort, |
| 313 | new->PcdPchUsbSsicPort); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 314 | fsp_display_upd_value("PcdPchUsbHsicPort", 1, |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 315 | old->PcdPchUsbHsicPort, |
| 316 | new->PcdPchUsbHsicPort); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 317 | fsp_display_upd_value("PcdPcieRootPortSpeed", 1, |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 318 | old->PcdPcieRootPortSpeed, |
| 319 | new->PcdPcieRootPortSpeed); |
| 320 | fsp_display_upd_value("PcdPchSsicEnable", 1, |
| 321 | old->PcdPchSsicEnable, |
| 322 | new->PcdPchSsicEnable); |
| 323 | |
| 324 | fsp_display_upd_value("PcdLogoPtr", 4, old->PcdLogoPtr, new->PcdLogoPtr); |
| 325 | fsp_display_upd_value("PcdLogoSize", 4, old->PcdLogoSize, new->PcdLogoSize); |
| 326 | fsp_display_upd_value("PcdRtcLock", 1, old->PcdRtcLock, new->PcdRtcLock); |
| 327 | fsp_display_upd_value("PMIC_I2CBus", 1, old->PMIC_I2CBus, new->PMIC_I2CBus); |
| 328 | fsp_display_upd_value("ISPEnable", 1, old->ISPEnable, new->ISPEnable); |
| 329 | fsp_display_upd_value("ISPPciDevConfig", 1, old->ISPPciDevConfig, new->ISPPciDevConfig); |
| 330 | fsp_display_upd_value("PcdSdDetectChk", 1, old->PcdSdDetectChk, new->PcdSdDetectChk); |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 331 | } |
| 332 | |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 333 | /* Called at BS_DEV_INIT_CHIPS time -- very early. Just after BS_PRE_DEVICE. */ |
| 334 | static void soc_init(void *chip_info) |
| 335 | { |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 336 | printk(BIOS_SPEW, "%s/%s\n", __FILE__, __func__); |
| 337 | soc_init_pre_device(chip_info); |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 338 | } |
| 339 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 340 | struct chip_operations soc_intel_braswell_ops = { |
| 341 | CHIP_NAME("Intel Braswell SoC") |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 342 | .enable_dev = enable_dev, |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 343 | .init = soc_init, |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 344 | }; |
| 345 | |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 346 | struct pci_operations soc_pci_ops = { |
Subrata Banik | 4a0f071 | 2019-03-20 14:29:47 +0530 | [diff] [blame] | 347 | .set_subsystem = &pci_dev_set_subsystem, |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 348 | }; |
Matt DeVillier | 143a836 | 2017-08-26 04:47:15 -0500 | [diff] [blame] | 349 | |
| 350 | /** |
| 351 | Return SoC stepping type |
| 352 | |
| 353 | @retval SOC_STEPPING SoC stepping type |
| 354 | **/ |
| 355 | int SocStepping(void) |
| 356 | { |
Kyösti Mälkki | c70eed1 | 2018-05-22 02:18:00 +0300 | [diff] [blame] | 357 | struct device *dev = pcidev_on_root(LPC_DEV, LPC_FUNC); |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 358 | const u8 revid = pci_read_config8(dev, 0x8); |
Matt DeVillier | 143a836 | 2017-08-26 04:47:15 -0500 | [diff] [blame] | 359 | |
| 360 | switch (revid & B_PCH_LPC_RID_STEPPING_MASK) { |
| 361 | case V_PCH_LPC_RID_A0: |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 362 | return SocA0; |
Matt DeVillier | 143a836 | 2017-08-26 04:47:15 -0500 | [diff] [blame] | 363 | case V_PCH_LPC_RID_A1: |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 364 | return SocA1; |
Matt DeVillier | 143a836 | 2017-08-26 04:47:15 -0500 | [diff] [blame] | 365 | case V_PCH_LPC_RID_A2: |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 366 | return SocA2; |
Matt DeVillier | 143a836 | 2017-08-26 04:47:15 -0500 | [diff] [blame] | 367 | case V_PCH_LPC_RID_A3: |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 368 | return SocA3; |
Matt DeVillier | 143a836 | 2017-08-26 04:47:15 -0500 | [diff] [blame] | 369 | case V_PCH_LPC_RID_A4: |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 370 | return SocA4; |
Matt DeVillier | 143a836 | 2017-08-26 04:47:15 -0500 | [diff] [blame] | 371 | case V_PCH_LPC_RID_A5: |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 372 | return SocA5; |
Matt DeVillier | 143a836 | 2017-08-26 04:47:15 -0500 | [diff] [blame] | 373 | case V_PCH_LPC_RID_A6: |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 374 | return SocA6; |
Matt DeVillier | 143a836 | 2017-08-26 04:47:15 -0500 | [diff] [blame] | 375 | case V_PCH_LPC_RID_A7: |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 376 | return SocA7; |
Matt DeVillier | 143a836 | 2017-08-26 04:47:15 -0500 | [diff] [blame] | 377 | case V_PCH_LPC_RID_B0: |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 378 | return SocB0; |
Matt DeVillier | 143a836 | 2017-08-26 04:47:15 -0500 | [diff] [blame] | 379 | case V_PCH_LPC_RID_B1: |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 380 | return SocB1; |
Matt DeVillier | 143a836 | 2017-08-26 04:47:15 -0500 | [diff] [blame] | 381 | case V_PCH_LPC_RID_B2: |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 382 | return SocB2; |
Matt DeVillier | 143a836 | 2017-08-26 04:47:15 -0500 | [diff] [blame] | 383 | case V_PCH_LPC_RID_B3: |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 384 | return SocB3; |
Matt DeVillier | 143a836 | 2017-08-26 04:47:15 -0500 | [diff] [blame] | 385 | case V_PCH_LPC_RID_B4: |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 386 | return SocB4; |
Matt DeVillier | 143a836 | 2017-08-26 04:47:15 -0500 | [diff] [blame] | 387 | case V_PCH_LPC_RID_B5: |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 388 | return SocB5; |
Matt DeVillier | 143a836 | 2017-08-26 04:47:15 -0500 | [diff] [blame] | 389 | case V_PCH_LPC_RID_B6: |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 390 | return SocB6; |
Matt DeVillier | 143a836 | 2017-08-26 04:47:15 -0500 | [diff] [blame] | 391 | case V_PCH_LPC_RID_B7: |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 392 | return SocB7; |
Matt DeVillier | 143a836 | 2017-08-26 04:47:15 -0500 | [diff] [blame] | 393 | case V_PCH_LPC_RID_C0: |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 394 | return SocC0; |
Matt DeVillier | 143a836 | 2017-08-26 04:47:15 -0500 | [diff] [blame] | 395 | case V_PCH_LPC_RID_C1: |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 396 | return SocC1; |
Matt DeVillier | 143a836 | 2017-08-26 04:47:15 -0500 | [diff] [blame] | 397 | case V_PCH_LPC_RID_C2: |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 398 | return SocC2; |
Matt DeVillier | 143a836 | 2017-08-26 04:47:15 -0500 | [diff] [blame] | 399 | case V_PCH_LPC_RID_C3: |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 400 | return SocC3; |
Matt DeVillier | 143a836 | 2017-08-26 04:47:15 -0500 | [diff] [blame] | 401 | case V_PCH_LPC_RID_C4: |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 402 | return SocC4; |
Matt DeVillier | 143a836 | 2017-08-26 04:47:15 -0500 | [diff] [blame] | 403 | case V_PCH_LPC_RID_C5: |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 404 | return SocC5; |
Matt DeVillier | 143a836 | 2017-08-26 04:47:15 -0500 | [diff] [blame] | 405 | case V_PCH_LPC_RID_C6: |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 406 | return SocC6; |
Matt DeVillier | 143a836 | 2017-08-26 04:47:15 -0500 | [diff] [blame] | 407 | case V_PCH_LPC_RID_C7: |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 408 | return SocC7; |
Matt DeVillier | 143a836 | 2017-08-26 04:47:15 -0500 | [diff] [blame] | 409 | case V_PCH_LPC_RID_D0: |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 410 | return SocD0; |
Matt DeVillier | 143a836 | 2017-08-26 04:47:15 -0500 | [diff] [blame] | 411 | case V_PCH_LPC_RID_D1: |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 412 | return SocD1; |
Matt DeVillier | 143a836 | 2017-08-26 04:47:15 -0500 | [diff] [blame] | 413 | case V_PCH_LPC_RID_D2: |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 414 | return SocD2; |
Matt DeVillier | 143a836 | 2017-08-26 04:47:15 -0500 | [diff] [blame] | 415 | case V_PCH_LPC_RID_D3: |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 416 | return SocD3; |
Matt DeVillier | 143a836 | 2017-08-26 04:47:15 -0500 | [diff] [blame] | 417 | case V_PCH_LPC_RID_D4: |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 418 | return SocD4; |
Matt DeVillier | 143a836 | 2017-08-26 04:47:15 -0500 | [diff] [blame] | 419 | case V_PCH_LPC_RID_D5: |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 420 | return SocD5; |
Matt DeVillier | 143a836 | 2017-08-26 04:47:15 -0500 | [diff] [blame] | 421 | case V_PCH_LPC_RID_D6: |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 422 | return SocD6; |
Matt DeVillier | 143a836 | 2017-08-26 04:47:15 -0500 | [diff] [blame] | 423 | case V_PCH_LPC_RID_D7: |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 424 | return SocD7; |
Matt DeVillier | 143a836 | 2017-08-26 04:47:15 -0500 | [diff] [blame] | 425 | default: |
Angel Pons | aee7ab2 | 2020-03-19 00:31:58 +0100 | [diff] [blame] | 426 | return SocSteppingMax; |
Matt DeVillier | 143a836 | 2017-08-26 04:47:15 -0500 | [diff] [blame] | 427 | } |
| 428 | } |