diff mbox series

[3/4] hdata/i2c: Ignore multi-port I2C devices

Message ID 20180424032502.17619-3-oohall@gmail.com
State Accepted
Headers show
Series [1/4] hdata/i2c: Ignore CFAM I2C master | expand

Commit Message

Oliver O'Halloran April 24, 2018, 3:25 a.m. UTC
Recent FSP firmware builds add support for multi-port I2C devices such
as the GPIO expanders used for the presence detect of OpenCAPI devices
and the PCIe hotplug controllers used to power cycle PCIe slots on ZZ.

The OpenCAPI driver inside of skiboot currently uses a platform-specific
method to talk to the relevant I2C device rather than relying on HDAT
since not all platforms correctly report the I2C devices (hello Zaius).
Additionally the nature of multi-port devices require that we a device
specific handler so that we generate the correct DT bindings. Currently
we don't and there is no immediate need for this support so just ignore
the multi-port devices for now.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
 hdata/i2c.c | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

Comments

Andrew Donnellan April 27, 2018, 6:21 a.m. UTC | #1
On 24/04/18 13:25, Oliver O'Halloran wrote:
> Recent FSP firmware builds add support for multi-port I2C devices such
> as the GPIO expanders used for the presence detect of OpenCAPI devices
> and the PCIe hotplug controllers used to power cycle PCIe slots on ZZ.
> 
> The OpenCAPI driver inside of skiboot currently uses a platform-specific
> method to talk to the relevant I2C device rather than relying on HDAT
> since not all platforms correctly report the I2C devices (hello Zaius).
> Additionally the nature of multi-port devices require that we a device
> specific handler so that we generate the correct DT bindings. Currently
> we don't and there is no immediate need for this support so just ignore
> the multi-port devices for now.
> 
> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>

Acked-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Tested-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
diff mbox series

Patch

diff --git a/hdata/i2c.c b/hdata/i2c.c
index c08b53d5c8fb..cbd3bf0155df 100644
--- a/hdata/i2c.c
+++ b/hdata/i2c.c
@@ -314,13 +314,22 @@  int parse_i2c_devs(const struct HDIF_common_hdr *hdr, int idata_index,
 		 * hdat. Log both cases to see what/where/why.
 		 */
 		if (!type || dev->type == 0xFF)
-			prlog(PR_WARNING, "HDAT I2C: found e%dp%d - %s@%x (%#x:%s)\n",
+			prlog(PR_WARNING, "HDAT I2C: found e%dp%d - %s@%x dp:%02x (%#x:%s)\n",
 			      dev->i2cm_engine, dev->i2cm_port, name, dev_addr,
-			      purpose, label);
+			      dev->dev_port, purpose, label);
 		else
-			prlog(PR_TRACE, "HDAT I2C: found e%dp%d - %s@%x (%#x:%s)\n",
+			prlog(PR_DEBUG, "HDAT I2C: found e%dp%d - %s@%x dp:%02x (%#x:%s)\n",
 			      dev->i2cm_engine, dev->i2cm_port, name, dev_addr,
-			      purpose, label);
+			      dev->dev_port, purpose, label);
+
+		/*
+		 * Multi-port device require special handling since we need to
+		 * generate the device-specific DT bindings. For now we're just
+		 * going to ignore them since these devices are owned by FW
+		 * any way.
+		 */
+		if (dev->dev_port != 0xff)
+			continue;
 
 		node = dt_new_addr(bus, name, dev_addr);
 		if (!node)