summaryrefslogtreecommitdiffstats
path: root/src/usr/targeting
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 /src/usr/targeting
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>
Diffstat (limited to 'src/usr/targeting')
-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
7 files changed, 72 insertions, 35 deletions
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