[coreboot-gerrit] Change in coreboot[master]: soc/amd/stoneyridge: Fix SPD code

Richard Spiegel (Code Review) gerrit at coreboot.org
Thu Nov 2 21:03:20 CET 2017


Richard Spiegel has uploaded this change for review. ( https://review.coreboot.org/22300


Change subject: soc/amd/stoneyridge: Fix SPD code
......................................................................

soc/amd/stoneyridge: Fix SPD code

SPD address should be uint8_t. Remove unused smbus_readSpd prototype
from dimmSpd.h.

BUG=b:62200225

Change-Id: Ia11c5994c41849ba01ecae3cee6fa97c527134d0
Signed-off-by: Richard Spiegel <richard.spiegel at silverbackltd.com>
---
M src/soc/amd/common/dimmSpd.h
M src/soc/amd/stoneyridge/dimmSpd.c
M src/soc/amd/stoneyridge/smbus_spd.c
3 files changed, 5 insertions(+), 6 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/00/22300/1

diff --git a/src/soc/amd/common/dimmSpd.h b/src/soc/amd/common/dimmSpd.h
index cdcdb73..2206b0c 100644
--- a/src/soc/amd/common/dimmSpd.h
+++ b/src/soc/amd/common/dimmSpd.h
@@ -20,7 +20,6 @@
 AmdMemoryReadSPD(IN UINT32 Func, IN UINTN Data,
 				IN OUT AGESA_READ_SPD_PARAMS *SpdData);
 
-int sb_readSpd(int spdAddress, char *buf, size_t len);
-int smbus_readSpd(int spdAddress, char *buf, size_t len);
+int sb_readSpd(uint8_t spdAddress, char *buf, size_t len);
 
 #endif
diff --git a/src/soc/amd/stoneyridge/dimmSpd.c b/src/soc/amd/stoneyridge/dimmSpd.c
index ace22bb..a821036 100644
--- a/src/soc/amd/stoneyridge/dimmSpd.c
+++ b/src/soc/amd/stoneyridge/dimmSpd.c
@@ -27,7 +27,7 @@
 AGESA_STATUS AmdMemoryReadSPD(UINT32 unused1, UINTN unused2,
 						AGESA_READ_SPD_PARAMS *info)
 {
-	int spdAddress;
+	uint8_t spdAddress;
 	DEVTREE_CONST struct device *dev = dev_find_slot(0, PCI_DEVFN(0x18, 2));
 	DEVTREE_CONST struct soc_amd_stoneyridge_config *conf = dev->chip_info;
 
diff --git a/src/soc/amd/stoneyridge/smbus_spd.c b/src/soc/amd/stoneyridge/smbus_spd.c
index 4e3e293..a8a5b37 100644
--- a/src/soc/amd/stoneyridge/smbus_spd.c
+++ b/src/soc/amd/stoneyridge/smbus_spd.c
@@ -33,10 +33,10 @@
  *           sending offset for every byte.
  *          Reads 128 bytes in 7-8 ms at 400 KHz.
  */
-static int readspd(uint16_t iobase, int SmbusSlaveAddress,
+static int readspd(uint16_t iobase, uint8_t SmbusSlaveAddress,
 			char *buffer, size_t count)
 {
-	u8 dev_addr;
+	uint8_t dev_addr;
 	size_t index;
 	int error;
 	char *pbuf = buffer;
@@ -93,7 +93,7 @@
 	outb(SMBSLV_STAT_CLEAR, ioBase + SMBSLVSTAT);
 }
 
-int sb_readSpd(int spdAddress, char *buf, size_t len)
+int sb_readSpd(uint8_t spdAddress, char *buf, size_t len)
 {
 	uint16_t ioBase = SMB_BASE_ADDR;
 	setupFch(ioBase);

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

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia11c5994c41849ba01ecae3cee6fa97c527134d0
Gerrit-Change-Number: 22300
Gerrit-PatchSet: 1
Gerrit-Owner: Richard Spiegel <richard.spiegel at silverbackltd.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20171102/12b90ec0/attachment-0001.html>


More information about the coreboot-gerrit mailing list