<p>Subrata Banik has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/22394">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">soc/intel/common: Fix CSE common code to accomodate Skylake/Kabylake<br><br>This patch ensures Skylake/Kabylake soc can make use of common<br>CSE code in order to perform global reset using HECI interface.<br><br>TEST=Build and boot on soraka/eve/reef/cnl-rvp<br><br>Change-Id: I49b89be8106a19cde1eb9b488ac660637537ad71<br>Signed-off-by: Subrata Banik <subrata.banik@intel.com><br>---<br>M src/soc/intel/common/block/cse/cse.c<br>1 file changed, 22 insertions(+), 3 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/94/22394/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/src/soc/intel/common/block/cse/cse.c b/src/soc/intel/common/block/cse/cse.c<br>index 617684c..6e2468c 100644<br>--- a/src/soc/intel/common/block/cse/cse.c<br>+++ b/src/soc/intel/common/block/cse/cse.c<br>@@ -14,6 +14,7 @@<br>  */<br> <br> #include <arch/early_variables.h><br>+#include <assert.h><br> #include <commonlib/helpers.h><br> #include <console/console.h><br> #include <delay.h><br>@@ -21,12 +22,10 @@<br> #include <device/pci_ids.h><br> #include <device/pci_ops.h><br> #include <intelblocks/cse.h><br>+#include <soc/iomap.h><br> #include <soc/pci_devs.h><br> #include <string.h><br> #include <timer.h><br>-<br>-/* default window for early boot, must be at least 12 bytes in size */<br>-#define HECI1_BASE_ADDRESS  0xfed1a000<br> <br> /* Wait up to 15 sec for HECI to get ready */<br> #define HECI_DELAY_READY        (15 * 1000)<br>@@ -108,15 +107,35 @@<br>    cse->sec_bar = tempbar;<br> }<br> <br>+/* Get HECI BAR 0 from PCI configuration space */<br>+static uint32_t get_cse_bar(void)<br>+{<br>+        uintptr_t bar;<br>+<br>+    bar = pci_read_config32(PCH_DEV_CSE, PCI_BASE_ADDRESS_0);<br>+    assert(bar != 0);<br>+    /*<br>+    * Bits 31-12 are the base address as per EDS for SPI,<br>+        * Don't care about 0-11 bit<br>+      */<br>+  return (bar & ~PCI_BASE_ADDRESS_MEM_ATTR_MASK);<br>+}<br>+<br> static uint32_t read_bar(uint32_t offset)<br> {<br>    struct cse_device *cse = car_get_var_ptr(&g_cse);<br>+        /* Reach PCI config space to get BAR incase CAR global not available */<br>+      if (!cse->sec_bar)<br>+                cse->sec_bar = get_cse_bar();<br>      return read32((void *)(cse->sec_bar + offset));<br> }<br> <br> static void write_bar(uint32_t offset, uint32_t val)<br> {<br>  struct cse_device *cse = car_get_var_ptr(&g_cse);<br>+        /* Reach PCI config space to get BAR incase CAR global not available */<br>+      if (!cse->sec_bar)<br>+                cse->sec_bar = get_cse_bar();<br>      return write32((void *)(cse->sec_bar + offset), val);<br> }<br> <br></pre><p>To view, visit <a href="https://review.coreboot.org/22394">change 22394</a>. To unsubscribe, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/22394"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I49b89be8106a19cde1eb9b488ac660637537ad71 </div>
<div style="display:none"> Gerrit-Change-Number: 22394 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Subrata Banik <subrata.banik@intel.com> </div>