<p>Marshall Dawson has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/22406">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">amd/common/spi: Update flash driver usage<br><br>Fix how the SPI driver is accessed in spi_SaveS3info.  This code has<br>been unused to date.<br><br>Change-Id: Ie2b97c13079fd049f6e02f3ff8fa630ed880343f<br>Signed-off-by: Marshall Dawson <marshalldawson3rd@gmail.com><br>---<br>M src/soc/amd/common/spi.c<br>1 file changed, 8 insertions(+), 8 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/06/22406/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/src/soc/amd/common/spi.c b/src/soc/amd/common/spi.c<br>index 31b686d..44c86e6 100644<br>--- a/src/soc/amd/common/spi.c<br>+++ b/src/soc/amd/common/spi.c<br>@@ -16,24 +16,24 @@<br> #include <console/console.h><br> #include <spi-generic.h><br> #include <spi_flash.h><br>+#include "s3_resume.h"<br> <br> void spi_SaveS3info(u32 pos, u32 size, u8 *buf, u32 len)<br> {<br>-   struct spi_flash *flash;<br>+     struct spi_flash flash;<br> <br>    spi_init();<br>-  flash = spi_flash_probe(0, 0);<br>-       if (!flash) {<br>+        if (spi_flash_probe(0, 0, &flash)) {<br>              printk(BIOS_DEBUG, "Could not find SPI device\n");<br>          /* Dont make flow stop. */<br>            return;<br>       }<br> <br>- spi_flash_volatile_group_begin(flash);<br>+       spi_flash_volatile_group_begin(&flash);<br> <br>-       spi_flash_erase(flash, pos, size);<br>-   spi_flash_write(flash, pos, sizeof(len), &len);<br>-  spi_flash_write(flash, pos + sizeof(len), len, buf);<br>+ spi_flash_erase(&flash, pos, size);<br>+      spi_flash_write(&flash, pos, sizeof(len), &len);<br>+     spi_flash_write(&flash, pos + sizeof(len), len, buf);<br> <br>- spi_flash_volatile_group_end(flash);<br>+ spi_flash_volatile_group_end(&flash);<br> }<br></pre><p>To view, visit <a href="https://review.coreboot.org/22406">change 22406</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/22406"/><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: Ie2b97c13079fd049f6e02f3ff8fa630ed880343f </div>
<div style="display:none"> Gerrit-Change-Number: 22406 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Marshall Dawson <marshalldawson3rd@gmail.com> </div>