[coreboot-gerrit] Change in coreboot[master]: amd/common/spi: Update flash driver usage

Marshall Dawson (Code Review) gerrit at coreboot.org
Fri Nov 10 01:31:23 CET 2017


Marshall Dawson has uploaded this change for review. ( https://review.coreboot.org/22406


Change subject: amd/common/spi: Update flash driver usage
......................................................................

amd/common/spi: Update flash driver usage

Fix how the SPI driver is accessed in spi_SaveS3info.  This code has
been unused to date.

Change-Id: Ie2b97c13079fd049f6e02f3ff8fa630ed880343f
Signed-off-by: Marshall Dawson <marshalldawson3rd at gmail.com>
---
M src/soc/amd/common/spi.c
1 file changed, 8 insertions(+), 8 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/06/22406/1

diff --git a/src/soc/amd/common/spi.c b/src/soc/amd/common/spi.c
index 31b686d..44c86e6 100644
--- a/src/soc/amd/common/spi.c
+++ b/src/soc/amd/common/spi.c
@@ -16,24 +16,24 @@
 #include <console/console.h>
 #include <spi-generic.h>
 #include <spi_flash.h>
+#include "s3_resume.h"
 
 void spi_SaveS3info(u32 pos, u32 size, u8 *buf, u32 len)
 {
-	struct spi_flash *flash;
+	struct spi_flash flash;
 
 	spi_init();
-	flash = spi_flash_probe(0, 0);
-	if (!flash) {
+	if (spi_flash_probe(0, 0, &flash)) {
 		printk(BIOS_DEBUG, "Could not find SPI device\n");
 		/* Dont make flow stop. */
 		return;
 	}
 
-	spi_flash_volatile_group_begin(flash);
+	spi_flash_volatile_group_begin(&flash);
 
-	spi_flash_erase(flash, pos, size);
-	spi_flash_write(flash, pos, sizeof(len), &len);
-	spi_flash_write(flash, pos + sizeof(len), len, buf);
+	spi_flash_erase(&flash, pos, size);
+	spi_flash_write(&flash, pos, sizeof(len), &len);
+	spi_flash_write(&flash, pos + sizeof(len), len, buf);
 
-	spi_flash_volatile_group_end(flash);
+	spi_flash_volatile_group_end(&flash);
 }

-- 
To view, visit https://review.coreboot.org/22406
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie2b97c13079fd049f6e02f3ff8fa630ed880343f
Gerrit-Change-Number: 22406
Gerrit-PatchSet: 1
Gerrit-Owner: Marshall Dawson <marshalldawson3rd at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20171110/e94e223a/attachment-0001.html>


More information about the coreboot-gerrit mailing list