From 18527d404f0f7487b8ac06f64a8d48e1523a39b0 Mon Sep 17 00:00:00 2001 From: Alvin Wang Date: Mon, 1 Apr 2019 04:53:40 -0500 Subject: Move the mcbist lab library to generic folder Change-Id: I8fd2d1d1c48e08d4f34aecde34803a9126ac6b4d Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/75283 Tested-by: Jenkins Server Tested-by: FSP CI Jenkins Tested-by: HWSV CI Tested-by: Hostboot CI Reviewed-by: STEPHEN GLANCY Reviewed-by: Louis Stermole Reviewed-by: Jennifer A. Stofer Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/75292 Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Reviewed-by: Daniel M. Crowell --- .../generic/memory/lib/utils/mcbist/gen_settings.H | 1 + .../memory/lib/utils/power_thermal/gen_throttle.H | 18 ++++---- .../memory/lib/utils/shared/mss_generic_consts.H | 48 ++++++++++++++++++++++ 3 files changed, 56 insertions(+), 11 deletions(-) (limited to 'src/import/generic/memory') diff --git a/src/import/generic/memory/lib/utils/mcbist/gen_settings.H b/src/import/generic/memory/lib/utils/mcbist/gen_settings.H index afd306dfb..9c4392d0b 100644 --- a/src/import/generic/memory/lib/utils/mcbist/gen_settings.H +++ b/src/import/generic/memory/lib/utils/mcbist/gen_settings.H @@ -42,6 +42,7 @@ #include #include #include +#include namespace mss { diff --git a/src/import/generic/memory/lib/utils/power_thermal/gen_throttle.H b/src/import/generic/memory/lib/utils/power_thermal/gen_throttle.H index d90c6bb01..eb0533916 100644 --- a/src/import/generic/memory/lib/utils/power_thermal/gen_throttle.H +++ b/src/import/generic/memory/lib/utils/power_thermal/gen_throttle.H @@ -214,11 +214,10 @@ fapi2::ReturnCode update_runtime_throttle(const fapi2::Target& i_target) l_run_port = (l_calc_port != 0) ? std::min(l_run_port, l_calc_port) : l_run_port; - FAPI_INF("New runtime throttles for %s for slot are %d, port are %d for %s", + FAPI_INF("New runtime throttles for %s for slot are %d, port are %d", mss::c_str(l_port), l_run_slot, - l_run_port, - mss::c_str(l_port)); + l_run_port); FAPI_TRY( mss::attr::set_runtime_mem_throttled_n_commands_per_port(l_port, l_run_port) ); FAPI_TRY( mss::attr::set_runtime_mem_throttled_n_commands_per_slot(l_port, l_run_slot) ); @@ -492,14 +491,13 @@ throttle::throttle( const fapi2::Target& i_port, f iv_port_power_limit += l_dimm_limit; } - FAPI_INF("Setting up throttle for target %s, Values are: max databus is %d, uplifts are %d %d, runtime throttles are %d %d for %s", + FAPI_INF("Setting up throttle for target %s, Values are: max databus is %d, uplifts are %d %d, runtime throttles are %d %d", mss::c_str(iv_target), iv_databus_port_max, iv_power_uplift, iv_power_uplift_idle, iv_runtime_n_slot, - iv_runtime_n_port, - mss::c_str(iv_target)); + iv_runtime_n_port); FAPI_INF("The dimm power limit is %d, dram clocks are %d, dimm power curve slopes are %d %d for %s", iv_port_power_limit, @@ -684,8 +682,7 @@ fapi2::ReturnCode throttle::thermal_throttles () iv_dimm_thermal_limit[l_pos], l_calc_util[l_pos]); - FAPI_INF("THERMAL throttles: %s dram databus utilization is %f for %s", mss::c_str(l_dimm), l_calc_util[l_pos], - mss::c_str(l_dimm)); + FAPI_INF("THERMAL throttles: %s dram databus utilization is %f", mss::c_str(l_dimm), l_calc_util[l_pos]); l_temp_n_slot = power_thermal::throttled_cmds (l_calc_util[l_pos], iv_m_clocks); @@ -1045,13 +1042,12 @@ fapi2::ReturnCode throttle::calc_split_util( o_util_dimm_max[(!l_high_pos)] = (l_count_dimms == TT::DIMMS_PER_PORT) ? (i_util_port - o_util_dimm_max[l_high_pos]) : 0; - FAPI_INF("Split utilization for target %s, DIMM in %d gets %f, DIMM in %d gets %f for %s", + FAPI_INF("Split utilization for target %s, DIMM in %d gets %f, DIMM in %d gets %f", mss::c_str(iv_target), l_high_pos, o_util_dimm_max[l_high_pos], !l_high_pos, - o_util_dimm_max[!l_high_pos], - mss::c_str(iv_target)); + o_util_dimm_max[!l_high_pos]); } else { diff --git a/src/import/generic/memory/lib/utils/shared/mss_generic_consts.H b/src/import/generic/memory/lib/utils/shared/mss_generic_consts.H index 6fcd73070..50b9063ff 100644 --- a/src/import/generic/memory/lib/utils/shared/mss_generic_consts.H +++ b/src/import/generic/memory/lib/utils/shared/mss_generic_consts.H @@ -76,6 +76,15 @@ enum mcbist_common_consts BG_SCRUB_IN_HOURS = 12, CMD_TIMEBASE = 8192, ///< Represents the timebase multiplier for the MCBIST inter cmd gap MAX_CMD_GAP = 4095, ///< Represents the maximum (non-multplied) time for MCBIST inter cmd gap + + + // MCBIST polling constant for actual HW + // The specific value here is not important, only that it is very large to avoid polling timeouts, + // but not to avoid any actual hardware timeouts + // Note: ~0 is not used as that would cause MCBIST to never timeout even if the hardware is in an infinite loop + // You can't get greater than ~0, so you'd never timeout + // TODO RTC:166340 - Clean up MCBIST polling + OVERLY_LARGE_NUMBER_OF_POLLS = 5000000000000, }; /// @@ -281,6 +290,45 @@ enum states NO_CHIP_SELECT_ACTIVE = 0xFF, }; + +enum port_select +{ + // Port selects for MCBIST and CCS + // Select for 1 port + PORT0 = 0b1000, + PORT1 = 0b0100, + PORT2 = 0b0010, + PORT3 = 0b0001, + // Selects for 2 port combinations + PORT01 = PORT0 | PORT1, + PORT02 = PORT0 | PORT2, + PORT03 = PORT0 | PORT3, + PORT12 = PORT1 | PORT2, + PORT13 = PORT1 | PORT3, + PORT23 = PORT2 | PORT3, + // Selects for 3 port combinations + PORT012 = PORT0 | PORT1 | PORT2, + PORT013 = PORT0 | PORT1 | PORT3, + PORT023 = PORT0 | PORT2 | PORT3, + PORT123 = PORT1 | PORT2 | PORT3, + // Select all + PORT0123 = PORT0 | PORT1 | PORT2 | PORT3, + // Maybe a better name for disabling all + PORT_NONE = 0b0000, +}; + +enum dimm_select +{ + // Dimm selects for MCBIST and CCS + // Select for 1 dimm + DIMM0 = 0b10, + DIMM1 = 0b01, + // Selects for 2 dimm combinations + DIMM01 = DIMM0 | DIMM1, + // Maybe a better name for disabling all + DIMM_NONE = 0b00, +}; + namespace mcbist { -- cgit v1.2.1