diff mbox series

[03/10] platform: Add fields for OpenCAPI platform data

Message ID 7411770dc1e5e87156fa3b01e734da767f9244f3.1519192720.git-series.andrew.donnellan@au1.ibm.com
State Superseded
Headers show
Series Initial OpenCAPI 3.0 Support for P9 | expand

Commit Message

Andrew Donnellan Feb. 21, 2018, 5:59 a.m. UTC
Add a platform_ocapi struct to store platform-specific values for resetting
OpenCAPI devices via I2C and for setting up the ODL PHY.

A later patch will add this to the relevant platforms.

Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>

---

v1->v2:

  - remove odl01 reset data (Fred)
  - remove i2c 1.8v hack (Fred)
---
 include/platform.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
diff mbox series

Patch

diff --git a/include/platform.h b/include/platform.h
index e6ece270516d..a77764464001 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -44,6 +44,17 @@  struct bmc_platform {
 	uint32_t ipmi_oem_pnor_access_status;
 };
 
+/* OpenCAPI platform-specific I2C information */
+struct platform_ocapi {
+	uint8_t i2c_engine;		/* I2C engine number */
+	uint8_t i2c_port;		/* I2C port number */
+	uint32_t i2c_offset[3];		/* Offsets on I2C device */
+	uint8_t i2c_odl0_data[3];	/* Data to reset ODL0 */
+	uint8_t i2c_odl1_data[3];	/* Data to reset ODL1 */
+	bool odl_phy_swap;		/* Swap ODL1 to use brick 2 rather than
+					 * brick 1 lanes */
+};
+
 /*
  * Each platform can provide a set of hooks
  * that can affect the generic code
@@ -58,6 +69,9 @@  struct platform {
 	 */
 	const struct bmc_platform *bmc;
 
+	/* OpenCAPI platform-specific I2C information */
+	const struct platform_ocapi *ocapi;
+
 	/*
 	 * Probe platform, return true on a match, called before
 	 * any allocation has been performed outside of the heap