diff options
| author | Dan Crowell <dcrowell@us.ibm.com> | 2014-03-26 09:42:19 -0500 |
|---|---|---|
| committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2014-03-27 08:20:24 -0500 |
| commit | b9896f73b25f5bb2cd29d8b78e904ba9c267763d (patch) | |
| tree | 391e894c7a491bba457ab41bbcb6bdc066a3ca21 /src/usr/hwpf/hwp/dram_initialization | |
| parent | ca721de0e1d3ce6da95ccece6053e157eaace012 (diff) | |
| download | blackbird-hostboot-b9896f73b25f5bb2cd29d8b78e904ba9c267763d.tar.gz blackbird-hostboot-b9896f73b25f5bb2cd29d8b78e904ba9c267763d.zip | |
Avoid scom errors when Centaur is deconfigured
Change-Id: I871f268a9562c6e9194f9883ed3f4e1f2741a427
CQ: SW252028
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/9897
Tested-by: Jenkins Server
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/hwpf/hwp/dram_initialization')
| -rw-r--r-- | src/usr/hwpf/hwp/dram_initialization/mss_power_cleanup/mss_power_cleanup.C | 201 | ||||
| -rw-r--r-- | src/usr/hwpf/hwp/dram_initialization/mss_power_cleanup/mss_power_cleanup.H | 11 |
2 files changed, 155 insertions, 57 deletions
diff --git a/src/usr/hwpf/hwp/dram_initialization/mss_power_cleanup/mss_power_cleanup.C b/src/usr/hwpf/hwp/dram_initialization/mss_power_cleanup/mss_power_cleanup.C index 76cb445e8..1ba2a871c 100644 --- a/src/usr/hwpf/hwp/dram_initialization/mss_power_cleanup/mss_power_cleanup.C +++ b/src/usr/hwpf/hwp/dram_initialization/mss_power_cleanup/mss_power_cleanup.C @@ -20,7 +20,7 @@ /* Origin: 30 */ /* */ /* IBM_PROLOG_END_TAG */ -// $Id: mss_power_cleanup.C,v 1.6 2014/02/17 19:21:37 bellows Exp $ +// $Id: mss_power_cleanup.C,v 1.10 2014/03/25 18:06:03 jdsloat Exp $ // $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/chips/centaur/working/procedures/ipl/fapi/mss_power_cleanup.C,v $ //------------------------------------------------------------------------------ // *! (C) Copyright International Business Machines Corp. 2012 @@ -29,7 +29,7 @@ //------------------------------------------------------------------------------ // *! TITLE : mss_power_cleanup // *! DESCRIPTION : see additional comments below -// *! OWNER NAME : Mark Bellows Email: bellows@us.ibm.com +// *! OWNER NAME : Jacob Sloat Email: jdsloat@us.ibm.com // *! BACKUP NAME : Anuwat Saetow Email: asaetow@us.ibm.com // *! ADDITIONAL COMMENTS : @@ -49,6 +49,10 @@ //------------------------------------------------------------------------------ // Version:| Author: | Date: | Comment: //---------|----------|---------|----------------------------------------------- +// 1.10 | jdsloat |25-MAR-14| ENUM_ATTR_MSS_INIT_STATE_COLD became fapi::ENUM_ATTR_MSS_INIT_STATE_COLD +// 1.9 | jdsloat |25-MAR-14| Fixed 1.8 +// 1.8 | jdsloat |25-MAR-14| Added a check to break procedure if HW non-functional +// 1.7 | bellows |19-FEB-14| RAS Review Updates Pass 2 // 1.6 |bellows |17-FEB-14| RAS review updates // 1.5 |bellows |05-FEB-14| Making this procedure work on really non-functional centaurs // 1.4 |bellows |21-Nov-13| Gerrit Review Updates - unused variable removed @@ -61,11 +65,11 @@ //------------------------------------------------------------------------------ // My Includes //------------------------------------------------------------------------------ -#include "cen_stopclocks.H" -#include "mss_power_cleanup.H" -#include "cen_scom_addresses.H" -#include "mss_eff_config.H" -#include "common_scom_addresses.H" +#include <cen_stopclocks.H> +#include <mss_power_cleanup.H> +#include <cen_scom_addresses.H> +#include <mss_eff_config.H> +#include <common_scom_addresses.H> //------------------------------------------------------------------------------ // Includes @@ -85,11 +89,6 @@ const uint8_t DIMM_SIZE = 2; //------------------------------------------------------------------------------ extern "C" { - fapi::ReturnCode mss_power_cleanup_centaur(const fapi::Target & i_target_centaur); - fapi::ReturnCode mss_power_cleanup_mba_part1(const fapi::Target & i_target_centaur, const fapi::Target & i_target_mba); - fapi::ReturnCode mss_power_cleanup_mba_fence(const fapi::Target & i_target_centaur, const fapi::Target & i_target_mba0, const fapi::Target & i_target_mba1 ); - - fapi::ReturnCode mss_power_cleanup_mba(const fapi::Target & i_target_mba); // clean up an mba //------------------------------------------------------------------------------ // @brief mss_power_cleanup(): This function will disable a centaur - fencing it and powering it down @@ -104,11 +103,12 @@ extern "C" { fapi::ReturnCode rc,rc0,rc1,rcf,rcc; uint8_t centaur_functional=1, mba0_functional=1, mba1_functional=1; - + uint8_t cen_init_state = 0; FAPI_INF("Running mss_power_cleanupon %s\n", i_target_centaur.toEcmdString()); - do { + do + { rc = FAPI_ATTR_GET(ATTR_FUNCTIONAL, &i_target_centaur, centaur_functional); if(rc) { FAPI_ERR("ERROR: Cannot get ATTR_FUNCTIONAL"); break; } @@ -118,6 +118,14 @@ extern "C" rc = FAPI_ATTR_GET(ATTR_FUNCTIONAL, &i_target_mba1, mba1_functional); if(rc) { FAPI_ERR("ERROR: Cannot get ATTR_FUNCTIONAL"); break; } + rc = FAPI_ATTR_GET(ATTR_MSS_INIT_STATE, &i_target_centaur, cen_init_state); + if(rc) { FAPI_ERR("ERROR: Cannot get ATTR_INIT_STATE"); break; } + + if (cen_init_state == fapi::ENUM_ATTR_MSS_INIT_STATE_COLD) + { + FAPI_ERR("Centaur clocks not on. Cannot execute mss_power_cleanup on this target: %s", i_target_centaur.toEcmdString()); break; + } + rc0 = mss_power_cleanup_mba_part1(i_target_centaur, i_target_mba0); rc1 = mss_power_cleanup_mba_part1(i_target_centaur, i_target_mba1); @@ -184,11 +192,13 @@ extern "C" return rc; } // end mss_power_cleanup() - fapi::ReturnCode set_powerdown_bits(int mba_functional, ecmdDataBufferBase &data_buffer_64) { + fapi::ReturnCode set_powerdown_bits(int mba_functional, ecmdDataBufferBase &data_buffer_64) + { fapi::ReturnCode rc; uint32_t rc_num = 0; - if(mba_functional == 0) { + if(mba_functional == 0) + { FAPI_INF("set_powerdown_bits MBA not Functional"); rc_num |= data_buffer_64.setBit(0 +48); // MASTER_PD_CNTL (48) rc_num |= data_buffer_64.setBit(1 +48); // ANALOG_INPUT_STAB2 (49) @@ -199,7 +209,8 @@ extern "C" rc_num |= data_buffer_64.setBit(14 +48); // TX_TRISTATE_CNTL (62) rc_num |= data_buffer_64.setBit(15 +48); // VCC_REG_PD (63) } - else { + else + { rc_num |= data_buffer_64.clearBit(0 +48); // MASTER_PD_CNTL (48) rc_num |= data_buffer_64.clearBit(1 +48); // ANALOG_INPUT_STAB2 (49) rc_num |= data_buffer_64.clearBit(7 +48); // ANALOG_INPUT_STAB1 (55) @@ -210,7 +221,8 @@ extern "C" rc_num |= data_buffer_64.clearBit(15 +48); // VCC_REG_PD (63) } - if (rc_num) { + if (rc_num) + { FAPI_ERR( "Error setting up buffers"); rc.setEcmdError(rc_num); } @@ -218,7 +230,8 @@ extern "C" return rc; } - fapi::ReturnCode mss_power_cleanup_mba_part1(const fapi::Target & i_target_centaur, const fapi::Target & i_target_mba) { + fapi::ReturnCode mss_power_cleanup_mba_part1(const fapi::Target & i_target_centaur, const fapi::Target & i_target_mba) + { // turn off functional vector fapi::ReturnCode rc; uint8_t centaur_functional; @@ -234,56 +247,91 @@ extern "C" FAPI_INF("Starting mss_power_cleanup_mba_part1"); rc = FAPI_ATTR_GET(ATTR_FUNCTIONAL, &i_target_centaur, centaur_functional); - if(rc) { FAPI_ERR("ERROR: Cannot get ATTR_FUNCTIONAL"); break; } + if(rc) + { + FAPI_ERR("ERROR: Cannot get ATTR_FUNCTIONAL"); + break; + } FAPI_INF("working on a centaur whose functional is %d", centaur_functional); rc = FAPI_ATTR_GET(ATTR_FUNCTIONAL, &i_target_mba, mba_functional); - if(rc) { FAPI_ERR("ERROR: Cannot get ATTR_FUNCTIONAL"); break; } + if(rc) { + FAPI_ERR("ERROR: Cannot get ATTR_FUNCTIONAL"); + break; + } FAPI_INF("working on an mba whose functional is %d", mba_functional); // But to clarify so there's no misconception, you can only turn off the clocks to the MEMS grid (Ports 2/3). If you want to deconfigure Ports 0/1, there is no way to turn those clocks off. The best you can do there is shut down the PHY inside DDR (I think they have an ultra low power mode where you can turn off virtually everything including their PLLs, phase rotators, analogs , FIFOs, etc) plus of course you can disable their I/O. I think those steps should be done no matter which port you're deconfiguring, but in terms of the chip clock grid, you only get that additional power savings in the bad Port 2/3 case. - if(centaur_functional == 1 && mba_functional == 0) { + if(centaur_functional == 1 && mba_functional == 0) + { FAPI_INF("cleanup_part1 MBA not functional"); // check that clocks are up to the DDR partition before turning it off // this case will only happen if we get memory up and later come back and want to // deconfigure it. The first time, it may not even be up yet. rc = fapiGetScom(i_target_centaur, TP_CLK_STATUS_0x01030008, data_buffer_64); - if(rc) { FAPI_ERR("ERROR: Cannot getScom 0x1030008"); break; } - if(data_buffer_64.getDoubleWord(0) == 0x000007FFFFFFFFFFull) { // pervasive clocks are on + if(rc) { + FAPI_ERR("ERROR: Cannot getScom 0x1030008"); + break; + } + if(data_buffer_64.getDoubleWord(0) == 0x000007FFFFFFFFFFull) + { // pervasive clocks are on rc = fapiGetScom(i_target_centaur, MEM_CLK_STATUS_0x03030008, data_buffer_64); - if(rc) { FAPI_ERR("ERROR: Cannot getScom 0x3030008"); break; } - if(data_buffer_64.getDoubleWord(0) == 0x0000001FFFFFFFFFull) { + if(rc) + { + FAPI_ERR("ERROR: Cannot getScom 0x3030008"); + break; + } + if(data_buffer_64.getDoubleWord(0) == 0x0000001FFFFFFFFFull) + { memon=1; } } - if(memon) { + if(memon) + { FAPI_INF("Mem Clocks On"); - if(mba_functional == 0) { + if(mba_functional == 0) + { FAPI_INF("This mba is not functional, doing more transactions"); // Do Port 0 rc = fapiGetScom(i_target_mba, DPHY01_DDRPHY_PC_POWERDOWN_1_P0_0x8000C0100301143F, data_buffer_64); - if(rc) { FAPI_ERR("ERROR: Cannot getScom DPHY01_DDRPHY_PC_POWERDOWN_1_P0_0x8000C0100301143F"); break; } + if(rc) + { + FAPI_ERR("ERROR: Cannot getScom DPHY01_DDRPHY_PC_POWERDOWN_1_P0_0x8000C0100301143F"); + break; + } rc = set_powerdown_bits(mba_functional, data_buffer_64); if(rc) break; rc = fapiPutScom(i_target_mba, DPHY01_DDRPHY_PC_POWERDOWN_1_P0_0x8000C0100301143F, data_buffer_64); - if(rc) { FAPI_ERR("ERROR: Cannot putScom DPHY01_DDRPHY_PC_POWERDOWN_1_P0_0x8000C0100301143F"); break; } + if(rc) + { + FAPI_ERR("ERROR: Cannot putScom DPHY01_DDRPHY_PC_POWERDOWN_1_P0_0x8000C0100301143F"); + break; + } // Do Port 1 rc = fapiGetScom(i_target_mba, DPHY01_DDRPHY_PC_POWERDOWN_1_P1_0x8001C0100301143F, data_buffer_64); - if(rc) { FAPI_ERR("ERROR: Cannot getScom DPHY01_DDRPHY_PC_POWERDOWN_1_P1_0x8001C0100301143F"); break; } + if(rc) + { + FAPI_ERR("ERROR: Cannot getScom DPHY01_DDRPHY_PC_POWERDOWN_1_P1_0x8001C0100301143F"); + break; + } rc = set_powerdown_bits(mba_functional, data_buffer_64); if(rc) break; rc = fapiPutScom(i_target_mba, DPHY01_DDRPHY_PC_POWERDOWN_1_P1_0x8001C0100301143F, data_buffer_64); - if(rc) { FAPI_ERR("ERROR: Cannot putScom DPHY01_DDRPHY_PC_POWERDOWN_1_P1_0x8001C0100301143F"); break; } + if(rc) + { + FAPI_ERR("ERROR: Cannot putScom DPHY01_DDRPHY_PC_POWERDOWN_1_P1_0x8001C0100301143F"); + break; + } // From Section 10.4 } // mba functional } @@ -291,34 +339,52 @@ extern "C" //TP_CHIP_DPHY23_GRID_DISABLE (Table 57 ). This must be decided during CFAMINIT . it may not be //dynamically updated rc = FAPI_ATTR_GET(ATTR_CHIP_UNIT_POS, &i_target_mba, unit_pos); // 0 = MBA01 and 1 = MBA23 - if(rc) { FAPI_ERR("ERROR: Cannot get ATTR_CHIP_UNIT_POS"); break; } + if(rc) + { + FAPI_ERR("ERROR: Cannot get ATTR_CHIP_UNIT_POS"); + break; + } - if(unit_pos == 1) { + if(unit_pos == 1) + { rc = fapiGetCfamRegister( i_target_centaur, CFAM_FSI_GP4_0x00001013, cfam_data); - if(rc) { FAPI_ERR("ERROR: Cannot getCfamRegister CFAM_FSI_GP4_0x00001013"); break; } + if(rc) + { + FAPI_ERR("ERROR: Cannot getCfamRegister CFAM_FSI_GP4_0x00001013"); + break; + } - if(mba_functional == 0) { + if(mba_functional == 0) + { rc_num |= cfam_data.setBit(1); } - else { + else + { rc_num |= cfam_data.clearBit(1); } - if (rc_num) { + if (rc_num) + { FAPI_ERR( "Error setting up buffers"); rc.setEcmdError(rc_num); break; } rc = fapiPutCfamRegister( i_target_centaur, CFAM_FSI_GP4_0x00001013, cfam_data); - if(rc) { FAPI_ERR("ERROR: Cannot putCfamRegister CFAM_FSI_GP4_0x00001013"); break; } + if(rc) + { + FAPI_ERR("ERROR: Cannot putCfamRegister CFAM_FSI_GP4_0x00001013"); + break; + } } // mba 1 only code } } while(0); - if(rc) { FAPI_ERR("ERROR: Bad RC in mss_power_cleanup_mba_part1"); } + if(rc) { + FAPI_ERR("ERROR: Bad RC in mss_power_cleanup_mba_part1"); + } return rc; } // end of mss_power_cleanup_mba_part1 @@ -355,10 +421,12 @@ extern "C" //1 1 1 Fencing enabled between MEMN and MEMS and at chiplet boundary. rc = fapiGetScom(i_target_centaur, TP_CLK_STATUS_0x01030008, data_buffer_64); if(rc) break; - if(data_buffer_64.getDoubleWord(0) == 0x000007FFFFFFFFFFull) { // pervasive clocks are on + if(data_buffer_64.getDoubleWord(0) == 0x000007FFFFFFFFFFull) + { // pervasive clocks are on rc = fapiGetScom(i_target_centaur, MEM_CLK_STATUS_0x03030008, data_buffer_64); if(rc) break; - if(data_buffer_64.getDoubleWord(0) == 0x0000001FFFFFFFFFull) { + if(data_buffer_64.getDoubleWord(0) == 0x0000001FFFFFFFFFull) + { memon=1; } } @@ -368,27 +436,33 @@ extern "C" rc = fapiGetScom( i_target_centaur, MEM_GP3_0x030F0012, data_buffer_64); if (rc) break; - if(mba_functional0 == 0 || mba_functional1 == 0) { // one of the two are non-functional + if(mba_functional0 == 0 || mba_functional1 == 0) + { // one of the two are non-functional rc_num |= data_buffer_64.setBit(31); // enable_partial_good_dc } - else { + else + { rc_num |= data_buffer_64.clearBit(31); } - if(mba_functional0 == 0) { + if(mba_functional0 == 0) + { rc_num |= data_buffer_64.setBit(18); // memn_fence_dc } - else { + else + { rc_num |= data_buffer_64.clearBit(18); // memn_fence_dc } - if(mba_functional1 == 0) { + if(mba_functional1 == 0) + { rc_num |= data_buffer_64.setBit(17); // mems_fence_dc } else { rc_num |= data_buffer_64.clearBit(17); // mems_fence_dc } - if (rc_num) { + if (rc_num) + { FAPI_ERR( "Error setting up buffers"); rc.setEcmdError(rc_num); break; @@ -401,7 +475,10 @@ extern "C" } while(0); - if(rc) { FAPI_ERR("ERROR: during mss_power_cleanup_mba_fence"); } + if(rc) + { + FAPI_ERR("ERROR: during mss_power_cleanup_mba_fence"); + } return rc; } // end of mss_power_cleanup_mba_fense @@ -414,7 +491,10 @@ extern "C" { FAPI_INF("Starting mss_power_cleanup_centaur"); rc = FAPI_ATTR_GET(ATTR_FUNCTIONAL, &i_target_centaur, centaur_functional); - if(rc) { FAPI_ERR("ERROR: Cannot get ATTR_FUNCTIONAL"); break; } + if(rc) { + FAPI_ERR("ERROR: Cannot get ATTR_FUNCTIONAL"); + break; + } int memon=0; int pervon=0; @@ -425,18 +505,29 @@ extern "C" // this case will only happen if we get memory up and later come back and want to // deconfigure it. The first time, it may not even be up yet. rc = fapiGetScom(i_target_centaur, TP_CLK_STATUS_0x01030008, data_buffer_64); - if(rc) { FAPI_ERR("ERROR: Cannot getScom 0x1030008"); break; } - if(data_buffer_64.getDoubleWord(0) == 0x000007FFFFFFFFFFull) { // pervasive clocks are on + if(rc) + { + FAPI_ERR("ERROR: Cannot getScom 0x1030008"); + break; + } + if(data_buffer_64.getDoubleWord(0) == 0x000007FFFFFFFFFFull) + { // pervasive clocks are on pervon=1; rc = fapiGetScom(i_target_centaur, MEM_CLK_STATUS_0x03030008, data_buffer_64); - if(rc) { FAPI_ERR("ERROR: Cannot getScom 0x3030008"); break; } - if(data_buffer_64.getDoubleWord(0) == 0x0000001FFFFFFFFFull) { + if(rc) + { + FAPI_ERR("ERROR: Cannot getScom 0x3030008"); + break; + } + if(data_buffer_64.getDoubleWord(0) == 0x0000001FFFFFFFFFull) + { memon=1; } } - if(pervon || memon) { + if(pervon || memon) + { bool l_stop_mem_clks=true; bool l_stop_nest_clks=true; bool l_stop_dram_rfrsh_clks=true; diff --git a/src/usr/hwpf/hwp/dram_initialization/mss_power_cleanup/mss_power_cleanup.H b/src/usr/hwpf/hwp/dram_initialization/mss_power_cleanup/mss_power_cleanup.H index 43c5bc492..026671375 100644 --- a/src/usr/hwpf/hwp/dram_initialization/mss_power_cleanup/mss_power_cleanup.H +++ b/src/usr/hwpf/hwp/dram_initialization/mss_power_cleanup/mss_power_cleanup.H @@ -5,7 +5,7 @@ /* */ /* IBM CONFIDENTIAL */ /* */ -/* COPYRIGHT International Business Machines Corp. 2013 */ +/* COPYRIGHT International Business Machines Corp. 2013,2014 */ /* */ /* p1 */ /* */ @@ -20,7 +20,7 @@ /* Origin: 30 */ /* */ /* IBM_PROLOG_END_TAG */ -// $Id: mss_power_cleanup.H,v 1.2 2013/11/14 16:55:43 bellows Exp $ +// $Id: mss_power_cleanup.H,v 1.3 2014/02/19 13:41:35 bellows Exp $ // $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/chips/centaur/working/procedures/ipl/fapi/mss_power_cleanup.H,v $ //------------------------------------------------------------------------------ // *! (C) Copyright International Business Machines Corp. 2012 @@ -42,6 +42,7 @@ //------------------------------------------------------------------------------ // Version:| Author: | Date: | Comment: //---------|----------|---------|----------------------------------------------- +// 1.3 | bellows |19-FEB-14| RAS Review Updates // 1.2 |bellows |11-Nov-13| Gerrit Review Comments // 1.1 |bellows |07-Nov-13| copied from mss_cnfg_cleanup.H version 1.2 //------------------------------------------------------------------------------ @@ -85,6 +86,12 @@ fapi::ReturnCode mss_power_cleanup(const fapi::Target & i_target_centaur, //------------------------------------------------------------------------------ fapi::ReturnCode mss_power_cleanup_mba(const fapi::Target & i_target_mba); // clean up an mba +fapi::ReturnCode mss_power_cleanup_centaur(const fapi::Target & i_target_centaur); +fapi::ReturnCode mss_power_cleanup_mba_part1(const fapi::Target & i_target_centaur, const fapi::Target & i_target_mba); +fapi::ReturnCode mss_power_cleanup_mba_fence(const fapi::Target & i_target_centaur, const fapi::Target & i_target_mba0, const fapi::Target & i_target_mba1 ); + + + } // extern "C" #endif // mss_power_cleanup_H |

