<p>Julien Viard de Galbert has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/25443">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">mb/scaleway/tagada: Don't change FIAMUX when Security Override is set<br><br>This will not enable M.2 SATA drive if the ME config was lost<br>(For instance after flashin a full flash factory image)<br><br>This is required so that the system can boot without FIA MUX error<br>during flash update procedure.<br><br>Change-Id: I55a8bcdc30bc67af2d3e9ccb8844eac599727108<br>Signed-off-by: Julien Viard de Galbert <jviarddegalbert@online.net><br>---<br>M src/mainboard/scaleway/tagada/hsio.c<br>1 file changed, 33 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/43/25443/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/mainboard/scaleway/tagada/hsio.c b/src/mainboard/scaleway/tagada/hsio.c</span><br><span>index dca80ac..b48ef11 100644</span><br><span>--- a/src/mainboard/scaleway/tagada/hsio.c</span><br><span>+++ b/src/mainboard/scaleway/tagada/hsio.c</span><br><span>@@ -19,6 +19,8 @@</span><br><span> #include <hsio.h></span><br><span> #include <gpio_defs.h></span><br><span> #include <soc/fiamux.h></span><br><span style="color: hsl(120, 100%, 40%);">+#include <string.h></span><br><span style="color: hsl(120, 100%, 40%);">+#include <fast_spi_def.h></span><br><span> </span><br><span> #ifdef __RAMSTAGE__</span><br><span> static void update_hsio_info_for_m2_slots(size_t num_of_entry,</span><br><span>@@ -27,6 +29,14 @@</span><br><span>       uint32_t reg32;</span><br><span>      bool m2a_pcie, m2b_pcie;</span><br><span>     uint8_t entry;</span><br><span style="color: hsl(120, 100%, 40%);">+        BL_FIA_MUX_CONFIG_HOB *fiamux_hob_data = get_fiamux_hob_data();</span><br><span style="color: hsl(120, 100%, 40%);">+       uint16_t supported_hsio_lanes;</span><br><span style="color: hsl(120, 100%, 40%);">+        void *spibar = fast_spi_get_bar();</span><br><span style="color: hsl(120, 100%, 40%);">+    uint32_t hsfs;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+      /* Configure FIA MUX PCD */</span><br><span style="color: hsl(120, 100%, 40%);">+   supported_hsio_lanes =</span><br><span style="color: hsl(120, 100%, 40%);">+                (uint16_t)fiamux_hob_data->FiaMuxConfig.SkuNumLanesAllowed;</span><br><span> </span><br><span>   /* Detects modules type */</span><br><span>   // _GPIO_4 : LFFF: M2A_CFGn : M2A_SATAn : 0 SATA, 1 PCIe</span><br><span>@@ -45,6 +55,10 @@</span><br><span>        // HSIO default config is for PCIe, only update for SATA</span><br><span>     // (also secondary PCIe lines are already set depending on SKU)</span><br><span>      for (entry = 0; entry < num_of_entry; entry++) {</span><br><span style="color: hsl(120, 100%, 40%);">+           /* only update the active config */</span><br><span style="color: hsl(120, 100%, 40%);">+           if (config[entry].NumLanesSupported != supported_hsio_lanes)</span><br><span style="color: hsl(120, 100%, 40%);">+                  continue;</span><br><span style="color: hsl(120, 100%, 40%);">+             BL_ME_FIA_CONFIG *fia_config = &(config[entry].FiaConfig);</span><br><span>               BL_ME_FIA_MUX_CONFIG *mux_config =</span><br><span>                   &(config[entry].FiaConfig.MuxConfiguration);</span><br><span>             BL_ME_FIA_SATA_CONFIG *sata_config =</span><br><span>@@ -63,6 +77,25 @@</span><br><span>                    sata_config->BL_MeFiaSataLaneSataSel.Lane12SataSel =</span><br><span>                              BL_ME_FIA_SATA_CONTROLLER_LANE_ASSIGNED;</span><br><span>             }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+           /* Check SPIBAR for security override</span><br><span style="color: hsl(120, 100%, 40%);">+            at least one M2 slot is populated with SATA</span><br><span style="color: hsl(120, 100%, 40%);">+                   the configuration is different form ME current one */</span><br><span style="color: hsl(120, 100%, 40%);">+              hsfs = read32(spibar + SPIBAR_HSFSTS_CTL);</span><br><span style="color: hsl(120, 100%, 40%);">+            if ((!(hsfs & SPIBAR_HSFSTS_FDOPSS))</span><br><span style="color: hsl(120, 100%, 40%);">+                      && (!m2a_pcie || !m2b_pcie)</span><br><span style="color: hsl(120, 100%, 40%);">+                   && memcmp(fia_config,</span><br><span style="color: hsl(120, 100%, 40%);">+                           &fiamux_hob_data->FiaMuxConfig.FiaMuxConfig,</span><br><span style="color: hsl(120, 100%, 40%);">+                           sizeof(BL_ME_FIA_CONFIG))) {</span><br><span style="color: hsl(120, 100%, 40%);">+                        /* update configuration to NOT change ME config</span><br><span style="color: hsl(120, 100%, 40%);">+                          as it will fail with security override set. */</span><br><span style="color: hsl(120, 100%, 40%);">+                     memcpy(fia_config,</span><br><span style="color: hsl(120, 100%, 40%);">+                           &fiamux_hob_data->FiaMuxConfig.FiaMuxConfig,</span><br><span style="color: hsl(120, 100%, 40%);">+                           sizeof(BL_ME_FIA_CONFIG));</span><br><span style="color: hsl(120, 100%, 40%);">+                     printk(BIOS_CRIT, "FLASH SECURITY OVERRIDE SET: "</span><br><span style="color: hsl(120, 100%, 40%);">+                                     "M2 SATA Slots are not available!\n");</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+          }</span><br><span>    }</span><br><span> }</span><br><span> #endif</span><br><span></span><br></pre><p>To view, visit <a href="https://review.coreboot.org/25443">change 25443</a>. To unsubscribe, or for help writing mail filters, 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/25443"/><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: I55a8bcdc30bc67af2d3e9ccb8844eac599727108 </div>
<div style="display:none"> Gerrit-Change-Number: 25443 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Julien Viard de Galbert <jviarddegalbert@online.net> </div>