diff options
Diffstat (limited to 'src/import/chips/p9/procedures/hwp/memory/lib')
41 files changed, 91 insertions, 302 deletions
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/bcw_load.H b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/bcw_load.H index 300e8c71c..6c94019f3 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/bcw_load.H +++ b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/bcw_load.H @@ -40,7 +40,7 @@ #include <p9_mc_scom_addresses.H> -#include <c_str.H> +#include <generic/memory/lib/utils/c_str.H> #include <lib/shared/mss_kind.H> namespace mss diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/bcw_load_ddr4.C b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/bcw_load_ddr4.C index 0cc1c2f0d..73521b8d9 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/bcw_load_ddr4.C +++ b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/bcw_load_ddr4.C @@ -36,7 +36,7 @@ #include <fapi2.H> #include <p9_mc_scom_addresses.H> -#include <c_str.H> +#include <generic/memory/lib/utils/c_str.H> #include <lib/utils/conversions.H> #include <lib/eff_config/timing.H> #include <lib/ccs/ccs.H> diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/control_word_ddr4.H b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/control_word_ddr4.H index c17322c05..963c06ced 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/control_word_ddr4.H +++ b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/control_word_ddr4.H @@ -41,7 +41,7 @@ #include <p9_mc_scom_addresses.H> -#include <c_str.H> +#include <generic/memory/lib/utils/c_str.H> #include <lib/ccs/ccs.H> namespace mss diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/data_buffer_ddr4.H b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/data_buffer_ddr4.H index 26b9403dd..445ea8cea 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/data_buffer_ddr4.H +++ b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/data_buffer_ddr4.H @@ -38,7 +38,7 @@ #include <vector> #include <fapi2.H> -#include <c_str.H> +#include <generic/memory/lib/utils/c_str.H> #include <lib/shared/mss_const.H> #include <lib/dimm/bcw_load_ddr4.H> #include <lib/phy/dp16.H> diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/latch_wr_vref.C b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/latch_wr_vref.C index bae1e2a45..d9e553cd5 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/latch_wr_vref.C +++ b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/latch_wr_vref.C @@ -35,7 +35,7 @@ #include <vector> #include <fapi2.H> -#include <c_str.H> +#include <generic/memory/lib/utils/c_str.H> #include <lib/dimm/ddr4/mrs_load_ddr4.H> #include <lib/dimm/ddr4/latch_wr_vref.H> #include <lib/dimm/rank.H> diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/latch_wr_vref.H b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/latch_wr_vref.H index 9533d7e96..fffa45832 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/latch_wr_vref.H +++ b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/latch_wr_vref.H @@ -38,7 +38,7 @@ #include <vector> #include <fapi2.H> -#include <c_str.H> +#include <generic/memory/lib/utils/c_str.H> #include <lib/dimm/mrs_load.H> #include <lib/dimm/ddr4/mrs_load_ddr4.H> #include <lib/eff_config/timing.H> diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/mrs_load_ddr4.H b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/mrs_load_ddr4.H index 55156e898..652f2d388 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/mrs_load_ddr4.H +++ b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/mrs_load_ddr4.H @@ -38,7 +38,7 @@ #include <vector> #include <fapi2.H> -#include <c_str.H> +#include <generic/memory/lib/utils/c_str.H> #include <lib/dimm/mrs_load.H> #include <lib/eff_config/timing.H> diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/state_machine.H b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/state_machine.H index b58f4522e..a3a18b01a 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/state_machine.H +++ b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/state_machine.H @@ -37,7 +37,7 @@ #define _MSS_STATE_MACHINE_H_ #include <fapi2.H> -#include <c_str.H> +#include <generic/memory/lib/utils/c_str.H> #include <lib/utils/checker.H> namespace mss diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/kind.H b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/kind.H index 599ad98aa..0c2f1bcc7 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/kind.H +++ b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/kind.H @@ -39,7 +39,7 @@ #include <fapi2.H> #include <lib/mss_attribute_accessors.H> -#include <c_str.H> +#include <generic/memory/lib/utils/c_str.H> namespace mss { diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/mrs_load.H b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/mrs_load.H index 0bdc1045f..7dbb16708 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/mrs_load.H +++ b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/mrs_load.H @@ -39,7 +39,7 @@ #include <fapi2.H> #include <p9_mc_scom_addresses.H> -#include <c_str.H> +#include <generic/memory/lib/utils/c_str.H> #include <lib/shared/mss_kind.H> #include <lib/ccs/ccs.H> diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/rcd_load.H b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/rcd_load.H index c7c897e61..f572d6389 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/rcd_load.H +++ b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/rcd_load.H @@ -40,7 +40,7 @@ #include <p9_mc_scom_addresses.H> -#include <c_str.H> +#include <generic/memory/lib/utils/c_str.H> #include <lib/shared/mss_kind.H> namespace mss diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/rcd_load_ddr4.H b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/rcd_load_ddr4.H index 4d3e73c2c..6a73da77a 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/rcd_load_ddr4.H +++ b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/rcd_load_ddr4.H @@ -40,7 +40,7 @@ #include <p9_mc_scom_addresses.H> -#include <c_str.H> +#include <generic/memory/lib/utils/c_str.H> namespace mss { diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/mc/port.H b/src/import/chips/p9/procedures/hwp/memory/lib/mc/port.H index 1cfe8cd92..f1a552b98 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/mc/port.H +++ b/src/import/chips/p9/procedures/hwp/memory/lib/mc/port.H @@ -45,7 +45,7 @@ #include <lib/shared/mss_const.H> #include <lib/utils/scom.H> #include <lib/dimm/rank.H> -#include <c_str.H> +#include <generic/memory/lib/utils/c_str.H> #include <lib/mcbist/address.H> namespace mss diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/mc/xlate.H b/src/import/chips/p9/procedures/hwp/memory/lib/mc/xlate.H index b1011d5c8..eee9f974e 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/mc/xlate.H +++ b/src/import/chips/p9/procedures/hwp/memory/lib/mc/xlate.H @@ -43,7 +43,7 @@ #include <lib/shared/mss_const.H> #include <lib/utils/scom.H> -#include <c_str.H> +#include <generic/memory/lib/utils/c_str.H> #include <lib/dimm/kind.H> namespace mss diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/mss.mk b/src/import/chips/p9/procedures/hwp/memory/lib/mss.mk index 04e82c270..2b07ee18c 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/mss.mk +++ b/src/import/chips/p9/procedures/hwp/memory/lib/mss.mk @@ -30,8 +30,8 @@ # Add common and generated parts to object list. MSS_PATH := $(ROOTPATH)/chips/p9/procedures/hwp/memory/lib - MSS_SOURCE := $(shell find $(MSS_PATH) -name '*.C' -exec basename {} \;) + MSS_MODULE_OBJS += $(patsubst %.C,%.o,$(MSS_SOURCE)) MSS_SOURCE_DIRS := $(shell find $(MSS_PATH) -type d) @@ -40,13 +40,13 @@ MSS_SOURCE_DIRS := $(shell find $(MSS_PATH) -type d) define MSS_MODULE_INCLUDES $(foreach dir, $(MSS_SOURCE_DIRS), $(call ADD_MODULE_SRCDIR,$(1),$(dir))) $(call ADD_MODULE_INCDIR,$(1),$(ROOTPATH)/chips/p9/procedures/hwp/memory) -$(call ADD_MODULE_INCDIR,$(1),$(ROOTPATH)/generic/memory) $(call ADD_MODULE_INCDIR,$(1),$(FAPI2_PATH)/include) $(call ADD_MODULE_INCDIR,$(1),$(GENPATH)) -$(call ADD_MODULE_INCDIR,$(1),$(FAPI2_PATH)/include) $(call ADD_MODULE_INCDIR,$(1),$(FAPI2_PLAT_INCLUDE)) +$(call ADD_MODULE_INCDIR,$(1),$(ROOTPATH)) endef MODULE = mss OBJS += $(MSS_MODULE_OBJS) + $(eval $(call MSS_MODULE_INCLUDES,$(MODULE))) $(call BUILD_MODULE) diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/mss_utils.H b/src/import/chips/p9/procedures/hwp/memory/lib/mss_utils.H index fa0180616..574ac532f 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/mss_utils.H +++ b/src/import/chips/p9/procedures/hwp/memory/lib/mss_utils.H @@ -39,6 +39,6 @@ //TK: what is this for? BRS #include <lib/utils/index.H> -#include <c_str.H> +#include <generic/memory/lib/utils/c_str.H> #endif // _MSS_P9_ATTR_UTILS_H_ diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/phy/apb.C b/src/import/chips/p9/procedures/hwp/memory/lib/phy/apb.C index e2d72743f..a7bfb7ba0 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/phy/apb.C +++ b/src/import/chips/p9/procedures/hwp/memory/lib/phy/apb.C @@ -36,7 +36,7 @@ #include <fapi2.H> #include <lib/phy/apb.H> #include <lib/utils/scom.H> -#include <c_str.H> +#include <generic/memory/lib/utils/c_str.H> #include <lib/utils/index.H> namespace mss diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/phy/dp16.C b/src/import/chips/p9/procedures/hwp/memory/lib/phy/dp16.C index c6beb6e30..9bebfa31e 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/phy/dp16.C +++ b/src/import/chips/p9/procedures/hwp/memory/lib/phy/dp16.C @@ -48,8 +48,8 @@ #include <lib/utils/bit_count.H> #include <lib/dimm/rank.H> #include <lib/utils/scom.H> -#include <lib/utils/pos.H> -#include <c_str.H> +#include <generic/memory/lib/utils/pos.H> +#include <generic/memory/lib/utils/c_str.H> #include <lib/workarounds/dp16_workarounds.H> diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/phy/phy_cntrl.C b/src/import/chips/p9/procedures/hwp/memory/lib/phy/phy_cntrl.C index 8f9e0e05f..fa1803076 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/phy/phy_cntrl.C +++ b/src/import/chips/p9/procedures/hwp/memory/lib/phy/phy_cntrl.C @@ -36,7 +36,7 @@ #include <fapi2.H> #include <lib/phy/phy_cntrl.H> #include <lib/utils/scom.H> -#include <c_str.H> +#include <generic/memory/lib/utils/c_str.H> #include <lib/utils/index.H> #include <lib/mss_attribute_accessors.H> diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/phy/seq.C b/src/import/chips/p9/procedures/hwp/memory/lib/phy/seq.C index 7c866a182..d73a0e5e3 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/phy/seq.C +++ b/src/import/chips/p9/procedures/hwp/memory/lib/phy/seq.C @@ -36,7 +36,7 @@ #include <fapi2.H> #include <lib/phy/seq.H> #include <lib/utils/scom.H> -#include <c_str.H> +#include <generic/memory/lib/utils/c_str.H> #include <lib/utils/bit_count.H> #include <lib/eff_config/timing.H> diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/decoder.C b/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/decoder.C index 0db5ab057..802c73255 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/decoder.C +++ b/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/decoder.C @@ -42,7 +42,7 @@ #include <lib/power_thermal/throttle.H> #include <lib/power_thermal/decoder.H> #include <lib/utils/find.H> -#include <c_str.H> +#include <generic/memory/lib/utils/c_str.H> #include <lib/utils/count_dimm.H> #include <lib/dimm/kind.H> diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/spd/common/spd_decoder.C b/src/import/chips/p9/procedures/hwp/memory/lib/spd/common/spd_decoder.C index 9e195dd3f..603ab19ca 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/spd/common/spd_decoder.C +++ b/src/import/chips/p9/procedures/hwp/memory/lib/spd/common/spd_decoder.C @@ -44,7 +44,7 @@ #include <lib/spd/rdimm/rdimm_decoder.H> #include <lib/spd/common/rcw_settings.H> #include <lib/utils/checker.H> -#include <c_str.H> +#include <generic/memory/lib/utils/c_str.H> #include <lib/utils/find.H> using fapi2::TARGET_TYPE_MCA; diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/spd/common/spd_decoder.H b/src/import/chips/p9/procedures/hwp/memory/lib/spd/common/spd_decoder.H index 783df06e9..187a43a71 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/spd/common/spd_decoder.H +++ b/src/import/chips/p9/procedures/hwp/memory/lib/spd/common/spd_decoder.H @@ -49,7 +49,7 @@ #include <lib/spd/common/rcw_settings.H> #include <lib/spd/rdimm/rdimm_decoder.H> #include <lib/spd/lrdimm/lrdimm_decoder.H> -#include <c_str.H> +#include <generic/memory/lib/utils/c_str.H> namespace mss { diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/spd/common/spd_decoder_v1_1.C b/src/import/chips/p9/procedures/hwp/memory/lib/spd/common/spd_decoder_v1_1.C index 60913ebe1..4cc43c5d3 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/spd/common/spd_decoder_v1_1.C +++ b/src/import/chips/p9/procedures/hwp/memory/lib/spd/common/spd_decoder_v1_1.C @@ -38,7 +38,7 @@ // mss lib #include <lib/spd/common/spd_decoder.H> #include <lib/utils/checker.H> -#include <c_str.H> +#include <generic/memory/lib/utils/c_str.H> #include <lib/utils/conversions.H> #include <lib/utils/find.H> diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/spd/lrdimm/lrdimm_decoder_v1_0.C b/src/import/chips/p9/procedures/hwp/memory/lib/spd/lrdimm/lrdimm_decoder_v1_0.C index f8fc68e2c..403837ece 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/spd/lrdimm/lrdimm_decoder_v1_0.C +++ b/src/import/chips/p9/procedures/hwp/memory/lib/spd/lrdimm/lrdimm_decoder_v1_0.C @@ -43,7 +43,7 @@ #include <lib/spd/lrdimm/lrdimm_decoder.H> #include <lib/spd/common/spd_decoder.H> #include <lib/utils/checker.H> -#include <c_str.H> +#include <generic/memory/lib/utils/c_str.H> #include <lib/utils/find.H> using fapi2::TARGET_TYPE_MCA; diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/spd/lrdimm/lrdimm_decoder_v1_1.C b/src/import/chips/p9/procedures/hwp/memory/lib/spd/lrdimm/lrdimm_decoder_v1_1.C index c2b38bd7a..56765ec0c 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/spd/lrdimm/lrdimm_decoder_v1_1.C +++ b/src/import/chips/p9/procedures/hwp/memory/lib/spd/lrdimm/lrdimm_decoder_v1_1.C @@ -43,7 +43,7 @@ #include <lib/spd/lrdimm/lrdimm_decoder.H> #include <lib/spd/common/spd_decoder.H> #include <lib/utils/checker.H> -#include <c_str.H> +#include <generic/memory/lib/utils/c_str.H> #include <lib/utils/find.H> using fapi2::TARGET_TYPE_MCA; diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/spd/lrdimm/lrdimm_decoder_v1_2.C b/src/import/chips/p9/procedures/hwp/memory/lib/spd/lrdimm/lrdimm_decoder_v1_2.C index 9d4aa7cc9..6c9a02d52 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/spd/lrdimm/lrdimm_decoder_v1_2.C +++ b/src/import/chips/p9/procedures/hwp/memory/lib/spd/lrdimm/lrdimm_decoder_v1_2.C @@ -43,7 +43,7 @@ #include <lib/spd/lrdimm/lrdimm_decoder.H> #include <lib/spd/common/spd_decoder.H> #include <lib/utils/checker.H> -#include <c_str.H> +#include <generic/memory/lib/utils/c_str.H> #include <lib/utils/find.H> using fapi2::TARGET_TYPE_MCA; diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/spd/rdimm/rdimm_decoder_v1_0.C b/src/import/chips/p9/procedures/hwp/memory/lib/spd/rdimm/rdimm_decoder_v1_0.C index 4590a30c3..5324f456c 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/spd/rdimm/rdimm_decoder_v1_0.C +++ b/src/import/chips/p9/procedures/hwp/memory/lib/spd/rdimm/rdimm_decoder_v1_0.C @@ -42,7 +42,7 @@ #include <lib/spd/rdimm/rdimm_decoder.H> #include <lib/spd/common/spd_decoder.H> #include <lib/utils/checker.H> -#include <c_str.H> +#include <generic/memory/lib/utils/c_str.H> #include <lib/utils/find.H> using fapi2::TARGET_TYPE_MCBIST; diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/spd/rdimm/rdimm_decoder_v1_1.C b/src/import/chips/p9/procedures/hwp/memory/lib/spd/rdimm/rdimm_decoder_v1_1.C index 3c0802403..4a6a2dc14 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/spd/rdimm/rdimm_decoder_v1_1.C +++ b/src/import/chips/p9/procedures/hwp/memory/lib/spd/rdimm/rdimm_decoder_v1_1.C @@ -33,7 +33,7 @@ #include <lib/spd/rdimm/rdimm_decoder.H> #include <lib/spd/common/spd_decoder.H> #include <lib/utils/checker.H> -#include <c_str.H> +#include <generic/memory/lib/utils/c_str.H> #include <lib/utils/find.H> using fapi2::TARGET_TYPE_MCBIST; diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/spd/spd_factory.C b/src/import/chips/p9/procedures/hwp/memory/lib/spd/spd_factory.C index 77a1d6a29..48cb91e8a 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/spd/spd_factory.C +++ b/src/import/chips/p9/procedures/hwp/memory/lib/spd/spd_factory.C @@ -47,7 +47,7 @@ #include <lib/spd/rdimm/rdimm_raw_cards.H> #include <lib/spd/lrdimm/lrdimm_raw_cards.H> #include <lib/utils/checker.H> -#include <c_str.H> +#include <generic/memory/lib/utils/c_str.H> #include <lib/utils/conversions.H> #include <lib/utils/find.H> diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/utils/c_str.C b/src/import/chips/p9/procedures/hwp/memory/lib/utils/c_str.C index 02ea7c1f9..7db26186a 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/utils/c_str.C +++ b/src/import/chips/p9/procedures/hwp/memory/lib/utils/c_str.C @@ -35,7 +35,7 @@ #include <fapi2.H> #include <lib/mss_attribute_accessors.H> -#include <c_str.H> +#include <generic/memory/lib/utils/c_str.H> using fapi2::TARGET_TYPE_MCBIST; using fapi2::TARGET_TYPE_MCA; diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/utils/count_dimm.H b/src/import/chips/p9/procedures/hwp/memory/lib/utils/count_dimm.H index 293f1eeac..7f75f9df1 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/utils/count_dimm.H +++ b/src/import/chips/p9/procedures/hwp/memory/lib/utils/count_dimm.H @@ -38,7 +38,7 @@ #include <fapi2.H> #include <lib/utils/find.H> -#include <c_str.H> +#include <generic/memory/lib/utils/c_str.H> namespace mss { diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/utils/fake_vpd.C b/src/import/chips/p9/procedures/hwp/memory/lib/utils/fake_vpd.C index 09d71a081..7f6e51222 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/utils/fake_vpd.C +++ b/src/import/chips/p9/procedures/hwp/memory/lib/utils/fake_vpd.C @@ -35,7 +35,7 @@ #include <mss.H> #include <lib/utils/fake_vpd.H> #include <lib/shared/mss_const.H> -#include <lib/utils/pos.H> +#include <generic/memory/lib/utils/pos.H> #ifndef DOXYGEN diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/utils/find.H b/src/import/chips/p9/procedures/hwp/memory/lib/utils/find.H index d5b7a23d1..8d0e4433e 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/utils/find.H +++ b/src/import/chips/p9/procedures/hwp/memory/lib/utils/find.H @@ -39,8 +39,8 @@ #include <fapi2.H> #include <vector> -#include <lib/utils/pos.H> -#include <c_str.H> +#include <generic/memory/lib/utils/pos.H> +#include <generic/memory/lib/utils/c_str.H> namespace mss { diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/utils/index.H b/src/import/chips/p9/procedures/hwp/memory/lib/utils/index.H index ea7569978..1e391d13a 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/utils/index.H +++ b/src/import/chips/p9/procedures/hwp/memory/lib/utils/index.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2016 */ +/* Contributors Listed Below - COPYRIGHT 2015,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -38,7 +38,7 @@ #include <fapi2.H> -#include <lib/utils/pos.H> +#include <generic/memory/lib/utils/pos.H> #include <lib/shared/mss_const.H> namespace mss diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/utils/mss_pair.H b/src/import/chips/p9/procedures/hwp/memory/lib/utils/mss_pair.H index 0a43ca394..8e3a19bea 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/utils/mss_pair.H +++ b/src/import/chips/p9/procedures/hwp/memory/lib/utils/mss_pair.H @@ -39,7 +39,7 @@ #include <fapi2.H> #include <lib/utils/find.H> -#include <c_str.H> +#include <generic/memory/lib/utils/c_str.H> namespace mss { diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/utils/pos.C b/src/import/chips/p9/procedures/hwp/memory/lib/utils/pos.C index 117f4d913..238f22bfe 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/utils/pos.C +++ b/src/import/chips/p9/procedures/hwp/memory/lib/utils/pos.C @@ -22,3 +22,50 @@ /* permissions and limitations under the License. */ /* */ /* IBM_PROLOG_END_TAG */ + +#include <fapi2.H> +#include <generic/memory/lib/utils/pos.H> + +namespace mss +{ + +/// +/// @brief Return a DIMM's position from a fapi2 target +/// @param[in] i_target a target representing the target in question +/// @return The position relative to the chip +/// +template<> +posTraits<fapi2::TARGET_TYPE_DIMM>::pos_type +pos(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target) +{ + typedef posTraits<fapi2::TARGET_TYPE_DIMM> TT; + + // Proc 0 is DIMM 0-15, proc 2 is 64-79 - 64 is the stride between processors + constexpr uint64_t DIMM_STRIDE_PER_PROC = 64; + constexpr uint64_t TOTAL_DIMM = TT::MC_PER_MODULE * TT::MCS_PER_MC * TT::PORTS_PER_MCS * TT::DIMMS_PER_PORT; + + TT::pos_type l_pos = 0; + + // Using fapi2 rather than mss::find as this is pretty low level stuff. + const auto l_proc_pos = + mss::template pos(i_target.getParent<fapi2::TARGET_TYPE_MCA>().getParent<fapi2::TARGET_TYPE_PROC_CHIP>()); + + if (FAPI_ATTR_GET(fapi2::ATTR_FAPI_POS, i_target, l_pos) != fapi2::FAPI2_RC_SUCCESS) + { + goto fapi_try_exit; + } + + // To get the FAPI_POS to the equivilent of ATTR_POS, we need to normalize the fapi_pos value + // to the processor (stride across which ever processor we're on) and then add in the delta + // per processor as ATTR_POS isn't processor relative (delta is the total dimm on a processor) + return ((l_pos - (l_proc_pos * DIMM_STRIDE_PER_PROC)) % TOTAL_DIMM) + (TOTAL_DIMM * l_proc_pos); + +fapi_try_exit: + // If we can't get our position, we're in other trouble + FAPI_ERR("can't get our fapi position"); + fapi2::Assert(false); + return 0; + +} + +}// mss diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/utils/pos.H b/src/import/chips/p9/procedures/hwp/memory/lib/utils/pos.H deleted file mode 100644 index f0afbd85f..000000000 --- a/src/import/chips/p9/procedures/hwp/memory/lib/utils/pos.H +++ /dev/null @@ -1,258 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/import/chips/p9/procedures/hwp/memory/lib/utils/pos.H $ */ -/* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* Contributors Listed Below - COPYRIGHT 2015,2017 */ -/* [+] International Business Machines Corp. */ -/* */ -/* */ -/* Licensed under the Apache License, Version 2.0 (the "License"); */ -/* you may not use this file except in compliance with the License. */ -/* You may obtain a copy of the License at */ -/* */ -/* http://www.apache.org/licenses/LICENSE-2.0 */ -/* */ -/* Unless required by applicable law or agreed to in writing, software */ -/* distributed under the License is distributed on an "AS IS" BASIS, */ -/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ -/* implied. See the License for the specific language governing */ -/* permissions and limitations under the License. */ -/* */ -/* IBM_PROLOG_END_TAG */ - -/// -/// @file pos.H -/// @brief Tools to return target's position from a fapi2 target -/// -// *HWP HWP Owner: Brian Silver <bsilver@us.ibm.com> -// *HWP HWP Backup: Andre Marin <aamarin@us.ibm.com> -// *HWP Team: Memory -// *HWP Level: 2 -// *HWP Consumed by: HB:FSP - -#ifndef _MSS_POS_H_ -#define _MSS_POS_H_ - -#include <fapi2.H> -#include <lib/shared/mss_const.H> - -namespace mss -{ - -/// -/// @brief Trait classes for the mss::pos functions -/// -template<fapi2::TargetType T> -class posTraits -{ - public: - // Needed as some targets have chip_unit_pos attributes, - // uint8_t and some attr_pos, uint32_t. We don't really care - // but the type checking in the macros sure does ... - typedef uint8_t pos_type; -}; - -/// -/// @brief DIMM Trait class for the mss::pos functions -/// -template<> -class posTraits<fapi2::TARGET_TYPE_DIMM> -{ - public: - typedef uint32_t pos_type; -}; - -/// -/// @brief Processor Trait class for the mss::pos functions -/// -template<> -class posTraits<fapi2::TARGET_TYPE_PROC_CHIP> -{ - public: - typedef uint32_t pos_type; -}; - -/// -/// @brief Return a target's position from a fapi2 target -/// @tparam T the fapi2::TargetType -/// @param[in] i_target a target representing the target in question -/// @return The position relative to the chip -/// -template< fapi2::TargetType T, typename TT = posTraits<T> > -inline typename TT::pos_type pos(const fapi2::Target<T>& i_target) -{ - typename TT::pos_type l_pos = 0; - - // Don't use FAPI_TRY as you'll mess up fapi2::current_err which - // lmits where this can be used. - if (FAPI_ATTR_GET(fapi2::ATTR_CHIP_UNIT_POS, i_target, l_pos) != fapi2::FAPI2_RC_SUCCESS) - { - goto fapi_try_exit; - } - - return l_pos; - -fapi_try_exit: - // If we can't get our unit position, we're in other trouble - FAPI_ERR("can't get our chip unit position"); - fapi2::Assert(false); - return 0; -} - -/// -/// @brief Return a processor's position from a fapi2 target -/// @param[in] i_target a target representing the target in question -/// @return The position relative to the chip -/// -template<> -inline posTraits<fapi2::TARGET_TYPE_PROC_CHIP>::pos_type pos( - const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target) -{ - posTraits<fapi2::TARGET_TYPE_PROC_CHIP>::pos_type l_pos = 0; - - if (FAPI_ATTR_GET(fapi2::ATTR_POS, i_target, l_pos) != fapi2::FAPI2_RC_SUCCESS) - { - goto fapi_try_exit; - } - - return l_pos; - -fapi_try_exit: - // If we can't get our position, we're in other trouble - FAPI_ERR("can't get our position"); - fapi2::Assert(false); - return 0; - -} - -/// -/// @brief Return a DIMM's position from a fapi2 target -/// @param[in] i_target a target representing the target in question -/// @return The position relative to the chip -/// -template<> -inline posTraits<fapi2::TARGET_TYPE_DIMM>::pos_type pos(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target) -{ - // Proc 0 is DIMM 0-15, proc 2 is 64-79 - 64 is the stride between processors - constexpr uint64_t DIMM_STRIDE_PER_PROC = 64; - constexpr uint64_t TOTAL_DIMM = MC_PER_MODULE * MCS_PER_MC * PORTS_PER_MCS * MAX_DIMM_PER_PORT; - - posTraits<fapi2::TARGET_TYPE_DIMM>::pos_type l_pos = 0; - - // Using fapi2 rather than mss::find as this is pretty low level stuff. - const auto l_proc_pos = - mss::template pos(i_target.getParent<fapi2::TARGET_TYPE_MCA>().getParent<fapi2::TARGET_TYPE_PROC_CHIP>()); - - if (FAPI_ATTR_GET(fapi2::ATTR_FAPI_POS, i_target, l_pos) != fapi2::FAPI2_RC_SUCCESS) - { - goto fapi_try_exit; - } - - // To get the FAPI_POS to the equivilent of ATTR_POS, we need to normalize the fapi_pos value - // to the processor (stride across which ever processor we're on) and then add in the delta - // per processor as ATTR_POS isn't processor relative (delta is the total dimm on a processor) - return ((l_pos - (l_proc_pos * DIMM_STRIDE_PER_PROC)) % TOTAL_DIMM) + (TOTAL_DIMM * l_proc_pos); - -fapi_try_exit: - // If we can't get our position, we're in other trouble - FAPI_ERR("can't get our fapi position"); - fapi2::Assert(false); - return 0; - -} - -/// -/// @brief Return a target's relative position from a fapi2 target -/// @tparam T the fapi2::TargetType -/// @tparam R the fapi2::TargetType we want the position relative to -/// @param[in] i_target a target representing the target in question -/// @return The position relative to chiplet R -/// -template< fapi2::TargetType R, fapi2::TargetType T, typename TT = posTraits<T> > -inline typename TT::pos_type relative_pos(const fapi2::Target<T>& i_target); - -/// -/// @brief Return a MCA's relative position from an MCBIST -/// @param[in] i_target a target representing the target in question -/// @return The position relative to chiplet R -/// -template<> -inline posTraits<fapi2::TARGET_TYPE_MCA>::pos_type -relative_pos<fapi2::TARGET_TYPE_MCBIST>(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target) -{ - return pos(i_target) % PORTS_PER_MCBIST; -} - -/// -/// @brief Return a DIMM's relative position from an MCS -/// @param[in] i_target a target representing the target in question -/// @return The position relative to chiplet R -/// -template<> -inline posTraits<fapi2::TARGET_TYPE_DIMM>::pos_type -relative_pos<fapi2::TARGET_TYPE_MCS>(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target) -{ - constexpr uint64_t MAX_DIMM_PER_MCS = PORTS_PER_MCS * MAX_DIMM_PER_PORT; - return pos(i_target) % MAX_DIMM_PER_MCS; -} - -/// -/// @brief Return an MCS's relative position from a processor -/// @param[in] i_target a target representing the target in question -/// @return The position relative to chiplet R -/// -template<> -inline posTraits<fapi2::TARGET_TYPE_MCS>::pos_type -relative_pos<fapi2::TARGET_TYPE_PROC_CHIP>(const fapi2::Target<fapi2::TARGET_TYPE_MCS>& i_target) -{ - constexpr uint64_t MCS_PER_PROC = MC_PER_MODULE * MCS_PER_MC; - return pos(i_target) % MCS_PER_PROC; -} - -/// -/// @brief Return an MCA's relative position from an MCS -/// @param[in] i_target a target representing the target in question -/// @return The position relative to chiplet R -/// -template<> -inline posTraits<fapi2::TARGET_TYPE_MCA>::pos_type -relative_pos<fapi2::TARGET_TYPE_MCS>(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target) -{ - return pos(i_target) % PORTS_PER_MCS; -} - - - -/// -/// @brief Return a target's fapi position from a fapi2 target -/// @tparam T the fapi2::TargetType -/// @param[in] i_target a target representing the target in question -/// @return The position relative to the system -/// -template< fapi2::TargetType T, typename TT = posTraits<T> > -inline uint32_t fapi_pos(const fapi2::Target<T>& i_target) -{ - uint32_t l_pos = 0; - - // Don't use FAPI_TRY as you'll mess up fapi2::current_err which - // lmits where this can be used. - if (FAPI_ATTR_GET(fapi2::ATTR_FAPI_POS, i_target, l_pos) != fapi2::FAPI2_RC_SUCCESS) - { - goto fapi_try_exit; - } - - return l_pos; - -fapi_try_exit: - // If we can't get our fapi position, we're in other trouble - FAPI_ERR("can't get our fapi position"); - fapi2::Assert(false); - return 0; -} - - -} -#endif diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/utils/scom.H b/src/import/chips/p9/procedures/hwp/memory/lib/utils/scom.H index 69099eacb..40ab76dc8 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/utils/scom.H +++ b/src/import/chips/p9/procedures/hwp/memory/lib/utils/scom.H @@ -37,7 +37,7 @@ #define _MSS_SCOM_H_ #include <fapi2.H> -#include <c_str.H> +#include <generic/memory/lib/utils/c_str.H> // // Wrapping scom operations: We wrap fapi2::get/putScom for two reasons. The diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/dp16_workarounds.C b/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/dp16_workarounds.C index 1c8d2f767..94cf845b8 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/dp16_workarounds.C +++ b/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/dp16_workarounds.C @@ -40,7 +40,7 @@ #include <p9_mc_scom_addresses_fld.H> #include <lib/utils/scom.H> -#include <lib/utils/pos.H> +#include <generic/memory/lib/utils/pos.H> #include <lib/workarounds/dp16_workarounds.H> #include <lib/phy/dp16.H> #include <lib/dimm/rank.H> diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/mcbist_workarounds.C b/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/mcbist_workarounds.C index 81cd342ed..f0433065d 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/mcbist_workarounds.C +++ b/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/mcbist_workarounds.C @@ -41,7 +41,7 @@ #include <lib/mss_attribute_accessors.H> #include <lib/utils/scom.H> -#include <lib/utils/pos.H> +#include <generic/memory/lib/utils/pos.H> #include <lib/dimm/kind.H> #include <lib/workarounds/mcbist_workarounds.H> #include <lib/mcbist/mcbist.H> |