From 72d9e40f3eb6ae54ee68689cfba9af27a8b2c2db Mon Sep 17 00:00:00 2001 From: Chris Engel Date: Thu, 5 May 2016 17:36:25 -0500 Subject: 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 Reviewed-by: Michael Baiocchi Reviewed-by: William G. Hoffa Reviewed-by: Daniel M. Crowell --- src/usr/targeting/common/genHwsvMrwXml.pl | 32 ++++++++++------------ src/usr/targeting/common/processMrw.pl | 14 +++++++++- .../targeting/common/xmltohb/attribute_types.xml | 8 +++--- .../common/xmltohb/attribute_types_hb.xml | 27 ++++++++++++++++++ .../common/xmltohb/simics_NIMBUS.system.xml | 20 ++++++-------- src/usr/targeting/common/xmltohb/target_types.xml | 2 +- .../targeting/common/xmltohb/target_types_hb.xml | 4 +++ 7 files changed, 72 insertions(+), 35 deletions(-) (limited to 'src/usr/targeting') 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 " \n"; print " \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. - 0,0,0,0,0,0 + 0,0,0,0,0,0,0,0,0,0,0,0 - 2,3 + 4,3 non-volatile 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 @@ -206,6 +206,20 @@ + + I2C_PAGE_MUTEX_3 + + Mutex to protect page select operations for I2C Master engine 3 + + + + + volatile-zeroed + + + + + I2C_ENGINE_MUTEX_0 Mutex for I2C Master engine 0 @@ -245,6 +259,19 @@ + + I2C_ENGINE_MUTEX_3 + Mutex for I2C Master engine 3 + + + + + volatile-zeroed + + + + + FSI_SCOM_MUTEX Mutex for FSI-based SCOM Operations 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 @@ XSCOM_BASE_ADDRESS 0x000603FC00000000 + + I2C_BUS_SPEED_ARRAY + + 0, 0, 0, + 0, 0, 0, + 400, 0, 0, + 0, 0, 0 + + @@ -4430,17 +4439,6 @@ 0,0,0,0,0,0,0,0 - - I2C_BUS_SPEED_ARRAY - - 1000, - 1000, - 0, - 0, - 0, - 0 - - FSP_BASE_ADDR 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 @@ EEPROM_SBE_BACKUP_INFO I2C_BUS_SPEED_ARRAY - 1000,1000,0,0,0,0 + 0,0,0,0,0,0,0,0,0,0,0,0 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 @@ -139,6 +139,10 @@ I2C_ENGINE_MUTEX_2 0 + + I2C_ENGINE_MUTEX_3 + 0 + XSCOM_VIRTUAL_ADDR -- cgit v1.2.1