Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2013 Google Inc. |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 5 | * Copyright (C) 2015 Intel Corp. |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 6 | * |
| 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 Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 15 | */ |
| 16 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 17 | #include <chip.h> |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 18 | #include <console/console.h> |
| 19 | #include <device/device.h> |
| 20 | #include <device/pci.h> |
Aaron Durbin | 789f2b6 | 2015-09-09 17:05:06 -0500 | [diff] [blame] | 21 | #include <fsp/util.h> |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 22 | #include <soc/pci_devs.h> |
| 23 | #include <soc/ramstage.h> |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 24 | |
| 25 | static void pci_domain_set_resources(device_t dev) |
| 26 | { |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 27 | printk(BIOS_SPEW, "%s/%s ( %s )\n", |
| 28 | __FILE__, __func__, dev_name(dev)); |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 29 | assign_resources(dev->link_list); |
| 30 | } |
| 31 | |
| 32 | static struct device_operations pci_domain_ops = { |
| 33 | .read_resources = pci_domain_read_resources, |
| 34 | .set_resources = pci_domain_set_resources, |
| 35 | .enable_resources = NULL, |
| 36 | .init = NULL, |
| 37 | .scan_bus = pci_domain_scan_bus, |
| 38 | .ops_pci_bus = pci_bus_default_ops, |
| 39 | }; |
| 40 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 41 | static void cpu_bus_noop(device_t dev) { } |
| 42 | |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 43 | static struct device_operations cpu_bus_ops = { |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 44 | .read_resources = cpu_bus_noop, |
| 45 | .set_resources = cpu_bus_noop, |
| 46 | .enable_resources = cpu_bus_noop, |
| 47 | .init = soc_init_cpus |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 48 | }; |
| 49 | |
| 50 | |
| 51 | static void enable_dev(device_t dev) |
| 52 | { |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 53 | printk(BIOS_SPEW, "----------\n%s/%s ( %s ), type: %d\n", |
| 54 | __FILE__, __func__, |
| 55 | dev_name(dev), dev->path.type); |
| 56 | printk(BIOS_SPEW, "vendor: 0x%04x. device: 0x%04x\n", |
| 57 | pci_read_config16(dev, PCI_VENDOR_ID), |
| 58 | pci_read_config16(dev, PCI_DEVICE_ID)); |
| 59 | printk(BIOS_SPEW, "class: 0x%02x %s\n" |
| 60 | "subclass: 0x%02x %s\n" |
| 61 | "prog: 0x%02x\n" |
| 62 | "revision: 0x%02x\n", |
| 63 | pci_read_config16(dev, PCI_CLASS_DEVICE) >> 8, |
| 64 | get_pci_class_name(dev), |
| 65 | pci_read_config16(dev, PCI_CLASS_DEVICE) & 0xff, |
| 66 | get_pci_subclass_name(dev), |
| 67 | pci_read_config8(dev, PCI_CLASS_PROG), |
| 68 | pci_read_config8(dev, PCI_REVISION_ID)); |
| 69 | |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 70 | /* Set the operations if it is a special bus type */ |
| 71 | if (dev->path.type == DEVICE_PATH_DOMAIN) { |
| 72 | dev->ops = &pci_domain_ops; |
| 73 | } else if (dev->path.type == DEVICE_PATH_CPU_CLUSTER) { |
| 74 | dev->ops = &cpu_bus_ops; |
| 75 | } else if (dev->path.type == DEVICE_PATH_PCI) { |
| 76 | /* Handle south cluster enablement. */ |
| 77 | if (PCI_SLOT(dev->path.pci.devfn) > GFX_DEV && |
| 78 | (dev->ops == NULL || dev->ops->enable == NULL)) { |
| 79 | southcluster_enable_dev(dev); |
| 80 | } |
| 81 | } |
| 82 | } |
| 83 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 84 | void soc_silicon_init_params(SILICON_INIT_UPD *params) |
| 85 | { |
| 86 | device_t dev = dev_find_slot(0, PCI_DEVFN(LPC_DEV, LPC_FUNC)); |
| 87 | struct soc_intel_braswell_config *config = dev->chip_info; |
| 88 | |
| 89 | /* Set the parameters for SiliconInit */ |
| 90 | printk(BIOS_DEBUG, "Updating UPD values for SiliconInit\n"); |
| 91 | params->PcdSdcardMode = config->PcdSdcardMode; |
| 92 | params->PcdEnableHsuart0 = config->PcdEnableHsuart0; |
| 93 | params->PcdEnableHsuart1 = config->PcdEnableHsuart1; |
| 94 | params->PcdEnableAzalia = config->PcdEnableAzalia; |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 95 | params->PcdEnableSata = config->PcdEnableSata; |
| 96 | params->PcdEnableXhci = config->PcdEnableXhci; |
| 97 | params->PcdEnableLpe = config->PcdEnableLpe; |
| 98 | params->PcdEnableDma0 = config->PcdEnableDma0; |
| 99 | params->PcdEnableDma1 = config->PcdEnableDma1; |
| 100 | params->PcdEnableI2C0 = config->PcdEnableI2C0; |
| 101 | params->PcdEnableI2C1 = config->PcdEnableI2C1; |
| 102 | params->PcdEnableI2C2 = config->PcdEnableI2C2; |
| 103 | params->PcdEnableI2C3 = config->PcdEnableI2C3; |
| 104 | params->PcdEnableI2C4 = config->PcdEnableI2C4; |
| 105 | params->PcdEnableI2C5 = config->PcdEnableI2C5; |
| 106 | params->PcdEnableI2C6 = config->PcdEnableI2C6; |
Subrata Banik | 13cd331 | 2015-08-07 18:22:54 +0530 | [diff] [blame] | 107 | params->GraphicsConfigPtr = 0; |
| 108 | params->AzaliaConfigPtr = 0; |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 109 | params->PunitPwrConfigDisable = config->PunitPwrConfigDisable; |
| 110 | params->ChvSvidConfig = config->ChvSvidConfig; |
| 111 | params->DptfDisable = config->DptfDisable; |
| 112 | params->PcdEmmcMode = config->PcdEmmcMode; |
| 113 | params->PcdUsb3ClkSsc = config->PcdUsb3ClkSsc; |
| 114 | params->PcdDispClkSsc = config->PcdDispClkSsc; |
| 115 | params->PcdSataClkSsc = config->PcdSataClkSsc; |
| 116 | params->Usb2Port0PerPortPeTxiSet = config->Usb2Port0PerPortPeTxiSet; |
| 117 | params->Usb2Port0PerPortTxiSet = config->Usb2Port0PerPortTxiSet; |
| 118 | params->Usb2Port0IUsbTxEmphasisEn = config->Usb2Port0IUsbTxEmphasisEn; |
| 119 | params->Usb2Port0PerPortTxPeHalf = config->Usb2Port0PerPortTxPeHalf; |
| 120 | params->Usb2Port1PerPortPeTxiSet = config->Usb2Port1PerPortPeTxiSet; |
| 121 | params->Usb2Port1PerPortTxiSet = config->Usb2Port1PerPortTxiSet; |
| 122 | params->Usb2Port1IUsbTxEmphasisEn = config->Usb2Port1IUsbTxEmphasisEn; |
| 123 | params->Usb2Port1PerPortTxPeHalf = config->Usb2Port1PerPortTxPeHalf; |
| 124 | params->Usb2Port2PerPortPeTxiSet = config->Usb2Port2PerPortPeTxiSet; |
| 125 | params->Usb2Port2PerPortTxiSet = config->Usb2Port2PerPortTxiSet; |
| 126 | params->Usb2Port2IUsbTxEmphasisEn = config->Usb2Port2IUsbTxEmphasisEn; |
| 127 | params->Usb2Port2PerPortTxPeHalf = config->Usb2Port2PerPortTxPeHalf; |
| 128 | params->Usb2Port3PerPortPeTxiSet = config->Usb2Port3PerPortPeTxiSet; |
| 129 | params->Usb2Port3PerPortTxiSet = config->Usb2Port3PerPortTxiSet; |
| 130 | params->Usb2Port3IUsbTxEmphasisEn = config->Usb2Port3IUsbTxEmphasisEn; |
| 131 | params->Usb2Port3PerPortTxPeHalf = config->Usb2Port3PerPortTxPeHalf; |
| 132 | params->Usb2Port4PerPortPeTxiSet = config->Usb2Port4PerPortPeTxiSet; |
| 133 | params->Usb2Port4PerPortTxiSet = config->Usb2Port4PerPortTxiSet; |
| 134 | params->Usb2Port4IUsbTxEmphasisEn = config->Usb2Port4IUsbTxEmphasisEn; |
| 135 | params->Usb2Port4PerPortTxPeHalf = config->Usb2Port4PerPortTxPeHalf; |
| 136 | params->Usb3Lane0Ow2tapgen2deemph3p5 = |
| 137 | config->Usb3Lane0Ow2tapgen2deemph3p5; |
| 138 | params->Usb3Lane1Ow2tapgen2deemph3p5 = |
| 139 | config->Usb3Lane1Ow2tapgen2deemph3p5; |
| 140 | params->Usb3Lane2Ow2tapgen2deemph3p5 = |
| 141 | config->Usb3Lane2Ow2tapgen2deemph3p5; |
| 142 | params->Usb3Lane3Ow2tapgen2deemph3p5 = |
| 143 | config->Usb3Lane3Ow2tapgen2deemph3p5; |
| 144 | params->PcdSataInterfaceSpeed = config->PcdSataInterfaceSpeed; |
| 145 | params->PcdPchUsbSsicPort = config->PcdPchUsbSsicPort; |
| 146 | params->PcdPchUsbHsicPort = config->PcdPchUsbHsicPort; |
| 147 | params->PcdPcieRootPortSpeed = config->PcdPcieRootPortSpeed; |
| 148 | params->PcdPchSsicEnable = config->PcdPchSsicEnable; |
| 149 | params->PcdLogoPtr = config->PcdLogoPtr; |
| 150 | params->PcdLogoSize = config->PcdLogoSize; |
| 151 | params->PcdRtcLock = config->PcdRtcLock; |
| 152 | params->PMIC_I2CBus = config->PMIC_I2CBus; |
| 153 | params->ISPEnable = config->ISPEnable; |
| 154 | params->ISPPciDevConfig = config->ISPPciDevConfig; |
Divya Sasidharan | 89a6685 | 2015-10-28 15:02:35 -0700 | [diff] [blame^] | 155 | params->PcdSdDetectChk = config->PcdSdDetectChk; |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 156 | } |
| 157 | |
| 158 | void soc_display_silicon_init_params(const SILICON_INIT_UPD *old, |
| 159 | SILICON_INIT_UPD *new) |
| 160 | { |
| 161 | /* Display the parameters for SiliconInit */ |
| 162 | printk(BIOS_SPEW, "UPD values for SiliconInit:\n"); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 163 | fsp_display_upd_value("PcdSdcardMode", 1, old->PcdSdcardMode, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 164 | new->PcdSdcardMode); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 165 | fsp_display_upd_value("PcdEnableHsuart0", 1, old->PcdEnableHsuart0, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 166 | new->PcdEnableHsuart0); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 167 | fsp_display_upd_value("PcdEnableHsuart1", 1, old->PcdEnableHsuart1, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 168 | new->PcdEnableHsuart1); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 169 | fsp_display_upd_value("PcdEnableAzalia", 1, old->PcdEnableAzalia, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 170 | new->PcdEnableAzalia); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 171 | fsp_display_upd_value("AzaliaConfigPtr", 4, |
Subrata Banik | 13cd331 | 2015-08-07 18:22:54 +0530 | [diff] [blame] | 172 | (uint32_t)old->AzaliaConfigPtr, |
| 173 | (uint32_t)new->AzaliaConfigPtr); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 174 | fsp_display_upd_value("PcdEnableSata", 1, old->PcdEnableSata, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 175 | new->PcdEnableSata); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 176 | fsp_display_upd_value("PcdEnableXhci", 1, old->PcdEnableXhci, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 177 | new->PcdEnableXhci); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 178 | fsp_display_upd_value("PcdEnableLpe", 1, old->PcdEnableLpe, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 179 | new->PcdEnableLpe); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 180 | fsp_display_upd_value("PcdEnableDma0", 1, old->PcdEnableDma0, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 181 | new->PcdEnableDma0); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 182 | fsp_display_upd_value("PcdEnableDma1", 1, old->PcdEnableDma1, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 183 | new->PcdEnableDma1); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 184 | fsp_display_upd_value("PcdEnableI2C0", 1, old->PcdEnableI2C0, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 185 | new->PcdEnableI2C0); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 186 | fsp_display_upd_value("PcdEnableI2C1", 1, old->PcdEnableI2C1, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 187 | new->PcdEnableI2C1); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 188 | fsp_display_upd_value("PcdEnableI2C2", 1, old->PcdEnableI2C2, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 189 | new->PcdEnableI2C2); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 190 | fsp_display_upd_value("PcdEnableI2C3", 1, old->PcdEnableI2C3, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 191 | new->PcdEnableI2C3); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 192 | fsp_display_upd_value("PcdEnableI2C4", 1, old->PcdEnableI2C4, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 193 | new->PcdEnableI2C4); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 194 | fsp_display_upd_value("PcdEnableI2C5", 1, old->PcdEnableI2C5, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 195 | new->PcdEnableI2C5); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 196 | fsp_display_upd_value("PcdEnableI2C6", 1, old->PcdEnableI2C6, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 197 | new->PcdEnableI2C6); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 198 | fsp_display_upd_value("PcdGraphicsConfigPtr", 4, |
Subrata Banik | 13cd331 | 2015-08-07 18:22:54 +0530 | [diff] [blame] | 199 | old->GraphicsConfigPtr, new->GraphicsConfigPtr); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 200 | fsp_display_upd_value("GpioFamilyInitTablePtr", 4, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 201 | (uint32_t)old->GpioFamilyInitTablePtr, |
| 202 | (uint32_t)new->GpioFamilyInitTablePtr); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 203 | fsp_display_upd_value("GpioPadInitTablePtr", 4, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 204 | (uint32_t)old->GpioPadInitTablePtr, |
| 205 | (uint32_t)new->GpioPadInitTablePtr); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 206 | fsp_display_upd_value("PunitPwrConfigDisable", 1, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 207 | old->PunitPwrConfigDisable, |
| 208 | new->PunitPwrConfigDisable); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 209 | fsp_display_upd_value("ChvSvidConfig", 1, old->ChvSvidConfig, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 210 | new->ChvSvidConfig); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 211 | fsp_display_upd_value("DptfDisable", 1, old->DptfDisable, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 212 | new->DptfDisable); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 213 | fsp_display_upd_value("PcdEmmcMode", 1, old->PcdEmmcMode, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 214 | new->PcdEmmcMode); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 215 | fsp_display_upd_value("PcdUsb3ClkSsc", 1, old->PcdUsb3ClkSsc, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 216 | new->PcdUsb3ClkSsc); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 217 | fsp_display_upd_value("PcdDispClkSsc", 1, old->PcdDispClkSsc, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 218 | new->PcdDispClkSsc); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 219 | fsp_display_upd_value("PcdSataClkSsc", 1, old->PcdSataClkSsc, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 220 | new->PcdSataClkSsc); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 221 | fsp_display_upd_value("Usb2Port0PerPortPeTxiSet", 1, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 222 | old->Usb2Port0PerPortPeTxiSet, |
| 223 | new->Usb2Port0PerPortPeTxiSet); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 224 | fsp_display_upd_value("Usb2Port0PerPortTxiSet", 1, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 225 | old->Usb2Port0PerPortTxiSet, |
| 226 | new->Usb2Port0PerPortTxiSet); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 227 | fsp_display_upd_value("Usb2Port0IUsbTxEmphasisEn", 1, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 228 | old->Usb2Port0IUsbTxEmphasisEn, |
| 229 | new->Usb2Port0IUsbTxEmphasisEn); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 230 | fsp_display_upd_value("Usb2Port0PerPortTxPeHalf", 1, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 231 | old->Usb2Port0PerPortTxPeHalf, |
| 232 | new->Usb2Port0PerPortTxPeHalf); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 233 | fsp_display_upd_value("Usb2Port1PerPortPeTxiSet", 1, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 234 | old->Usb2Port1PerPortPeTxiSet, |
| 235 | new->Usb2Port1PerPortPeTxiSet); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 236 | fsp_display_upd_value("Usb2Port1PerPortTxiSet", 1, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 237 | old->Usb2Port1PerPortTxiSet, |
| 238 | new->Usb2Port1PerPortTxiSet); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 239 | fsp_display_upd_value("Usb2Port1IUsbTxEmphasisEn", 1, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 240 | old->Usb2Port1IUsbTxEmphasisEn, |
| 241 | new->Usb2Port1IUsbTxEmphasisEn); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 242 | fsp_display_upd_value("Usb2Port1PerPortTxPeHalf", 1, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 243 | old->Usb2Port1PerPortTxPeHalf, |
| 244 | new->Usb2Port1PerPortTxPeHalf); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 245 | fsp_display_upd_value("Usb2Port2PerPortPeTxiSet", 1, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 246 | old->Usb2Port2PerPortPeTxiSet, |
| 247 | new->Usb2Port2PerPortPeTxiSet); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 248 | fsp_display_upd_value("Usb2Port2PerPortTxiSet", 1, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 249 | old->Usb2Port2PerPortTxiSet, |
| 250 | new->Usb2Port2PerPortTxiSet); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 251 | fsp_display_upd_value("Usb2Port2IUsbTxEmphasisEn", 1, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 252 | old->Usb2Port2IUsbTxEmphasisEn, |
| 253 | new->Usb2Port2IUsbTxEmphasisEn); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 254 | fsp_display_upd_value("Usb2Port2PerPortTxPeHalf", 1, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 255 | old->Usb2Port2PerPortTxPeHalf, |
| 256 | new->Usb2Port2PerPortTxPeHalf); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 257 | fsp_display_upd_value("Usb2Port3PerPortPeTxiSet", 1, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 258 | old->Usb2Port3PerPortPeTxiSet, |
| 259 | new->Usb2Port3PerPortPeTxiSet); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 260 | fsp_display_upd_value("Usb2Port3PerPortTxiSet", 1, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 261 | old->Usb2Port3PerPortTxiSet, |
| 262 | new->Usb2Port3PerPortTxiSet); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 263 | fsp_display_upd_value("Usb2Port3IUsbTxEmphasisEn", 1, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 264 | old->Usb2Port3IUsbTxEmphasisEn, |
| 265 | new->Usb2Port3IUsbTxEmphasisEn); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 266 | fsp_display_upd_value("Usb2Port3PerPortTxPeHalf", 1, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 267 | old->Usb2Port3PerPortTxPeHalf, |
| 268 | new->Usb2Port3PerPortTxPeHalf); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 269 | fsp_display_upd_value("Usb2Port4PerPortPeTxiSet", 1, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 270 | old->Usb2Port4PerPortPeTxiSet, |
| 271 | new->Usb2Port4PerPortPeTxiSet); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 272 | fsp_display_upd_value("Usb2Port4PerPortTxiSet", 1, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 273 | old->Usb2Port4PerPortTxiSet, |
| 274 | new->Usb2Port4PerPortTxiSet); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 275 | fsp_display_upd_value("Usb2Port4IUsbTxEmphasisEn", 1, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 276 | old->Usb2Port4IUsbTxEmphasisEn, |
| 277 | new->Usb2Port4IUsbTxEmphasisEn); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 278 | fsp_display_upd_value("Usb2Port4PerPortTxPeHalf", 1, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 279 | old->Usb2Port4PerPortTxPeHalf, |
| 280 | new->Usb2Port4PerPortTxPeHalf); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 281 | fsp_display_upd_value("Usb3Lane0Ow2tapgen2deemph3p5", 1, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 282 | old->Usb3Lane0Ow2tapgen2deemph3p5, |
| 283 | new->Usb3Lane0Ow2tapgen2deemph3p5); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 284 | fsp_display_upd_value("Usb3Lane1Ow2tapgen2deemph3p5", 1, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 285 | old->Usb3Lane1Ow2tapgen2deemph3p5, |
| 286 | new->Usb3Lane1Ow2tapgen2deemph3p5); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 287 | fsp_display_upd_value("Usb3Lane2Ow2tapgen2deemph3p5", 1, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 288 | old->Usb3Lane2Ow2tapgen2deemph3p5, |
| 289 | new->Usb3Lane2Ow2tapgen2deemph3p5); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 290 | fsp_display_upd_value("Usb3Lane3Ow2tapgen2deemph3p5", 1, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 291 | old->Usb3Lane3Ow2tapgen2deemph3p5, |
| 292 | new->Usb3Lane3Ow2tapgen2deemph3p5); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 293 | fsp_display_upd_value("PcdSataInterfaceSpeed", 1, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 294 | old->PcdSataInterfaceSpeed, |
| 295 | new->PcdSataInterfaceSpeed); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 296 | fsp_display_upd_value("PcdPchUsbSsicPort", 1, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 297 | old->PcdPchUsbSsicPort, new->PcdPchUsbSsicPort); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 298 | fsp_display_upd_value("PcdPchUsbHsicPort", 1, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 299 | old->PcdPchUsbHsicPort, new->PcdPchUsbHsicPort); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 300 | fsp_display_upd_value("PcdPcieRootPortSpeed", 1, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 301 | old->PcdPcieRootPortSpeed, new->PcdPcieRootPortSpeed); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 302 | fsp_display_upd_value("PcdPchSsicEnable", 1, old->PcdPchSsicEnable, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 303 | new->PcdPchSsicEnable); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 304 | fsp_display_upd_value("PcdLogoPtr", 4, old->PcdLogoPtr, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 305 | new->PcdLogoPtr); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 306 | fsp_display_upd_value("PcdLogoSize", 4, old->PcdLogoSize, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 307 | new->PcdLogoSize); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 308 | fsp_display_upd_value("PcdRtcLock", 1, old->PcdRtcLock, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 309 | new->PcdRtcLock); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 310 | fsp_display_upd_value("PMIC_I2CBus", 1, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 311 | old->PMIC_I2CBus, new->PMIC_I2CBus); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 312 | fsp_display_upd_value("ISPEnable", 1, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 313 | old->ISPEnable, new->ISPEnable); |
Lee Leahy | 66208bd | 2015-10-15 16:17:58 -0700 | [diff] [blame] | 314 | fsp_display_upd_value("ISPPciDevConfig", 1, |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 315 | old->ISPPciDevConfig, new->ISPPciDevConfig); |
Divya Sasidharan | 89a6685 | 2015-10-28 15:02:35 -0700 | [diff] [blame^] | 316 | fsp_display_upd_value("PcdSdDetectChk", 1, |
| 317 | old->PcdSdDetectChk, new->PcdSdDetectChk); |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 318 | } |
| 319 | |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 320 | /* Called at BS_DEV_INIT_CHIPS time -- very early. Just after BS_PRE_DEVICE. */ |
| 321 | static void soc_init(void *chip_info) |
| 322 | { |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 323 | printk(BIOS_SPEW, "%s/%s\n", __FILE__, __func__); |
| 324 | soc_init_pre_device(chip_info); |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 325 | } |
| 326 | |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 327 | struct chip_operations soc_intel_braswell_ops = { |
| 328 | CHIP_NAME("Intel Braswell SoC") |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 329 | .enable_dev = enable_dev, |
| 330 | .init = soc_init, |
| 331 | }; |
| 332 | |
| 333 | static void pci_set_subsystem(device_t dev, unsigned vendor, unsigned device) |
| 334 | { |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 335 | printk(BIOS_SPEW, "%s/%s ( %s, 0x%04x, 0x%04x )\n", |
| 336 | __FILE__, __func__, dev_name(dev), vendor, device); |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 337 | if (!vendor || !device) { |
| 338 | pci_write_config32(dev, PCI_SUBSYSTEM_VENDOR_ID, |
| 339 | pci_read_config32(dev, PCI_VENDOR_ID)); |
| 340 | } else { |
| 341 | pci_write_config32(dev, PCI_SUBSYSTEM_VENDOR_ID, |
| 342 | ((device & 0xffff) << 16) | (vendor & 0xffff)); |
| 343 | } |
| 344 | } |
| 345 | |
| 346 | struct pci_operations soc_pci_ops = { |
| 347 | .set_subsystem = &pci_set_subsystem, |
| 348 | }; |