summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSunil Kumar <skumar8j@in.ibm.com>2019-01-11 03:11:57 -0600
committerRAJA DAS <rajadas2@in.ibm.com>2019-01-18 07:46:26 -0600
commit3819989297207c85bd04f8633c8efac31b2c55f2 (patch)
tree3f98ebbd7fc62bf4bc83c35788b144ecdf19d652
parentda97ec3205737cfe74a4cd1065eef150c0f424a8 (diff)
downloadtalos-sbe-3819989297207c85bd04f8633c8efac31b2c55f2.tar.gz
talos-sbe-3819989297207c85bd04f8633c8efac31b2c55f2.zip
Incorporate NVDIMM HWP into SBE.
Change-Id: I7c0b338d31b419914c74c2aaee9d24625b7dc233 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/70360 Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: RAJA DAS <rajadas2@in.ibm.com>
-rw-r--r--src/build/Makefile3
-rw-r--r--src/build/img_defs.mk7
-rw-r--r--src/build/import_hwp_mk/power/istepmpipl/Makefile4
-rw-r--r--src/build/import_hwp_mk/power/istepmpipl/istepmpiplfiles.mk3
-rw-r--r--src/sbefw/app/power/apppowerfiles.mk4
-rw-r--r--src/sbefw/app/power/chipop_table.C1
-rw-r--r--src/sbefw/app/power/ipl_table.C10
-rw-r--r--src/sbefw/app/power/sbecmdflushnvdimm.C118
-rw-r--r--src/sbefw/app/power/sbecmdflushnvdimm.H51
-rw-r--r--src/sbefw/app/power/sbecmdiplcontrol.C54
-rw-r--r--src/sbefw/app/power/sbecmdiplcontrol.H11
11 files changed, 193 insertions, 73 deletions
diff --git a/src/build/Makefile b/src/build/Makefile
index f57fd5a6..48a3235c 100644
--- a/src/build/Makefile
+++ b/src/build/Makefile
@@ -5,7 +5,7 @@
#
# OpenPOWER sbe Project
#
-# Contributors Listed Below - COPYRIGHT 2015,2018
+# Contributors Listed Below - COPYRIGHT 2015,2019
# [+] International Business Machines Corp.
#
#
@@ -258,6 +258,7 @@ ATTRFILES += $(IMPORT_XML_DIR)/attribute_info/p9_cache_contained_attributes.xml
ATTRFILES += $(BASE_FAPI2_DIR)/xml/attribute_info/chip_attributes.xml
ATTRFILES += $(IMPORT_XML_DIR)/attribute_info/chip_ec_attributes.xml
ATTRFILES += $(IMPORT_XML_DIR)/attribute_info/p9_hcode_image_build_attributes.xml
+ATTRFILES += $(IMPORT_XML_DIR)/attribute_info/memory_mcs_attributes.xml
$(OBJDIR):
mkdir -p $(OBJDIR)
diff --git a/src/build/img_defs.mk b/src/build/img_defs.mk
index a154928c..77d2c7aa 100644
--- a/src/build/img_defs.mk
+++ b/src/build/img_defs.mk
@@ -5,7 +5,7 @@
#
# OpenPOWER sbe Project
#
-# Contributors Listed Below - COPYRIGHT 2015,2018
+# Contributors Listed Below - COPYRIGHT 2015,2019
# [+] International Business Machines Corp.
#
#
@@ -119,6 +119,9 @@ ifndef CACHE_SRCDIR
export CACHE_SRCDIR = $(IMPORT_SRCDIR)/chips/p9/procedures/hwp/cache
endif
+ifndef MEMHWP_SRCDIR
+export MEMHWP_SRCDIR = $(IMPORT_SRCDIR)/chips/p9/procedures/hwp/memory/lib/workarounds
+endif
ifndef CORE_SRCDIR
export CORE_SRCDIR = $(IMPORT_SRCDIR)/chips/p9/procedures/hwp/core
endif
@@ -188,7 +191,7 @@ export P9_XIP_BINDIR = $(BASE_OBJDIR)/xip
endif
ifndef IMG_INCLUDES
-export IMG_INCLUDES = -I$(IMAGEPROCS_COMMON_SRCDIR) -I$(IMAGEPROCS_P9_SRCDIR) -I$(IMAGEPROCS_CEN_SRCDIR) -I$(P9_XIP_SRCDIR) -I$(BUILD_DIR) -I$(CACHE_SRCDIR) -I$(UTILS_SRCDIR) -I$(CORE_SRCDIR) -I$(PERV_SRCDIR) -I$(NEST_SRCDIR) -I$(IO_SRCDIR) -I$(PM_SRCDIR) -I$(INITFILES_SRCDIR) -I$(HWPLIB_SRCDIR) -I$(HWPFFDC_SRCDIR)
+export IMG_INCLUDES = -I$(IMAGEPROCS_COMMON_SRCDIR) -I$(IMAGEPROCS_P9_SRCDIR) -I$(IMAGEPROCS_CEN_SRCDIR) -I$(P9_XIP_SRCDIR) -I$(BUILD_DIR) -I$(CACHE_SRCDIR) -I$(UTILS_SRCDIR) -I$(CORE_SRCDIR) -I$(PERV_SRCDIR) -I$(NEST_SRCDIR) -I$(IO_SRCDIR) -I$(PM_SRCDIR) -I$(INITFILES_SRCDIR) -I$(HWPLIB_SRCDIR) -I$(HWPFFDC_SRCDIR) -I$(MEMHWP_SRCDIR)
endif
ifndef BOOT_OBJDIR
diff --git a/src/build/import_hwp_mk/power/istepmpipl/Makefile b/src/build/import_hwp_mk/power/istepmpipl/Makefile
index 4cc55c04..651838b8 100644
--- a/src/build/import_hwp_mk/power/istepmpipl/Makefile
+++ b/src/build/import_hwp_mk/power/istepmpipl/Makefile
@@ -5,7 +5,7 @@
#
# OpenPOWER sbe Project
#
-# Contributors Listed Below - COPYRIGHT 2016,2018
+# Contributors Listed Below - COPYRIGHT 2016,2019
# [+] International Business Machines Corp.
#
#
@@ -31,7 +31,7 @@ export SUB_OBJDIR = /$(IMPORT_OBJDIR)/istepmpipl
include img_defs.mk
include istepmpiplfiles.mk
-export VPATH = $(PERV_SRCDIR):$(NEST_SRCDIR):$(IO_SRCDIR):$(CACHE_SRCDIR):$(CORE_SRCDIR):$(PM_SRCDIR):$(INITFILES_SRCDIR):$(HWPLIB_SRCDIR)
+export VPATH = $(PERV_SRCDIR):$(NEST_SRCDIR):$(IO_SRCDIR):$(CACHE_SRCDIR):$(CORE_SRCDIR):$(PM_SRCDIR):$(INITFILES_SRCDIR):$(HWPLIB_SRCDIR):$(MEMHWP_SRCDIR)
OBJSISTEPMPIPL := $(addprefix $(OBJDIR-ISTEPMPIPL)/, $(ISTEPMPIPL_OBJECTS))
diff --git a/src/build/import_hwp_mk/power/istepmpipl/istepmpiplfiles.mk b/src/build/import_hwp_mk/power/istepmpipl/istepmpiplfiles.mk
index e84c70ca..b0999dd9 100644
--- a/src/build/import_hwp_mk/power/istepmpipl/istepmpiplfiles.mk
+++ b/src/build/import_hwp_mk/power/istepmpipl/istepmpiplfiles.mk
@@ -5,7 +5,7 @@
#
# OpenPOWER sbe Project
#
-# Contributors Listed Below - COPYRIGHT 2016,2018
+# Contributors Listed Below - COPYRIGHT 2016,2019
# [+] International Business Machines Corp.
#
#
@@ -60,6 +60,7 @@ ISTEPMPIPL-CPP-SOURCES += p9_sbe_fastarray_cleanup.C
ISTEPMPIPL-CPP-SOURCES += p9_sbe_fastarray_setup.C
# io eol toggle procedure moved here to locate it on seeprom
ISTEPMPIPL-CPP-SOURCES += p9_sbe_io_eol_toggle.C
+ISTEPMPIPL-CPP-SOURCES += nvdimm_workarounds.C
ISTEPMPIPL-C-SOURCES =
ISTEPMPIPL-S-SOURCES =
diff --git a/src/sbefw/app/power/apppowerfiles.mk b/src/sbefw/app/power/apppowerfiles.mk
index 8d134aa9..e05ecefc 100644
--- a/src/sbefw/app/power/apppowerfiles.mk
+++ b/src/sbefw/app/power/apppowerfiles.mk
@@ -5,7 +5,7 @@
#
# OpenPOWER sbe Project
#
-# Contributors Listed Below - COPYRIGHT 2015,2018
+# Contributors Listed Below - COPYRIGHT 2015,2019
# [+] International Business Machines Corp.
#
#
@@ -32,6 +32,7 @@ APPPOWERPIBMEM-CPP-SOURCES += sbecmdcntrldmt.C
APPPOWERPIBMEM-CPP-SOURCES += sbecmdsram.C
APPPOWERPIBMEM-CPP-SOURCES += sbecmdgeneric.C
APPPOWERPIBMEM-CPP-SOURCES += istep.C
+APPPOWERPIBMEM-CPP-SOURCES += sbecmdflushnvdimm.C
APPPOWERPIBMEM-C-SOURCES =
APPPOWERPIBMEM-S-SOURCES =
@@ -47,6 +48,7 @@ APPPOWERSEEPROM-CPP-SOURCES += sbecmdgeneric.C
APPPOWERSEEPROM-CPP-SOURCES += sbecmdtracearray.C
APPPOWERSEEPROM-CPP-SOURCES += sbearchregdump.C
APPPOWERSEEPROM-CPP-SOURCES += sbecmdcntlinst.C
+APPPOWERSEEPROM-CPP-SOURCES += sbecmdflushnvdimm.C
APPPOWERSEEPROM-C-SOURCES =
APPPOWERSEEPROM-S-SOURCES =
diff --git a/src/sbefw/app/power/chipop_table.C b/src/sbefw/app/power/chipop_table.C
index 1431b343..c0f28da5 100644
--- a/src/sbefw/app/power/chipop_table.C
+++ b/src/sbefw/app/power/chipop_table.C
@@ -24,6 +24,7 @@
/* IBM_PROLOG_END_TAG */
#include "sbecmdscomaccess.H"
#include "sbecmdiplcontrol.H"
+#include "sbecmdflushnvdimm.H"
#include "sbecmdgeneric.H"
#include "sbecmdmemaccess.H"
#include "sbecmdregaccess.H"
diff --git a/src/sbefw/app/power/ipl_table.C b/src/sbefw/app/power/ipl_table.C
index 86b41f41..91379a67 100644
--- a/src/sbefw/app/power/ipl_table.C
+++ b/src/sbefw/app/power/ipl_table.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER sbe Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2017,2018 */
+/* Contributors Listed Below - COPYRIGHT 2017,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -110,6 +110,7 @@
#include "sbeSecureMemRegionManager.H"
#include "sbeConsole.H"
+#include "sbecmdflushnvdimm.H"
// Forward declaration
using namespace fapi2;
@@ -128,7 +129,6 @@ static const uint64_t N3_FIR_SYSTEM_CHECKSTOP_BIT = 30; // 63-33 = 30
// Externs
extern p9_thread_control_FP_t threadCntlhwp;
extern uint64_t G_ring_save[8];
-
//Utility function to mask special attention
extern ReturnCode maskSpecialAttn( const Target<TARGET_TYPE_CORE>& i_target );
@@ -999,6 +999,12 @@ ReturnCode istepStartMpipl( voidfuncptr_t i_hwp)
SBE_ERROR(SBE_FUNC "resetCrespErrLatch failed");
break;
}
+ rc = flushNVDIMM();
+ if( rc != FAPI2_RC_SUCCESS )
+ {
+ SBE_ERROR(SBE_FUNC "flushNVDIMM failed");
+ break;
+ }
}while(0);
diff --git a/src/sbefw/app/power/sbecmdflushnvdimm.C b/src/sbefw/app/power/sbecmdflushnvdimm.C
new file mode 100644
index 00000000..c551cbca
--- /dev/null
+++ b/src/sbefw/app/power/sbecmdflushnvdimm.C
@@ -0,0 +1,118 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/sbefw/app/power/sbecmdflushnvdimm.C $ */
+/* */
+/* OpenPOWER sbe Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2015,2019 */
+/* [+] 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: ppe/sbe/sbefw/sbecmdiplcontrol.C
+ *
+ * @brief This file contains the SBE istep chipOps
+ *
+ */
+#include "sbefifo.H"
+#include "sbetrace.H"
+#include "sbe_sp_intf.H"
+#include "sbeFifoMsgUtils.H"
+#include "nvdimm_workarounds.H"
+#include "sbecmdflushnvdimm.H"
+
+using namespace fapi2;
+
+
+#ifdef __SBEFW_SEEPROM__
+
+///////////////////////////////////////////////////////////////////////
+// @brief sbeHandleFlushNVDIMM Sbe flush NVDIMM function
+//
+// @return RC from the underlying FIFO utility
+///////////////////////////////////////////////////////////////////////
+
+mss::workarounds::nvdimm::p9_flush_nvdimm_FP_t p9_flush_nvdimm_hwp = &mss::workarounds::nvdimm::trigger_csave;
+
+uint32_t sbeHandleFlushNVDIMM(uint8_t *i_pArg)
+{
+
+ #define SBE_FUNC " sbeHandleFlushNVDIMM "
+ SBE_ENTER(SBE_FUNC);
+ uint32_t rc = SBE_SEC_OPERATION_SUCCESSFUL;
+ ReturnCode fapiRc = FAPI2_RC_SUCCESS;
+ uint32_t len = 0;
+ sbeRespGenHdr_t respHdr;
+ respHdr.init();
+ sbeResponseFfdc_t ffdc;
+
+ do
+ {
+ // Dequeue the EOT entry as no more data is expected.
+ rc = sbeUpFifoDeq_mult (len, NULL);
+ CHECK_SBE_RC_AND_BREAK_IF_NOT_SUCCESS(rc);
+
+ fapiRc = flushNVDIMM();
+ if( fapiRc != FAPI2_RC_SUCCESS )
+ {
+ SBE_ERROR(SBE_FUNC "p9_flush_NVDIMM_hwp failed");
+ respHdr.setStatus( SBE_PRI_GENERIC_EXECUTION_FAILURE,
+ SBE_SEC_HWP_FAILURE);
+ ffdc.setRc(fapiRc);
+ break;
+ }
+
+ }while(0);
+
+ // Create the Response to caller
+ do
+ {
+ // If there was a FIFO error, will skip sending the response,
+ // instead give the control back to the command processor thread
+ CHECK_SBE_RC_AND_BREAK_IF_NOT_SUCCESS(rc);
+ rc = sbeDsSendRespHdr( respHdr, &ffdc);
+ }while(0);
+
+ SBE_EXIT(SBE_FUNC);
+ return rc;
+ #undef SBE_FUNC
+}
+//----------------------------------------------------------------------------
+
+fapi2::ReturnCode flushNVDIMM()
+{
+ #define SBE_FUNC "flushNVDIMM "
+ SBE_ENTER(SBE_FUNC);
+ ReturnCode fapiRc = FAPI2_RC_SUCCESS;
+ Target<TARGET_TYPE_PROC_CHIP> procTgt = plat_getChipTarget();
+ do
+ {
+ SBE_EXEC_HWP(fapiRc, p9_flush_nvdimm_hwp, procTgt);
+ if( fapiRc != FAPI2_RC_SUCCESS )
+ {
+ SBE_ERROR(SBE_FUNC "p9_flush_NVDIMM_hwp failed");
+ break;
+ }
+
+ }while(0);
+ SBE_EXIT(SBE_FUNC);
+ return fapiRc;
+ #undef SBE_FUNC
+}
+
+/* end PIBMEM CODE ----------------------------- */
+#endif //#ifndef __SBEFW_SEEPROM__
diff --git a/src/sbefw/app/power/sbecmdflushnvdimm.H b/src/sbefw/app/power/sbecmdflushnvdimm.H
new file mode 100644
index 00000000..789ac3d0
--- /dev/null
+++ b/src/sbefw/app/power/sbecmdflushnvdimm.H
@@ -0,0 +1,51 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/sbefw/app/power/sbecmdflushnvdimm.H $ */
+/* */
+/* OpenPOWER sbe Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2015,2019 */
+/* [+] 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: ppe/sbe/sbefw/sbecmdiplcontrol.H
+ *
+ * @brief This file contains the SBE command details
+ *
+ */
+
+#ifndef __SBEFW_SBECMDFLUSHNVDIMM_H
+#define __SBEFW_SBECMDFLUSHNVDIMM_H
+
+#include <stdint.h>
+#include "sbecmdgeneric.H"
+#include "fapi2.H"
+
+/**
+ * @brief execute flush NVDIMM chip-op (0xA103)
+ *
+ * @param[in] i_pArg Buffer to be passed to the function (not used as of now)
+ *
+ * @return Rc from the FIFO access utility
+ */
+uint32_t sbeHandleFlushNVDIMM(uint8_t *i_pArg);
+
+// Utility function to call NVDIMM procedure.
+fapi2::ReturnCode flushNVDIMM();
+
+#endif // __SBEFW_SBECMDIPLCONTROL_H
diff --git a/src/sbefw/app/power/sbecmdiplcontrol.C b/src/sbefw/app/power/sbecmdiplcontrol.C
index 88eb9b8d..97872411 100644
--- a/src/sbefw/app/power/sbecmdiplcontrol.C
+++ b/src/sbefw/app/power/sbecmdiplcontrol.C
@@ -47,7 +47,6 @@
#include "p9n2_quad_scom_addresses.H"
#include "p9_suspend_io.H"
-//#include "nvdimm_workarounds.H"
#include <p9_sbe_attr_setup.H>
@@ -306,59 +305,6 @@ uint32_t sbeHandleSuspendIO(uint8_t *i_pArg)
}
//----------------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////
-// @brief sbeHandleFlushNVDIMM Sbe flush NVDIMM function
-//
-// @return RC from the underlying FIFO utility
-///////////////////////////////////////////////////////////////////////
-
-//mss::workarounds::nvdimm::p9_flush_nvdimm_FP_t p9_flush_nvdimm_hwp = &mss::workarounds::nvdimm::trigger_csave;
-
-uint32_t sbeHandleFlushNVDIMM(uint8_t *i_pArg)
-{
-
- #define SBE_FUNC " sbeHandleFlushNVDIMM "
- SBE_ENTER(SBE_FUNC);
- uint32_t rc = SBE_SEC_OPERATION_SUCCESSFUL;
- ReturnCode fapiRc = FAPI2_RC_SUCCESS;
- uint32_t len = 0;
- sbeRespGenHdr_t respHdr;
- respHdr.init();
- sbeResponseFfdc_t ffdc;
- //Target<TARGET_TYPE_PROC_CHIP > procTgt = plat_getChipTarget();
-
- do
- {
- // Dequeue the EOT entry as no more data is expected.
- rc = sbeUpFifoDeq_mult (len, NULL);
- CHECK_SBE_RC_AND_BREAK_IF_NOT_SUCCESS(rc);
-
- //SBE_EXEC_HWP(fapiRc, p9_flush_nvdimm_hwp, procTgt);
- if( fapiRc != FAPI2_RC_SUCCESS )
- {
- SBE_ERROR(SBE_FUNC "p9_flush_NVDIMM_hwp failed");
- respHdr.setStatus( SBE_PRI_GENERIC_EXECUTION_FAILURE,
- SBE_SEC_HWP_FAILURE);
- ffdc.setRc(fapiRc);
- break;
- }
- }while(0);
-
- // Create the Response to caller
- do
- {
- // If there was a FIFO error, will skip sending the response,
- // instead give the control back to the command processor thread
- CHECK_SBE_RC_AND_BREAK_IF_NOT_SUCCESS(rc);
- rc = sbeDsSendRespHdr( respHdr, &ffdc);
- }while(0);
-
- SBE_EXIT(SBE_FUNC);
- return rc;
- #undef SBE_FUNC
-}
-//----------------------------------------------------------------------------
-
ReturnCode performAttrSetup( )
{
#define SBE_FUNC "performAttrSetup "
diff --git a/src/sbefw/app/power/sbecmdiplcontrol.H b/src/sbefw/app/power/sbecmdiplcontrol.H
index 9721b212..31bec1c9 100644
--- a/src/sbefw/app/power/sbecmdiplcontrol.H
+++ b/src/sbefw/app/power/sbecmdiplcontrol.H
@@ -37,7 +37,7 @@
#include "fapi2.H"
/**
- * @brief execute suspend IO chip-op (0xA102)
+ * @brief execute suspend IO chip-op (0xA103)
*
* @param[in] i_pArg Buffer to be passed to the function (not used as of now)
*
@@ -45,15 +45,6 @@
*/
uint32_t sbeHandleSuspendIO(uint8_t *i_pArg);
-/**
- * @brief execute flush NVDIMM chip-op (0xA103)
- *
- * @param[in] i_pArg Buffer to be passed to the function (not used as of now)
- *
- * @return Rc from the FIFO access utility
- */
-uint32_t sbeHandleFlushNVDIMM(uint8_t *i_pArg);
-
// Utility function to do TPM reset
fapi2::ReturnCode performTpmReset();
OpenPOWER on IntegriCloud