[3/9] platform: Add fields for OpenCAPI platform data

Message ID 3ea2ef60eb1496e64a4f8396868036f6c6ec06c1.1513579137.git-series.andrew.donnellan@au1.ibm.com
State Changes Requested
Headers show
Series
  • Initial OpenCAPI 3.0 Support for P9
Related show

Commit Message

Andrew Donnellan Dec. 18, 2017, 7:07 a.m.
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>
---
 include/platform.h | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

Comments

Frederic Barrat Jan. 10, 2018, 5:22 p.m. | #1
Le 18/12/2017 à 08:07, Andrew Donnellan a écrit :
> 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>
> ---
>   include/platform.h | 15 +++++++++++++++
>   1 file changed, 15 insertions(+)
> 
> diff --git a/include/platform.h b/include/platform.h
> index f3af390..59fef96 100644
> --- a/include/platform.h
> +++ b/include/platform.h
> @@ -44,6 +44,18 @@ struct bmc_platform {
>   	uint32_t ipmi_oem_pnor_access_status;
>   };
> 
> +/* OpenCAPI platform-specific I2C information */
> +struct platform_ocapi {
> +	bool i2c_voltage_18;		/* Is 1.8V I2C I/O voltage override needed? */

Not convinced that voltage setting is going to be useful. We'll find out 
soon enough on witherspoon, I guess. We could remove it for now if we 
assume we'll need another patchset for witherspoon (which seems likely 
to me, at least for the platform code).

> +	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 */ > +	uint8_t i2c_odl01_data[3];	/* Data to reset both ODL0 and ODL1 */

I know I'm at the origin of this, but I don't think we reset the 2 links 
simultaneously any more, so it could be dropped.

   Fred


> +	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 +70,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
>
Andrew Donnellan Jan. 11, 2018, 3:01 a.m. | #2
On 11/01/18 04:22, Frederic Barrat wrote:
> Le 18/12/2017 à 08:07, Andrew Donnellan a écrit :
>> 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>
>> ---
>>   include/platform.h | 15 +++++++++++++++
>>   1 file changed, 15 insertions(+)
>>
>> diff --git a/include/platform.h b/include/platform.h
>> index f3af390..59fef96 100644
>> --- a/include/platform.h
>> +++ b/include/platform.h
>> @@ -44,6 +44,18 @@ struct bmc_platform {
>>       uint32_t ipmi_oem_pnor_access_status;
>>   };
>>
>> +/* OpenCAPI platform-specific I2C information */
>> +struct platform_ocapi {
>> +    bool i2c_voltage_18;        /* Is 1.8V I2C I/O voltage override 
>> needed? */
> 
> Not convinced that voltage setting is going to be useful. We'll find out 
> soon enough on witherspoon, I guess. We could remove it for now if we 
> assume we'll need another patchset for witherspoon (which seems likely 
> to me, at least for the platform code).

Yeah, it's likely we'll need another patch for witherspoon after this... 
Ideally this should be set correctly by hostboot, we should check that.

> 
>> +    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 */ > +    
>> uint8_t i2c_odl01_data[3];    /* Data to reset both ODL0 and ODL1 */
> 
> I know I'm at the origin of this, but I don't think we reset the 2 links 
> simultaneously any more, so it could be dropped.
> 

Will drop.
Andrew Donnellan Jan. 11, 2018, 5:48 a.m. | #3
On 11/01/18 14:01, Andrew Donnellan wrote:
>> Not convinced that voltage setting is going to be useful. We'll find 
>> out soon enough on witherspoon, I guess. We could remove it for now if 
>> we assume we'll need another patchset for witherspoon (which seems 
>> likely to me, at least for the platform code).
> 
> Yeah, it's likely we'll need another patch for witherspoon after this... 
> Ideally this should be set correctly by hostboot, we should check that.

Flashed our witherspoon with a current op-build pnor, it doesn't appear 
to set the bit correctly. Hmm.

> 
>>
>>> +    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 */ > + 
>>> uint8_t i2c_odl01_data[3];    /* Data to reset both ODL0 and ODL1 */
>>
>> I know I'm at the origin of this, but I don't think we reset the 2 
>> links simultaneously any more, so it could be dropped.
>>
> 
> Will drop.
>

Patch

diff --git a/include/platform.h b/include/platform.h
index f3af390..59fef96 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -44,6 +44,18 @@  struct bmc_platform {
 	uint32_t ipmi_oem_pnor_access_status;
 };
 
+/* OpenCAPI platform-specific I2C information */
+struct platform_ocapi {
+	bool i2c_voltage_18;		/* Is 1.8V I2C I/O voltage override needed? */
+	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 */
+	uint8_t i2c_odl01_data[3];	/* Data to reset both ODL0 and 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 +70,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