diff options
| author | Tzafrir Cohen <tzafrir@debian.org> | 2025-09-17 07:08:47 +0300 |
|---|---|---|
| committer | git-ubuntu importer <ubuntu-devel-discuss@lists.ubuntu.com> | 2025-09-17 10:47:15 +0000 |
| commit | 5c47b3f775633ee4f144f19ba638c2c1073d97b1 (patch) | |
| tree | f2bb8e840c6e34827a81a5c84e03592da45ae916 /fw_comps_mgr | |
| parent | efcd6aa58a664da726c42ad146004377b7a57c91 (diff) | |
4.33.0+1-1 (patches unapplied)HEADimport/4.33.0+1-1ubuntu/resolute-develubuntu/resoluteubuntu/questing-proposedubuntu/questing-develubuntu/questingubuntu/develdebian/sid
Imported using git-ubuntu import.
Notes
Notes: * New upstream release (Closes: #1097420). - Remove patches: - dev_mgt-include-missing-function-declaration.patch - fwctrl-fix-reg-status-typo.patch - fwctrl-include-missing-function-declarations.patch - kernel_fallthrough.patch - kernel_ioremap_check_null.patch - kernel_statify.patch * Note that fwctl is supported
Diffstat (limited to 'fw_comps_mgr')
| -rwxr-xr-x | fw_comps_mgr/Makefile.am | 3 | ||||
| -rw-r--r-- | fw_comps_mgr/Makefile.in | 24 | ||||
| -rw-r--r-- | fw_comps_mgr/fw_comps_mgr.cpp | 216 | ||||
| -rw-r--r-- | fw_comps_mgr/fw_comps_mgr.h | 16 |
4 files changed, 207 insertions, 52 deletions
diff --git a/fw_comps_mgr/Makefile.am b/fw_comps_mgr/Makefile.am index a82fec1..3648a78 100755 --- a/fw_comps_mgr/Makefile.am +++ b/fw_comps_mgr/Makefile.am @@ -68,7 +68,8 @@ libfw_comps_mgr_la_DEPENDENCIES = \ $(top_builddir)/reg_access/libreg_access.la \ $(top_builddir)/${MTCR_CONF_DIR}/libmtcr_ul.la \ $(top_builddir)/tools_res_mgmt/libtools_res_mgmt.la \ - $(top_builddir)/mft_utils/libmftutils.la + $(top_builddir)/mft_utils/libmftutils.la \ + $(top_builddir)/common/libcommon.la if ENABLE_INBAND diff --git a/fw_comps_mgr/Makefile.in b/fw_comps_mgr/Makefile.in index 4e22753..5e9f490 100644 --- a/fw_comps_mgr/Makefile.in +++ b/fw_comps_mgr/Makefile.in @@ -117,7 +117,7 @@ DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/config/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_compile_flag.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -223,13 +223,13 @@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +CABLE_ACCESS_DIR = @CABLE_ACCESS_DIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMPILER_FPIC = @COMPILER_FPIC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ -CURL_INC_DIR = @CURL_INC_DIR@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ @@ -283,6 +283,7 @@ MUPARSER_CFLAGS = @MUPARSER_CFLAGS@ MUPARSER_LIBS = @MUPARSER_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ +NVML_DIR = @NVML_DIR@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OFED_BUILD = @OFED_BUILD@ @@ -296,6 +297,9 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PROJECT = @PROJECT@ RANLIB = @RANLIB@ SED = @SED@ @@ -308,6 +312,7 @@ TOOLS_BUILD_TIME = @TOOLS_BUILD_TIME@ TOOLS_CRYPTO = @TOOLS_CRYPTO@ TOOLS_GIT_SHA = @TOOLS_GIT_SHA@ VERSION = @VERSION@ +VFIO_DRIVER_DIR = @VFIO_DRIVER_DIR@ XZ_UTILS_DIR = @XZ_UTILS_DIR@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ @@ -335,6 +340,8 @@ default_en_inband = @default_en_inband@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ +expat_CFLAGS = @expat_CFLAGS@ +expat_LIBS = @expat_LIBS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -344,13 +351,23 @@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ +libcurl_CFLAGS = @libcurl_CFLAGS@ +libcurl_LIBS = @libcurl_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ +liblzma_CFLAGS = @liblzma_CFLAGS@ +liblzma_LIBS = @liblzma_LIBS@ +libxml2_CFLAGS = @libxml2_CFLAGS@ +libxml2_LIBS = @libxml2_LIBS@ +libz_CFLAGS = @libz_CFLAGS@ +libz_LIBS = @libz_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ +openssl_CFLAGS = @openssl_CFLAGS@ +openssl_LIBS = @openssl_LIBS@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ @@ -394,7 +411,8 @@ libfw_comps_mgr_la_DEPENDENCIES = \ $(top_builddir)/reg_access/libreg_access.la \ $(top_builddir)/${MTCR_CONF_DIR}/libmtcr_ul.la \ $(top_builddir)/tools_res_mgmt/libtools_res_mgmt.la \ - $(top_builddir)/mft_utils/libmftutils.la $(am__append_2) + $(top_builddir)/mft_utils/libmftutils.la \ + $(top_builddir)/common/libcommon.la $(am__append_2) libfw_comps_mgr_la_LIBADD = $(libfw_comps_mgr_la_DEPENDENCIES) all: all-am diff --git a/fw_comps_mgr/fw_comps_mgr.cpp b/fw_comps_mgr/fw_comps_mgr.cpp index 955d87a..857317b 100644 --- a/fw_comps_mgr/fw_comps_mgr.cpp +++ b/fw_comps_mgr/fw_comps_mgr.cpp @@ -42,6 +42,7 @@ #include "fw_comps_mgr_dma_access.h" #include "common/bit_slice.h" #include "common/tools_time.h" +#include "reg_access/mcam_capabilities.h" #include <signal.h> #include <iostream> @@ -652,8 +653,12 @@ bool FwCompsMgr::controlFsm(fsm_command_t command, _lastFsmCtrl.update_handle = _updateHandle; if (_linkXFlow && (command == FSM_CMD_DOWNSTREAM_DEVICE_TRANSFER || command == FSM_CMD_ACTIVATE_ALL)) { - _lastFsmCtrl.component_index = - 0; /* This the FW need - for downstream need to work with 0/device_id or auto_update */ + comp_query_st compQuery = _compsQueryMap[FwComponent::COMPID_LINKX]; + if (compQuery.comp_status.component_index == _componentIndex) + { + _lastFsmCtrl.component_index = + 0; // This the FW need - for downstream need to work with 0/device_id or auto_update + } if (_autoUpdate) { _lastFsmCtrl.auto_update = 1; _lastFsmCtrl.device_index_size = 0; @@ -1168,16 +1173,32 @@ void FwCompsMgr::GenerateHandle() } } -const char* CompNames[] = {"NO_COMPONENT 1", "COMPID_BOOT_IMG", - "COMPID_RUNTIME_IMG", "COMPID_USER_NVCONFIG", - "COMPID_OEM_NVCONFIG", "COMPID_MLNX_NVCONFIG", - "COMPID_CS_TOKEN", "COMPID_DBG_TOKEN", - "COMPID_DEV_INFO", "NO_COMPONENT 2", - "COMPID_GEARBOX", "COMPID_CONGESTION_CONTROL", - "COMPID_LINKX_PROPERTIES", "COMPID_CRYPTO_TO_COMMISSIONING", - "COMPID_RMCS_TOKEN", "COMPID_RMDT_TOKEN", - "COMPID_CRCS_TOKEN", "COMPID_CRDT_TOKEN", - "COMPID_CLOCK_SYNC_EEPROM"}; +const char* CompNames[] = {"NO_COMPONENT 1", + "COMPID_BOOT_IMG", + "COMPID_RUNTIME_IMG", + "COMPID_USER_NVCONFIG", + "COMPID_OEM_NVCONFIG", + "COMPID_MLNX_NVCONFIG", + "COMPID_CS_TOKEN", + "COMPID_DBG_TOKEN", + "COMPID_DEV_INFO", + "NO_COMPONENT 2", + "COMPID_GEARBOX", + "COMPID_CONGESTION_CONTROL", + "COMPID_LINKX_PROPERTIES", + "COMPID_CRYPTO_TO_COMMISSIONING", + "COMPID_RMCS_TOKEN", + "COMPID_RMDT_TOKEN", + "COMPID_CRCS_TOKEN", + "COMPID_CRDT_TOKEN", + "COMPID_CLOCK_SYNC_EEPROM", + "NO_COMPONENT 3", + "NO_COMPONENT 4", + "COMPID_DIGITAL_CACERT_CHAIN", + "COMPID_DIGITAL_CACERT_REMOVAL", + "COMPID_DIGITAL_CACERT_CHAIN_REMOVAL", + "NO_COMPONENT 4", + "COMPID_LINKX_ELS"}; bool FwCompsMgr::RefreshComponentsStatus(comp_status_st* ComponentStatus) { @@ -1196,37 +1217,48 @@ bool FwCompsMgr::RefreshComponentsStatus(comp_status_st* ComponentStatus) memset(&compStatus, 0, sizeof(comp_query_st)); if (queryComponentStatus(compIdx, &(compStatus.comp_status))) { compStatus.comp_status.component_index = compIdx; - if ((ComponentStatus != NULL) && (compStatus.comp_status.identifier == FwComponent::COMPID_LINKX)) { + if (ComponentStatus != NULL && (compStatus.comp_status.identifier == FwComponent::COMPID_LINKX || + compStatus.comp_status.identifier == FwComponent::COMPID_LINKX_ELS)) + { memcpy(ComponentStatus, &compStatus.comp_status, sizeof(compStatus.comp_status)); } /* */ - u_int32_t capSt[DEFAULT_SIZE] = {0}; - if (queryComponentInfo(compIdx, 1, COMPINFO_CAPABILITIES, DEFAULT_SIZE, capSt) == false) { - if (queryComponentInfo(compIdx, 0, COMPINFO_CAPABILITIES, DEFAULT_SIZE, capSt) == false) { - /*_lastError = FWCOMPS_REG_FAILED; */ - DPRINTF(("-D- Found component: %#x name %s MCQI failed \n", compStatus.comp_status.identifier, - CompNames[compStatus.comp_status.identifier])); - return false; + if (compStatus.comp_status.identifier > FwComponent::COMPID_LAST_IDX || + compStatus.comp_status.identifier < FwComponent::COMPID_FIRST_IDX) + { + DPRINTF(("-D- queryComponentStatus, unknown component identifier %d !!\n", + compStatus.comp_status.identifier)); + } + else + { + u_int32_t capSt[DEFAULT_SIZE] = {0}; + if (queryComponentInfo(compIdx, 1, COMPINFO_CAPABILITIES, DEFAULT_SIZE, capSt) == false) { + if (queryComponentInfo(compIdx, 0, COMPINFO_CAPABILITIES, DEFAULT_SIZE, capSt) == false) { + /*_lastError = FWCOMPS_REG_FAILED; */ + DPRINTF(("-D- Found component: %#x name %s MCQI failed \n", compStatus.comp_status.identifier, + CompNames[compStatus.comp_status.identifier])); + return false; + } } + compStatus.valid = 1; + compStatus.comp_cap.supported_info_bitmask = _currCompInfo.data.mcqi_cap_ext.supported_info_bitmask; + compStatus.comp_cap.component_size = _currCompInfo.data.mcqi_cap_ext.component_size; + compStatus.comp_cap.max_component_size = _currCompInfo.data.mcqi_cap_ext.max_component_size; + compStatus.comp_cap.mcda_max_write_size = _currCompInfo.data.mcqi_cap_ext.mcda_max_write_size; + compStatus.comp_cap.log_mcda_word_size = _currCompInfo.data.mcqi_cap_ext.log_mcda_word_size; + compStatus.comp_cap.match_base_guid_mac = _currCompInfo.data.mcqi_cap_ext.match_base_guid_mac; + compStatus.comp_cap.check_user_timestamp = _currCompInfo.data.mcqi_cap_ext.check_user_timestamp; + compStatus.comp_cap.match_psid = _currCompInfo.data.mcqi_cap_ext.match_psid; + compStatus.comp_cap.match_chip_id = _currCompInfo.data.mcqi_cap_ext.match_chip_id; + compStatus.comp_cap.signed_updates_only = _currCompInfo.data.mcqi_cap_ext.signed_updates_only; + compStatus.comp_cap.rd_en = _currCompInfo.data.mcqi_cap_ext.rd_en; + memcpy(&(_compsQueryMap[compStatus.comp_status.identifier]), &compStatus, sizeof(compStatus)); + // reg_access_hca_mcqi_cap_ext_ext_print(&(compStatus.comp_cap), stdout, 3); + DPRINTF(("-D- Found component with identifier=%#x index=%u name=%s supported_info_bitmask=0x%x \n", + compStatus.comp_status.identifier, compIdx, CompNames[compStatus.comp_status.identifier], + compStatus.comp_cap.supported_info_bitmask)); } - compStatus.valid = 1; - compStatus.comp_cap.supported_info_bitmask = _currCompInfo.data.mcqi_cap_ext.supported_info_bitmask; - compStatus.comp_cap.component_size = _currCompInfo.data.mcqi_cap_ext.component_size; - compStatus.comp_cap.max_component_size = _currCompInfo.data.mcqi_cap_ext.max_component_size; - compStatus.comp_cap.mcda_max_write_size = _currCompInfo.data.mcqi_cap_ext.mcda_max_write_size; - compStatus.comp_cap.log_mcda_word_size = _currCompInfo.data.mcqi_cap_ext.log_mcda_word_size; - compStatus.comp_cap.match_base_guid_mac = _currCompInfo.data.mcqi_cap_ext.match_base_guid_mac; - compStatus.comp_cap.check_user_timestamp = _currCompInfo.data.mcqi_cap_ext.check_user_timestamp; - compStatus.comp_cap.match_psid = _currCompInfo.data.mcqi_cap_ext.match_psid; - compStatus.comp_cap.match_chip_id = _currCompInfo.data.mcqi_cap_ext.match_chip_id; - compStatus.comp_cap.signed_updates_only = _currCompInfo.data.mcqi_cap_ext.signed_updates_only; - compStatus.comp_cap.rd_en = _currCompInfo.data.mcqi_cap_ext.rd_en; - memcpy(&(_compsQueryMap[compStatus.comp_status.identifier]), &compStatus, sizeof(compStatus)); - // reg_access_hca_mcqi_cap_ext_ext_print(&(compStatus.comp_cap), stdout, 3); last_index_flag = compStatus.comp_status.last_index_flag; - DPRINTF(("-D- Found component with identifier=%#x index=%u name=%s supported_info_bitmask=0x%x \n", - compStatus.comp_status.identifier, compIdx, CompNames[compStatus.comp_status.identifier], - compStatus.comp_cap.supported_info_bitmask)); } else { DPRINTF(("-D- queryComponentStatus failed for component index %d !!\n", compIdx)); return false; @@ -1389,9 +1421,12 @@ bool FwCompsMgr::burnComponents(std::vector < FwComponent >& comps, ProgressCall DPRINTF(("Verifying FW component has failed!\n")); return false; } - if (comps[i].getType() == FwComponent::COMPID_LINKX || comps[i].getType() == FwComponent::COMPID_CLOCK_SYNC_EEPROM) { - if (!controlFsm(FSM_CMD_DOWNSTREAM_DEVICE_TRANSFER, FSMST_DOWNSTREAM_DEVICE_TRANSFER, 0, FSMST_LOCKED, - progressFuncAdv)) { + if (comps[i].getType() == FwComponent::COMPID_LINKX || + comps[i].getType() == FwComponent::COMPID_LINKX_ELS || + comps[i].getType() == FwComponent::COMPID_CLOCK_SYNC_EEPROM) + { + if (!controlFsm(FSM_CMD_DOWNSTREAM_DEVICE_TRANSFER, FSMST_DOWNSTREAM_DEVICE_TRANSFER, 0, FSMST_LOCKED, + progressFuncAdv)) { DPRINTF(("Downstream LinkX begin has failed!\n")); return false; } @@ -1534,8 +1569,8 @@ const char* FwComponent::getCompIdStr(comps_ids_t compId) return "DIGITAL_CACERT_CHAIN"; case DIGITAL_CACERT_REMOVAL: return "DIGITAL_CACERT_REMOVAL"; - case DIGITAL_CACERT_CHAIN_REMOVAL: - return "DIGITAL_CACERT_CHAIN_REMOVAL"; + case COMPID_LINKX_ELS: + return "COMPID_LINKX_ELS"; default: return "UNKNOWN_COMPONENT"; } @@ -1544,6 +1579,7 @@ const char* FwComponent::getCompIdStr(comps_ids_t compId) u_int32_t FwCompsMgr::getFwSupport() { u_int32_t devid = 0; + _secureHostState = 0x0; _isDmaSupported = false; #ifndef UEFI_BUILD @@ -1604,20 +1640,20 @@ u_int32_t FwCompsMgr::getFwSupport() return 0; } _mircCaps = EXTRACT(mcam.mng_access_reg_cap_mask[3 - 3], 2, 1); - int mode = 0; + struct tools_open_mlock mlock; memset(&mlock, 0, sizeof(mlock)); rc = reg_access_secure_host(_mf, REG_ACCESS_METHOD_GET, &mlock); if (rc == ME_OK) { - mode = mlock.operation; + _secureHostState = mlock.operation; } DPRINTF(( "getFwSupport _mircCaps = %d mcqsCap = %d mcqiCap = %d mccCap = %d mcdaCap = %d mqisCap = %d mcddCap = %d mgirCap = %d secure_host = %d\n", - _mircCaps, mcqsCap, mcqiCap, mccCap, mcdaCap, mqisCap, mcddCap, mgirCap, mode)); + _mircCaps, mcqsCap, mcqiCap, mccCap, mcdaCap, mqisCap, mcddCap, mgirCap, _secureHostState)); - if (mcqsCap && mcqiCap && mccCap && mcdaCap && mqisCap && mgirCap && mode == 0) + if (mcqsCap && mcqiCap && mccCap && mcdaCap && mqisCap && mgirCap && _secureHostState == 0) { return 1; } @@ -1812,6 +1848,7 @@ bool FwCompsMgr::queryFwInfo(fwInfoT* query, bool next_boot_fw_ver) query->ini_file_version = mgir.fw_info.ini_file_version; query->geo_address = mgir.hw_info.ga; query->geo_address_valid = mgir.hw_info.ga_valid; + query->independent_module = mgir.hw_info.module_master_fw_default; /* Since in switches MGIR 'dev' field is used to indicate dev-branch instead of the original purpose for dev-secure, */ /* we now read from a new field called 'dev_sc' to determine if the switch is dev-secure */ @@ -1863,6 +1900,20 @@ bool FwCompsMgr::queryFwInfo(fwInfoT* query, bool next_boot_fw_ver) strncpy(query->deviceVsd, (char*)deviceVsd.data(), VSD_LEN); } + query->pci_switch_only_mode_valid = 0; + bool is_hca = dm_dev_is_hca(dm_device_id); + if (is_hca) + { + bool is_mgir_pci_switch_only_mode_supported = false; + rc = isCapabilitySupportedAccordingToMcamReg(_mf, MCAM_CAP_MGIR_PCI_SWITCH_ONLY_MODE, is_hca, + &is_mgir_pci_switch_only_mode_supported); + if (rc == ME_OK && is_mgir_pci_switch_only_mode_supported) + { + query->pci_switch_only_mode_valid = 1; + query->pci_switch_only_mode = mgir.hw_info.pci_switch_only_mode; + } + } + return true; } @@ -2141,6 +2192,10 @@ bool FwCompsMgr::IsDevicePresent(FwComponent::comps_ids_t compType) { comp_status_st query; memset(&query, 0, sizeof(query)); + if (_compsQueryMap.empty()) + { + RefreshComponentsStatus(); + } if (_compsQueryMap[compType].valid) { if (!queryComponentStatus(_compsQueryMap[compType].comp_status.component_index, &query)) @@ -2512,3 +2567,72 @@ fw_comps_error_t FwCompsMgr::mccErrTrans(u_int8_t err) return FWCOMPS_GENERAL_ERR; } } + + +bool FwCompsMgr::runMISOC(reg_access_hca_misoc_reg_ext* bfb_component, u_int32_t type, u_int32_t query_pending) +{ + // check via MCAM if MISOC supported + int misoc_reg_supported = 0; + reg_access_hca_mcam_reg_ext mcam; + memset(&mcam, 0, sizeof(mcam)); + mcam.access_reg_group = 0; // group 0 for IDs 0x9001 to 0x907F + reg_access_status_t rc = reg_access_mcam(_mf, REG_ACCESS_METHOD_GET, &mcam); + if (rc == ME_OK) + { + // MISOC is bit 38s + // DWORD select logic: 3 - (38 / 32) + // bit select logic: 38 % 32 + misoc_reg_supported = EXTRACT(mcam.mng_access_reg_cap_mask[3 - 1], 6, 1); + } + DPRINTF(("misoc_reg_supported = %d\n", misoc_reg_supported)); + if (!misoc_reg_supported) + { + _lastError = FWCOMPS_REG_ACCESS_REG_NOT_SUPP; + return false; + } + + bool ret = true; + mft_signal_set_handling(1); + bfb_component->type = EXTRACT(type, 0, 4); + bfb_component->query_pending = EXTRACT(query_pending, 0, 1); + + DPRINTF(("-D- MISOC: type %u query_pending %u" + "\n", + type, query_pending)); + rc = reg_access_misoc(_mf, REG_ACCESS_METHOD_GET, bfb_component); + deal_with_signal(); + if (rc) + { + _lastError = regErrTrans(rc); + setLastRegisterAccessStatus(rc); + ret = false; + } + + return ret; +} + +bool FwCompsMgr::queryMISOC(std::string& version, u_int32_t type, u_int32_t query_pending) +{ + struct reg_access_hca_misoc_reg_ext bfb_component; + memset(&bfb_component, 0, sizeof(bfb_component)); + + if (!runMISOC(&bfb_component, type, query_pending)) + { + DPRINTF(("Error in reading MISOC register.\n")); + return false; + } + + if (bfb_component.query_not_available) + { + version = "Info not available"; + } + else + { + char version_str[257]; + memset(version_str, 0, sizeof(version_str)); + memcpy(version_str, bfb_component.version, 256); + version = version_str; + } + + return true; +} \ No newline at end of file diff --git a/fw_comps_mgr/fw_comps_mgr.h b/fw_comps_mgr/fw_comps_mgr.h index bb0bd73..92e8ebb 100644 --- a/fw_comps_mgr/fw_comps_mgr.h +++ b/fw_comps_mgr/fw_comps_mgr.h @@ -43,6 +43,7 @@ #include <vector> #include <string> +#include <map> #include "reg_access/reg_access.h" #include "mlxfwops/uefi_c/mft_uefi_common.h" #include "mlxfwops/lib/mlxfwops_com.h" @@ -139,6 +140,9 @@ typedef struct u_int32_t ini_file_version; u_int8_t geo_address; bool geo_address_valid; + uint8_t independent_module; + uint8_t pci_switch_only_mode; + uint8_t pci_switch_only_mode_valid; } fwInfoT; @@ -177,6 +181,7 @@ class FwComponent public: typedef enum { + COMPID_FIRST_IDX = 0x1, COMPID_BOOT_IMG = 0x1, COMPID_RUNTIME_IMG = 0x2, COMPID_USER_NVCONFIG = 0x3, @@ -198,7 +203,10 @@ public: DIGITAL_CACERT_CHAIN = 0x16, DIGITAL_CACERT_REMOVAL = 0x17, DIGITAL_CACERT_CHAIN_REMOVAL = 0x18, - COMPID_UNKNOWN = 0xff, + COMPID_LINKX_ELS = 0x1a, + COMPID_BFB = 0x1b, + COMPID_LAST_IDX = 0x1b, + COMPID_UNKNOWN = 0xFFFF, } comps_ids_t; typedef enum @@ -441,6 +449,10 @@ public: u_int32_t local_port = 0, u_int8_t pnat = 0, u_int32_t lp_msb = 0); + u_int8_t GetSecureHostState() { return _secureHostState; } + bool IsDevicePresent(FwComponent::comps_ids_t compType); + bool queryMISOC(std::string& version, u_int32_t type, u_int32_t query_pending); + bool runMISOC(reg_access_hca_misoc_reg_ext* bfb_component, u_int32_t type, u_int32_t query_pending); private: typedef enum @@ -575,7 +587,6 @@ private: void extractRomInfo(mgirReg* mgir, fwInfoT* fwQuery); bool isDMAAccess(); bool fallbackToRegisterAccess(); - bool IsDevicePresent(FwComponent::comps_ids_t compType); std::vector<comp_query_st> _compsQueryMap; bool _fwSupport; @@ -611,5 +622,6 @@ private: #ifndef UEFI_BUILD trm_ctx _trm; #endif + u_int8_t _secureHostState; }; #endif /* USER_MLXFWOPS_LIB_FW_COMPS_MGR_H_ */ |
