summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMark Pizzutillo <Mark.Pizzutillo@ibm.com>2019-04-29 16:15:40 -0400
committerDaniel M. Crowell <dcrowell@us.ibm.com>2019-05-08 14:53:07 -0500
commitdc855079f5226e4890a3ccc323e11b7614e6479a (patch)
tree5f8df750d8ddcf2d5362ba8e22b2433cf69bc6ea /src
parent8b15178b06799698b5cd18348096563256241e61 (diff)
downloadtalos-hostboot-dc855079f5226e4890a3ccc323e11b7614e6479a.tar.gz
talos-hostboot-dc855079f5226e4890a3ccc323e11b7614e6479a.zip
Add L1 PMIC procedures
Change-Id: Ic577d07244580941c62e4405b79c69443f20a69e Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/76745 Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: HWSV CI <hwsv-ci+hostboot@us.ibm.com> Reviewed-by: Louis Stermole <stermole@us.ibm.com> Reviewed-by: STEPHEN GLANCY <sglancy@us.ibm.com> Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com> Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com> Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/76869 Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r--src/import/chips/ocmb/common/procedures/hwp/pmic/00pmic_common.mk15
-rw-r--r--src/import/chips/ocmb/common/procedures/hwp/pmic/lib/mss_pmic.mk25
-rw-r--r--src/import/chips/ocmb/common/procedures/hwp/pmic/lib/utils/pmic_bias_utils.H49
-rw-r--r--src/import/chips/ocmb/common/procedures/hwp/pmic/lib/utils/pmic_enable_utils.H34
-rw-r--r--src/import/chips/ocmb/common/procedures/hwp/pmic/pmic_bias.C36
-rw-r--r--src/import/chips/ocmb/common/procedures/hwp/pmic/pmic_bias.H42
-rw-r--r--src/import/chips/ocmb/common/procedures/hwp/pmic/pmic_bias.mk6
-rw-r--r--src/import/chips/ocmb/common/procedures/hwp/pmic/pmic_enable.C30
-rw-r--r--src/import/chips/ocmb/common/procedures/hwp/pmic/pmic_enable.H32
-rw-r--r--src/import/chips/ocmb/common/procedures/hwp/pmic/pmic_enable.mk6
-rw-r--r--src/import/hwpf/fapi2/xml/attribute_info/common_attributes.xml2
11 files changed, 276 insertions, 1 deletions
diff --git a/src/import/chips/ocmb/common/procedures/hwp/pmic/00pmic_common.mk b/src/import/chips/ocmb/common/procedures/hwp/pmic/00pmic_common.mk
index f23dcda20..45aa96761 100644
--- a/src/import/chips/ocmb/common/procedures/hwp/pmic/00pmic_common.mk
+++ b/src/import/chips/ocmb/common/procedures/hwp/pmic/00pmic_common.mk
@@ -22,3 +22,18 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
+
+MSS_PMIC_INCLUDES := $(GENPATH)
+MSS_PMIC_INCLUDES += $(ROOTPATH)
+MSS_PMIC_INCLUDES += $(ROOTPATH)/chips/ocmb/common/include
+MSS_PMIC_INCLUDES += $(ROOTPATH)/chips/ocmb/common/procedures/hwp/pmic/lib
+MSS_PMIC_INCLUDES += $(ROOTPATH)/chips/ocmb/common/procedures/hwp/pmic
+
+# For generic attribute accessors
+MSS_PMIC_INCLUDES += $(ROOTPATH)/generic/memory/lib
+
+CATCH_UNIT_TESTS_INCLUDES := $(ROOTPATH)/hwpf/fapi2/test
+
+# ADD_PMIC_MEMORY_INCDIRS
+# This macro will add additional include paths for all memory modules
+ADD_PMIC_MEMORY_INCDIRS = $(call __ADD_MODULE_INCDIR,$(1),$(MSS_PMIC_INCLUDES))
diff --git a/src/import/chips/ocmb/common/procedures/hwp/pmic/lib/mss_pmic.mk b/src/import/chips/ocmb/common/procedures/hwp/pmic/lib/mss_pmic.mk
index 8b56d7557..fece37d40 100644
--- a/src/import/chips/ocmb/common/procedures/hwp/pmic/lib/mss_pmic.mk
+++ b/src/import/chips/ocmb/common/procedures/hwp/pmic/lib/mss_pmic.mk
@@ -22,3 +22,28 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
+
+MSS_PMIC_PATH := $(ROOTPATH)/chips/ocmb/common/procedures/hwp/pmic/lib
+
+MSS_PMIC_SOURCE := $(shell find $(MSS_PMIC_PATH) -name '*.C' -exec basename {} \;)
+
+MSS_PMIC_MODULE_OBJS += $(patsubst %.C,%.o,$(MSS_PMIC_SOURCE))
+
+MSS_PMIC_SOURCE_DIRS := $(shell find $(MSS_PMIC_PATH) -type d)
+
+# Define common source and include paths.
+define MSS_PMIC_MODULE_INCLUDES
+$(foreach dir, $(MSS_PMIC_SOURCE_DIRS), $(call ADD_MODULE_SRCDIR,$(1),$(dir)))
+$(call ADD_MODULE_INCDIR,$(1),$(ROOTPATH)/chips/ocmb/common/procedures/hwp/pmic)
+$(call ADD_MODULE_INCDIR,$(1),$(ROOTPATH)/chips/ocmb/common/procedures/hwp/pmic/lib)
+$(call ADD_MODULE_INCDIR,$(1),$(ROOTPATH)/generic/memory/lib)
+$(call ADD_MODULE_INCDIR,$(1),$(FAPI2_PATH)/include)
+$(call ADD_MODULE_INCDIR,$(1),$(GENPATH))
+$(call ADD_MODULE_INCDIR,$(1),$(FAPI2_PLAT_INCLUDE))
+$(call ADD_MODULE_INCDIR,$(1),$(ROOTPATH))
+endef
+MODULE = mss_pmic
+OBJS += $(MSS_PMIC_MODULE_OBJS)
+
+$(eval $(call MSS_PMIC_MODULE_INCLUDES,$(MODULE)))
+$(call BUILD_MODULE)
diff --git a/src/import/chips/ocmb/common/procedures/hwp/pmic/lib/utils/pmic_bias_utils.H b/src/import/chips/ocmb/common/procedures/hwp/pmic/lib/utils/pmic_bias_utils.H
index 08bd4add1..58757e249 100644
--- a/src/import/chips/ocmb/common/procedures/hwp/pmic/lib/utils/pmic_bias_utils.H
+++ b/src/import/chips/ocmb/common/procedures/hwp/pmic/lib/utils/pmic_bias_utils.H
@@ -22,3 +22,52 @@
/* permissions and limitations under the License. */
/* */
/* IBM_PROLOG_END_TAG */
+
+///
+/// @file pmic_bias_utils.H
+/// @brief Procedure definition to bias PMIC
+///
+// *HWP HWP Owner: Mark Pizzutillo <mark.pizzutillo@ibm.com>
+// *HWP HWP Backup: Louis Stermole <stermole@us.ibm.com>
+// *HWP Team: Memory
+// *HWP Level: 1
+// *HWP Consumed by: FSP:HB
+
+#ifndef __PMIC_BIAS_UTILS_H__
+#define __PMIC_BIAS_UTILS_H__
+
+#include <fapi2.H>
+
+namespace mss
+{
+namespace pmic
+{
+
+///
+/// @brief Rail settings that the bias procedure can modify
+///
+enum setting
+{
+ // We order these by rail in groups of 4 so they match with the rail enums,
+ // so the rail can be derived from just a % 4 when we have more settings to change
+ SWA_VOLT = 0,
+ SWB_VOLT = 1,
+ SWC_VOLT = 2,
+ SWD_VOLT = 3,
+ NO_SETTING = 4,
+};
+
+///
+/// @brief Different methods of biasing
+///
+enum unit
+{
+ NO_UNIT = 0, // default value that we can use for error checking
+ VALUE = 1,
+ PERCENT = 2,
+};
+
+}// pmic
+}// mss
+
+#endif
diff --git a/src/import/chips/ocmb/common/procedures/hwp/pmic/lib/utils/pmic_enable_utils.H b/src/import/chips/ocmb/common/procedures/hwp/pmic/lib/utils/pmic_enable_utils.H
index d5348bda1..d673a0073 100644
--- a/src/import/chips/ocmb/common/procedures/hwp/pmic/lib/utils/pmic_enable_utils.H
+++ b/src/import/chips/ocmb/common/procedures/hwp/pmic/lib/utils/pmic_enable_utils.H
@@ -22,3 +22,37 @@
/* permissions and limitations under the License. */
/* */
/* IBM_PROLOG_END_TAG */
+
+///
+/// @file pmic_enable_utils.H
+/// @brief Utility functions for PMIC enable operation
+///
+// *HWP HWP Owner: Mark Pizzutillo <mark.pizzutillo@ibm.com>
+// *HWP HWP Backup: Louis Stermole <stermole@us.ibm.com>
+// *HWP Team: Memory
+// *HWP Level: 1
+// *HWP Consumed by: FSP:HB
+
+#ifndef __PMIC_ENABLE_UTILS_H__
+#define __PMIC_ENABLE_UTILS_H__
+
+#include <fapi2.H>
+
+namespace mss
+{
+namespace pmic
+{
+
+///
+/// @brief Different enable operations
+///
+enum enable_mode
+{
+ SPD = 0, // Use values from the SPD (default). Overwrite the vendor region with SPD settings
+ MANUAL = 1, // Use voltage settings currently in the vendor region. (Changed via pmic_update, or factory defaults)
+};
+
+}// pmic
+}// mss
+
+#endif
diff --git a/src/import/chips/ocmb/common/procedures/hwp/pmic/pmic_bias.C b/src/import/chips/ocmb/common/procedures/hwp/pmic/pmic_bias.C
index 559aa7f75..a8da82dcd 100644
--- a/src/import/chips/ocmb/common/procedures/hwp/pmic/pmic_bias.C
+++ b/src/import/chips/ocmb/common/procedures/hwp/pmic/pmic_bias.C
@@ -22,3 +22,39 @@
/* permissions and limitations under the License. */
/* */
/* IBM_PROLOG_END_TAG */
+
+///
+/// @file pmic_bias.C
+/// @brief Procedure definition to bias PMIC
+///
+// *HWP HWP Owner: Mark Pizzutillo <mark.pizzutillo@ibm.com>
+// *HWP HWP Backup: Louis Stermole <stermole@us.ibm.com>
+// *HWP Team: Memory
+// *HWP Level: 1
+// *HWP Consumed by: FSP:HB
+
+#include <fapi2.H>
+#include <lib/utils/pmic_bias_utils.H>
+
+extern "C"
+{
+ ///
+ /// @brief Bias procedure for PMIC devices
+ ///
+ /// @param[in] i_ocmb_target explorer target
+ /// @param[in] i_setting setting to change (swa_volt, swb_volt, etc.)
+ /// @param[in] i_amount amount to change by
+ /// @param[in] i_unit percentage or value
+ /// @param[in] i_force ignore 10% change limit
+ /// @return fapi2::ReturnCode FAPI2_RC_SUCCESS iff success
+ ///
+ fapi2::ReturnCode pmic_bias(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_ocmb_target,
+ const mss::pmic::setting i_setting,
+ const float i_amount,
+ const mss::pmic::unit i_unit,
+ const bool i_force)
+ {
+ // TK - L1 implementation, function not filled in yet
+ return fapi2::FAPI2_RC_SUCCESS;
+ }
+}
diff --git a/src/import/chips/ocmb/common/procedures/hwp/pmic/pmic_bias.H b/src/import/chips/ocmb/common/procedures/hwp/pmic/pmic_bias.H
index 8dc43fba9..924ada60e 100644
--- a/src/import/chips/ocmb/common/procedures/hwp/pmic/pmic_bias.H
+++ b/src/import/chips/ocmb/common/procedures/hwp/pmic/pmic_bias.H
@@ -22,3 +22,45 @@
/* permissions and limitations under the License. */
/* */
/* IBM_PROLOG_END_TAG */
+
+///
+/// @file pmic_bias.H
+/// @brief Procedure definition to bias PMIC
+///
+// *HWP HWP Owner: Mark Pizzutillo <mark.pizzutillo@ibm.com>
+// *HWP HWP Backup: Louis Stermole <stermole@us.ibm.com>
+// *HWP Team: Memory
+// *HWP Level: 1
+// *HWP Consumed by: FSP:HB
+
+#ifndef __PMIC_BIAS_H__
+#define __PMIC_BIAS_H__
+
+#include <fapi2.H>
+#include <lib/pmic/pmic_bias_utils.H>
+
+typedef fapi2::ReturnCode (*pmic_bias_FP_t) (const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>&,
+ const mss::pmic::setting,
+ const float,
+ const mss::pmic::unit,
+ const bool);
+
+extern "C"
+{
+ ///
+ /// @brief Bias procedure for PMIC devices
+ ///
+ /// @param[in] i_ocmb_target explorer target
+ /// @param[in] i_setting setting to change (swa_volt, swb_volt, etc.)
+ /// @param[in] i_amount amount to change by
+ /// @param[in] i_unit percentage or value
+ /// @param[in] i_force ignore 10% change limit
+ /// @return fapi2::ReturnCode FAPI2_RC_SUCCESS iff success
+ ///
+ fapi2::ReturnCode exp_pmic_bias(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_ocmb_target,
+ const mss::pmic::setting i_setting = mss::pmic::setting::NO_SETTING,
+ const float i_amount = 0,
+ const mss::pmic::unit i_unit = mss::pmic::unit::NO_UNIT,
+ const bool i_force = false);
+}
+#endif
diff --git a/src/import/chips/ocmb/common/procedures/hwp/pmic/pmic_bias.mk b/src/import/chips/ocmb/common/procedures/hwp/pmic/pmic_bias.mk
index e582a2160..8356e8cb9 100644
--- a/src/import/chips/ocmb/common/procedures/hwp/pmic/pmic_bias.mk
+++ b/src/import/chips/ocmb/common/procedures/hwp/pmic/pmic_bias.mk
@@ -22,3 +22,9 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
+
+-include 00pmic_common.mk
+
+PROCEDURE=pmic_bias
+$(eval $(call ADD_PMIC_MEMORY_INCDIRS,$(PROCEDURE)))
+$(call BUILD_PROCEDURE)
diff --git a/src/import/chips/ocmb/common/procedures/hwp/pmic/pmic_enable.C b/src/import/chips/ocmb/common/procedures/hwp/pmic/pmic_enable.C
index da23b45e1..c1403be9d 100644
--- a/src/import/chips/ocmb/common/procedures/hwp/pmic/pmic_enable.C
+++ b/src/import/chips/ocmb/common/procedures/hwp/pmic/pmic_enable.C
@@ -22,3 +22,33 @@
/* permissions and limitations under the License. */
/* */
/* IBM_PROLOG_END_TAG */
+
+///
+/// @file pmic_enable.C
+/// @brief Procedure definition to enable PMIC
+///
+// *HWP HWP Owner: Mark Pizzutillo <mark.pizzutillo@ibm.com>
+// *HWP HWP Backup: Louis Stermole <stermole@us.ibm.com>
+// *HWP Team: Memory
+// *HWP Level: 1
+// *HWP Consumed by: FSP:HB
+
+#include <fapi2.H>
+#include <pmic_enable.H>
+#include <lib/utils/pmic_enable_utils.H>
+
+extern "C"
+{
+ ///
+ /// @brief enable function for pmic module
+ /// @param[in] i_target ocmb target
+ /// @param[in] i_mode enable mode operation
+ /// @return FAPI2_RC_SUCCESS iff ok
+ ///
+ fapi2::ReturnCode pmic_enable(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_ocmb_target,
+ const mss::pmic::enable_mode i_mode)
+ {
+ // TK - L1 implementation, function not filled in yet
+ return fapi2::FAPI2_RC_SUCCESS;
+ }
+}
diff --git a/src/import/chips/ocmb/common/procedures/hwp/pmic/pmic_enable.H b/src/import/chips/ocmb/common/procedures/hwp/pmic/pmic_enable.H
index 4da977a9d..9175bd99c 100644
--- a/src/import/chips/ocmb/common/procedures/hwp/pmic/pmic_enable.H
+++ b/src/import/chips/ocmb/common/procedures/hwp/pmic/pmic_enable.H
@@ -22,3 +22,35 @@
/* permissions and limitations under the License. */
/* */
/* IBM_PROLOG_END_TAG */
+
+///
+/// @file pmic_enable.H
+/// @brief Procedure definition to enable PMIC
+///
+// *HWP HWP Owner: Mark Pizzutillo <mark.pizzutillo@ibm.com>
+// *HWP HWP Backup: Louis Stermole <stermole@us.ibm.com>
+// *HWP Team: Memory
+// *HWP Level: 1
+// *HWP Consumed by: FSP:HB
+
+#ifndef __PMIC_ENABLE_H__
+#define __PMIC_ENABLE_H__
+
+#include <fapi2.H>
+#include <lib/utils/pmic_enable_utils.H>
+
+typedef fapi2::ReturnCode (*pmic_enable_FP_t) (const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>&,
+ const mss::pmic::enable_mode);
+
+extern "C"
+{
+ ///
+ /// @brief enable function for pmic module
+ /// @param[in] i_target ocmb target
+ /// @param[in] i_mode enable mode operation
+ /// @return FAPI2_RC_SUCCESS iff ok
+ ///
+ fapi2::ReturnCode pmic_enable(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target,
+ const mss::pmic::enable_mode i_mode = mss::pmic::enable_mode::SPD);
+}
+#endif
diff --git a/src/import/chips/ocmb/common/procedures/hwp/pmic/pmic_enable.mk b/src/import/chips/ocmb/common/procedures/hwp/pmic/pmic_enable.mk
index fd59828d5..17d6de50d 100644
--- a/src/import/chips/ocmb/common/procedures/hwp/pmic/pmic_enable.mk
+++ b/src/import/chips/ocmb/common/procedures/hwp/pmic/pmic_enable.mk
@@ -22,3 +22,9 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
+
+-include 00pmic_common.mk
+
+PROCEDURE=pmic_enable
+$(eval $(call ADD_PMIC_MEMORY_INCDIRS,$(PROCEDURE)))
+$(call BUILD_PROCEDURE)
diff --git a/src/import/hwpf/fapi2/xml/attribute_info/common_attributes.xml b/src/import/hwpf/fapi2/xml/attribute_info/common_attributes.xml
index 4a97f47db..cd1620a03 100644
--- a/src/import/hwpf/fapi2/xml/attribute_info/common_attributes.xml
+++ b/src/import/hwpf/fapi2/xml/attribute_info/common_attributes.xml
@@ -129,7 +129,7 @@
PROC - MC - MI - DMI
PROC - MC - MI - MCC - OMI
(OMIC - OMI is not supported)
- PROC - PMIC
+ OCMB - PMIC
MEMBUF - MBA - DIMM
MEMBUF - L4
OCMB - MEM_PORT - DIMM
OpenPOWER on IntegriCloud