diff options
| author | Glenn Miles <milesg@ibm.com> | 2019-04-16 10:52:25 -0500 |
|---|---|---|
| committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2019-05-01 14:59:14 -0500 |
| commit | a6b70d6c06d2b261bbb0a00522088fd5c0d8f395 (patch) | |
| tree | e9f9fe2eac68bcaf12d13d4212cbc635008cbba6 /src | |
| parent | 5f68c549965e0cebcb557026938ba57ff0aa8ba8 (diff) | |
| download | blackbird-hostboot-a6b70d6c06d2b261bbb0a00522088fd5c0d8f395.tar.gz blackbird-hostboot-a6b70d6c06d2b261bbb0a00522088fd5c0d8f395.zip | |
Add new 'expupd' module
Chages required to add the 'expupd' module which will contain
hostboot support and tests for updating the explorer chip
firmware.
RTC: 193924
Change-Id: Iceddc675e8078aeafe62893df8febb531f4a0cf0
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/76623
Reviewed-by: Ilya Smirnov <ismirno@us.ibm.com>
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Reviewed-by: Matt Derksen <mderkse1@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
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/include/usr/expupd/expupd_reasoncodes.H | 47 | ||||
| -rw-r--r-- | src/include/usr/hbotcompid.H | 12 | ||||
| -rw-r--r-- | src/makefile | 2 | ||||
| -rw-r--r-- | src/usr/isteps/expupd/expupd.mk | 34 | ||||
| -rw-r--r-- | src/usr/isteps/expupd/makefile | 35 | ||||
| -rw-r--r-- | src/usr/isteps/expupd/test/expupdatetest.H | 212 | ||||
| -rw-r--r-- | src/usr/isteps/expupd/test/makefile | 33 | ||||
| -rw-r--r-- | src/usr/isteps/expupd/test/test.mk | 34 | ||||
| -rw-r--r-- | src/usr/isteps/makefile | 1 |
9 files changed, 410 insertions, 0 deletions
diff --git a/src/include/usr/expupd/expupd_reasoncodes.H b/src/include/usr/expupd/expupd_reasoncodes.H new file mode 100644 index 000000000..ed3cd2717 --- /dev/null +++ b/src/include/usr/expupd/expupd_reasoncodes.H @@ -0,0 +1,47 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/include/usr/expupd/expupd_reasoncodes.H $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 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 __EXPUPD_REASONCODES_H +#define __EXPUPD_REASONCODES_H + +#include <hbotcompid.H> + +namespace EXPUPD +{ + + enum ExpUpdModuleId + { + MOD_UPDATE_ALL_EXP_FLASH_IMAGES = 0x01, + }; + + enum ExpUpdReasonCode + { + EXPUPD_INVALID_EYECATCHER = UCD_COMP_ID | 0x01, + EXPUPD_INVALID_MAJOR_VER = UCD_COMP_ID | 0x02, + }; + +}; // namespace EXPUPD + +#endif diff --git a/src/include/usr/hbotcompid.H b/src/include/usr/hbotcompid.H index e3a3ec5d7..4afcaa80e 100644 --- a/src/include/usr/hbotcompid.H +++ b/src/include/usr/hbotcompid.H @@ -484,6 +484,18 @@ const compId_t UCD_COMP_ID = 0x4100; const char UCD_COMP_NAME[] = "ucd"; //@} + +// +/** @name EXPUPD + * Explorer update component + */ +//@{ +const compId_t EXPUPD_COMP_ID = 0x4200; +const char EXPUPD_COMP_NAME[] = "expupd"; + +//@} + +// // /** @name HDAT * HDAT component diff --git a/src/makefile b/src/makefile index 8dc48b9c4..460485629 100644 --- a/src/makefile +++ b/src/makefile @@ -215,6 +215,7 @@ EXTENDED_MODULES += $(if $(CONFIG_FSP_BUILD),,nvram) EXTENDED_MODULES += mmio EXTENDED_MODULES += smf EXTENDED_MODULES += expaccess +EXTENDED_MODULES += expupd #*************************************** # Working test modules @@ -260,6 +261,7 @@ TESTCASE_MODULES += $(if $(CONFIG_EARLY_TESTCASES) && $(FSP_BUILD) ,,testnvram) #TODO RTC: 206800 Investigate why SMF tests fail in Axone TESTCASE_MODULES += $(if $(CONFIG_AXONE_BRING_UP),,testsmf) TESTCASE_MODULES += testexpaccess +TESTCASE_MODULES += testexpupd #****************************************************************** #KNOWN ISSUES (I might let these run but there is something wrong) diff --git a/src/usr/isteps/expupd/expupd.mk b/src/usr/isteps/expupd/expupd.mk new file mode 100644 index 000000000..1b824b064 --- /dev/null +++ b/src/usr/isteps/expupd/expupd.mk @@ -0,0 +1,34 @@ +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/usr/isteps/expupd/expupd.mk $ +# +# OpenPOWER HostBoot Project +# +# Contributors Listed Below - COPYRIGHT 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 +EXTRAINCDIR += ${ROOTPATH}/src/import +EXTRAINCDIR += ${ROOTPATH}/src/import/chips/ocmb/explorer/common/include/ +EXTRAINCDIR += ${ROOTPATH}/src/import/chips/ocmb/explorer/procedures/hwp/memory/ +EXTRAINCDIR += ${ROOTPATH}/src/import/chips/common/utils/imageProcs +EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/ffdc/ +EXTRAINCDIR += ${ROOTPATH}/src/import/hwpf/fapi2/include +EXTRAINCDIR += ${ROOTPATH}/src/include/usr/fapi2 + +# Need to build exp_fw_update procedure +OBJS += exp_fw_update.o diff --git a/src/usr/isteps/expupd/makefile b/src/usr/isteps/expupd/makefile new file mode 100644 index 000000000..2ee89f6e4 --- /dev/null +++ b/src/usr/isteps/expupd/makefile @@ -0,0 +1,35 @@ +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/usr/isteps/expupd/makefile $ +# +# OpenPOWER HostBoot Project +# +# Contributors Listed Below - COPYRIGHT 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 + +ROOTPATH = ../../../.. +MODULE = expupd + +SUBDIRS += test.d + +include expupd.mk + +include ${ROOTPATH}/config.mk + +VPATH += ${ROOTPATH}/src/import/chips/ocmb/explorer/procedures/hwp/memory/ diff --git a/src/usr/isteps/expupd/test/expupdatetest.H b/src/usr/isteps/expupd/test/expupdatetest.H new file mode 100644 index 000000000..51602f961 --- /dev/null +++ b/src/usr/isteps/expupd/test/expupdatetest.H @@ -0,0 +1,212 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/isteps/expupd/test/expupdatetest.H $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 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 __EXPUPDATETEST_H +#define __EXPUPDATETEST_H + +/** + * @file expupdatetest.H + * + * @brief Test cases for explorer chip firmware update + */ + +#include <cxxtest/TestSuite.H> +#include <errl/errlmanager.H> +#include <errl/errlentry.H> +#include <fapi2.H> +#include <plat_hwp_invoker.H> +#include <exp_inband.H> +#include <exp_data_structs.H> +#include <exp_fw_update.H> +#include <generic/memory/lib/utils/endian_utils.H> +#ifndef __HOSTBOOT_RUNTIME +#include <vfs/vfs.H> // module_is_loaded & module_load +#endif + +const char MSS_LIBRARY_NAME[] = "libisteps_mss.so"; +const char EXPUPD_LIBRARY_NAME[] = "libexpupd.so"; + +/** + * @brief Generic function to load a module + * @param o_module_loaded - returns true if module is loaded by this function + * @param i_modName - module name to load + * @return error handle if module_load call fails + */ +errlHndl_t loadModule(bool & o_module_loaded, const char * i_modName) +{ + errlHndl_t err = nullptr; + o_module_loaded = false; + +// VFS functions only compilable in non-runtime environment +#ifndef __HOSTBOOT_RUNTIME + if(!VFS::module_is_loaded(i_modName)) + { + err = VFS::module_load(i_modName); + if(err) + { + TS_FAIL("loadModule() - %s load failed", i_modName ); + } + else + { + o_module_loaded = true; + TS_TRACE("loadModule: %s loaded", i_modName); + } + } +#endif + return err; +} + +/** + * @brief Generic function to unload a module + * @param i_modName - module name to load + * @return error handle if module_unload call fails + */ +errlHndl_t unloadModule(const char * i_modName) +{ + errlHndl_t err = nullptr; + +// VFS function only compilable in non-runtime environment +#ifndef __HOSTBOOT_RUNTIME + err = VFS::module_unload(i_modName); + if(err) + { + TS_FAIL("unloadExplorerModule() - %s unload failed", i_modName ); + } + else + { + TS_TRACE("unloadModule: %s unloaded", i_modName); + } +#endif + return err; +} + +class ExpUpdateTest: public CxxTest::TestSuite +{ + public: + + /** + * @brief Test the explorer firmware update procedure + */ + void testExpFwUpdate( void ) + { + errlHndl_t l_errl = nullptr; + + uint8_t l_dataBuffer[4096] = {0}; + + // Create a vector of TARGETING::Target pointers + TARGETING::TargetHandleList l_chipList; + + // Get a list of all of the functioning ocmb chips + TARGETING::getAllChips(l_chipList, TARGETING::TYPE_OCMB_CHIP, true); + + for (const auto & l_ocmb: l_chipList) + { + TS_TRACE("testExpFwUpdate: updating OCMB 0x%.8X", + TARGETING::get_huid(l_ocmb)); + + fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>l_fapi2_target(l_ocmb); + + // Invoke procedure + FAPI_INVOKE_HWP(l_errl, exp_fw_update, l_fapi2_target, + l_dataBuffer, sizeof(l_dataBuffer)); + if (l_errl) + { + TS_FAIL("Error from exp_fw_update for 0x%.8X target", + TARGETING::get_huid(l_ocmb)); + break; + } + } + + if (l_errl) + { + errlCommit(l_errl, CXXTEST_COMP_ID); + } + TS_TRACE("testExpFwUpdate: exiting"); + }; + + /** + * @brief Constructor + */ + ExpUpdateTest() : CxxTest::TestSuite() + { + mss_module_loaded = false; + expupd_module_loaded = false; + + // All modules are loaded by runtime, + // so testcase loading of modules is not required +#ifndef __HOSTBOOT_RUNTIME + errlHndl_t err = nullptr; + + err = loadModule(mss_module_loaded, MSS_LIBRARY_NAME); + if(err) + { + TS_FAIL("ExpUpdateTest() - Constuctor: failed to load MSS module"); + errlCommit( err, CXXTEST_COMP_ID ); + } + err = loadModule(expupd_module_loaded, EXPUPD_LIBRARY_NAME); + if(err) + { + TS_FAIL("ExpUpdateTest() - Constuctor: failed to load EXPUPD module"); + errlCommit( err, CXXTEST_COMP_ID ); + } +#endif + }; + + + /** + * @brief Destructor + */ + ~ExpUpdateTest() + { + errlHndl_t err = nullptr; + if (mss_module_loaded) + { + err = unloadModule(MSS_LIBRARY_NAME); + if(err) + { + TS_FAIL("~ExpUpdateTest() - Destructor: failed to unload MSS module"); + errlCommit( err, CXXTEST_COMP_ID ); + } + } + if (expupd_module_loaded) + { + err = unloadModule(EXPUPD_LIBRARY_NAME); + if(err) + { + TS_FAIL("~ExpUpdateTest() - Destructor: failed to unload EXPUPD module"); + errlCommit( err, CXXTEST_COMP_ID ); + } + } + + }; + + private: + // use this to keep track of if we need to unload any + // modules loaded by this testcase + bool mss_module_loaded; + bool expupd_module_loaded; +}; + +#endif diff --git a/src/usr/isteps/expupd/test/makefile b/src/usr/isteps/expupd/test/makefile new file mode 100644 index 000000000..d028105f9 --- /dev/null +++ b/src/usr/isteps/expupd/test/makefile @@ -0,0 +1,33 @@ +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/usr/isteps/expupd/test/makefile $ +# +# OpenPOWER HostBoot Project +# +# Contributors Listed Below - COPYRIGHT 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 + +ROOTPATH = ../../../../.. +MODULE = testexpupd + +include test.mk + +TESTS = expupdatetest.H + +include ${ROOTPATH}/config.mk diff --git a/src/usr/isteps/expupd/test/test.mk b/src/usr/isteps/expupd/test/test.mk new file mode 100644 index 000000000..c23c8723b --- /dev/null +++ b/src/usr/isteps/expupd/test/test.mk @@ -0,0 +1,34 @@ +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/usr/isteps/expupd/test/test.mk $ +# +# OpenPOWER HostBoot Project +# +# Contributors Listed Below - COPYRIGHT 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 + +EXTRAINCDIR += ${ROOTPATH}/src/include/usr/fapi2 +EXTRAINCDIR += ${ROOTPATH}/src/import/hwpf/fapi2/include +EXTRAINCDIR += ${ROOTPATH}/src/import/chips/common/utils/imageProcs +EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/ffdc +EXTRAINCDIR += ${ROOTPATH}/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/shared +EXTRAINCDIR += ${ROOTPATH}/src/import/chips/ocmb/explorer/procedures/hwp/memory/ +EXTRAINCDIR += ${ROOTPATH}/src/import/chips/ocmb/explorer/common/include +EXTRAINCDIR += ${ROOTPATH}/src/import + diff --git a/src/usr/isteps/makefile b/src/usr/isteps/makefile index dca7777f7..496861bf2 100644 --- a/src/usr/isteps/makefile +++ b/src/usr/isteps/makefile @@ -52,6 +52,7 @@ SUBDIRS+=nest.d SUBDIRS+=io.d SUBDIRS+=nvdimm.d SUBDIRS+=ucd.d +SUBDIRS+=expupd.d #TODO: RTC 176018 EXTRAINCDIR += ${ROOTPATH}/src/import/ |

