[PATCH linux v6 13/18] drivers/fsi: Minor updates to FSI core

christopher.lee.bostic at gmail.com christopher.lee.bostic at gmail.com
Mon Oct 31 09:09:34 AEDT 2016


From: Chris Bostic <cbostic at us.ibm.com>

Added some export symbols for fsi_device_read/write for FSI
client drivers.  Removed the byte swapping done on CFAM config
word reads - already in proper order.  Removed fsi_crc4 checks,
they were incorectly reporting bad crc's.  Need to evaluate
what is wrong with the method of calculation.

Add missing assignment of slave to fsi_device during scan.

Signed-off-by: Chris Bostic <cbostic at us.ibm.com>
---
 drivers/fsi/fsi-core.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/fsi/fsi-core.c b/drivers/fsi/fsi-core.c
index 565c7e3..95e867e 100644
--- a/drivers/fsi/fsi-core.c
+++ b/drivers/fsi/fsi-core.c
@@ -64,6 +64,7 @@ int fsi_device_read(struct fsi_device *dev, uint32_t addr, void *val,
 
 	return fsi_slave_read(dev->slave, dev->addr + addr, val, size);
 }
+EXPORT_SYMBOL_GPL(fsi_device_read);
 
 int fsi_device_write(struct fsi_device *dev, uint32_t addr, const void *val,
 		size_t size)
@@ -76,6 +77,7 @@ int fsi_device_write(struct fsi_device *dev, uint32_t addr, const void *val,
 
 	return fsi_slave_write(dev->slave, dev->addr + addr, val, size);
 }
+EXPORT_SYMBOL_GPL(fsi_device_write);
 
 int fsi_device_peek(struct fsi_device *dev, void *val)
 {
@@ -171,16 +173,15 @@ static int fsi_slave_scan(struct fsi_slave *slave)
 					"error reading slave registers\n");
 			return -1;
 		}
-
-		conf = be32_to_cpu(conf);
-
+/* todo: fix crc calc problems */
+#if 0
 		if (!check_crc4_u32(conf)) {
 			dev_warn(&slave->dev,
 				"crc error in slave register at 0x%04x\n",
 					i);
 			return -1;
 		}
-
+#endif
 		slots = (conf & FSI_SLAVE_CONF_SLOTS_MASK)
 			>> FSI_SLAVE_CONF_SLOTS_SHIFT;
 		version = (conf & FSI_SLAVE_CONF_VERSION_MASK)
@@ -199,6 +200,7 @@ static int fsi_slave_scan(struct fsi_slave *slave)
 			if (!dev)
 				return -ENOMEM;
 
+			dev->slave = slave;
 			dev->engine_type = type;
 			dev->version = version;
 			dev->unit = i;
@@ -252,11 +254,10 @@ static int fsi_slave_init(struct fsi_master *master,
 		return -ENODEV;
 	}
 
-	chip_id = be32_to_cpu(chip_id);
 	if (!check_crc4_u32(chip_id)) {
 		dev_warn(master->dev, "slave %02x:%02x: invalid chip id CRC!\n",
 				link, slave_id);
-		return -EIO;
+		/* todo, fix crc calc issues.  Just warn for now */
 	}
 
 	pr_debug("fsi: found chip %08x at %02x:%02x:%02x\n",
-- 
1.8.2.2



More information about the openbmc mailing list