diff options
-rw-r--r-- | src/usr/runtime/common/extra_runtime_attributes.xml | 31 | ||||
-rw-r--r-- | src/usr/runtime/common/hsvc_attribute_structs.H | 84 | ||||
-rw-r--r-- | src/usr/runtime/common/hsvc_exdata.C | 62 | ||||
-rw-r--r-- | src/usr/runtime/common/hsvc_procdata.C | 275 | ||||
-rw-r--r-- | src/usr/runtime/common/hsvc_sysdata.C | 135 | ||||
-rw-r--r-- | src/usr/runtime/makefile | 2 | ||||
-rw-r--r-- | src/usr/runtime/populate_attributes.C | 846 | ||||
-rw-r--r-- | src/usr/runtime/test/makefile | 3 | ||||
-rw-r--r-- | src/usr/runtime/test/runtimeattrstest.H | 528 |
9 files changed, 0 insertions, 1966 deletions
diff --git a/src/usr/runtime/common/extra_runtime_attributes.xml b/src/usr/runtime/common/extra_runtime_attributes.xml deleted file mode 100644 index 6058e554c..000000000 --- a/src/usr/runtime/common/extra_runtime_attributes.xml +++ /dev/null @@ -1,31 +0,0 @@ -<!-- IBM_PROLOG_BEGIN_TAG --> -<!-- This is an automatically generated prolog. --> -<!-- --> -<!-- $Source: src/usr/runtime/common/extra_runtime_attributes.xml $ --> -<!-- --> -<!-- OpenPOWER HostBoot Project --> -<!-- --> -<!-- COPYRIGHT International Business Machines Corp. 2012,2014 --> -<!-- --> -<!-- 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 --> -<!-- -Contains FAPI attributes that we want to send up to HostServices -that may not be specifically defined in the various HWP attribute -xml files and procedures - -Parser only requires attribute, id and targetType tags. ---> - -<!-- Leaving file in place to handle possible workarounds --> diff --git a/src/usr/runtime/common/hsvc_attribute_structs.H b/src/usr/runtime/common/hsvc_attribute_structs.H deleted file mode 100644 index 6e6b40a79..000000000 --- a/src/usr/runtime/common/hsvc_attribute_structs.H +++ /dev/null @@ -1,84 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/usr/runtime/common/hsvc_attribute_structs.H $ */ -/* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* COPYRIGHT International Business Machines Corp. 2012,2014 */ -/* */ -/* 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 __RUNTIME_HSVC_ATTRIBUTE_STRUCTS_H -#define __RUNTIME_HSVC_ATTRIBUTE_STRUCTS_H - -/** - * @file attribute_structs.H - * - * @brief Shared structures with the HostServices code - */ -struct hsvc_proc_header_t { - uint64_t procid; //=NNNCCC - uint64_t offset; //offset to attribute header relative to start of node_data - uint64_t numAttr; //number of populated attributes - static const uint64_t NO_PROC = 0xFFFFFFFFFFFFFFFF; -}; - -struct hsvc_ex_header_t { - uint64_t parent_procid; //=NNNCCC - uint64_t chiplet; //physical ex number (0..15) - uint64_t offset; //offset to attribute header relative to start of node_data - uint64_t numAttr; //number of populated attributes - static const uint64_t NO_PROC = 0xFFFFFFFFFFFFFFFF; - static const uint64_t NO_CHIPLET = 0xFFFFFFFFFFFFFFFF; -}; - -struct hsvc_attr_header_t { - uint64_t id; // attribute id - uint64_t sizeBytes; // size of attribute data - uint64_t offset; // offset to attribute data relative to start of node_data/sys_data - static const uint64_t NO_ATTRIBUTE = 0x0; -}; - -// This is the data that will be in the 'System Attribute Data' -// section of HDAT -struct hsvc_system_data_t -{ - uint64_t nodePresent; //bitstring of populated nodes, bit0=node0, etc - uint64_t numAttr; //number of populated attributes - uint64_t offset; //offset to attribute headers relative to start of system_data - //blob of data... -}; - -// This is the data that will be in the 'Node Attribute Data' -// section of HDAT, there will be 1 of these per physical -// drawer/book/octant/blade -struct hsvc_node_data_t -{ - uint64_t procOffset; //offset to proc headers relative to start of node_data - uint64_t exOffset; //offset to ex headers relative to start of node_data - uint64_t numTargets; //number of proc+ex targets present in this node - //blob of data... -}; - -// Custom Attribute IDs -// Note: Standard fapi::AttributeId are only 32-bits so we can use the top -// 32-bits of the 64-bit value for our own numbers -static const uint64_t HSVC_HUID = 0xFF000001FFFFFFFF; -static const uint64_t HSVC_PHYS_PATH = 0xFF000002FFFFFFFF; -static const uint64_t HSVC_ECMD_STRING = 0xFF000003FFFFFFFF; -static const uint64_t HSVC_IBSCOM_BASE = 0xFF000004FFFFFFFF; -static const uint64_t HSVC_PLID = 0xFF000005FFFFFFFF; - -#endif diff --git a/src/usr/runtime/common/hsvc_exdata.C b/src/usr/runtime/common/hsvc_exdata.C deleted file mode 100644 index a8c22453c..000000000 --- a/src/usr/runtime/common/hsvc_exdata.C +++ /dev/null @@ -1,62 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/usr/runtime/common/hsvc_exdata.C $ */ -/* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* Contributors Listed Below - COPYRIGHT 2012,2015 */ -/* [+] 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 */ -// Generated on Wed Feb 18 09:37:26 CST 2015 by cswenson from -// ./create_hsvc_data.pl -w ../../xml/attribute_info/chip_attributes.xml ../../xml/attribute_info/common_attributes.xml ../../xml/attribute_info/freq_attributes.xml ../../xml/attribute_info/L2_L3_attributes.xml ../../xml/attribute_info/p8_xip_customize_attributes.xml ../../xml/attribute_info/pm_hwp_attributes.xml ../../xml/attribute_info/pm_plat_attributes.xml ../../xml/attribute_info/poreve_memory_attributes.xml ../../xml/attribute_info/proc_chip_ec_feature.xml ../../xml/attribute_info/proc_fab_smp_fabric_attributes.xml ../../xml/attribute_info/proc_pll_ring_attributes.xml ../../xml/attribute_info/proc_setup_bars_l3_attributes.xml ../../xml/attribute_info/proc_winkle_scan_override_attributes.xml ../../xml/attribute_info/scratch_attributes.xml ../../xml/attribute_info/system_attributes.xml ../../xml/attribute_info/unit_attributes.xml -// -- Input: ../../xml/attribute_info/chip_attributes.xml -- -HSVC_LOAD_ATTR( ATTR_TARGET_SCOMABLE ); -// -- Input: ../../xml/attribute_info/common_attributes.xml -- -HSVC_LOAD_ATTR( ATTR_FUNCTIONAL ); -// -- Input: ../../xml/attribute_info/freq_attributes.xml -- -// No attributes found -// -- Input: ../../xml/attribute_info/L2_L3_attributes.xml -- -// No attributes found -// -- Input: ../../xml/attribute_info/p8_xip_customize_attributes.xml -- -HSVC_LOAD_ATTR( ATTR_PROC_L3_ENABLE ); -// -- Input: ../../xml/attribute_info/pm_hwp_attributes.xml -- -HSVC_LOAD_ATTR( ATTR_PM_SPWUP_FSP ); -HSVC_LOAD_ATTR( ATTR_PM_SPWUP_IGNORE_XSTOP_FLAG ); -HSVC_LOAD_ATTR( ATTR_PM_SPWUP_OCC ); -HSVC_LOAD_ATTR( ATTR_PM_SPWUP_OHA_FLAG ); -HSVC_LOAD_ATTR( ATTR_PM_SPWUP_PHYP ); -// -- Input: ../../xml/attribute_info/pm_plat_attributes.xml -- -// No attributes found -// -- Input: ../../xml/attribute_info/poreve_memory_attributes.xml -- -// No attributes found -// -- Input: ../../xml/attribute_info/proc_chip_ec_feature.xml -- -// No attributes found -// -- Input: ../../xml/attribute_info/proc_fab_smp_fabric_attributes.xml -- -// No attributes found -// -- Input: ../../xml/attribute_info/proc_pll_ring_attributes.xml -- -// No attributes found -// -- Input: ../../xml/attribute_info/proc_setup_bars_l3_attributes.xml -- -// No attributes found -// -- Input: ../../xml/attribute_info/proc_winkle_scan_override_attributes.xml -- -// No attributes found -// -- Input: ../../xml/attribute_info/scratch_attributes.xml -- -// No attributes found -// -- Input: ../../xml/attribute_info/system_attributes.xml -- -// No attributes found -// -- Input: ../../xml/attribute_info/unit_attributes.xml -- -HSVC_LOAD_ATTR( ATTR_CHIP_UNIT_POS ); diff --git a/src/usr/runtime/common/hsvc_procdata.C b/src/usr/runtime/common/hsvc_procdata.C deleted file mode 100644 index 6716eef4e..000000000 --- a/src/usr/runtime/common/hsvc_procdata.C +++ /dev/null @@ -1,275 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/usr/runtime/common/hsvc_procdata.C $ */ -/* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* Contributors Listed Below - COPYRIGHT 2012,2017 */ -/* [+] 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 */ -// Generated on Wed Feb 18 09:37:26 CST 2015 by cswenson from -// ./create_hsvc_data.pl -w ../../xml/attribute_info/chip_attributes.xml ../../xml/attribute_info/common_attributes.xml ../../xml/attribute_info/freq_attributes.xml ../../xml/attribute_info/L2_L3_attributes.xml ../../xml/attribute_info/p8_xip_customize_attributes.xml ../../xml/attribute_info/pm_hwp_attributes.xml ../../xml/attribute_info/pm_plat_attributes.xml ../../xml/attribute_info/poreve_memory_attributes.xml ../../xml/attribute_info/proc_chip_ec_feature.xml ../../xml/attribute_info/proc_fab_smp_fabric_attributes.xml ../../xml/attribute_info/proc_pll_ring_attributes.xml ../../xml/attribute_info/proc_setup_bars_l3_attributes.xml ../../xml/attribute_info/proc_winkle_scan_override_attributes.xml ../../xml/attribute_info/scratch_attributes.xml ../../xml/attribute_info/system_attributes.xml ../../xml/attribute_info/unit_attributes.xml -// -- Input: ../../xml/attribute_info/chip_attributes.xml -- -HSVC_LOAD_ATTR( ATTR_CHIP_HAS_SBE ); -HSVC_LOAD_ATTR( ATTR_CHIP_ID ); -HSVC_LOAD_ATTR( ATTR_CHIP_REGIONS_TO_ENABLE ); -HSVC_LOAD_ATTR_P( ATTR_EC ); -HSVC_LOAD_ATTR( ATTR_EX_L2_SINGLE_MEMBER_ENABLE ); -HSVC_LOAD_ATTR( ATTR_FABRIC_CHIP_ID ); -HSVC_LOAD_ATTR( ATTR_FABRIC_GROUP_ID ); -HSVC_LOAD_ATTR( ATTR_FSI_GP_REG_SCOM_ACCESS ); -HSVC_LOAD_ATTR( ATTR_I2C_SLAVE_ADDRESS ); -HSVC_LOAD_ATTR_P( ATTR_NAME ); -HSVC_LOAD_ATTR( ATTR_OSCSWITCH_CTL0 ); -HSVC_LOAD_ATTR( ATTR_OSCSWITCH_CTL1 ); -HSVC_LOAD_ATTR( ATTR_OSCSWITCH_CTL2 ); -HSVC_LOAD_ATTR( ATTR_PCI_OSCSWITCH_CONFIG ); -HSVC_LOAD_ATTR( ATTR_PROC_BOOT_VOLTAGE_VID ); -HSVC_LOAD_ATTR( ATTR_PROC_DCM_INSTALLED ); -HSVC_LOAD_ATTR( ATTR_TARGET_SCOMABLE ); -// -- Input: ../../xml/attribute_info/common_attributes.xml -- -HSVC_LOAD_ATTR( ATTR_FUNCTIONAL ); -HSVC_LOAD_ATTR( ATTR_POS ); -// -- Input: ../../xml/attribute_info/freq_attributes.xml -- -// No attributes found -// -- Input: ../../xml/attribute_info/L2_L3_attributes.xml -- -// No attributes found -// -- Input: ../../xml/attribute_info/p8_xip_customize_attributes.xml -- -HSVC_LOAD_ATTR( ATTR_PROC_ADU_UNTRUSTED_BAR_BASE_ADDR ); -HSVC_LOAD_ATTR( ATTR_PROC_ADU_UNTRUSTED_BAR_SIZE ); -HSVC_LOAD_ATTR( ATTR_PROC_A_ENABLE ); -HSVC_LOAD_ATTR( ATTR_PROC_NX_ENABLE ); -HSVC_LOAD_ATTR( ATTR_PROC_PBA_UNTRUSTED_BAR_BASE_ADDR ); -HSVC_LOAD_ATTR( ATTR_PROC_PBA_UNTRUSTED_BAR_SIZE ); -HSVC_LOAD_ATTR( ATTR_PROC_PCIE_ENABLE ); -HSVC_LOAD_ATTR( ATTR_PROC_PSI_UNTRUSTED_BAR0_BASE_ADDR ); -HSVC_LOAD_ATTR( ATTR_PROC_PSI_UNTRUSTED_BAR0_SIZE ); -HSVC_LOAD_ATTR( ATTR_PROC_PSI_UNTRUSTED_BAR1_BASE_ADDR ); -HSVC_LOAD_ATTR( ATTR_PROC_PSI_UNTRUSTED_BAR1_SIZE ); -HSVC_LOAD_ATTR( ATTR_PROC_SECURITY_SETUP_VECTOR ); -HSVC_LOAD_ATTR( ATTR_PROC_X_ENABLE ); -// -- Input: ../../xml/attribute_info/pm_hwp_attributes.xml -- -HSVC_LOAD_ATTR( ATTR_CPM_INFLECTION_POINTS ); -HSVC_LOAD_ATTR( ATTR_PM_AISS_TIMEOUT ); -HSVC_LOAD_ATTR( ATTR_PM_EXTERNAL_VRM_STEPDELAY_RANGE ); -HSVC_LOAD_ATTR( ATTR_PM_EXTERNAL_VRM_STEPDELAY_VALUE ); -HSVC_LOAD_ATTR( ATTR_PM_FIRINIT_DONE_ONCE_FLAG ); -HSVC_LOAD_ATTR( ATTR_PM_IVRMS_ENABLED ); -HSVC_LOAD_ATTR( ATTR_PM_OCC_HEARTBEAT_TIME ); -HSVC_LOAD_ATTR( ATTR_PM_OCC_LFIR_MASK ); -HSVC_LOAD_ATTR( ATTR_PM_PBAX_RCV_RESERV_TIMEOUT ); -HSVC_LOAD_ATTR( ATTR_PM_PBAX_SND_RESERV_TIMEOUT ); -HSVC_LOAD_ATTR( ATTR_PM_PBAX_SND_RETRY_COUNT_OVERCOMMIT_ENABLE ); -HSVC_LOAD_ATTR( ATTR_PM_PBAX_SND_RETRY_THRESHOLD ); -HSVC_LOAD_ATTR( ATTR_PM_PBA_FIR_MASK ); -HSVC_LOAD_ATTR( ATTR_PM_PFET_POWERDOWN_CORE_DELAY0 ); -HSVC_LOAD_ATTR( ATTR_PM_PFET_POWERDOWN_CORE_DELAY0_VALUE ); -HSVC_LOAD_ATTR( ATTR_PM_PFET_POWERDOWN_CORE_DELAY1 ); -HSVC_LOAD_ATTR( ATTR_PM_PFET_POWERDOWN_CORE_DELAY1_VALUE ); -HSVC_LOAD_ATTR( ATTR_PM_PFET_POWERDOWN_CORE_SEQUENCE_DELAY_SELECT ); -HSVC_LOAD_ATTR( ATTR_PM_PFET_POWERDOWN_ECO_DELAY0 ); -HSVC_LOAD_ATTR( ATTR_PM_PFET_POWERDOWN_ECO_DELAY0_VALUE ); -HSVC_LOAD_ATTR( ATTR_PM_PFET_POWERDOWN_ECO_DELAY1 ); -HSVC_LOAD_ATTR( ATTR_PM_PFET_POWERDOWN_ECO_DELAY1_VALUE ); -HSVC_LOAD_ATTR( ATTR_PM_PFET_POWERDOWN_ECO_SEQUENCE_DELAY_SELECT ); -HSVC_LOAD_ATTR( ATTR_PM_PFET_POWERUP_CORE_DELAY0 ); -HSVC_LOAD_ATTR( ATTR_PM_PFET_POWERUP_CORE_DELAY0_VALUE ); -HSVC_LOAD_ATTR( ATTR_PM_PFET_POWERUP_CORE_DELAY1 ); -HSVC_LOAD_ATTR( ATTR_PM_PFET_POWERUP_CORE_DELAY1_VALUE ); -HSVC_LOAD_ATTR( ATTR_PM_PFET_POWERUP_CORE_SEQUENCE_DELAY_SELECT ); -HSVC_LOAD_ATTR( ATTR_PM_PFET_POWERUP_ECO_DELAY0 ); -HSVC_LOAD_ATTR( ATTR_PM_PFET_POWERUP_ECO_DELAY0_VALUE ); -HSVC_LOAD_ATTR( ATTR_PM_PFET_POWERUP_ECO_DELAY1 ); -HSVC_LOAD_ATTR( ATTR_PM_PFET_POWERUP_ECO_DELAY1_VALUE ); -HSVC_LOAD_ATTR( ATTR_PM_PFET_POWERUP_ECO_SEQUENCE_DELAY_SELECT ); -HSVC_LOAD_ATTR( ATTR_PM_PMC_HANGPULSE_DIVIDER ); -HSVC_LOAD_ATTR( ATTR_PM_PMC_LFIR_MASK ); -HSVC_LOAD_ATTR( ATTR_PM_POWER_PROXY_TRACE_TIMER ); -HSVC_LOAD_ATTR( ATTR_PM_PPT_TIMER_MATCH_VALUE ); -HSVC_LOAD_ATTR( ATTR_PM_PPT_TIMER_TICK ); -HSVC_LOAD_ATTR( ATTR_PM_PSTATE0_FREQUENCY ); -HSVC_LOAD_ATTR( ATTR_PM_PSTATE_STEPSIZE ); -HSVC_LOAD_ATTR( ATTR_PM_PVSAFE_PSTATE ); -HSVC_LOAD_ATTR( ATTR_PM_RESONANT_CLOCK_ENABLE ); -HSVC_LOAD_ATTR( ATTR_PM_RESONANT_CLOCK_FULL_CSB_PSTATE ); -HSVC_LOAD_ATTR( ATTR_PM_RESONANT_CLOCK_HFRHIGH_PSTATE ); -HSVC_LOAD_ATTR( ATTR_PM_RESONANT_CLOCK_HFRLOW_PSTATE ); -HSVC_LOAD_ATTR( ATTR_PM_RESONANT_CLOCK_LFRLOW_PSTATE ); -HSVC_LOAD_ATTR( ATTR_PM_RESONANT_CLOCK_LFRUPPER_PSTATE ); -HSVC_LOAD_ATTR( ATTR_PM_SAFE_PSTATE ); -HSVC_LOAD_ATTR( ATTR_PM_SLEEP_WINKLE_REQUEST_TIMEOUT ); -HSVC_LOAD_ATTR( ATTR_PM_SPIPSS_CLOCK_DIVIDER ); -HSVC_LOAD_ATTR( ATTR_PM_SPIPSS_CLOCK_PHASE ); -HSVC_LOAD_ATTR( ATTR_PM_SPIPSS_CLOCK_POLARITY ); -HSVC_LOAD_ATTR( ATTR_PM_SPIPSS_FRAME_SIZE ); -HSVC_LOAD_ATTR( ATTR_PM_SPIPSS_INTER_FRAME_DELAY ); -HSVC_LOAD_ATTR( ATTR_PM_SPIPSS_INTER_FRAME_DELAY_SETTING ); -HSVC_LOAD_ATTR( ATTR_PM_SPIPSS_IN_COUNT ); -HSVC_LOAD_ATTR( ATTR_PM_SPIPSS_IN_DELAY ); -HSVC_LOAD_ATTR( ATTR_PM_SPIPSS_OUT_COUNT ); -HSVC_LOAD_ATTR( ATTR_PM_SPIVID_CLOCK_DIVIDER ); -HSVC_LOAD_ATTR( ATTR_PM_SPIVID_CLOCK_PHASE ); -HSVC_LOAD_ATTR( ATTR_PM_SPIVID_CLOCK_POLARITY ); -HSVC_LOAD_ATTR( ATTR_PM_SPIVID_CRC_CHECK_ENABLE ); -HSVC_LOAD_ATTR( ATTR_PM_SPIVID_CRC_GEN_ENABLE ); -HSVC_LOAD_ATTR( ATTR_PM_SPIVID_CRC_POLYNOMIAL_ENABLES ); -HSVC_LOAD_ATTR( ATTR_PM_SPIVID_FRAME_SIZE ); -HSVC_LOAD_ATTR( ATTR_PM_SPIVID_INTERFRAME_DELAY_WRITE_STATUS ); -HSVC_LOAD_ATTR( ATTR_PM_SPIVID_INTERFRAME_DELAY_WRITE_STATUS_VALUE ); -HSVC_LOAD_ATTR( ATTR_PM_SPIVID_INTER_RETRY_DELAY ); -HSVC_LOAD_ATTR( ATTR_PM_SPIVID_INTER_RETRY_DELAY_VALUE ); -HSVC_LOAD_ATTR( ATTR_PM_SPIVID_IN_DELAY_FRAME1 ); -HSVC_LOAD_ATTR( ATTR_PM_SPIVID_IN_DELAY_FRAME2 ); -HSVC_LOAD_ATTR( ATTR_PM_SPIVID_MAJORITY_VOTE_ENABLE ); -HSVC_LOAD_ATTR( ATTR_PM_SPIVID_MAX_RETRIES ); -HSVC_LOAD_ATTR( ATTR_PROC_DPLL_DIVIDER ); -// -- Input: ../../xml/attribute_info/pm_plat_attributes.xml -- -HSVC_LOAD_ATTR( ATTR_FREQ_EXT_BIAS_DOWN ); -HSVC_LOAD_ATTR( ATTR_FREQ_EXT_BIAS_UP ); -HSVC_LOAD_ATTR( ATTR_PM_APSS_CHIP_SELECT ); -HSVC_LOAD_ATTR( ATTR_PM_PBAX_BRDCST_ID_VECTOR ); -HSVC_LOAD_ATTR( ATTR_PM_PBAX_CHIPID ); -HSVC_LOAD_ATTR( ATTR_PM_PBAX_NODEID ); -HSVC_LOAD_ATTR( ATTR_PM_SLEEP_ENTRY ); -HSVC_LOAD_ATTR( ATTR_PM_SLEEP_EXIT ); -HSVC_LOAD_ATTR( ATTR_PM_SLEEP_TYPE ); -HSVC_LOAD_ATTR( ATTR_PM_SPIVID_PORT_ENABLE ); -HSVC_LOAD_ATTR( ATTR_PM_UNDERVOLTING_FREQ_MAXIMUM ); -HSVC_LOAD_ATTR( ATTR_PM_UNDERVOLTING_FRQ_MINIMUM ); -HSVC_LOAD_ATTR( ATTR_PM_WINKLE_ENTRY ); -HSVC_LOAD_ATTR( ATTR_PM_WINKLE_EXIT ); -HSVC_LOAD_ATTR( ATTR_PM_WINKLE_TYPE ); -HSVC_LOAD_ATTR( ATTR_VOLTAGE_EXT_VCS_BIAS_DOWN ); -HSVC_LOAD_ATTR( ATTR_VOLTAGE_EXT_VCS_BIAS_UP ); -HSVC_LOAD_ATTR( ATTR_VOLTAGE_EXT_VDD_BIAS_DOWN ); -HSVC_LOAD_ATTR( ATTR_VOLTAGE_EXT_VDD_BIAS_UP ); -HSVC_LOAD_ATTR( ATTR_VOLTAGE_INT_VCS_BIAS_DOWN ); -HSVC_LOAD_ATTR( ATTR_VOLTAGE_INT_VCS_BIAS_UP ); -HSVC_LOAD_ATTR( ATTR_VOLTAGE_INT_VDD_BIAS_DOWN ); -HSVC_LOAD_ATTR( ATTR_VOLTAGE_INT_VDD_BIAS_UP ); -HSVC_LOAD_ATTR( ATTR_PROC_R_DISTLOSS_VCS ); -HSVC_LOAD_ATTR( ATTR_PROC_R_DISTLOSS_VDD ); -HSVC_LOAD_ATTR( ATTR_PROC_R_LOADLINE_VCS ); -HSVC_LOAD_ATTR( ATTR_PROC_R_LOADLINE_VDD ); -HSVC_LOAD_ATTR( ATTR_PROC_VRM_VOFFSET_VCS ); -HSVC_LOAD_ATTR( ATTR_PROC_VRM_VOFFSET_VDD ); -// -- Input: ../../xml/attribute_info/poreve_memory_attributes.xml -- -HSVC_LOAD_ATTR( ATTR_PNOR_I2C_ADDRESS_BYTES ); -HSVC_LOAD_ATTR( ATTR_SBE_SEEPROM_I2C_ADDRESS_BYTES ); -HSVC_LOAD_ATTR( ATTR_SBE_SEEPROM_I2C_DEVICE_ADDRESS ); -HSVC_LOAD_ATTR( ATTR_SBE_SEEPROM_I2C_PORT ); -// -- Input: ../../xml/attribute_info/proc_chip_ec_feature.xml -- -HSVC_LOAD_ATTR( ATTR_CHIP_EC_FEATURE_ADU_PBINIT_LAUNCH_BUG ); -HSVC_LOAD_ATTR( ATTR_CHIP_EC_FEATURE_AISS_SPECIAL_WAKEUP ); -HSVC_LOAD_ATTR( ATTR_CHIP_EC_FEATURE_BOOT_FREQ_LESS_PSAVE ); -HSVC_LOAD_ATTR( ATTR_CHIP_EC_FEATURE_CAPP_HANG_CONTROL_ON_SCOM ); -HSVC_LOAD_ATTR( ATTR_CHIP_EC_FEATURE_CAPP_PROD ); -HSVC_LOAD_ATTR( ATTR_CHIP_EC_FEATURE_DUAL_CAPP_PRESENT ); -HSVC_LOAD_ATTR( ATTR_CHIP_EC_FEATURE_ENABLE_IVE_PERFORMANCE_ORDERING ); -HSVC_LOAD_ATTR( ATTR_CHIP_EC_FEATURE_ENABLE_PCI_DMAR_OOO ); -HSVC_LOAD_ATTR( ATTR_CHIP_EC_FEATURE_FBC_SERIAL_SCOM_C10_VER2 ); -HSVC_LOAD_ATTR( ATTR_CHIP_EC_FEATURE_FBC_SERIAL_SCOM_C8_VER2 ); -HSVC_LOAD_ATTR( ATTR_CHIP_EC_FEATURE_FBC_SERIAL_SCOM_C8_VER3 ); -HSVC_LOAD_ATTR( ATTR_CHIP_EC_FEATURE_FBC_SERIAL_SCOM_WE5_VER2 ); -HSVC_LOAD_ATTR( ATTR_CHIP_EC_FEATURE_FBC_UX_LOCAL_ARB_RR ); -HSVC_LOAD_ATTR( ATTR_CHIP_EC_FEATURE_FBC_UX_SCOPE_ARB_LFSR_ON_STARVATION_ELSE_RR ); -HSVC_LOAD_ATTR( ATTR_CHIP_EC_FEATURE_FBC_UX_SCOPE_ARB_RR ); -HSVC_LOAD_ATTR( ATTR_CHIP_EC_FEATURE_HCA_BAR_SCOM_BUG ); -HSVC_LOAD_ATTR( ATTR_CHIP_EC_FEATURE_HCA_SPLIT_HANG_CONTROL ); -HSVC_LOAD_ATTR( ATTR_CHIP_EC_FEATURE_HW_BUG_PBASLVRESET ); -HSVC_LOAD_ATTR( ATTR_CHIP_EC_FEATURE_HW_BUG_PIBSLVRESET ); -HSVC_LOAD_ATTR( ATTR_CHIP_EC_FEATURE_HW_BUG_PLLINIT ); -HSVC_LOAD_ATTR( ATTR_CHIP_EC_FEATURE_HW_BUG_TOD_ERROR_MASK_NOT_WRITABLE ); -HSVC_LOAD_ATTR( ATTR_CHIP_EC_FEATURE_IVRM_WINKLE_BUG ); -HSVC_LOAD_ATTR( ATTR_CHIP_EC_FEATURE_LCTANK_PLL_VCO_BUG ); -HSVC_LOAD_ATTR( ATTR_CHIP_EC_FEATURE_MCD_HANG_RECOVERY_BUG ); -HSVC_LOAD_ATTR( ATTR_CHIP_EC_FEATURE_MCS_ECC_BYPASS_DISABLE ); -HSVC_LOAD_ATTR( ATTR_CHIP_EC_FEATURE_MCS_MURDD1_FIR_CONTROL ); -HSVC_LOAD_ATTR( ATTR_CHIP_EC_FEATURE_MCS_P8_DD2_FIR_CONTROL ); -HSVC_LOAD_ATTR( ATTR_CHIP_EC_FEATURE_MCS_VENDD1_FIR_CONTROL ); -HSVC_LOAD_ATTR( ATTR_CHIP_EC_FEATURE_MPIPL_AISS_WINKLE_ENTRY ); -HSVC_LOAD_ATTR( ATTR_CHIP_EC_FEATURE_NOT_SUPPORT_SBE_AUTO_START ); -HSVC_LOAD_ATTR( ATTR_CHIP_EC_FEATURE_NOT_SUPPORT_SBE_CFAM_START ); -HSVC_LOAD_ATTR( ATTR_CHIP_EC_FEATURE_NV_PRESENT ); -HSVC_LOAD_ATTR( ATTR_CHIP_EC_FEATURE_NX_HANG_CONTROL_ON_SCOM ); -HSVC_LOAD_ATTR( ATTR_CHIP_EC_FEATURE_OCC_CE_FIR_DISABLE ); -HSVC_LOAD_ATTR( ATTR_CHIP_EC_FEATURE_OCC_DISABLE ); -HSVC_LOAD_ATTR( ATTR_CHIP_EC_FEATURE_PCBS_ERR_RESET ); -HSVC_LOAD_ATTR( ATTR_CHIP_EC_FEATURE_RECAL_CTLE_ENABLE ); -HSVC_LOAD_ATTR( ATTR_CHIP_EC_FEATURE_RECAL_DDC_ENABLE ); -HSVC_LOAD_ATTR( ATTR_CHIP_EC_FEATURE_RECAL_DFE_ENABLE ); -HSVC_LOAD_ATTR( ATTR_CHIP_EC_FEATURE_RESONANT_CLK_VALID ); -HSVC_LOAD_ATTR( ATTR_CHIP_EC_FEATURE_SECURE_IOVALID_PRESENT ); -HSVC_LOAD_ATTR( ATTR_CHIP_EC_FEATURE_SET_ABUS_PRBS_TAP_ID ); -HSVC_LOAD_ATTR( ATTR_CHIP_EC_FEATURE_SET_LEGACY_NODE_ID_VALID_MBOX_BIT ); -HSVC_LOAD_ATTR( ATTR_CHIP_EC_FEATURE_SINGLE_XBUS_PRESENT ); -HSVC_LOAD_ATTR( ATTR_CHIP_EC_FEATURE_TA_A_T1_PRESENT ); -HSVC_LOAD_ATTR( ATTR_CHIP_EC_FEATURE_TA_PB_T1_PRESENT ); -HSVC_LOAD_ATTR( ATTR_CHIP_EC_FEATURE_TRACE_CONTROL_ON_SCOM ); -HSVC_LOAD_ATTR( ATTR_CHIP_EC_FEATURE_USE_POLLING_PROT ); -HSVC_LOAD_ATTR( ATTR_CHIP_EC_FEATURE_XBUS_DLL_SLOW_MURANO ); -HSVC_LOAD_ATTR( ATTR_CHIP_EC_FEATURE_XBUS_RESONANT_CLK_VALID ); -HSVC_LOAD_ATTR( ATTR_CHIP_EC_FEATURE_ZCAL_OVERRIDE ); -HSVC_LOAD_ATTR( ATTR_CHIP_EC_PFET_POWEROFF_BUG ); -HSVC_LOAD_ATTR( ATTR_DCCAL_PLL_WORKAROUND ); -HSVC_LOAD_ATTR( ATTR_IO_TRAINING_DLL_WORKAROUND ); -HSVC_LOAD_ATTR( ATTR_IO_TRAINING_SLS_WORKAROUND ); -HSVC_LOAD_ATTR( ATTR_PROC_EC_CORE_HANG_PULSE_BUG ); -HSVC_LOAD_ATTR( ATTR_PROC_EC_MSS_RECONFIG_POSSIBLE ); -HSVC_LOAD_ATTR( ATTR_PROC_EC_OHA_L3_PURGE_ABORT_ENABLE ); -HSVC_LOAD_ATTR( ATTR_PROC_EC_PBA_PREFETCH_ENABLE ); -// -- Input: ../../xml/attribute_info/proc_fab_smp_fabric_attributes.xml -- -HSVC_LOAD_ATTR( ATTR_PROC_PCIE_NOT_F_LINK ); -// -- Input: ../../xml/attribute_info/proc_pll_ring_attributes.xml -- -HSVC_LOAD_ATTR( ATTR_PROC_ABUS_CUPLL_PFD360_OFFSET ); -HSVC_LOAD_ATTR( ATTR_PROC_ABUS_CUPLL_REFCLKSEL_OFFSET ); -HSVC_LOAD_ATTR( ATTR_PROC_AB_BNDY_PLL_CHIPLET_ID ); -HSVC_LOAD_ATTR( ATTR_PROC_AB_BNDY_PLL_DATA ); -HSVC_LOAD_ATTR( ATTR_PROC_AB_BNDY_PLL_FLUSH ); -HSVC_LOAD_ATTR( ATTR_PROC_AB_BNDY_PLL_LENGTH ); -HSVC_LOAD_ATTR( ATTR_PROC_AB_BNDY_PLL_SCAN_SELECT ); -HSVC_LOAD_ATTR( ATTR_PROC_DMI_CUPLL_PFD360_OFFSET ); -HSVC_LOAD_ATTR( ATTR_PROC_DMI_CUPLL_REFCLKSEL_OFFSET ); -HSVC_LOAD_ATTR( ATTR_PROC_PB_BNDY_DMIPLL_CHIPLET_ID ); -HSVC_LOAD_ATTR( ATTR_PROC_PB_BNDY_DMIPLL_DATA ); -HSVC_LOAD_ATTR( ATTR_PROC_PB_BNDY_DMIPLL_FLUSH ); -HSVC_LOAD_ATTR( ATTR_PROC_PB_BNDY_DMIPLL_LENGTH ); -HSVC_LOAD_ATTR( ATTR_PROC_PB_BNDY_DMIPLL_SCAN_SELECT ); -HSVC_LOAD_ATTR( ATTR_PROC_PCI_BNDY_PLL_CHIPLET_ID ); -HSVC_LOAD_ATTR( ATTR_PROC_PCI_BNDY_PLL_DATA ); -HSVC_LOAD_ATTR( ATTR_PROC_PCI_BNDY_PLL_FLUSH ); -HSVC_LOAD_ATTR( ATTR_PROC_PCI_BNDY_PLL_LENGTH ); -HSVC_LOAD_ATTR( ATTR_PROC_PCI_BNDY_PLL_SCAN_SELECT ); -HSVC_LOAD_ATTR( ATTR_PROC_PERV_BNDY_PLL_CHIPLET_ID ); -HSVC_LOAD_ATTR( ATTR_PROC_PERV_BNDY_PLL_DATA ); -HSVC_LOAD_ATTR( ATTR_PROC_PERV_BNDY_PLL_FLUSH ); -HSVC_LOAD_ATTR( ATTR_PROC_PERV_BNDY_PLL_LENGTH ); -HSVC_LOAD_ATTR( ATTR_PROC_PERV_BNDY_PLL_SCAN_SELECT ); -// -- Input: ../../xml/attribute_info/proc_setup_bars_l3_attributes.xml -- -HSVC_LOAD_ATTR( ATTR_PROC_L3_BAR1_REG ); -HSVC_LOAD_ATTR( ATTR_PROC_L3_BAR2_REG ); -HSVC_LOAD_ATTR( ATTR_PROC_L3_BAR_GROUP_MASK_REG ); -// -- Input: ../../xml/attribute_info/proc_winkle_scan_override_attributes.xml -- -HSVC_LOAD_ATTR( ATTR_PROC_EX_FUNC_L3_DELTA_DATA ); -HSVC_LOAD_ATTR( ATTR_PROC_EX_FUNC_L3_LENGTH ); -// -- Input: ../../xml/attribute_info/scratch_attributes.xml -- -// No attributes found -// -- Input: ../../xml/attribute_info/system_attributes.xml -- -// No attributes found -// -- Input: ../../xml/attribute_info/unit_attributes.xml -- -// No attributes found diff --git a/src/usr/runtime/common/hsvc_sysdata.C b/src/usr/runtime/common/hsvc_sysdata.C deleted file mode 100644 index 8166e24ec..000000000 --- a/src/usr/runtime/common/hsvc_sysdata.C +++ /dev/null @@ -1,135 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/usr/runtime/common/hsvc_sysdata.C $ */ -/* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* Contributors Listed Below - COPYRIGHT 2012,2017 */ -/* [+] 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 */ -// Generated on Wed Feb 18 09:37:26 CST 2015 by cswenson from -// ./create_hsvc_data.pl -w ../../xml/attribute_info/chip_attributes.xml ../../xml/attribute_info/common_attributes.xml ../../xml/attribute_info/freq_attributes.xml ../../xml/attribute_info/L2_L3_attributes.xml ../../xml/attribute_info/p8_xip_customize_attributes.xml ../../xml/attribute_info/pm_hwp_attributes.xml ../../xml/attribute_info/pm_plat_attributes.xml ../../xml/attribute_info/poreve_memory_attributes.xml ../../xml/attribute_info/proc_chip_ec_feature.xml ../../xml/attribute_info/proc_fab_smp_fabric_attributes.xml ../../xml/attribute_info/proc_pll_ring_attributes.xml ../../xml/attribute_info/proc_setup_bars_l3_attributes.xml ../../xml/attribute_info/proc_winkle_scan_override_attributes.xml ../../xml/attribute_info/scratch_attributes.xml ../../xml/attribute_info/system_attributes.xml ../../xml/attribute_info/unit_attributes.xml - -// -- Input: ../../xml/attribute_info/chip_attributes.xml -- -// No attributes found -// -- Input: ../../xml/attribute_info/common_attributes.xml -- -// No attributes found -// -- Input: ../../xml/attribute_info/freq_attributes.xml -- -HSVC_LOAD_ATTR( ATTR_FREQ_A_MHZ ); -HSVC_LOAD_ATTR( ATTR_FREQ_CORE_FLOOR_MHZ ); -HSVC_LOAD_ATTR( ATTR_FREQ_CORE_NOMINAL_MHZ ); -HSVC_LOAD_ATTR( ATTR_FREQ_MEM_REFCLOCK ); -HSVC_LOAD_ATTR( ATTR_FREQ_PB_MHZ ); -HSVC_LOAD_ATTR( ATTR_FREQ_PCIE_MHZ ); -HSVC_LOAD_ATTR( ATTR_FREQ_PROC_REFCLOCK ); -HSVC_LOAD_ATTR( ATTR_FREQ_PROC_REFCLOCK_KHZ ); -HSVC_LOAD_ATTR( ATTR_FREQ_X_MHZ ); -// -- Input: ../../xml/attribute_info/L2_L3_attributes.xml -- -HSVC_LOAD_ATTR( ATTR_L2_FORCE_R_T2_EPS ); -HSVC_LOAD_ATTR( ATTR_L2_R_T0_EPS ); -HSVC_LOAD_ATTR( ATTR_L2_R_T1_EPS ); -HSVC_LOAD_ATTR( ATTR_L2_R_T2_EPS ); -HSVC_LOAD_ATTR( ATTR_L2_W_EPS ); -HSVC_LOAD_ATTR( ATTR_L3_FORCE_R_T2_EPS ); -HSVC_LOAD_ATTR( ATTR_L3_R_T0_EPS ); -HSVC_LOAD_ATTR( ATTR_L3_R_T1_EPS ); -HSVC_LOAD_ATTR( ATTR_L3_R_T2_EPS ); -HSVC_LOAD_ATTR( ATTR_L3_W_EPS ); -// -- Input: ../../xml/attribute_info/p8_xip_customize_attributes.xml -- -HSVC_LOAD_ATTR( ATTR_SBE_IMAGE_MINIMUM_VALID_EXS ); -// -- Input: ../../xml/attribute_info/pm_hwp_attributes.xml -- -HSVC_LOAD_ATTR( ATTR_PM_GLOBAL_FIR_TRACE_EN ); -HSVC_LOAD_ATTR( ATTR_PM_PCBS_FSM_TRACE_EN ); -HSVC_LOAD_ATTR( ATTR_PM_PFET_WORKAROUND_RUN_FLAG ); -HSVC_LOAD_ATTR( ATTR_PM_SLW_CONTROL_VECTOR_OFFSET ); -HSVC_LOAD_ATTR( ATTR_PM_SLW_DEEP_SLEEP_EXIT_GOOD_HALT_ADDR ); -HSVC_LOAD_ATTR( ATTR_PM_SLW_DEEP_WINKLE_EXIT_GOOD_HALT_ADDR ); -// -- Input: ../../xml/attribute_info/pm_plat_attributes.xml -- -HSVC_LOAD_ATTR( ATTR_CPM_TURBO_BOOST_PERCENT ); -HSVC_LOAD_ATTR( ATTR_FREQ_CORE_MAX ); -HSVC_LOAD_ATTR( ATTR_PM_EXTERNAL_VRM_STEPDELAY ); -HSVC_LOAD_ATTR( ATTR_PM_EXTERNAL_VRM_STEPSIZE ); -HSVC_LOAD_ATTR( ATTR_PM_RESONANT_CLOCK_FULL_CLOCK_SECTOR_BUFFER_FREQUENCY ); -HSVC_LOAD_ATTR( ATTR_PM_RESONANT_CLOCK_HIGH_BAND_LOWER_FREQUENCY ); -HSVC_LOAD_ATTR( ATTR_PM_RESONANT_CLOCK_HIGH_BAND_UPPER_FREQUENCY ); -HSVC_LOAD_ATTR( ATTR_PM_RESONANT_CLOCK_LOW_BAND_LOWER_FREQUENCY ); -HSVC_LOAD_ATTR( ATTR_PM_RESONANT_CLOCK_LOW_BAND_UPPER_FREQUENCY ); -HSVC_LOAD_ATTR( ATTR_PM_SAFE_FREQUENCY ); -HSVC_LOAD_ATTR( ATTR_PM_SLEEP_ENABLE ); -HSVC_LOAD_ATTR( ATTR_PM_SPIPSS_FREQUENCY ); -HSVC_LOAD_ATTR( ATTR_PM_SPIVID_FREQUENCY ); -HSVC_LOAD_ATTR( ATTR_PM_SYSTEM_IVRM_VPD_MIN_LEVEL ); -// -- Input: ../../xml/attribute_info/poreve_memory_attributes.xml -- -// No attributes found -// -- Input: ../../xml/attribute_info/proc_chip_ec_feature.xml -- -// No attributes found -// -- Input: ../../xml/attribute_info/proc_fab_smp_fabric_attributes.xml -- -HSVC_LOAD_ATTR( ATTR_FREQ_CORE ); -HSVC_LOAD_ATTR( ATTR_PROC_EPS_GB_DIRECTION ); -HSVC_LOAD_ATTR( ATTR_PROC_EPS_GB_PERCENTAGE ); -HSVC_LOAD_ATTR( ATTR_PROC_FABRIC_ASYNC_SAFE_MODE ); -// -- Input: ../../xml/attribute_info/proc_pll_ring_attributes.xml -- -// No attributes found -// -- Input: ../../xml/attribute_info/proc_setup_bars_l3_attributes.xml -- -// No attributes found -// -- Input: ../../xml/attribute_info/proc_winkle_scan_override_attributes.xml -- -HSVC_LOAD_ATTR( ATTR_PROC_PBIEX_ASYNC_SEL ); -// -- Input: ../../xml/attribute_info/scratch_attributes.xml -- -HSVC_LOAD_ATTR( ATTR_DUMMY_SCRATCH_PLAT_INIT_UINT8 ); -HSVC_LOAD_ATTR( ATTR_SCRATCH_UINT32_1 ); -HSVC_LOAD_ATTR( ATTR_SCRATCH_UINT32_2 ); -HSVC_LOAD_ATTR( ATTR_SCRATCH_UINT32_ARRAY_1 ); -HSVC_LOAD_ATTR( ATTR_SCRATCH_UINT32_ARRAY_2 ); -HSVC_LOAD_ATTR( ATTR_SCRATCH_UINT64_1 ); -HSVC_LOAD_ATTR( ATTR_SCRATCH_UINT64_2 ); -HSVC_LOAD_ATTR( ATTR_SCRATCH_UINT64_ARRAY_1 ); -HSVC_LOAD_ATTR( ATTR_SCRATCH_UINT64_ARRAY_2 ); -HSVC_LOAD_ATTR( ATTR_SCRATCH_UINT8_1 ); -HSVC_LOAD_ATTR( ATTR_SCRATCH_UINT8_2 ); -HSVC_LOAD_ATTR( ATTR_SCRATCH_UINT8_ARRAY_1 ); -HSVC_LOAD_ATTR( ATTR_SCRATCH_UINT8_ARRAY_2 ); -// -- Input: ../../xml/attribute_info/system_attributes.xml -- -HSVC_LOAD_ATTR( ATTR_ALL_MCS_IN_INTERLEAVING_GROUP ); -HSVC_LOAD_ATTR( ATTR_BOOT_FREQ_MHZ ); -HSVC_LOAD_ATTR( ATTR_BOOT_VOLTAGE ); -HSVC_LOAD_ATTR( ATTR_DISABLE_I2C_ACCESS ); -HSVC_LOAD_ATTR( ATTR_EXECUTION_PLATFORM ); -HSVC_LOAD_ATTR( ATTR_EX_GARD_BITS ); -HSVC_LOAD_ATTR( ATTR_IS_MPIPL ); -HSVC_LOAD_ATTR( ATTR_IS_SIMULATION ); -HSVC_LOAD_ATTR( ATTR_MEMB_DDR_REFCLOCK_RCVR_TERM ); -HSVC_LOAD_ATTR( ATTR_MEMB_DMI_REFCLOCK_RCVR_TERM ); -HSVC_LOAD_ATTR( ATTR_MEM_FILTER_PLL_SOURCE ); -HSVC_LOAD_ATTR( ATTR_MNFG_FLAGS ); -HSVC_LOAD_ATTR( ATTR_MULTI_SCOM_BUFFER_MAX_SIZE ); -// TODO RTC:161596 - Remove references to deprecated NEST_FREQ_MHZ -HSVC_LOAD_ATTR( ATTR_NEST_FREQ_MHZ ); -HSVC_LOAD_ATTR( ATTR_PCI_REFCLOCK_RCVR_TERM ); -HSVC_LOAD_ATTR( ATTR_PIB_I2C_NEST_PLL ); -HSVC_LOAD_ATTR( ATTR_PIB_I2C_REFCLOCK ); -HSVC_LOAD_ATTR( ATTR_PM_HWP_ATTR_VERSION ); -HSVC_LOAD_ATTR( ATTR_PROC_EPS_TABLE_TYPE ); -HSVC_LOAD_ATTR( ATTR_PROC_FABRIC_PUMP_MODE ); -HSVC_LOAD_ATTR( ATTR_PROC_REFCLOCK_RCVR_TERM ); -HSVC_LOAD_ATTR( ATTR_PROC_X_BUS_WIDTH ); -HSVC_LOAD_ATTR( ATTR_RECONFIGURE_LOOP ); -HSVC_LOAD_ATTR( ATTR_REDUNDANT_CLOCKS ); -HSVC_LOAD_ATTR( ATTR_RISK_LEVEL ); -HSVC_LOAD_ATTR( ATTR_SBE_IMAGE_OFFSET ); -// -- Input: ../../xml/attribute_info/unit_attributes.xml -- -// No attributes found diff --git a/src/usr/runtime/makefile b/src/usr/runtime/makefile index d0e0abd93..bdfa301c3 100644 --- a/src/usr/runtime/makefile +++ b/src/usr/runtime/makefile @@ -34,8 +34,6 @@ MODULE = runtime VPATH += ${ROOTPATH}/src/usr/hdat -#@TODO RTC:132750 -#OBJS += populate_attributes.o OBJS += populate_hbruntime.o OBJS += hdatservice.o OBJS += fakepayload.o diff --git a/src/usr/runtime/populate_attributes.C b/src/usr/runtime/populate_attributes.C deleted file mode 100644 index 08677a09b..000000000 --- a/src/usr/runtime/populate_attributes.C +++ /dev/null @@ -1,846 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/usr/runtime/populate_attributes.C $ */ -/* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* Contributors Listed Below - COPYRIGHT 2012,2017 */ -/* [+] 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 populate_attributes.C - * - * @brief Populate attributes for runtime HostServices code - */ - -#include <sys/misc.h> -#include <trace/interface.H> -#include <errl/errlentry.H> -#include <fapi.H> -#include <fapiAttributeIds.H> -#include <targeting/common/target.H> -#include <targeting/common/targetservice.H> -#include <targeting/common/utilFilter.H> -#include <targeting/common/entitypath.H> -#include <runtime/runtime_reasoncodes.H> -#include <runtime/runtime.H> -#include "common/hsvc_attribute_structs.H" -#include <mbox/ipc_msg_types.H> -#include <sys/task.h> -#include <intr/interrupt.H> -#include <errl/errlmanager.H> - -trace_desc_t *g_trac_runtime = NULL; -TRAC_INIT(&g_trac_runtime, RUNTIME_COMP_NAME, KILOBYTE); - -/** - * @brief Read a FAPI attribute and stick it into mainstore - */ -#define HSVC_LOAD_ATTR(__fid) \ - fapi::__fid##_Type result_##__fid; \ - _rc = FAPI_ATTR_GET( __fid, _target, result_##__fid ); \ - if( _rc ) { \ - TRACFCOMP( g_trac_runtime, "Error reading 0x%X, rc=0x%X", fapi::__fid, _rc ); \ - _failed_attribute = fapi::__fid; \ - break; \ - } \ - TRACDCOMP( g_trac_runtime, "> %d: 0x%x=%X @ %p", *_num_attr, fapi::__fid, result_##__fid, _output_ptr ); \ - _cur_header = &(_all_headers[(*_num_attr)]); \ - _cur_header->id = fapi::__fid; \ - _cur_header->sizeBytes = sizeof(fapi::__fid##_Type); \ - _cur_header->offset = (_output_ptr - _beginning); \ - if( _output_ptr + sizeof(fapi::__fid##_Type) > _end_of_area ) { \ - TRACFCOMP( g_trac_runtime, "Not enough space for 0x%X (%p + 0x%X > %p", fapi::__fid, _output_ptr, sizeof(fapi::__fid##_Type), _end_of_area ); \ - _failed_attribute = fapi::__fid; \ - break; \ - } \ - memcpy( _output_ptr, &result_##__fid, sizeof(fapi::__fid##_Type) ); \ - _output_ptr += sizeof(fapi::__fid##_Type); \ - (*_num_attr)++; - -/** - * @brief Read a Privileged FAPI attribute and stick it into mainstore - */ -#define HSVC_LOAD_ATTR_P(__fid) \ - fapi::__fid##_Type result_##__fid; \ - _rc = FAPI_ATTR_GET_PRIVILEGED( __fid, _target, result_##__fid ); \ - if( _rc ) { \ - TRACFCOMP( g_trac_runtime, "Error reading 0x%X, rc=0x%X", fapi::__fid, _rc ); \ - _failed_attribute = fapi::__fid; \ - break; \ - } \ - TRACDCOMP( g_trac_runtime, "> %d: 0x%x=%X @ %p", *_num_attr, fapi::__fid, result_##__fid, _output_ptr ); \ - _cur_header = &(_all_headers[(*_num_attr)]); \ - _cur_header->id = fapi::__fid; \ - _cur_header->sizeBytes = sizeof(fapi::__fid##_Type); \ - _cur_header->offset = (_output_ptr - _beginning); \ - if( _output_ptr + sizeof(fapi::__fid##_Type) > _end_of_area ) { \ - TRACFCOMP( g_trac_runtime, "Not enough space for 0x%X (%p + 0x%X > %p", fapi::__fid, _output_ptr, sizeof(fapi::__fid##_Type), _end_of_area ); \ - _failed_attribute = fapi::__fid; \ - break; \ - } \ - memcpy( _output_ptr, &result_##__fid, sizeof(fapi::__fid##_Type) ); \ - _output_ptr += sizeof(fapi::__fid##_Type); \ - (*_num_attr)++; - -/** - * @brief Read the HUID attribute from targeting and stick it into mainstore - */ -#define ADD_HUID(__targ) \ - _huid_temp = TARGETING::get_huid(__targ); \ - TRACDCOMP( g_trac_runtime, "> HUID=%.8X @ %p", _huid_temp, _output_ptr ); \ - _cur_header = &(_all_headers[(*_num_attr)]); \ - _cur_header->id = HSVC_HUID; \ - _cur_header->sizeBytes = sizeof(uint32_t); \ - _cur_header->offset = (_output_ptr - _beginning); \ - memcpy( _output_ptr, &_huid_temp, sizeof(uint32_t) ); \ - _output_ptr += sizeof(uint32_t); \ - (*_num_attr)++; - -/** - * @brief Read the PHYS_PATH attribute from targeting and stick it into mainstore - */ -#define ADD_PHYS_PATH(__targ) \ - { TARGETING::AttributeTraits<TARGETING::ATTR_PHYS_PATH>::Type pathPhys; \ - _rc = !(__targ->tryGetAttr<TARGETING::ATTR_PHYS_PATH>(pathPhys)); \ - _cur_header = &(_all_headers[(*_num_attr)]); \ - _cur_header->id = HSVC_PHYS_PATH; \ - _cur_header->sizeBytes = sizeof(uint8_t) + (sizeof(pathPhys[0]) * pathPhys.size()); \ - _cur_header->offset = (_output_ptr - _beginning); \ - memcpy( _output_ptr, &pathPhys, _cur_header->sizeBytes ); \ - _output_ptr += _cur_header->sizeBytes; \ - (*_num_attr)++; } - -/** - * @brief Read the ECMD_STRING attribute from targeting and stick it into mainstore - */ -#define ADD_ECMD_STRING() \ - { const char* estring = _target->toEcmdString(); \ - _cur_header = &(_all_headers[(*_num_attr)]); \ - _cur_header->id = HSVC_ECMD_STRING; \ - _cur_header->sizeBytes = fapi::MAX_ECMD_STRING_LEN; \ - _cur_header->offset = (_output_ptr - _beginning); \ - memcpy( _output_ptr, estring, _cur_header->sizeBytes ); \ - _output_ptr += _cur_header->sizeBytes; \ - (*_num_attr)++; } - -/** - * @brief Read the IBSCOM_BASE attribute from targeting - * and stick it into mainstore - */ -#define ADD_IBSCOM_BASE(__targ) \ - { TARGETING::AttributeTraits \ - <TARGETING::ATTR_IBSCOM_PROC_BASE_ADDR>::Type ibscomBase; \ - _rc = !(__targ->tryGetAttr \ - <TARGETING::ATTR_IBSCOM_PROC_BASE_ADDR>(ibscomBase)); \ - _cur_header = &(_all_headers[(*_num_attr)]); \ - _cur_header->id = HSVC_IBSCOM_BASE; \ - _cur_header->sizeBytes = sizeof(uint64_t); \ - _cur_header->offset = (_output_ptr - _beginning); \ - memcpy( _output_ptr, &ibscomBase, _cur_header->sizeBytes ); \ - _output_ptr += _cur_header->sizeBytes; \ - (*_num_attr)++; } - -/** - * @brief Read the PLID attribute from targeting - * and stick it into mainstore - */ -#define ADD_PLID(__targ) \ - { TARGETING::AttributeTraits \ - <TARGETING::ATTR_HOSTSVC_PLID>::Type plid_temp; \ - _rc = !(__targ->tryGetAttr \ - <TARGETING::ATTR_HOSTSVC_PLID>(plid_temp)); \ - _cur_header = &(_all_headers[(*_num_attr)]); \ - _cur_header->id = HSVC_PLID; \ - _cur_header->sizeBytes = sizeof(uint32_t); \ - _cur_header->offset = (_output_ptr - _beginning); \ - memcpy( _output_ptr, &plid_temp, _cur_header->sizeBytes ); \ - _output_ptr += _cur_header->sizeBytes; \ - (*_num_attr)++; } - -/** - * @brief Insert a terminator into the attribute list - */ -#define EMPTY_ATTRIBUTE \ - _cur_header = &(_all_headers[(*_num_attr)]); \ - _cur_header->id = hsvc_attr_header_t::NO_ATTRIBUTE; \ - _cur_header->sizeBytes = 0; \ - _cur_header->offset = 0; - - -namespace RUNTIME -{ - -// This is the data that will be in the 'System Attribute Data' -// section of HDAT -struct system_data_t -{ - enum { - MAX_ATTRIBUTES = 100 - }; - - // header data that HostServices uses - hsvc_system_data_t hsvc; - - // actual data content - hsvc_attr_header_t attrHeaders[MAX_ATTRIBUTES]; - char attributes[MAX_ATTRIBUTES*sizeof(uint32_t)]; -}; - -// This is the data that will be in the 'Node Attribute Data' -// section of HDAT, there will be 1 of these per physical -// drawer/book/octant/blade -struct node_data_t -{ - enum { - MAX_PROCS_RSV = P8_MAX_PROCS+4, //leave space for double - MAX_EX_RSV = MAX_PROCS_RSV*P8_MAX_EX_PER_PROC, - NUM_PROC_ATTRIBUTES = 250, - NUM_EX_ATTRIBUTES = 20, - MAX_ATTRIBUTES = MAX_PROCS_RSV*NUM_PROC_ATTRIBUTES + - MAX_EX_RSV*NUM_EX_ATTRIBUTES - }; - - // header data that HostServices uses - hsvc_node_data_t hsvc; - - // actual data content - hsvc_proc_header_t procs[MAX_PROCS_RSV]; - hsvc_ex_header_t ex[MAX_EX_RSV]; - hsvc_attr_header_t procAttrHeaders[MAX_PROCS_RSV][NUM_PROC_ATTRIBUTES]; - hsvc_attr_header_t exAttrHeaders[MAX_EX_RSV][NUM_EX_ATTRIBUTES]; - char attributes[MAX_ATTRIBUTES*sizeof(uint32_t)]; -}; - - -/** - * @brief Populate system attributes for HostServices - * @param i_nodes Bit-mask of present nodes - */ -errlHndl_t populate_system_attributes( uint64_t i_nodes ) -{ - errlHndl_t errhdl = NULL; - TRACFCOMP( g_trac_runtime, "populate_system_attributes> i_nodes=%.16X", i_nodes ); - - // These variables are used by the HSVC_LOAD_ATTR macros directly - uint64_t _failed_attribute = 0; //attribute we failed on - int _rc = 0; //result from FAPI_ATTR_GET - - do { - TRACDCOMP( g_trac_runtime, "-SYSTEM-" ); - - // Wipe out our cache of the NACA/SPIRA pointers - RUNTIME::rediscover_hdat(); - - // find our memory range and fill it with some junk data - uint64_t sys_data_addr = 0; - uint64_t sys_data_size = 0; - errhdl = RUNTIME::get_host_data_section(RUNTIME::HSVC_SYSTEM_DATA, - 0, - sys_data_addr, - sys_data_size ); - if( errhdl ) - { - TRACFCOMP( g_trac_runtime, "Could not find a space for the system data" ); - break; - } - if( (sys_data_addr == 0) || (sys_data_size == 0) ) - { - TRACFCOMP( g_trac_runtime, "Invalid memory values for HSVC_SYSTEM_DATA" ); - /*@ - * @errortype - * @reasoncode RUNTIME::RC_INVALID_SECTION - * @moduleid RUNTIME::MOD_RUNTIME_POP_SYS_ATTR - * @userdata1 Returned address: sys_data_addr - * @userdata2 Returned size: sys_data_size - * @devdesc Invalid memory values for HSVC_SYSTEM_DATA - */ - errhdl = new ERRORLOG::ErrlEntry( - ERRORLOG::ERRL_SEV_UNRECOVERABLE, - RUNTIME::MOD_RUNTIME_POP_SYS_ATTR, - RUNTIME::RC_INVALID_SECTION, - sys_data_addr, - sys_data_size ); - // most likely this is a HB code bug - errhdl->addProcedureCallout(HWAS::EPUB_PRC_HB_CODE, - HWAS::SRCI_PRIORITY_HIGH); - // but it could also be a FSP bug in setting up the HDAT data - errhdl->addProcedureCallout(HWAS::EPUB_PRC_SP_CODE, - HWAS::SRCI_PRIORITY_HIGH); - // save some of the HDAT data for FFDC - RUNTIME::add_host_data_ffdc( RUNTIME::HSVC_SYSTEM_DATA, errhdl ); - - break; - } - else if( sizeof(system_data_t) > sys_data_size ) - { - TRACFCOMP( g_trac_runtime, "Not enough space allocated by HDAT for HostServices System Data" ); - /*@ - * @errortype - * @reasoncode RUNTIME::RC_NOT_ENOUGH_SPACE - * @moduleid RUNTIME::MOD_RUNTIME_POP_SYS_ATTR - * @userdata1 Required size - * @userdata2 Available size - * @devdesc Not enough space allocated by HDAT for - * HostServices System Data - */ - errhdl = new ERRORLOG::ErrlEntry( - ERRORLOG::ERRL_SEV_UNRECOVERABLE, - RUNTIME::MOD_RUNTIME_POP_SYS_ATTR, - RUNTIME::RC_NOT_ENOUGH_SPACE, - sizeof(system_data_t), - sys_data_size ); - // need to update the FSP code - errhdl->addProcedureCallout(HWAS::EPUB_PRC_SP_CODE, - HWAS::SRCI_PRIORITY_HIGH); - - // save some of the HDAT data for FFDC - RUNTIME::add_host_data_ffdc( RUNTIME::HSVC_SYSTEM_DATA, errhdl ); - - break; - } - - system_data_t* sys_data = reinterpret_cast<system_data_t*>(sys_data_addr); - memset( sys_data, 'A', sizeof(system_data_t) ); - - // These variables are used by the HSVC_LOAD_ATTR macros directly - uint64_t* _num_attr = NULL; //pointer to numAttr in struct - char* _output_ptr = NULL; //next memory location to copy attr data into - char* _beginning = NULL; //position zero for offset calculation - hsvc_attr_header_t* _all_headers = NULL; //array of attribute headers - fapi::Target* _target = NULL; //target for FAPI_ATTR_GET - hsvc_attr_header_t* _cur_header = NULL; //temp variable - uint32_t _huid_temp = 0; //temp variable - void* _end_of_area = reinterpret_cast<void*>(sys_data_addr - + sys_data_size); - - // Prepare the vars for the HSVC_LOAD_ATTR macros - _beginning = reinterpret_cast<char*>(sys_data); - _output_ptr = sys_data->attributes; - _all_headers = sys_data->attrHeaders; - _num_attr = &(sys_data->hsvc.numAttr); - _target = NULL; //system queries use NULL target - - // Grab a system object to work with - TARGETING::Target* sys = NULL; - TARGETING::targetService().getTopLevelTarget(sys); - - // Fill in the metadata - sys_data->hsvc.offset = - reinterpret_cast<uint64_t>(sys_data->attrHeaders) - - reinterpret_cast<uint64_t>(sys_data); - sys_data->hsvc.nodePresent = i_nodes; - sys_data->hsvc.numAttr = 0; - - // Fill up the attributes - ADD_HUID( sys ); // for debug - ADD_PHYS_PATH( sys ); - ADD_PLID( sys ); - // Use a generated file for the list of attributes to load - #include "common/hsvc_sysdata.C" - - // Add an empty attribute header to signal the end - EMPTY_ATTRIBUTE; - - size_t total_bytes = _output_ptr - sys_data->attributes; - TRACFCOMP( g_trac_runtime, "populate_system_attributes> numAttr=%d, bytes=%d", sys_data->hsvc.numAttr, total_bytes ); - - // Make sure we don't overrun our space - assert( *_num_attr < system_data_t::MAX_ATTRIBUTES ); - - TRACDCOMP( g_trac_runtime, "Run: system_cmp0.memory_ln4->image.save attributes.sys.bin 0x%X %d", sys_data, total_bytes ); - } while(0); - - // Handle any errors from FAPI_ATTR_GET - if( _rc ) - { - errlHndl_t rc_errhdl = NULL; - - /*@ - * @errortype - * @reasoncode RUNTIME::RC_ATTR_GET_FAIL - * @moduleid RUNTIME::MOD_RUNTIME_POP_SYS_ATTR - * @userdata1 Return code from FAPI_ATTR_GET - * @userdata2 FAPI Attribute Id that failed - * @devdesc Error retrieving FAPI attribute - */ - rc_errhdl = new ERRORLOG::ErrlEntry( ERRORLOG::ERRL_SEV_UNRECOVERABLE, - RUNTIME::MOD_RUNTIME_POP_SYS_ATTR, - RUNTIME::RC_ATTR_GET_FAIL, - _rc, - _failed_attribute, - true /*Add HB Software Callout*/); - rc_errhdl->collectTrace(TARG_COMP_NAME,KILOBYTE/2); - - // Any previous error is probably more interesting so just commit - // the rc error - if( errhdl ) - { - errlCommit(rc_errhdl, RUNTIME_COMP_ID); - } - else - { - errhdl = rc_errhdl; - } - } - - return errhdl; -} - -/** - * @brief Populate node attributes for HostServices - */ -errlHndl_t populate_node_attributes( uint64_t i_nodeNum ) -{ - errlHndl_t errhdl = NULL; - - // These variables are used by the HSVC_LOAD_ATTR macros directly - uint64_t _failed_attribute = 0; //attribute we failed on - int _rc = 0; //result from FAPI_ATTR_GET - - do { - TRACDCOMP( g_trac_runtime, "-NODE-" ); - TRACFCOMP( g_trac_runtime, "populate_node_attributes(node=%d)", i_nodeNum ); - - // Wipe out our cache of the NACA/SPIRA pointers - RUNTIME::rediscover_hdat(); - - // allocate memory and fill it with some junk data - uint64_t node_data_addr = 0; - size_t node_data_size = 0; - errhdl = RUNTIME::get_host_data_section( - RUNTIME::HSVC_NODE_DATA, - i_nodeNum, - node_data_addr, - node_data_size ); - if( errhdl ) - { - TRACFCOMP( g_trac_runtime, "Could not find a space for the node data" ); - break; - } - if( (node_data_addr == 0) || (node_data_size == 0) ) - { - TRACFCOMP( g_trac_runtime, "Invalid memory values for HSVC_NODE_DATA" ); - /*@ - * @errortype - * @reasoncode RUNTIME::RC_INVALID_SECTION - * @moduleid RUNTIME::MOD_RUNTIME_POP_NODE_ATTR - * @userdata1 Returned address: node_data_addr - * @userdata2 Returned size: node_data_size - * @devdesc Invalid memory values for HSVC_NODE_DATA - */ - errhdl = new ERRORLOG::ErrlEntry( - ERRORLOG::ERRL_SEV_UNRECOVERABLE, - RUNTIME::MOD_RUNTIME_POP_NODE_ATTR, - RUNTIME::RC_INVALID_SECTION, - node_data_addr, - node_data_size, - true /*Add HB Software Callout*/ ); - break; - } - else if( sizeof(node_data_t) > node_data_size ) - { - TRACFCOMP( g_trac_runtime, "Not enough space allocated by HDAT for HostServices Node Data" ); - /*@ - * @errortype - * @reasoncode RUNTIME::RC_NOT_ENOUGH_SPACE - * @moduleid RUNTIME::MOD_RUNTIME_POP_NODE_ATTR - * @userdata1 Required size - * @userdata2 Available size - * @devdesc Not enough space allocated by HDAT for - * HostServices Node Data - */ - errhdl = new ERRORLOG::ErrlEntry( - ERRORLOG::ERRL_SEV_UNRECOVERABLE, - RUNTIME::MOD_RUNTIME_POP_NODE_ATTR, - RUNTIME::RC_NOT_ENOUGH_SPACE, - sizeof(node_data_t), - node_data_size ); - // need to update the FSP code - errhdl->addProcedureCallout(HWAS::EPUB_PRC_SP_CODE, - HWAS::SRCI_PRIORITY_HIGH); - - // save some of the HDAT data for FFDC - RUNTIME::add_host_data_ffdc( RUNTIME::HSVC_NODE_DATA, errhdl ); - - break; - } - - node_data_t* node_data = reinterpret_cast<node_data_t*>(node_data_addr); - memset( node_data, 'A', sizeof(node_data_t) ); - - // These variables are used by the HSVC_LOAD_ATTR macros directly - uint64_t* _num_attr = NULL; //pointer to numAttr in struct - char* _output_ptr = NULL; //next memory location to copy attr data into - char* _beginning = NULL; //position zero for offset calculation - hsvc_attr_header_t* _all_headers = NULL; //array of attribute headers - fapi::Target* _target = NULL; //target for FAPI_ATTR_GET - hsvc_attr_header_t* _cur_header = NULL; //temp variable - uint32_t _huid_temp = 0; //temp variable - void* _end_of_area = reinterpret_cast<void*>(node_data_addr - + node_data_size); - - // Prepare the vars for the HSVC_LOAD_ATTR macros - _beginning = reinterpret_cast<char*>(node_data); - _output_ptr = node_data->attributes; - - // indices for ex_header and proc_header - size_t next_proc = 0; - size_t next_ex = 0; - - // Fill in the metadata - node_data->hsvc.numTargets = 0; - node_data->hsvc.procOffset = - reinterpret_cast<uint64_t>(node_data->procs) - - reinterpret_cast<uint64_t>(node_data); - - // Get all proc targets - // use PredicateHwas to filter only present procs - TARGETING::PredicateHwas isPresent; - isPresent.reset().poweredOn(true).present(true); - // filter for Chips/Chiplets - TARGETING::PredicateCTM isChipProc(TARGETING::CLASS_CHIP, - TARGETING::TYPE_PROC); - // declare a postfix expression widget - TARGETING::PredicatePostfixExpr goodFilter; - // is-a-chip is-present AND - goodFilter.push(&isChipProc).push(&isPresent).And(); - // apply the filter through all targets. - TARGETING::TargetRangeFilter procIter( - TARGETING::targetService().begin(), - TARGETING::targetService().end(), - &goodFilter ); - - // Iterate through the present proc list - // p is the index of the current procIter - for ( size_t p = 0; procIter; ++procIter,p++ ) - { - // Cast to a FAPI type of target. - fapi::Target fapi_proc( fapi::TARGET_TYPE_PROC_CHIP, - reinterpret_cast<void *> - (const_cast<TARGETING::Target*>(*procIter)) ); - - // Compute the processor id to match what HDAT uses - uint64_t node_id = - (*procIter)->getAttr<TARGETING::ATTR_FABRIC_GROUP_ID>(); - uint64_t chip_id = - (*procIter)->getAttr<TARGETING::ATTR_FABRIC_CHIP_ID>(); - uint32_t procid = (node_id << 3) | (chip_id); //NNNCCC - TRACDCOMP( g_trac_runtime, "PROC:%d (%.8X)", procid, TARGETING::get_huid(*procIter) ); - - // Fill in the metadata - node_data->procs[p].procid = procid; - node_data->procs[p].offset = - reinterpret_cast<uint64_t>(&(node_data->procAttrHeaders[p][0])) - - reinterpret_cast<uint64_t>(node_data); - node_data->procs[p].numAttr = 0; - (node_data->hsvc.numTargets)++; - - // Prepare the variables for the HSVC_LOAD_ATTR calls - _all_headers = &(node_data->procAttrHeaders[p][0]); - _num_attr = &(node_data->procs[p].numAttr); - _target = &fapi_proc; - - // Fill up the attributes - ADD_HUID( (*procIter) ); // for debug - ADD_PHYS_PATH( (*procIter) ); - ADD_ECMD_STRING(); - ADD_IBSCOM_BASE( (*procIter) ); - - // Use a generated file for the list of attributes to load - #include "common/hsvc_procdata.C" - - // Add an empty attribute header to signal the end - EMPTY_ATTRIBUTE; - - TRACFCOMP( g_trac_runtime, "populate_node_attributes> PROC:%d (%.8X) : numAttr=%d", procid, TARGETING::get_huid(*procIter), node_data->procs[p].numAttr ); - - // Make sure we don't overrun our space - assert( *_num_attr < node_data_t::NUM_PROC_ATTRIBUTES ); - - // Loop around all of the EX chiplets for this proc - TARGETING::TargetHandleList all_ex; - TARGETING::getChildChiplets( all_ex, (*procIter), - TARGETING::TYPE_EX, false ); - for( size_t e = 0; e < all_ex.size(); e++ ) - { - uint32_t chiplet = - all_ex[e]->getAttr<TARGETING::ATTR_CHIP_UNIT>(); - TRACDCOMP( g_trac_runtime, "EX:p%d c%d(%.8X)", procid, chiplet, get_huid(all_ex[e]) ); - - // Fill in the metadata - (node_data->hsvc.numTargets)++; - node_data->ex[next_ex].parent_procid = procid; - node_data->ex[next_ex].chiplet = chiplet; - node_data->ex[next_ex].offset = - reinterpret_cast<uint64_t>( - &(node_data->exAttrHeaders[next_ex][0])) - - reinterpret_cast<uint64_t>(node_data); - node_data->hsvc.exOffset = - reinterpret_cast<uint64_t>(node_data->ex) - - reinterpret_cast<uint64_t>(node_data); - node_data->ex[next_ex].numAttr = 0; - - // Cast to a FAPI type of target. - fapi::Target fapi_ex( fapi::TARGET_TYPE_EX_CHIPLET, - reinterpret_cast<void *> - (const_cast<TARGETING::Target*>(all_ex[e])) ); - - // Prepare the variables for the HSVC_LOAD_ATTR calls - _all_headers = &(node_data->exAttrHeaders[next_ex][0]); - _num_attr = &(node_data->ex[next_ex].numAttr); - _target = &fapi_ex; - - // Fill up the attributes - ADD_HUID( (all_ex[e]) ); // for debug - ADD_PHYS_PATH( (all_ex[e]) ); - ADD_ECMD_STRING(); - // Use a generated file for the list of attributes to load - #include "common/hsvc_exdata.C" - - // Add an empty attribute header to signal the end - EMPTY_ATTRIBUTE; - - TRACFCOMP( g_trac_runtime, "populate_node_attributes> EX:p%d c%d(%.8X) : numAttr=%d", procid, chiplet, get_huid(all_ex[e]), node_data->ex[next_ex].numAttr ); - - // Make sure we don't overrun our space - assert( *_num_attr < node_data_t::NUM_EX_ATTRIBUTES ); - - next_ex++; - } - - next_proc++; - } - - size_t total_bytes = _output_ptr - node_data->attributes; - TRACFCOMP( g_trac_runtime, "populate_node_attributes> Total bytes = %d", total_bytes ); - - // Add an empty Proc marker at the end - node_data->procs[next_proc].procid = hsvc_proc_header_t::NO_PROC; - node_data->procs[next_proc].offset = 0; - node_data->procs[next_proc].numAttr = 0; - (node_data->hsvc.numTargets)++; - - // Add an empty EX marker at the end - node_data->ex[next_ex].parent_procid = hsvc_ex_header_t::NO_PROC; - node_data->ex[next_ex].chiplet = hsvc_ex_header_t::NO_CHIPLET; - node_data->ex[next_ex].numAttr = 0; - - TRACDCOMP( g_trac_runtime, "Run: system_cmp0.memory_ln4->image.save attributes.node.bin 0x%X %d", node_data, total_bytes ); - } while(0); - - // Handle any errors from FAPI_ATTR_GET - if( _rc ) - { - errlHndl_t rc_errhdl = NULL; - - /*@ - * @errortype - * @reasoncode RUNTIME::RC_ATTR_GET_FAIL - * @moduleid RUNTIME::MOD_RUNTIME_POP_NODE_ATTR - * @userdata1 Return code from FAPI_ATTR_GET - * @userdata2 FAPI Attribute Id that failed - * @devdesc Error retrieving FAPI attribute - */ - rc_errhdl = new ERRORLOG::ErrlEntry( ERRORLOG::ERRL_SEV_UNRECOVERABLE, - RUNTIME::MOD_RUNTIME_POP_NODE_ATTR, - RUNTIME::RC_ATTR_GET_FAIL, - _rc, - _failed_attribute, - true /*Add HB Software Callout*/ ); - rc_errhdl->collectTrace(TARG_COMP_NAME,KILOBYTE/2); - - // Any previous error is probably more interesting so just commit - // the rc error - if( errhdl ) - { - errlCommit(rc_errhdl, RUNTIME_COMP_ID); - } - else - { - errhdl = rc_errhdl; - } - } - - return errhdl; -} - -/** - * @brief Populate attributes for HostServices - */ -errlHndl_t populate_attributes( void ) -{ - errlHndl_t errhdl = NULL; - - do { - TRACFCOMP( g_trac_runtime, "Running populate_attributes" ); - - TARGETING::Target * sys = NULL; - TARGETING::targetService().getTopLevelTarget( sys ); - assert(sys != NULL); - - TARGETING::ATTR_HB_EXISTING_IMAGE_type hb_images = - sys->getAttr<TARGETING::ATTR_HB_EXISTING_IMAGE>(); - - // Figure out which node we are running on - TARGETING::Target* mproc = NULL; - TARGETING::targetService().masterProcChipTargetHandle(mproc); - - TARGETING::EntityPath epath = - mproc->getAttr<TARGETING::ATTR_PHYS_PATH>(); - - const TARGETING::EntityPath::PathElement pe = - epath.pathElementOfType(TARGETING::TYPE_NODE); - - uint64_t nodeid = pe.instance; - - // ATTR_HB_EXISTING_IMAGE only gets set on a multi-drawer system. - // Currently set up in host_sys_fab_iovalid_processing() which only - // gets called if there are multiple physical nodes. It eventually - // needs to be setup by a hb routine that snoops for multiple nodes. - uint64_t present_nodes = hb_images; - if(hb_images == 0) - { - // Set the appropriate bit for our node - present_nodes = ((uint64_t)0x1 - << ((sizeof(present_nodes) * 8) - 1)) - >> nodeid; - } - else - { - // need to left-justify the uint8 into the uint64 we want - present_nodes = present_nodes << - ((sizeof(present_nodes)-sizeof(hb_images))*8); - } - - // Write the System-level Attributes - errhdl = populate_system_attributes(present_nodes); - if( errhdl ) - { - TRACFCOMP( g_trac_runtime, "populate_attributes failed" ); - break; - } - - // Single or Multi-node? - if(hb_images == 0) //Single-node - { - // Single node system, call inline and pass in our node number - errhdl = populate_node_attributes(nodeid); - if(errhdl != NULL) - { - TRACFCOMP( g_trac_runtime, "populate_node_attributes failed" ); - } - break; - } - - // continue - multi-node - - // This msgQ catches the responses to populate the attributes - msg_q_t msgQ = msg_q_create(); - errhdl = MBOX::msgq_register(MBOX::HB_POP_ATTR_MSGQ,msgQ); - - if(errhdl) - { - TRACFCOMP( g_trac_runtime, "MBOX::msgq_register failed!" ); - break; - } - - - uint8_t node_map[8]; - - sys->tryGetAttr<TARGETING::ATTR_FABRIC_TO_PHYSICAL_NODE_MAP>(node_map); - - uint64_t msg_count = 0; - - // This is a multi-drawer system. - // The assertion is that the hostboot instance must be equal to - // the logical node we are running on. The ideal would be to have - // a function call that would return the HB instance number. - task_affinity_pin(); - task_affinity_migrate_to_master(); - uint64_t this_node = INTR::PIR_t(task_getcpuid()).nodeId; - task_affinity_unpin(); - - uint64_t payloadBase = sys->getAttr<TARGETING::ATTR_PAYLOAD_BASE>(); - - //loop though all possible drawers whether they exist or not - // An invalid or non-existant logical node number in that drawer - // indicates that the drawer does not exist. - for(uint64_t drawer = 0; drawer < sizeof(node_map); ++drawer) - { - uint64_t node = node_map[drawer]; - - if(node < (sizeof(TARGETING::ATTR_HB_EXISTING_IMAGE_type) * 8)) - { - - // set mask to msb - TARGETING::ATTR_HB_EXISTING_IMAGE_type mask = 0x1 << - ((sizeof(TARGETING::ATTR_HB_EXISTING_IMAGE_type) * 8) -1); - - if( 0 != ((mask >> node) & hb_images ) ) - { - TRACDCOMP( g_trac_runtime, - "populate_attributes-sending msg for drawer %d", - drawer ); - ++msg_count; - msg_t * msg = msg_allocate(); - msg->type = IPC::IPC_POPULATE_ATTRIBUTES; - msg->data[0] = drawer; // offset in attribute table - msg->data[1] = this_node; // node to send a msg back to - msg->extra_data = reinterpret_cast<uint64_t*>(payloadBase); - errhdl = MBOX::send(MBOX::HB_IPC_MSGQ, msg, node); - if (errhdl) - { - TRACFCOMP( g_trac_runtime, "MBOX::send failed"); - break; - } - } - } - } - - if(errhdl == NULL) - { - // wait for all hb images to respond - while(msg_count) - { - msg_t* msg = msg_wait(msgQ); - TRACFCOMP( g_trac_runtime, - "populate node attributes. drawer %d completed.", - msg->data[0]); - msg_free(msg); - --msg_count; - } - } - - MBOX::msgq_unregister(MBOX::HB_POP_ATTR_MSGQ); - msg_q_destroy(msgQ); - - } while(0); - - return errhdl; -} - -void setPayloadBaseAddress(uint64_t i_payloadAddress) -{ - TARGETING::Target * sys = NULL; - TARGETING::targetService().getTopLevelTarget( sys ); - sys->setAttr<TARGETING::ATTR_PAYLOAD_BASE>(i_payloadAddress); -} - -} //namespace RUNTIME diff --git a/src/usr/runtime/test/makefile b/src/usr/runtime/test/makefile index fe3f3ed92..e307302f2 100644 --- a/src/usr/runtime/test/makefile +++ b/src/usr/runtime/test/makefile @@ -40,9 +40,6 @@ MODULE = testruntime #@TODO RTC:178802 #vpath %.C ../../targeting/runtime -#@TODO RTC:132750 -#TESTS += runtimeattrtest.H - #@TODO RTC:178802 #EXTRAINCDIR += ${ROOTPATH}/src/include/usr/runtime/ diff --git a/src/usr/runtime/test/runtimeattrstest.H b/src/usr/runtime/test/runtimeattrstest.H deleted file mode 100644 index 2cf2f389e..000000000 --- a/src/usr/runtime/test/runtimeattrstest.H +++ /dev/null @@ -1,528 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/usr/runtime/test/runtimeattrstest.H $ */ -/* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* Contributors Listed Below - COPYRIGHT 2012,2016 */ -/* [+] 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 __TEST_RUNTIMEATTRSTEST_H -#define __TEST_RUNTIMEATTRSTEST_H - -/** - * @file runtimeattrstest.H - * - */ - -#include <cxxtest/TestSuite.H> - -#include <fapi.H> -#include <fapiAttributeIds.H> -#include <targeting/common/target.H> -#include <targeting/common/targetservice.H> -#include <targeting/common/utilFilter.H> -#include <arch/ppc.H> //for MAGIC -#include <attributeenums.H> -#include <errl/errlmanager.H> -//#include <hwpf/plat/fapiPlatHwpInvoker.H> -#include "../common/hsvc_attribute_structs.H" - -extern trace_desc_t* g_trac_runtime; - -using namespace fapi; - -class RuntimeAttrsTest: public CxxTest::TestSuite -{ - public: - void testVerifySystemAttributes(void) - { - TRACFCOMP( g_trac_runtime, "testVerifySystemAttributes> start" ); - hsvc_system_data_t* sysdata = getSysPtr(); - - //Look for a valid node number - if( sysdata->nodePresent != 0x8000000000000000 ) - { - TRACFCOMP( g_trac_runtime, "nodePresent=%.16X", sysdata->nodePresent ); - TS_FAIL("testVerifySystemAttributes> nodePresent is invalid"); - } - - //Make sure we have some attributes out there - if( sysdata->numAttr == 0 ) - { - TS_FAIL("testVerifySystemAttributes> numAttr is zero"); - } - - //Make sure that the offset is what we expect - if( sysdata->offset != 24 ) //3 words from the start - { - TRACFCOMP( g_trac_runtime, "offset=%.16X", sysdata->offset ); - TS_FAIL("testVerifySystemAttributes> offset is invalid"); - } - - char* beginning = reinterpret_cast<char*>(sysdata); - hsvc_attr_header_t* headers = reinterpret_cast<hsvc_attr_header_t*> - ((beginning+sysdata->offset)); - - //Grab a couple of arbitrary attributes - ReturnCode l_rc; - - fapi::ATTR_FREQ_PB_MHZ_Type freq = 0; - l_rc = FAPI_ATTR_GET(ATTR_FREQ_PB_MHZ,NULL,freq); - if( l_rc ) - { - TS_FAIL("Error getting fapi::ATTR_FREQ_PB_MHZ"); - } - bool freq_found = false; - - fapi::ATTR_PM_SYSTEM_IVRM_VPD_MIN_LEVEL_Type vpdMinLevel = 0; - l_rc = FAPI_ATTR_GET( - ATTR_PM_SYSTEM_IVRM_VPD_MIN_LEVEL,NULL,vpdMinLevel); - if( l_rc ) - { - TS_FAIL("Error getting fapi::ATTR_PM_SYSTEM_IVRM_VPD_MIN_LEVEL"); - } - bool vpdMinLevel_found = false; - - uint64_t attr = 0; - while( headers[attr].id != hsvc_attr_header_t::NO_ATTRIBUTE ) - { - if( headers[attr].id == fapi::ATTR_FREQ_PB_MHZ ) - { - freq_found = true; - if( headers[attr].sizeBytes != - sizeof(fapi::ATTR_FREQ_PB_MHZ_Type) ) - { - TRACFCOMP( g_trac_runtime, "size=%.16X", headers[attr].sizeBytes ); - TS_FAIL("Size of fapi::ATTR_FREQ_PB_MHZ data is wrong"); - } - else - { - fapi::ATTR_FREQ_PB_MHZ_Type* freq_act = - reinterpret_cast<fapi::ATTR_FREQ_PB_MHZ_Type*> - (beginning+headers[attr].offset); - if( *freq_act != freq ) - { - TRACFCOMP( g_trac_runtime, "Expected=%X, Actual=%X", freq, *freq_act ); - TS_FAIL("fapi::ATTR_FREQ_PB_MHZ data is wrong"); - } - } - } - else if( headers[attr].id - == fapi::ATTR_PM_SYSTEM_IVRM_VPD_MIN_LEVEL ) - { - vpdMinLevel_found = true; - if( headers[attr].sizeBytes != - sizeof(fapi::ATTR_PM_SYSTEM_IVRM_VPD_MIN_LEVEL_Type) ) - { - TRACFCOMP( g_trac_runtime, "size=%.16X", headers[attr].sizeBytes ); - TS_FAIL("Size of fapi::ATTR_PM_SYSTEM_IVRM_VPD_MIN_LEVEL " - "data is wrong"); - } - else - { - fapi::ATTR_PM_SYSTEM_IVRM_VPD_MIN_LEVEL_Type* - vpdMinLevel_act = reinterpret_cast< - fapi::ATTR_PM_SYSTEM_IVRM_VPD_MIN_LEVEL_Type*> - (beginning+headers[attr].offset); - if( *vpdMinLevel_act != vpdMinLevel ) - { - TRACFCOMP( g_trac_runtime, "Expected=%X, Actual=%X", vpdMinLevel, *vpdMinLevel_act ); - TS_FAIL("fapi::ATTR_PM_SYSTEM_IVRM_VPD_MIN_LEVEL data " - "is wrong"); - } - } - } - attr++; - } - - if( attr != sysdata->numAttr ) - { - TRACFCOMP( g_trac_runtime, "numAttr=%d, found attr=%d", sysdata->numAttr, attr ); - TS_FAIL("testVerifySystemAttributes> Number of attributes found doesn't match expected value"); - } - - if( !freq_found ) - { - TS_FAIL("Never found FREQ_PB_MHZ in system attributes"); - } - if( !vpdMinLevel_found ) - { - TS_FAIL("Never found ATTR_PM_SYSTEM_IVRM_VPD_MIN_LEVEL in system " - "attributes"); - } - - TRACFCOMP( g_trac_runtime, "testVerifySystemAttributes> finish" ); - } - - void testVerifyNodeAttributes(void) - { - TRACFCOMP( g_trac_runtime, "testVerifyNodeAttributes> start" ); - hsvc_node_data_t* nodedata = getNodePtr(); - - //Make sure we have some targets out there (at least 1 proc and 1 ex) - if( nodedata->numTargets < 2 ) - { - TS_FAIL("testVerifyNodeAttributes> numTargets is zero"); - } - - //Make sure that the offsets are reasonable - if( nodedata->procOffset == 0 ) - { - TS_FAIL("testVerifyNodeAttributes> procOffset is invalid"); - } - if( nodedata->exOffset == 0 ) - { - TS_FAIL("testVerifyNodeAttributes> exOffset is invalid"); - } - if( nodedata->procOffset == nodedata->exOffset ) - { - TS_FAIL("testVerifyNodeAttributes> offsets are equal - that is bad"); - } - - char* beginning = reinterpret_cast<char*>(nodedata); - - //Look at the procs - hsvc_proc_header_t* procs = reinterpret_cast<hsvc_proc_header_t*> - ((beginning+nodedata->procOffset)); - - //Verify the header data is okay - hsvc_proc_header_t* curproc = procs; - TRACDCOMP( g_trac_runtime, "procs=%p", procs ); - while( curproc->procid != hsvc_proc_header_t::NO_PROC ) - { - //Verify we have some attributes - if( curproc->numAttr == 0 ) - { - TRACFCOMP(g_trac_runtime,"Proc %d has zero attributes",curproc->procid); - TS_FAIL("testVerifyNodeAttributes> no attributes for proc"); - } - - //Find a target to match this one - fapi::Target* proc = getProcTarget( curproc->procid ); - TRACDCOMP( g_trac_runtime, "procid = %d", curproc->procid ); - - //Grab a couple of arbitrary attributes - hsvc_attr_header_t* headers = reinterpret_cast<hsvc_attr_header_t*> - ((beginning+curproc->offset)); - ReturnCode l_rc; - - fapi::ATTR_CHIP_ID_Type tmp1 = 0; - l_rc = FAPI_ATTR_GET(ATTR_CHIP_ID,proc,tmp1); - if( l_rc ) - { - TS_FAIL("Error getting fapi::ATTR_CHIP_ID"); - } - bool tmp1_found = false; - - fapi::ATTR_PM_PVSAFE_PSTATE_Type tmp2 = 0; - l_rc = FAPI_ATTR_GET(ATTR_PM_PVSAFE_PSTATE,proc,tmp2); - if( l_rc ) - { - TS_FAIL("Error getting fapi::ATTR_PM_PVSAFE_PSTATE"); - } - bool tmp2_found = false; - - uint64_t attr = 0; - while( headers[attr].id != hsvc_attr_header_t::NO_ATTRIBUTE ) - { - if( headers[attr].id == fapi::ATTR_CHIP_ID ) - { - tmp1_found = true; - if( headers[attr].sizeBytes != - sizeof(fapi::ATTR_CHIP_ID_Type) ) - { - TRACFCOMP( g_trac_runtime, "procid=%d: size=%.16X", curproc->procid, headers[attr].sizeBytes ); - TS_FAIL("Size of fapi::ATTR_CHIP_ID data is wrong"); - } - else - { - fapi::ATTR_CHIP_ID_Type* tmp1_act = - reinterpret_cast<fapi::ATTR_CHIP_ID_Type*> - (beginning+headers[attr].offset); - if( *tmp1_act != tmp1 ) - { - TRACFCOMP( g_trac_runtime, "procid=%d: Expected=%X, Actual=%X", curproc->procid, tmp1, *tmp1_act ); - TS_FAIL("fapi::ATTR_CHIP_ID data is wrong"); - } - } - } - else if( headers[attr].id == fapi::ATTR_PM_PVSAFE_PSTATE ) - { - tmp2_found = true; - if( headers[attr].sizeBytes != - sizeof(fapi::ATTR_PM_PVSAFE_PSTATE_Type) ) - { - TRACFCOMP( g_trac_runtime, "size=%.16X", headers[attr].sizeBytes ); - TS_FAIL("Size of fapi::ATTR_PM_PVSAFE_PSTATE data is wrong"); - } - else - { - fapi::ATTR_PM_PVSAFE_PSTATE_Type* tmp2_act = - reinterpret_cast<fapi::ATTR_PM_PVSAFE_PSTATE_Type*> - (beginning+headers[attr].offset); - if( *tmp2_act != tmp2 ) - { - TRACFCOMP( g_trac_runtime, "procid=%d: Expected=%X, Actual=%X", curproc->procid, tmp2, *tmp2_act ); - TS_FAIL("fapi::ATTR_PM_PVSAFE_PSTATE data is wrong"); - } - } - } - attr++; - } - if( attr != curproc->numAttr ) - { - TRACFCOMP( g_trac_runtime, "procid=%d: numAttr=%d, found attr=%d", curproc->procid, curproc->numAttr, attr ); - TS_FAIL("testVerifyNodeAttributes> Number of attributes found doesn't match expected value"); - } - - if( !tmp1_found ) - { - TS_FAIL("Never found ATTR_PM_PVSAFE_PSTATE for procid=%d",curproc->procid); - } - if( !tmp2_found ) - { - TS_FAIL("Never found ATTR_PM_PVSAFE_PSTATE for procid=%d",curproc->procid); - } - - delete proc; - curproc++; - } - - - //Look at the EXs - hsvc_ex_header_t* exs = reinterpret_cast<hsvc_ex_header_t*> - ((beginning+nodedata->exOffset)); - - //Verify the header data is okay - hsvc_ex_header_t* curex = exs; - while( curex->parent_procid != hsvc_proc_header_t::NO_PROC ) - { - //Verify we have some attributes - if( curex->numAttr == 0 ) - { - TRACFCOMP(g_trac_runtime,"Proc %d has zero attributes",curproc->procid); - TS_FAIL("testVerifyNodeAttributes> no attributes for proc"); - } - - //Find a target to match this one - fapi::Target* ex = getExTarget( curex->parent_procid, - curex->chiplet ); - TRACDCOMP( g_trac_runtime, "procid = %d, chiplet = %d", curex->parent_procid, curex->chiplet ); - - //Grab a couple of arbitrary attributes - hsvc_attr_header_t* headers = reinterpret_cast<hsvc_attr_header_t*> - ((beginning+curex->offset)); - ReturnCode l_rc; - - fapi::ATTR_CHIP_UNIT_POS_Type tmp1 = 0; - l_rc = FAPI_ATTR_GET(ATTR_CHIP_UNIT_POS,ex,tmp1); - if( l_rc ) - { - TS_FAIL("Error getting fapi::ATTR_CHIP_UNIT_POS"); - errlHndl_t errhdl = fapiRcToErrl(l_rc); - errlCommit(errhdl,RUNTIME_COMP_ID); - } - bool tmp1_found = false; - - fapi::ATTR_FUNCTIONAL_Type tmp2 = 0; - l_rc = FAPI_ATTR_GET(ATTR_FUNCTIONAL,ex,tmp2); - if( l_rc ) - { - TS_FAIL("Error getting fapi::ATTR_FUNCTIONAL"); - errlHndl_t errhdl = fapiRcToErrl(l_rc); - errlCommit(errhdl,RUNTIME_COMP_ID); - } - bool tmp2_found = false; - - uint64_t attr = 0; - while( headers[attr].id != hsvc_attr_header_t::NO_ATTRIBUTE ) - { - if( headers[attr].id == fapi::ATTR_CHIP_UNIT_POS ) - { - tmp1_found = true; - if( headers[attr].sizeBytes != - sizeof(fapi::ATTR_CHIP_UNIT_POS_Type) ) - { - TRACFCOMP( g_trac_runtime, "size=%.16X", headers[attr].sizeBytes ); - TS_FAIL("Size of fapi::ATTR_CHIP_UNIT_POS data is wrong"); - } - else - { - fapi::ATTR_CHIP_UNIT_POS_Type* tmp1_act = - reinterpret_cast<fapi::ATTR_CHIP_UNIT_POS_Type*> - (beginning+headers[attr].offset); - if( *tmp1_act != tmp1 ) - { - TRACFCOMP( g_trac_runtime, "procid=%d: Expected=%X, Actual=%X", curproc->procid, tmp1, *tmp1_act ); - TS_FAIL("fapi::ATTR_CHIP_UNIT_POS data is wrong"); - } - } - } - else if( headers[attr].id == fapi::ATTR_FUNCTIONAL ) - { - tmp2_found = true; - if( headers[attr].sizeBytes != - sizeof(fapi::ATTR_FUNCTIONAL_Type) ) - { - TRACFCOMP( g_trac_runtime, "size=%.16X", headers[attr].sizeBytes ); - TS_FAIL("Size of fapi::ATTR_FUNCTIONAL data is wrong"); - } - else - { - fapi::ATTR_FUNCTIONAL_Type* tmp2_act = - reinterpret_cast<fapi::ATTR_FUNCTIONAL_Type*> - (beginning+headers[attr].offset); - if( *tmp2_act != tmp2 ) - { - TRACFCOMP( g_trac_runtime, "procid=%d: Expected=%X, Actual=%X", curproc->procid, tmp2, *tmp2_act ); - TS_FAIL("fapi::ATTR_FUNCTIONAL data is wrong"); - } - } - } - attr++; - } - if( attr != curex->numAttr ) - { - TRACFCOMP( g_trac_runtime, "procid=%d: numAttr=%d, found attr=%d", curproc->procid, curex->numAttr, attr ); - TS_FAIL("Number of attributes found doesn't match expected value"); - } - - if( !tmp1_found ) - { - TS_FAIL("Never found ATTR_CHIP_UNIT_POS for procid=%d, ex=%d", - curproc->procid,curex->chiplet); - } - if( !tmp2_found ) - { - TS_FAIL("Never found ATTR_FUNCTIONAL for procid=%d, ex=%d", - curproc->procid,curex->chiplet); - } - - delete ex; - curex++; - } - - TRACFCOMP( g_trac_runtime, "testVerifyNodeAttributes> finish" ); - } - - private: - hsvc_system_data_t* getSysPtr(void) - { - errlHndl_t errhdl = NULL; - uint64_t sys_data_addr = 0; - size_t sys_data_size = 0; - errhdl = RUNTIME::get_host_data_section(RUNTIME::HSVC_SYSTEM_DATA, - 0, - sys_data_addr, - sys_data_size ); - if (errhdl) delete errhdl; - return( (hsvc_system_data_t*)(sys_data_addr) ); - }; - hsvc_node_data_t* getNodePtr(void) - { - errlHndl_t errhdl = NULL; - uint64_t node_data_addr = 0; - size_t node_data_size = 0; - errhdl = RUNTIME::get_host_data_section(RUNTIME::HSVC_NODE_DATA, - 0, - node_data_addr, - node_data_size ); - if (errhdl) delete errhdl; - return( (hsvc_node_data_t*)(node_data_addr) ); - }; - - //utility to fetch a proc target based on a procid - TARGETING::Target* _getProcTarget( uint64_t i_procid ) - { - // Grab a system object to work with - TARGETING::Target* sys = NULL; - TARGETING::targetService().getTopLevelTarget(sys); - - // Loop through all of the procs - TARGETING::TargetHandleList all_procs; - TARGETING::getAllChips( all_procs, TARGETING::TYPE_PROC, false ); - if( all_procs.empty() ) - { - TRACDCOMP( g_trac_runtime, "all_procs is empty!!, type=%d", TARGETING::TYPE_PROC ); - - TARGETING::PredicateCTM predProc(TARGETING::CLASS_CHIP, TARGETING::TYPE_PROC); - - TARGETING::PredicatePostfixExpr checkExpr; - checkExpr.push(&predProc); - TARGETING::targetService().getAssociated( all_procs, sys, - TARGETING::TargetService::CHILD, - TARGETING::TargetService::ALL, &checkExpr ); - } - - TARGETING::Target* proc_target = NULL; - for( size_t p = 0; p < all_procs.size(); p++ ) - { - uint64_t group_id = - all_procs[p]->getAttr<TARGETING::ATTR_FABRIC_GROUP_ID>(); - uint64_t chip_pos = - all_procs[p]->getAttr<TARGETING::ATTR_FABRIC_CHIP_ID>(); - uint32_t procid = createChipId( node_id, chip_pos ); - if( procid == i_procid ) - { - proc_target = all_procs[p]; - break; - } - } - - return proc_target; - } - - //utility to fetch a proc target based on a procid - fapi::Target* getProcTarget( uint64_t i_procid ) - { - TARGETING::Target* proc = _getProcTarget(i_procid); - if( proc != NULL ) - { - return( new fapi::Target( fapi::TARGET_TYPE_PROC_CHIP, - reinterpret_cast<void *> - (const_cast<TARGETING::Target*>(proc)) ) ); - } - return NULL; - }; - - //utility to fetch an ex target based on a procid and chiplet number - fapi::Target* getExTarget( uint64_t i_procid, uint64_t i_chiplet ) - { - TARGETING::Target* proc = _getProcTarget(i_procid); - TARGETING::TargetHandleList all_ex; - TARGETING::getChildChiplets( all_ex, proc, - TARGETING::TYPE_EX, false ); - for( size_t e = 0; e < all_ex.size(); e++ ) - { - uint32_t chiplet = all_ex[e]->getAttr<TARGETING::ATTR_CHIP_UNIT>(); - if( chiplet == i_chiplet ) - { - return( new fapi::Target( - fapi::TARGET_TYPE_PROC_CHIP, - reinterpret_cast<void *> - (const_cast<TARGETING::Target*>(all_ex[e])) ) ); - } - } - return NULL; - } -}; - - -#endif - |