summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Engel <cjengel@us.ibm.com>2016-05-05 17:36:25 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2016-05-17 15:57:39 -0400
commit72d9e40f3eb6ae54ee68689cfba9af27a8b2c2db (patch)
tree453361ee134beee8f9b67ad97a31f15131705459
parent83f5c16f12410fbb3671d577e66a43145c5ea9d1 (diff)
downloadtalos-hostboot-72d9e40f3eb6ae54ee68689cfba9af27a8b2c2db.tar.gz
talos-hostboot-72d9e40f3eb6ae54ee68689cfba9af27a8b2c2db.zip
P9 i2c master support
Updated i2c master code to support 4 engines in P9 and scom offset changes Updated attributes to support 4 engines and to match existing simics models Change-Id: I29aeb98274407777a59f11404f45d08ecadbeab2 RTC: 153481 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/24211 Tested-by: Jenkins Server Tested-by: FSP CI Jenkins Reviewed-by: Andres A. Lugo-Reyes <aalugore@us.ibm.com> Reviewed-by: Michael Baiocchi <mbaiocch@us.ibm.com> Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
-rwxr-xr-xsrc/usr/i2c/i2c.C18
-rwxr-xr-xsrc/usr/targeting/common/genHwsvMrwXml.pl32
-rw-r--r--src/usr/targeting/common/processMrw.pl14
-rw-r--r--src/usr/targeting/common/xmltohb/attribute_types.xml8
-rw-r--r--src/usr/targeting/common/xmltohb/attribute_types_hb.xml27
-rw-r--r--src/usr/targeting/common/xmltohb/simics_NIMBUS.system.xml20
-rwxr-xr-xsrc/usr/targeting/common/xmltohb/target_types.xml2
-rwxr-xr-xsrc/usr/targeting/common/xmltohb/target_types_hb.xml4
8 files changed, 82 insertions, 43 deletions
diff --git a/src/usr/i2c/i2c.C b/src/usr/i2c/i2c.C
index d310687e9..9265d1cfa 100755
--- a/src/usr/i2c/i2c.C
+++ b/src/usr/i2c/i2c.C
@@ -78,6 +78,7 @@ TRAC_INIT( & g_trac_i2cr, "I2CR", KILOBYTE );
#define CENTAUR_MASTER_ENGINES 1 // Number of Engines in a Centaur
#define MAX_NACK_RETRIES 3
#define PAGE_OPERATION 0xffffffff // Special value use to determine type of op
+#define P9_ENGINE_SCOM_OFFSET 0x1000
// Derived from ATTR_I2C_BUS_SPEED_ARRAY[engine][port] attribute
const TARGETING::ATTR_I2C_BUS_SPEED_ARRAY_type g_var = {{NULL}};
@@ -1757,7 +1758,10 @@ bool i2cGetEngineMutex( TARGETING::Target * i_target,
i_engineLock = i_target->
getHbMutexAttr<TARGETING::ATTR_I2C_ENGINE_MUTEX_2>();
break;
-
+ case 3:
+ i_engineLock = i_target->
+ getHbMutexAttr<TARGETING::ATTR_I2C_ENGINE_MUTEX_3>();
+ break;
default:
TRACFCOMP( g_trac_i2c,
ERR_MRK"i2cGetEngineMutex: Invalid engine for getting Mutex! "
@@ -1790,17 +1794,18 @@ bool i2cGetPageMutex( TARGETING::Target * i_target,
i_pageLock = i_target->
getHbMutexAttr<TARGETING::ATTR_I2C_PAGE_MUTEX_0>();
break;
-
case 1:
i_pageLock = i_target->
getHbMutexAttr<TARGETING::ATTR_I2C_PAGE_MUTEX_1>();
break;
-
case 2:
i_pageLock = i_target->
getHbMutexAttr<TARGETING::ATTR_I2C_PAGE_MUTEX_2>();
break;
-
+ case 3:
+ i_pageLock = i_target->
+ getHbMutexAttr<TARGETING::ATTR_I2C_PAGE_MUTEX_3>();
+ break;
default:
TRACFCOMP( g_trac_i2c,
ERR_MRK"i2cGetPageMutex: Invalid engine for getting mutex!");
@@ -3427,13 +3432,10 @@ errlHndl_t i2cResetActiveMasters ( i2cProcessType i_resetType,
"i_functional=%d",
i_resetType, i_functional );
- // @todo RTC:123019- I2CM Changes for P9
-#if (0)
err = i2cProcessActiveMasters (i_resetType, // select engines
I2C_OP_RESET, // reset engines
I2C_BUS_SPEED_FROM_MRW,
i_functional);
-#endif
TRACFCOMP( g_trac_i2c,
EXIT_MRK"i2cResetActiveMasters(): err rc=0x%X, plid=0x%X",
@@ -3623,7 +3625,7 @@ errlHndl_t i2cRegisterOp ( DeviceFW::OperationType i_opType,
if ( i_args.switches.useHostI2C == 1 )
{
op_addr = I2C_HOST_MASTER_BASE_ADDR + i_reg +
- (i_args.engine * 0x20); // engine reg offset
+ (i_args.engine * P9_ENGINE_SCOM_OFFSET);
op_size=8;
err = DeviceFW::deviceOp( i_opType,
diff --git a/src/usr/targeting/common/genHwsvMrwXml.pl b/src/usr/targeting/common/genHwsvMrwXml.pl
index 43fc51449..75f53b4f5 100755
--- a/src/usr/targeting/common/genHwsvMrwXml.pl
+++ b/src/usr/targeting/common/genHwsvMrwXml.pl
@@ -6337,8 +6337,8 @@ sub addI2cBusSpeedArray
my $tmp_offset = 0x0;
my $tmp_ct eq "";
- # bus_speed_arry[engine][port] is 2x3 array
- my @speed_array = (0, 0, 0, 0, 0, 0);
+ # bus_speed_arry[engine][port] is 4x3 array
+ my @speed_array = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
# Loop through all i2c devices
for my $i ( 0 .. $#I2Cdevices )
@@ -6431,21 +6431,11 @@ sub addI2cBusSpeedArray
$tmp_port = $I2Cdevices[$i]{i2c_port};
$tmp_offset = ($tmp_engine * 3) + $tmp_port;
- # @todo RTC 117430 - Default procs to 1MHZ speed until MRWs are updated
- $tmp_ct = "$I2Cdevices[$i]{i2c_content_type}";
- if ( ( ($tmp_ct eq "PRIMARY_SBE_VPD") ||
- ($tmp_ct eq "REDUNDANT_SBE_VPD") ||
- ($tmp_ct eq "PRIMARY_MODULE_VPD") ||
- ($tmp_ct eq "PRIMARY_FRU_AND_MODULE_VPD") ||
- ($tmp_ct eq "REDUNDANT_FRU_AND_MODULE_VPD") )
- &&
- ( $I2Cdevices[$i]{i2cm_name} eq "pu" ) )
- {
- $tmp_speed = 1000;
- }
- else
- {
- $tmp_speed = $I2Cdevices[$i]{i2c_speed};
+ # @todo RTC 153696 - Default everything off except TPM until MRW is correct and simics model is complete
+ if ($tmp_engine == 2 && $tmp_port == 0) {
+ $tmp_speed = 400;
+ } else {
+ $tmp_speed = 0;
}
# use the slower speed if there is a previous entry
@@ -6465,7 +6455,13 @@ sub addI2cBusSpeedArray
print " $speed_array[2],\n";
print " $speed_array[3],\n";
print " $speed_array[4],\n";
- print " $speed_array[5]\n";
+ print " $speed_array[5],\n";
+ print " $speed_array[6],\n";
+ print " $speed_array[7],\n";
+ print " $speed_array[8],\n";
+ print " $speed_array[9],\n";
+ print " $speed_array[10],\n";
+ print " $speed_array[11],\n";
print " </default>\n";
print " </attribute>\n";
diff --git a/src/usr/targeting/common/processMrw.pl b/src/usr/targeting/common/processMrw.pl
index c938550b6..766497b18 100644
--- a/src/usr/targeting/common/processMrw.pl
+++ b/src/usr/targeting/common/processMrw.pl
@@ -574,6 +574,12 @@ sub processI2cSpeeds
$bus_speeds[1][0] = $bus_speeds2[3];
$bus_speeds[1][1] = $bus_speeds2[4];
$bus_speeds[1][2] = $bus_speeds2[5];
+ $bus_speeds[2][0] = $bus_speeds2[6];
+ $bus_speeds[2][1] = $bus_speeds2[7];
+ $bus_speeds[2][2] = $bus_speeds2[8];
+ $bus_speeds[3][0] = $bus_speeds2[9];
+ $bus_speeds[3][1] = $bus_speeds2[10];
+ $bus_speeds[3][2] = $bus_speeds2[11];
my $i2cs=$targetObj->findConnections($target,"I2C","");
if ($i2cs ne "") {
@@ -600,7 +606,13 @@ sub processI2cSpeeds
$bus_speeds[0][2].",".
$bus_speeds[1][0].",".
$bus_speeds[1][1].",".
- $bus_speeds[1][2];
+ $bus_speeds[1][2].",".
+ $bus_speeds[2][0].",".
+ $bus_speeds[2][1].",".
+ $bus_speeds[2][2].",".
+ $bus_speeds[3][0].",".
+ $bus_speeds[3][1].",".
+ $bus_speeds[3][2];
$targetObj->setAttribute($target,"I2C_BUS_SPEED_ARRAY",$bus_speed_attr);
}
diff --git a/src/usr/targeting/common/xmltohb/attribute_types.xml b/src/usr/targeting/common/xmltohb/attribute_types.xml
index d41200e04..dcb1e5d74 100644
--- a/src/usr/targeting/common/xmltohb/attribute_types.xml
+++ b/src/usr/targeting/common/xmltohb/attribute_types.xml
@@ -16594,16 +16594,16 @@ DEPRECATED!!!!
Creator: MRW
Purpose: Used by FW to know the fastest possible bus speed that all of
the devices on a given bus are able to use.
- Data Format: 2x3 array of uint16_t values. The first two values
- indicate the engine number of the bus. The next 3 vaules indicate
+ Data Format: 4x3 array of uint16_t values. The first two values
+ indicate the engine number of the bus. The next 3 values indicate
the port number of the bus. The value in the array is the I2C bus
speed used for that engine/port combination in KHz.
</description>
<simpleType>
<uint16_t>
- <default>0,0,0,0,0,0</default>
+ <default>0,0,0,0,0,0,0,0,0,0,0,0</default>
</uint16_t>
- <array>2,3</array>
+ <array>4,3</array>
</simpleType>
<persistency>non-volatile</persistency>
<readable/>
diff --git a/src/usr/targeting/common/xmltohb/attribute_types_hb.xml b/src/usr/targeting/common/xmltohb/attribute_types_hb.xml
index 0f6a29240..abd9f81a1 100644
--- a/src/usr/targeting/common/xmltohb/attribute_types_hb.xml
+++ b/src/usr/targeting/common/xmltohb/attribute_types_hb.xml
@@ -207,6 +207,20 @@
</attribute>
<attribute>
+ <id>I2C_PAGE_MUTEX_3</id>
+ <description>
+ Mutex to protect page select operations for I2C Master engine 3
+ </description>
+ <simpleType>
+ <hbmutex></hbmutex>
+ </simpleType>
+ <persistency>volatile-zeroed</persistency>
+ <readable/>
+ <writeable/>
+ <hbOnly/>
+</attribute>
+
+<attribute>
<id>I2C_ENGINE_MUTEX_0</id>
<description>Mutex for I2C Master engine 0</description>
<simpleType>
@@ -246,6 +260,19 @@
</attribute>
<attribute>
+ <id>I2C_ENGINE_MUTEX_3</id>
+ <description>Mutex for I2C Master engine 3</description>
+ <simpleType>
+ <hbmutex>
+ </hbmutex>
+ </simpleType>
+ <persistency>volatile-zeroed</persistency>
+ <readable/>
+ <writeable/>
+ <hbOnly/>
+</attribute>
+
+<attribute>
<id>FSI_SCOM_MUTEX</id>
<description>Mutex for FSI-based SCOM Operations</description>
<simpleType>
diff --git a/src/usr/targeting/common/xmltohb/simics_NIMBUS.system.xml b/src/usr/targeting/common/xmltohb/simics_NIMBUS.system.xml
index 667073025..9533a2474 100644
--- a/src/usr/targeting/common/xmltohb/simics_NIMBUS.system.xml
+++ b/src/usr/targeting/common/xmltohb/simics_NIMBUS.system.xml
@@ -252,6 +252,15 @@
<attribute><id>XSCOM_BASE_ADDRESS</id>
<default>0x000603FC00000000</default>
</attribute>
+ <attribute>
+ <id>I2C_BUS_SPEED_ARRAY</id>
+ <default>
+ 0, 0, 0,
+ 0, 0, 0,
+ 400, 0, 0,
+ 0, 0, 0
+ </default>
+ </attribute>
</targetInstance>
<!-- Nimbus n0p0 EQ units -->
@@ -4430,17 +4439,6 @@
0,0,0,0,0,0,0,0
</default>
</attribute>
- <attribute>
- <id>I2C_BUS_SPEED_ARRAY</id>
- <default>
- 1000,
- 1000,
- 0,
- 0,
- 0,
- 0
- </default>
- </attribute>
<!-- Data from PHYP Memory Map -->
<attribute><id>FSP_BASE_ADDR</id>
diff --git a/src/usr/targeting/common/xmltohb/target_types.xml b/src/usr/targeting/common/xmltohb/target_types.xml
index bb928cc8e..97ad74499 100755
--- a/src/usr/targeting/common/xmltohb/target_types.xml
+++ b/src/usr/targeting/common/xmltohb/target_types.xml
@@ -2144,7 +2144,7 @@
<attribute><id>EEPROM_SBE_BACKUP_INFO</id></attribute>
<attribute>
<id>I2C_BUS_SPEED_ARRAY</id>
- <default>1000,1000,0,0,0,0</default>
+ <default>0,0,0,0,0,0,0,0,0,0,0,0</default>
</attribute>
<!-- From PHYP Memory Map -->
diff --git a/src/usr/targeting/common/xmltohb/target_types_hb.xml b/src/usr/targeting/common/xmltohb/target_types_hb.xml
index 272de53c7..de818096b 100755
--- a/src/usr/targeting/common/xmltohb/target_types_hb.xml
+++ b/src/usr/targeting/common/xmltohb/target_types_hb.xml
@@ -140,6 +140,10 @@
<default>0</default>
</attribute>
<attribute>
+ <id>I2C_ENGINE_MUTEX_3</id>
+ <default>0</default>
+ </attribute>
+ <attribute>
<id>XSCOM_VIRTUAL_ADDR</id>
</attribute>
<attribute><id>IPMI_SENSORS</id></attribute>
OpenPOWER on IntegriCloud