From 518a05ca5136d3b2149ed6502871a7de52d9b794 Mon Sep 17 00:00:00 2001 From: Matt Derksen Date: Tue, 12 Feb 2019 15:50:32 -0600 Subject: Move nvdimm_update call to istep 21.1 istep20 is not called on FSP-based systems, so the update call needed to be moved to 21.1. This was selected because it requires lids. Change-Id: I2378eb1629e982913a3abe8b652b436edd692439 RTC: 201197 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/71859 Tested-by: Jenkins Server Tested-by: Jenkins OP Build CI Tested-by: FSP CI Jenkins Tested-by: Jenkins OP HW Reviewed-by: Christian R. Geddes Reviewed-by: Corey V. Swenson Reviewed-by: Daniel M. Crowell --- src/usr/isteps/istep20/call_host_load_payload.C | 10 ---- src/usr/isteps/istep20/call_nvdimm_update.C | 76 ------------------------ src/usr/isteps/istep20/call_nvdimm_update.H | 38 ------------ src/usr/isteps/istep20/makefile | 1 - src/usr/isteps/istep21/call_host_runtime_setup.C | 14 ++++- src/usr/isteps/istep21/call_nvdimm_update.C | 76 ++++++++++++++++++++++++ src/usr/isteps/istep21/call_nvdimm_update.H | 38 ++++++++++++ src/usr/isteps/istep21/makefile | 1 + 8 files changed, 127 insertions(+), 127 deletions(-) delete mode 100644 src/usr/isteps/istep20/call_nvdimm_update.C delete mode 100644 src/usr/isteps/istep20/call_nvdimm_update.H create mode 100644 src/usr/isteps/istep21/call_nvdimm_update.C create mode 100644 src/usr/isteps/istep21/call_nvdimm_update.H (limited to 'src') diff --git a/src/usr/isteps/istep20/call_host_load_payload.C b/src/usr/isteps/istep20/call_host_load_payload.C index 26dab532b..44e7672f4 100644 --- a/src/usr/isteps/istep20/call_host_load_payload.C +++ b/src/usr/isteps/istep20/call_host_load_payload.C @@ -40,10 +40,6 @@ #include #include -#ifdef CONFIG_NVDIMM -#include "call_nvdimm_update.H" -#endif - using namespace ERRORLOG; using namespace ISTEP; @@ -134,12 +130,6 @@ void* call_host_load_payload (void *io_pArgs) } } -#ifdef CONFIG_NVDIMM - // Update the NVDIMM controller code, if necessary - // Need to do this after LIDs are accessible - NVDIMM_UPDATE::call_nvdimm_update(); -#endif - }while(0); return l_err; diff --git a/src/usr/isteps/istep20/call_nvdimm_update.C b/src/usr/isteps/istep20/call_nvdimm_update.C deleted file mode 100644 index 7a1817faf..000000000 --- a/src/usr/isteps/istep20/call_nvdimm_update.C +++ /dev/null @@ -1,76 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/usr/isteps/istep20/call_nvdimm_update.C $ */ -/* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* Contributors Listed Below - COPYRIGHT 2018 */ -/* [+] 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 */ -#include -#include -#include -#include -#include - -// NVDIMM support -#include - -#include "call_nvdimm_update.H" - -namespace NVDIMM_UPDATE -{ - -/** - * @brief This function updates the NVDIMM firmware code - */ -void call_nvdimm_update() -{ - TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,ENTER_MRK"call_nvdimm_update()"); - - TARGETING::TargetHandleList l_nvdimmTargetList; - TARGETING::TargetHandleList l_procList; - TARGETING::getAllChips(l_procList, TARGETING::TYPE_PROC, false); - - // grab the NVDIMMs under each processor and add to overall list - for (auto l_proc : l_procList) - { - TARGETING::TargetHandleList tmpList = - TARGETING::getProcNVDIMMs(l_proc); - l_nvdimmTargetList.insert(l_nvdimmTargetList.end(), - tmpList.begin(), tmpList.end()); - } - - // Run the nvdimm update function if the list is not empty - if ( !l_nvdimmTargetList.empty() ) - { - TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, - "call_nvdimm_update(): found %d nvdimms to check for update", - l_nvdimmTargetList.size()); - bool updateWorked = NVDIMM::nvdimm_update(l_nvdimmTargetList); - if (!updateWorked) - { - TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, - "call_nvdimm_update(): nvdimm update failed"); - } - } - - TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,EXIT_MRK"call_nvdimm_update()"); -} - -}; diff --git a/src/usr/isteps/istep20/call_nvdimm_update.H b/src/usr/isteps/istep20/call_nvdimm_update.H deleted file mode 100644 index 70922f3d8..000000000 --- a/src/usr/isteps/istep20/call_nvdimm_update.H +++ /dev/null @@ -1,38 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/usr/isteps/istep20/call_nvdimm_update.H $ */ -/* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* Contributors Listed Below - COPYRIGHT 2018 */ -/* [+] 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 */ -#ifndef __CALL_NVDIMM_UPDATE_H -#define __CALL_NVDIMM_UPDATE_H - -namespace NVDIMM_UPDATE -{ - /** - * @brief This function updates the NVDIMM firmware code - * Will locate functional NVDIMMs and update their - * nv controller code if necessary. - */ - void call_nvdimm_update(); -} - -#endif diff --git a/src/usr/isteps/istep20/makefile b/src/usr/isteps/istep20/makefile index 5a656bd3b..f98bb7e9b 100644 --- a/src/usr/isteps/istep20/makefile +++ b/src/usr/isteps/istep20/makefile @@ -26,6 +26,5 @@ ROOTPATH = ../../../.. MODULE = istep20 OBJS += call_host_load_payload.o -OBJS += $(if $(CONFIG_NVDIMM),call_nvdimm_update.o,) include ${ROOTPATH}/config.mk diff --git a/src/usr/isteps/istep21/call_host_runtime_setup.C b/src/usr/isteps/istep21/call_host_runtime_setup.C index 7ff75e886..c9c302123 100644 --- a/src/usr/isteps/istep21/call_host_runtime_setup.C +++ b/src/usr/isteps/istep21/call_host_runtime_setup.C @@ -66,6 +66,10 @@ #include "call_update_ucd_flash.H" #endif +#ifdef CONFIG_NVDIMM +#include "call_nvdimm_update.H" +#endif + using namespace ERRORLOG; using namespace ISTEP; using namespace ISTEP_ERROR; @@ -705,6 +709,12 @@ void* call_host_runtime_setup (void *io_pArgs) break; } +#ifdef CONFIG_NVDIMM + // Update the NVDIMM controller code, if necessary + // Need to do this after LIDs are accessible + NVDIMM_UPDATE::call_nvdimm_update(); +#endif + #ifdef CONFIG_START_OCC_DURING_BOOT bool l_activatePM = TARGETING::is_sapphire_load(); #else @@ -746,7 +756,7 @@ void* call_host_runtime_setup (void *io_pArgs) } #endif } - // No support for OCC + // No support for OCC else if( !Util::isSimicsRunning() ) { //Shouldnt clear this ATTR_PM_FIRINIT_DONE_ONCE_FLAG @@ -836,7 +846,7 @@ void* call_host_runtime_setup (void *io_pArgs) break; } } - + // Update the MDRT Count from Attribute TargetService& l_targetService = targetService(); Target* l_sys = nullptr; diff --git a/src/usr/isteps/istep21/call_nvdimm_update.C b/src/usr/isteps/istep21/call_nvdimm_update.C new file mode 100644 index 000000000..1204adb61 --- /dev/null +++ b/src/usr/isteps/istep21/call_nvdimm_update.C @@ -0,0 +1,76 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/isteps/istep21/call_nvdimm_update.C $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2018,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 */ +#include +#include +#include +#include +#include + +// NVDIMM support +#include + +#include "call_nvdimm_update.H" + +namespace NVDIMM_UPDATE +{ + +/** + * @brief This function updates the NVDIMM firmware code + */ +void call_nvdimm_update() +{ + TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,ENTER_MRK"call_nvdimm_update()"); + + TARGETING::TargetHandleList l_nvdimmTargetList; + TARGETING::TargetHandleList l_procList; + TARGETING::getAllChips(l_procList, TARGETING::TYPE_PROC, false); + + // grab the NVDIMMs under each processor and add to overall list + for (auto l_proc : l_procList) + { + TARGETING::TargetHandleList tmpList = + TARGETING::getProcNVDIMMs(l_proc); + l_nvdimmTargetList.insert(l_nvdimmTargetList.end(), + tmpList.begin(), tmpList.end()); + } + + // Run the nvdimm update function if the list is not empty + if ( !l_nvdimmTargetList.empty() ) + { + TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, + "call_nvdimm_update(): found %d nvdimms to check for update", + l_nvdimmTargetList.size()); + bool updateWorked = NVDIMM::nvdimm_update(l_nvdimmTargetList); + if (!updateWorked) + { + TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, + "call_nvdimm_update(): nvdimm update failed"); + } + } + + TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,EXIT_MRK"call_nvdimm_update()"); +} + +}; diff --git a/src/usr/isteps/istep21/call_nvdimm_update.H b/src/usr/isteps/istep21/call_nvdimm_update.H new file mode 100644 index 000000000..bc461d72f --- /dev/null +++ b/src/usr/isteps/istep21/call_nvdimm_update.H @@ -0,0 +1,38 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/isteps/istep21/call_nvdimm_update.H $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2018,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 */ +#ifndef __CALL_NVDIMM_UPDATE_H +#define __CALL_NVDIMM_UPDATE_H + +namespace NVDIMM_UPDATE +{ + /** + * @brief This function updates the NVDIMM firmware code + * Will locate functional NVDIMMs and update their + * nv controller code if necessary. + */ + void call_nvdimm_update(); +} + +#endif diff --git a/src/usr/isteps/istep21/makefile b/src/usr/isteps/istep21/makefile index 1ba8edd32..41db2a612 100644 --- a/src/usr/isteps/istep21/makefile +++ b/src/usr/isteps/istep21/makefile @@ -43,5 +43,6 @@ OBJS += freqAttrData.o OBJS += call_host_verify_hdat.o OBJS += call_host_start_payload.o OBJS += $(if $(CONFIG_UCD_FLASH_UPDATES),call_update_ucd_flash.o,) +OBJS += $(if $(CONFIG_NVDIMM),call_nvdimm_update.o,) include ${ROOTPATH}/config.mk -- cgit v1.2.3