diff options
author | Brian Silver <bsilver@us.ibm.com> | 2016-10-05 16:55:56 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2016-10-10 13:53:42 -0400 |
commit | 105e2057c8dba73c0ef601ddf862ce27f9aedd4a (patch) | |
tree | 459976122d66e302752d50023cf83e5b66584a72 /src | |
parent | 419fc706cfb77f1a67ff974ff84090fc6032fec3 (diff) | |
download | talos-hostboot-105e2057c8dba73c0ef601ddf862ce27f9aedd4a.tar.gz talos-hostboot-105e2057c8dba73c0ef601ddf862ce27f9aedd4a.zip |
Change MCA initfile to not divide by 0 if there are no DIMM
Change-Id: I5ebcb11dba0c77d1bf9c107dd8e3e412ca3632ce
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/30761
Reviewed-by: STEPHEN GLANCY <sglancy@us.ibm.com>
Reviewed-by: Jenny Huynh <jhuynh@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Prachi Gupta <pragupta@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Reviewed-by: Brian R. Silver <bsilver@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/30769
Reviewed-by: Hostboot Team <hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/import/chips/p9/initfiles/p9.mca.scom.initfile | 12 | ||||
-rw-r--r-- | src/import/chips/p9/procedures/hwp/initfiles/p9_mca_scom.C | 9 |
2 files changed, 17 insertions, 4 deletions
diff --git a/src/import/chips/p9/initfiles/p9.mca.scom.initfile b/src/import/chips/p9/initfiles/p9.mca.scom.initfile index 47cd87692..5cbb0ec0f 100644 --- a/src/import/chips/p9/initfiles/p9.mca.scom.initfile +++ b/src/import/chips/p9/initfiles/p9.mca.scom.initfile @@ -114,14 +114,22 @@ define def_MEM_TYPE_2667_20_20_20 = def_MSS_FREQ_EQ_2667 && ( MCS.ATTR_E define def_NUM_RANKS = ( MCS.ATTR_EFF_NUM_RANKS_PER_DIMM[def_PORT_INDEX][0] + MCS.ATTR_EFF_NUM_RANKS_PER_DIMM[def_PORT_INDEX][1] ); + +# We don't have a div 0 problem here as we don't run this if we don't have DIMM so the number of ranks won't be 0. define def_REFRESH_INTERVAL = ((MCS.ATTR_EFF_DRAM_TREFI[def_PORT_INDEX])/(8*def_NUM_RANKS)); + define def_RANK_SWITCH_TCK = 4 + ((MCBIST.ATTR_MSS_FREQ-1866)/267); # 1866: 4 2133: 5 2400: 6 2667: 7 define def_BUS_TURNAROUND_TCK = 4 + ((MCBIST.ATTR_MSS_FREQ-1866)/267); # 1866: 4 2133: 5 2400: 6 2667: 7 +# Funky ... If the attribute is 0, then the value of the == operation will be 1 which bitwise-or'd with 0 gives us 1. If the attribute is != 0, then the +# value of the == operation will be 0 which when bitwise-or'd with the attribute will give us the attribute value. Love, Prachi, Jenny, Shelton and Brian. +define def_SLOT0_DENOMINATOR = (MCS.ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM[def_PORT_INDEX][0] == 0x0) | MCS.ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM[def_PORT_INDEX][0]; +define def_SLOT1_DENOMINATOR = (MCS.ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM[def_PORT_INDEX][1] == 0x0) | MCS.ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM[def_PORT_INDEX][1]; + define def_SLOT0_DRAM_STACK_HEIGHT = ( MCS.ATTR_EFF_NUM_RANKS_PER_DIMM[def_PORT_INDEX][0] - / MCS.ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM[def_PORT_INDEX][0] ); + / def_SLOT0_DENOMINATOR ); define def_SLOT1_DRAM_STACK_HEIGHT = ( MCS.ATTR_EFF_NUM_RANKS_PER_DIMM[def_PORT_INDEX][1] - / MCS.ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM[def_PORT_INDEX][1] ); + / def_SLOT1_DENOMINATOR ); #--****************************************************************************** #-- Dial Assignments diff --git a/src/import/chips/p9/procedures/hwp/initfiles/p9_mca_scom.C b/src/import/chips/p9/procedures/hwp/initfiles/p9_mca_scom.C index 5d0e93792..895e5958a 100644 --- a/src/import/chips/p9/procedures/hwp/initfiles/p9_mca_scom.C +++ b/src/import/chips/p9/procedures/hwp/initfiles/p9_mca_scom.C @@ -68,6 +68,7 @@ constexpr auto literal_0b011000 = 0b011000; constexpr auto literal_0b000 = 0b000; constexpr auto literal_0b100 = 0b100; constexpr auto literal_0b010 = 0b010; +constexpr auto literal_0x0 = 0x0; constexpr auto literal_0b001 = 0b001; constexpr auto literal_0b101 = 0b101; constexpr auto literal_0b011 = 0b011; @@ -853,6 +854,8 @@ fapi2::ReturnCode p9_mca_scom(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& TGT0, break; } + auto l_def_SLOT0_DENOMINATOR = ((l_TGT2_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM[l_def_PORT_INDEX][literal_0] == literal_0x0) + | l_TGT2_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM[l_def_PORT_INDEX][literal_0]); fapi2::ATTR_EFF_NUM_RANKS_PER_DIMM_Type l_TGT2_ATTR_EFF_NUM_RANKS_PER_DIMM; l_rc = FAPI_ATTR_GET(fapi2::ATTR_EFF_NUM_RANKS_PER_DIMM, TGT2, l_TGT2_ATTR_EFF_NUM_RANKS_PER_DIMM); @@ -863,9 +866,11 @@ fapi2::ReturnCode p9_mca_scom(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& TGT0, } auto l_def_SLOT0_DRAM_STACK_HEIGHT = (l_TGT2_ATTR_EFF_NUM_RANKS_PER_DIMM[l_def_PORT_INDEX][literal_0] / - l_TGT2_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM[l_def_PORT_INDEX][literal_0]); + l_def_SLOT0_DENOMINATOR); + auto l_def_SLOT1_DENOMINATOR = ((l_TGT2_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM[l_def_PORT_INDEX][literal_1] == literal_0x0) + | l_TGT2_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM[l_def_PORT_INDEX][literal_1]); auto l_def_SLOT1_DRAM_STACK_HEIGHT = (l_TGT2_ATTR_EFF_NUM_RANKS_PER_DIMM[l_def_PORT_INDEX][literal_1] / - l_TGT2_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM[l_def_PORT_INDEX][literal_1]); + l_def_SLOT1_DENOMINATOR); { l_rc = fapi2::getScom( TGT0, 0x7010914ull, l_scom_buffer ); |