diff options
Diffstat (limited to 'src/usr')
-rw-r--r-- | src/usr/expaccess/README.md (renamed from src/usr/expscom/README.md) | 0 | ||||
-rw-r--r-- | src/usr/expaccess/expaccess.mk (renamed from src/usr/expscom/makefile) | 18 | ||||
-rw-r--r-- | src/usr/expaccess/expscom_trace.C (renamed from src/usr/expscom/expscom_trace.C) | 4 | ||||
-rw-r--r-- | src/usr/expaccess/expscom_trace.H (renamed from src/usr/expscom/expscom_trace.H) | 4 | ||||
-rw-r--r-- | src/usr/expaccess/expscom_utils.C (renamed from src/usr/expscom/expscom_utils.C) | 4 | ||||
-rw-r--r-- | src/usr/expaccess/expscom_utils.H (renamed from src/usr/expscom/expscom_utils.H) | 4 | ||||
-rw-r--r-- | src/usr/expaccess/i2cscomdd.C (renamed from src/usr/expscom/i2cscomdd.C) | 2 | ||||
-rw-r--r-- | src/usr/expaccess/i2cscomdd.H (renamed from src/usr/expscom/i2cscomdd.H) | 4 | ||||
-rw-r--r-- | src/usr/expaccess/makefile | 36 | ||||
-rw-r--r-- | src/usr/expaccess/mmioscomdd.C (renamed from src/usr/expscom/mmioscomdd.C) | 4 | ||||
-rw-r--r-- | src/usr/expaccess/mmioscomdd.H (renamed from src/usr/expscom/mmioscomdd.H) | 4 | ||||
-rw-r--r-- | src/usr/expaccess/runtime/makefile | 36 | ||||
-rw-r--r-- | src/usr/expaccess/runtime/test/makefile | 37 | ||||
-rw-r--r-- | src/usr/expaccess/test/expscomtest.H (renamed from src/usr/expscom/test/expscomtest.H) | 2 | ||||
-rw-r--r-- | src/usr/expaccess/test/makefile | 33 | ||||
-rw-r--r-- | src/usr/expaccess/test/ocmbcommtest.H | 334 | ||||
-rw-r--r-- | src/usr/expaccess/test/test.mk (renamed from src/usr/expscom/test/makefile) | 17 | ||||
-rw-r--r-- | src/usr/initservice/extinitsvc/extinitsvctasks.H | 2 | ||||
-rw-r--r-- | src/usr/makefile | 4 |
19 files changed, 507 insertions, 42 deletions
diff --git a/src/usr/expscom/README.md b/src/usr/expaccess/README.md index 0710b49ce..0710b49ce 100644 --- a/src/usr/expscom/README.md +++ b/src/usr/expaccess/README.md diff --git a/src/usr/expscom/makefile b/src/usr/expaccess/expaccess.mk index e6cac665e..84835c522 100644 --- a/src/usr/expscom/makefile +++ b/src/usr/expaccess/expaccess.mk @@ -1,11 +1,11 @@ # IBM_PROLOG_BEGIN_TAG # This is an automatically generated prolog. # -# $Source: src/usr/expscom/makefile $ +# $Source: src/usr/expaccess/expaccess.mk $ # # OpenPOWER HostBoot Project # -# Contributors Listed Below - COPYRIGHT 2011,2019 +# Contributors Listed Below - COPYRIGHT 2019 # [+] International Business Machines Corp. # # @@ -22,9 +22,6 @@ # permissions and limitations under the License. # # IBM_PROLOG_END_TAG -ROOTPATH = ../../.. -MODULE = expscom - EXTRAINCDIR += ${ROOTPATH}/src/import EXTRAINCDIR += ${ROOTPATH}/src/import/chips/ocmb/explorer/common/include/ EXTRAINCDIR += ${ROOTPATH}/src/import/chips/ocmb/explorer/procedures/hwp/memory/ @@ -33,16 +30,9 @@ 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_indband to use EKB's getMMIO/putMMIO +# Need to build exp_indband to use EKB's getMMIO/putMMIO/getCMD/getRSP OBJS += exp_inband.o - OBJS += expscom_trace.o OBJS += expscom_utils.o OBJS += i2cscomdd.o -OBJS += mmioscomdd.o - -SUBDIRS += test.d - -VPATH += ${ROOTPATH}/src/import/chips/ocmb/explorer/procedures/hwp/memory/ - -include ${ROOTPATH}/config.mk
\ No newline at end of file +OBJS += mmioscomdd.o
\ No newline at end of file diff --git a/src/usr/expscom/expscom_trace.C b/src/usr/expaccess/expscom_trace.C index 14b48c086..041530f27 100644 --- a/src/usr/expscom/expscom_trace.C +++ b/src/usr/expaccess/expscom_trace.C @@ -1,11 +1,11 @@ /* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ -/* $Source: src/usr/expscom/expscom_trace.C $ */ +/* $Source: src/usr/expaccess/expscom_trace.C $ */ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2018 */ +/* Contributors Listed Below - COPYRIGHT 2015,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ diff --git a/src/usr/expscom/expscom_trace.H b/src/usr/expaccess/expscom_trace.H index 8335a4b3c..6e69db714 100644 --- a/src/usr/expscom/expscom_trace.H +++ b/src/usr/expaccess/expscom_trace.H @@ -1,11 +1,11 @@ /* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ -/* $Source: src/usr/expscom/expscom_trace.H $ */ +/* $Source: src/usr/expaccess/expscom_trace.H $ */ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2018 */ +/* Contributors Listed Below - COPYRIGHT 2015,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ diff --git a/src/usr/expscom/expscom_utils.C b/src/usr/expaccess/expscom_utils.C index db2ff9dab..5ea7eeeb2 100644 --- a/src/usr/expscom/expscom_utils.C +++ b/src/usr/expaccess/expscom_utils.C @@ -1,11 +1,11 @@ /* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ -/* $Source: src/usr/expscom/expscom_utils.C $ */ +/* $Source: src/usr/expaccess/expscom_utils.C $ */ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2018 */ +/* Contributors Listed Below - COPYRIGHT 2018,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ diff --git a/src/usr/expscom/expscom_utils.H b/src/usr/expaccess/expscom_utils.H index 0a9aa0dd3..328b7c823 100644 --- a/src/usr/expscom/expscom_utils.H +++ b/src/usr/expaccess/expscom_utils.H @@ -1,11 +1,11 @@ /* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ -/* $Source: src/usr/expscom/expscom_utils.H $ */ +/* $Source: src/usr/expaccess/expscom_utils.H $ */ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2018 */ +/* Contributors Listed Below - COPYRIGHT 2018,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ diff --git a/src/usr/expscom/i2cscomdd.C b/src/usr/expaccess/i2cscomdd.C index 580bec600..97d760009 100644 --- a/src/usr/expscom/i2cscomdd.C +++ b/src/usr/expaccess/i2cscomdd.C @@ -1,7 +1,7 @@ /* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ -/* $Source: src/usr/expscom/i2cscomdd.C $ */ +/* $Source: src/usr/expaccess/i2cscomdd.C $ */ /* */ /* OpenPOWER HostBoot Project */ /* */ diff --git a/src/usr/expscom/i2cscomdd.H b/src/usr/expaccess/i2cscomdd.H index a65f847ca..84b3f97a0 100644 --- a/src/usr/expscom/i2cscomdd.H +++ b/src/usr/expaccess/i2cscomdd.H @@ -1,11 +1,11 @@ /* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ -/* $Source: src/usr/expscom/i2cscomdd.H $ */ +/* $Source: src/usr/expaccess/i2cscomdd.H $ */ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2011,2018 */ +/* Contributors Listed Below - COPYRIGHT 2011,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ diff --git a/src/usr/expaccess/makefile b/src/usr/expaccess/makefile new file mode 100644 index 000000000..f25c22bf5 --- /dev/null +++ b/src/usr/expaccess/makefile @@ -0,0 +1,36 @@ +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/usr/expaccess/makefile $ +# +# OpenPOWER HostBoot Project +# +# Contributors Listed Below - COPYRIGHT 2011,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 = expaccess + +SUBDIRS += test.d +SUBDIRS += runtime.d + +include expaccess.mk + +include ${ROOTPATH}/config.mk + +VPATH += ${ROOTPATH}/src/import/chips/ocmb/explorer/procedures/hwp/memory/
\ No newline at end of file diff --git a/src/usr/expscom/mmioscomdd.C b/src/usr/expaccess/mmioscomdd.C index 58ed0a6c6..bf4513158 100644 --- a/src/usr/expscom/mmioscomdd.C +++ b/src/usr/expaccess/mmioscomdd.C @@ -1,11 +1,11 @@ /* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ -/* $Source: src/usr/expscom/mmioscomdd.C $ */ +/* $Source: src/usr/expaccess/mmioscomdd.C $ */ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2011,2018 */ +/* Contributors Listed Below - COPYRIGHT 2011,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ diff --git a/src/usr/expscom/mmioscomdd.H b/src/usr/expaccess/mmioscomdd.H index bef9013b9..edb9ec474 100644 --- a/src/usr/expscom/mmioscomdd.H +++ b/src/usr/expaccess/mmioscomdd.H @@ -1,11 +1,11 @@ /* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ -/* $Source: src/usr/expscom/mmioscomdd.H $ */ +/* $Source: src/usr/expaccess/mmioscomdd.H $ */ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2011,2018 */ +/* Contributors Listed Below - COPYRIGHT 2011,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ diff --git a/src/usr/expaccess/runtime/makefile b/src/usr/expaccess/runtime/makefile new file mode 100644 index 000000000..ed744eab2 --- /dev/null +++ b/src/usr/expaccess/runtime/makefile @@ -0,0 +1,36 @@ +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/usr/expaccess/runtime/makefile $ +# +# OpenPOWER HostBoot Project +# +# Contributors Listed Below - COPYRIGHT 2011,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 = expaccess_rt + +SUBDIRS += test.d + +include ../expaccess.mk + +VPATH += ${ROOTPATH}/src/import/chips/ocmb/explorer/procedures/hwp/memory/ +VPATH += ${ROOTPATH}/src/usr/expaccess/ + +include ${ROOTPATH}/config.mk
\ No newline at end of file diff --git a/src/usr/expaccess/runtime/test/makefile b/src/usr/expaccess/runtime/test/makefile new file mode 100644 index 000000000..addcbd5e7 --- /dev/null +++ b/src/usr/expaccess/runtime/test/makefile @@ -0,0 +1,37 @@ +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/usr/expaccess/runtime/test/makefile $ +# +# OpenPOWER HostBoot Project +# +# Contributors Listed Below - COPYRIGHT 2011,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 + +HOSTBOOT_RUNTIME = 1 + +ROOTPATH = ../../../../.. +MODULE = testexpaccess_rt + +include ../../test/test.mk + +TESTS = ../../test/*.H + +include ${ROOTPATH}/config.mk + + diff --git a/src/usr/expscom/test/expscomtest.H b/src/usr/expaccess/test/expscomtest.H index 4acb72e21..c943ca7ba 100644 --- a/src/usr/expscom/test/expscomtest.H +++ b/src/usr/expaccess/test/expscomtest.H @@ -1,7 +1,7 @@ /* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ -/* $Source: src/usr/expscom/test/expscomtest.H $ */ +/* $Source: src/usr/expaccess/test/expscomtest.H $ */ /* */ /* OpenPOWER HostBoot Project */ /* */ diff --git a/src/usr/expaccess/test/makefile b/src/usr/expaccess/test/makefile new file mode 100644 index 000000000..8f8fb86fc --- /dev/null +++ b/src/usr/expaccess/test/makefile @@ -0,0 +1,33 @@ +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/usr/expaccess/test/makefile $ +# +# 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 + +ROOTPATH = ../../../.. +MODULE = testexpaccess + +include test.mk + +TESTS = *.H + +include ${ROOTPATH}/config.mk
\ No newline at end of file diff --git a/src/usr/expaccess/test/ocmbcommtest.H b/src/usr/expaccess/test/ocmbcommtest.H new file mode 100644 index 000000000..3c717d939 --- /dev/null +++ b/src/usr/expaccess/test/ocmbcommtest.H @@ -0,0 +1,334 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/expaccess/test/ocmbcommtest.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 __OCMBCOMMTEST_H +#define __OCMBCOMMTEST_H +/** + * @file ocmbcommtest.H + * + * @brief Test cases for OCMB communication protocol + */ +#include <cxxtest/TestSuite.H> +#include <errl/errlmanager.H> +#include <errl/errlentry.H> +#include <fapi2.H> +#ifndef __HOSTBOOT_RUNTIME +#include <vfs/vfs.H> // module_is_loaded & module_load +#endif +#include <plat_hwp_invoker.H> +#include <exp_inband.H> +#include <exp_data_structs.H> +#include <generic/memory/lib/utils/endian_utils.H> + +// EXP_FW_ADAPTER_PROPERTIES_GET data response format +#define FW_ADAPTER_MAX_FW_IMAGE 4 +#define FW_ADAPTER_CHIP_VERSION_SIZE 128 +#define FW_ADAPTER_SPI_FLASH_ID_SIZE 32 +typedef struct +{ + uint32_t fw_number_of_images; // number of FW images + uint32_t boot_partion_id; // ID of current boot partion + struct fw_version_string + { + uint32_t major; // FW version - Major release + uint32_t minor; // FW version - Minor release + uint32_t build_num; // FW build number + uint32_t build_patch; // FW build path number + uint32_t sector_size; // FW sector size + } fw_ver_str[FW_ADAPTER_MAX_FW_IMAGE]; + + uint32_t ram_size_in_bytes; // RAM size in bytes + unsigned char chip_version[FW_ADAPTER_CHIP_VERSION_SIZE]; // Explorer chip revision + unsigned char spi_flash_id[FW_ADAPTER_SPI_FLASH_ID_SIZE]; // SPI flash ID + uint32_t spi_flash_size; // SPI flash size in bytes + uint32_t error_buffer_offset; // FW error buffer offset in SPI flash + uint32_t error_buffer_size; // FW error buffer size in bytes +} FW_ADAPTER_PROPERTIES_type; + + +// Testing this code +const char EXPLORER_LIBRARY_NAME[16] = "libexpaccess.so"; + +// Need this module for mss::c_str call in HWP failure path traces +const char MSS_LIBRARY_NAME[17] = "libisteps_mss.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 = NULL; + 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; + FAPI_INF("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 = NULL; + +// 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 + { + FAPI_INF("unloadModule: %s unloaded", i_modName); + } +#endif + return err; +} + + +class OCMBCommTest: public CxxTest::TestSuite +{ + public: + + /** + * @brief Fills in command structure for the EXP_FW_ADAPTER_PROPERTIES_GET cmd + * @param io_cmd -- command that gets filled in + */ + void buildPropertiesGetCmd(host_fw_command_struct & io_cmd) + { + io_cmd.cmd_id = 0x07; // EXP_FW_ADAPTER_PROPERTIES_GET + io_cmd.cmd_flags = 0x00; // no additional data + io_cmd.request_identifier = 0x0203; // host generated id number + io_cmd.cmd_length = 0x00000000; // length of addditional data + io_cmd.cmd_crc = 0xFFFFFFFF; // CRC-32 of no additional data + io_cmd.host_work_area = 0x00000000; + io_cmd.cmd_work_area = 0x00000000; + memset(io_cmd.padding, 0, sizeof(io_cmd.padding)); + memset(io_cmd.command_argument, 0, sizeof(io_cmd.command_argument)); + } + + /** + * @brief Convert structure from little endian format into big endian + * @param o_data -- big endian output + * @param i_data -- vector of little endian data + * @return true if successful, else false + */ + bool fw_adapter_properties_struct_from_little_endian( + FW_ADAPTER_PROPERTIES_type & o_data, + std::vector<uint8_t>& i_data) + { + bool l_rc = false; + + // make sure we don't go outside i_data range + if (i_data.size() >= sizeof(o_data)) + { + uint32_t l_idx = 0; + l_rc = mss::readLE(i_data, l_idx, o_data.fw_number_of_images); + l_rc &= mss::readLE(i_data, l_idx, o_data.boot_partion_id); + for (int i = 0; i < FW_ADAPTER_MAX_FW_IMAGE; ++i) + { + l_rc &= mss::readLE(i_data, l_idx, o_data.fw_ver_str[i].major); + l_rc &= mss::readLE(i_data, l_idx, o_data.fw_ver_str[i].minor); + l_rc &= mss::readLE(i_data, l_idx, o_data.fw_ver_str[i].build_num); + l_rc &= mss::readLE(i_data, l_idx, o_data.fw_ver_str[i].build_patch); + l_rc &= mss::readLE(i_data, l_idx, o_data.fw_ver_str[i].sector_size); + } + l_rc &= mss::readLE(i_data, l_idx, o_data.ram_size_in_bytes); + l_rc &= mss::readLEArray(i_data, FW_ADAPTER_CHIP_VERSION_SIZE, l_idx, o_data.chip_version); + l_rc &= mss::readLEArray(i_data, FW_ADAPTER_SPI_FLASH_ID_SIZE, l_idx, o_data.spi_flash_id); + l_rc &= mss::readLE(i_data, l_idx, o_data.spi_flash_size); + l_rc &= mss::readLE(i_data, l_idx, o_data.error_buffer_offset); + l_rc &= mss::readLE(i_data, l_idx, o_data.error_buffer_size); + } + else + { + TS_FAIL("fw_adapter_properties_struct_from_little_endian(): " + "not enough data present (%d, expected %d)", + i_data.size(), sizeof(o_data) ); + } + return l_rc; + } + + /** + * @brief Test the Explorer inband command/response path + */ + void testOcmbInbandCmdRsp( void ) + { + errlHndl_t l_errl = nullptr; + + // 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); + + host_fw_command_struct l_cmd; + host_fw_response_struct l_rsp; + std::vector<uint8_t> l_rsp_data; + + // Create a non-destructive get_properties command + buildPropertiesGetCmd(l_cmd); + + for (auto & l_ocmb: l_chipList) + { + FAPI_INF("testOcmbInbandCmdRsp: testing 0x%.8X OCMB", TARGETING::get_huid(l_ocmb)); + + fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>l_fapi2_target( l_ocmb ); + + // send the command + FAPI_INVOKE_HWP(l_errl, mss::exp::ib::putCMD, l_fapi2_target, + l_cmd); + if (l_errl) + { + TS_FAIL("Error from putCMD for 0x%.8X target", + TARGETING::get_huid(l_ocmb)); + break; + } + + // grab the response + FAPI_INVOKE_HWP(l_errl, mss::exp::ib::getRSP, l_fapi2_target, + l_rsp, l_rsp_data); + if (l_errl) + { + TS_FAIL("Error from getRSP for 0x%.8X target", + TARGETING::get_huid(l_ocmb)); + break; + } + + // Check for a valid data response length + if (l_rsp.response_length != sizeof(FW_ADAPTER_PROPERTIES_type)) + { + TS_FAIL("Unexpected response length 0x%.8X (expected 0x%.8X)", + l_rsp.response_length, sizeof(FW_ADAPTER_PROPERTIES_type)); + break; + } + + // Now convert the little endian response data into big endian + FW_ADAPTER_PROPERTIES_type l_fw_adapter_data; + fw_adapter_properties_struct_from_little_endian(l_fw_adapter_data, + l_rsp_data); + + // Check for some expected response values + // Simics should return 0x10 as the first byte of chip_version + if (l_fw_adapter_data.chip_version[0] != 0x10 ) + { + TS_FAIL("Expected chip_version to start with 0x10, found 0x%02X", + l_fw_adapter_data.chip_version[0]); + } + } + + if (l_errl) + { + errlCommit( l_errl, TARG_COMP_ID ); + } + FAPI_INF("testOcmbInbandCmdRsp: exiting"); + }; + + /** + * @brief Constructor + */ + OCMBCommTest() : CxxTest::TestSuite() + { + explorer_module_loaded = false; + mss_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(explorer_module_loaded, EXPLORER_LIBRARY_NAME); + if(err) + { + TS_FAIL("OCMBCommTest() - Constuctor: failed to load EXPLORER module"); + errlCommit( err, TARG_COMP_ID ); + } + else + { + err = loadModule(mss_module_loaded, MSS_LIBRARY_NAME); + if(err) + { + TS_FAIL("OCMBCommTest() - Constuctor: failed to load MSS module"); + errlCommit( err, TARG_COMP_ID ); + } + } +#endif + }; + + + /** + * @brief Destructor + */ + ~OCMBCommTest() + { + errlHndl_t err = nullptr; + if (explorer_module_loaded) + { + err = unloadModule(EXPLORER_LIBRARY_NAME); + if(err) + { + TS_FAIL("~OCMBCommTest() - Destructor: failed to unload EXPLORER module"); + errlCommit( err, TARG_COMP_ID ); + } + } + if (mss_module_loaded) + { + err = unloadModule(MSS_LIBRARY_NAME); + if(err) + { + TS_FAIL("~OCMBCommTest() - Destructor: failed to unload MSS module"); + errlCommit( err, TARG_COMP_ID ); + } + } + }; + + private: + // use these to keep track of if we need to unload any + // modules loaded by this testcase + bool explorer_module_loaded; + bool mss_module_loaded; + +}; + +#endif diff --git a/src/usr/expscom/test/makefile b/src/usr/expaccess/test/test.mk index 79e47ffb7..059efe27d 100644 --- a/src/usr/expscom/test/makefile +++ b/src/usr/expaccess/test/test.mk @@ -1,11 +1,11 @@ # IBM_PROLOG_BEGIN_TAG # This is an automatically generated prolog. # -# $Source: src/usr/expscom/test/makefile $ +# $Source: src/usr/expaccess/test/test.mk $ # # OpenPOWER HostBoot Project # -# Contributors Listed Below - COPYRIGHT 2018 +# Contributors Listed Below - COPYRIGHT 2019 # [+] International Business Machines Corp. # # @@ -22,15 +22,14 @@ # permissions and limitations under the License. # # IBM_PROLOG_END_TAG -ROOTPATH = ../../../.. - -EXTRAINCDIR += ${ROOTPATH}/src/include/usr/fapi2/ +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/ocmb/explorer/procedures/hwp/memory -EXTRAINCDIR += ${ROOTPATH}/src/import/ +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 -MODULE = testexpscom -TESTS = *.H include ${ROOTPATH}/config.mk diff --git a/src/usr/initservice/extinitsvc/extinitsvctasks.H b/src/usr/initservice/extinitsvc/extinitsvctasks.H index 71ac9b945..971269817 100644 --- a/src/usr/initservice/extinitsvc/extinitsvctasks.H +++ b/src/usr/initservice/extinitsvc/extinitsvctasks.H @@ -383,7 +383,7 @@ const TaskInfo g_exttaskinfolist[] = { * @brief Explorer Scom library */ { - "libexpscom.so" , // taskname + "libexpaccess.so" , // taskname NULL, // no pointer to fn { INIT_TASK, // task type diff --git a/src/usr/makefile b/src/usr/makefile index c2c0f5b35..5f4e94cf3 100644 --- a/src/usr/makefile +++ b/src/usr/makefile @@ -5,7 +5,7 @@ # # OpenPOWER HostBoot Project # -# Contributors Listed Below - COPYRIGHT 2010,2018 +# Contributors Listed Below - COPYRIGHT 2010,2019 # [+] Google Inc. # [+] International Business Machines Corp. # @@ -36,7 +36,7 @@ SUBDIRS += diag.d SUBDIRS += dump.d SUBDIRS += errl.d SUBDIRS += errldisplay.d -SUBDIRS += expscom.d +SUBDIRS += expaccess.d SUBDIRS += fapi2.d SUBDIRS += fsi.d SUBDIRS += fsiscom.d |