/* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ /* $Source: src/usr/hdat/hdatiplparms.H $ */ /* */ /* OpenPOWER HostBoot Project */ /* */ /* Contributors Listed Below - COPYRIGHT 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 HDATIPLPARMS_H #define HDATIPLPARMS_H /** * @file hdatiplparms.H * * @brief This file contains the class definition for the IPL parms object * constructed with data obtained from the registry and iplp component. * */ // Change Log *****************************************************************/ // // End Change Log *************************************************************/ /*----------------------------------------------------------------------------*/ /* Includes */ /*----------------------------------------------------------------------------*/ #include // standard types #include #include #include "hdatutil.H" #include namespace HDAT { /*----------------------------------------------------------------------------*/ /* Typedefs */ /*----------------------------------------------------------------------------*/ const uint16_t HDAT_IPL_PARAMS_VERSION = 0x5F; const char HDAT_IPLP_STRUCT_NAME[7] = "IPLPMS"; /** @enum hdatDataPtrs * Constants for the internal data pointers that are added to the base * class */ enum hdatIplDataPtrs { HDAT_IPL_SYS = 0, HDAT_IPL_PARMS = 1, HDAT_IPL_TIME = 2, HDAT_IPL_PVT = 3, HDAT_IPL_DUMP = 4, HDAT_IPL_HMC = 5, HDAT_IPL_CUOD = 6, HDAT_IPL_MANF = 7, HDAT_IPL_PORT_CODES = 8, HDAT_IPL_LAST = 9 }; /** @brief Structure definition for system model and feature code */ struct hdatSysParms_t { uint32_t hdatSysModel; uint32_t hdatProcFeatCode; uint32_t hdatEffectivePvr; uint32_t hdatSysType; uint8_t hdatReserved3[8]; // Reserved uint32_t hdatABCBusSpeed; // Speed in MHz uint32_t hdatWXYZBusSpeed; // Speed in MHz uint32_t hdatSystemECOMode; // System ECO Mode set by the user uint32_t hdatSystemAttributes; // System supports multiple TPMDs uint32_t hdatMemoryScrubbing; // Memory Scrubbing uint16_t hdatCurrentSPPLValue; // The Current SPPL Value uint8_t hdatReserved2; // Reserved uint8_t usePoreSleep; // Use PORE Sleep uint32_t hdatReserved1; // Reserved uint8_t vTpmEnabled; // vTPM Enabled uint8_t hdatHwPageTbl; // Hardware Page Table uint16_t hdatDispWheel; // Hypervisor Dispatch Wheel uint32_t hdatNestFreq; // Nest Clock Frequency in MHz uint8_t hdatSplitCoreMode; // Split Core Mode uint8_t hdatReserved4; // Reserved uint16_t hdatReserved5; // Reserved uint8_t hdatSystemVendorName[64]; // System Vendor Name uint16_t hdatSysSecuritySetting; // System Security Settings uint16_t hdatTpmConfBits; // TPM Configuration Bits uint16_t hdatTpmDrawer; // TPMs/Drawer uint16_t hdatReserved6; // Reserved uint8_t hdatHwKeyHashValue[64]; // Hardware Keys Hash Value char hdatSystemFamily[64]; // System Family/Vendor Name char hdatSystemType[64]; // System Type/Vendor Type } __attribute__ ((packed)); /** @brief Structure definition for Other IPL Attributes within hdatIPLParams_t * */ struct hdatOtherIPLAttributes_t { uint32_t hdatReserved1 : 1; // Reserved uint32_t hdatCreDefPartition : 1; // Create Default Parititon uint32_t hdatCTAState : 1; // Click To Accept State uint32_t hdatDisVirtIOConn : 1; // Disable Virtual IO Connectivity uint32_t hdatResetPCINOs : 1; // Reset PCI Numbers uint32_t hdatClrPhypNvram : 1; // Clear PHYP NVRAM uint32_t hdatMDCLogPartVPD : 1; // Preserve MDC Logical Paritition VPD uint32_t hdatCECCMCapable : 1; // CEC Concurrent Maintanance Capable uint32_t hdati5OSEnable : 1; // i5/OS enable uint32_t hdatSELFlagsValid : 1; // SEL Flags Valid uint32_t hdatDelSELFromHyp : 1; // Delete SELs originated from PHYP/OPAL uint32_t hdatDelSELFromHB : 1; // Delete SELs originated from Hostboot uint32_t hdatDelSELFromBMC : 1; // Delete SELs originated from BMC uint32_t hdatReserved2 : 15; // Reserved uint32_t hdatServiceIndMode : 2; // Platform Service Indicator Mode uint32_t hdatDefPartitionType : 2; // Default Partition Type }__attribute__ ((packed)); /** @brief Structure definition for IPL Parameters * */ struct hdatIPLParams_t { uint8_t hdatReserved1; // Reserved uint8_t hdatIPLDestination; // Hypervisor IPL Destination uint8_t hdatIPLSide; // Platform IPL Side uint8_t hdatIPLSpeed; // Platform IPL Speed for Current IPL uint16_t hdatCECIPLAttributes; // CEC IPL Attributes uint8_t hdatIPLMajorType; // CEC IPL Major Type uint8_t hdatIPLMinorType; // CEC IPL Minor Type uint8_t hdatOSIPLMode; // Operating System IPL Mode uint8_t hdatKeyLockPosition; // Key Lock Position uint8_t hdatLMBSize; // Logical Memory Block Size uint8_t hdatReserved2; // Reserved uint32_t hdatMaxHSLConns; // Max number of HSL Opticonnect // connections hdatOtherIPLAttributes_t hdatOIA; // Other IPL Attributes uint16_t hdatHugePageMemCount; // Huge Page Memory Count uint8_t hdatHugePageMemSize; // Huge Page Memory Size uint8_t hdatNumVlanSwitches; // Number of VLAN Switches uint32_t hdatReserved3; // Reserved uint32_t hdatEnlargedIOCap; // Enlarged IO Capacity }__attribute__ ((packed)); /** @brief Structure definition for IPL Time Data * */ struct hdatIplTimeData_t { uint32_t hdatReserved1; // Reserved uint32_t hdatReserved2; // Reserved uint32_t hdatReserved3; // Reserved union {uint32_t hdatRTCValidFlags; // Real Time Clock and Delta Valid Flags uint32_t hdatReserved4 :27, hdatFSPTimeRef : 1, hdatHYPSetTOD : 1, hdatReserved5 : 1, hdatCumRTCDeltaValid : 1, hdatIPLStartRTCValid : 1;}; uint64_t hdatCumulativeRTCDelta; // Cumulative RTC Delta uint32_t hdatReserved6; // Reserved uint32_t hdatReserved7; // Reserved } __attribute__ ((packed)); /** @brief Structure definition for service processor private IPL type */ struct hdatIplSpPvt_t { uint32_t hdatIplType; } __attribute__ ((packed)); /** @brief Structure definition for dump information */ struct hdatDump_t { union {uint16_t hdatFlags; // word view unioned with bit view uint16_t hdatRptPending : 1, // 1 = A dump exists and is // waiting to be extracted hdatHdwDumpExists : 1, // 1 = Hardware dump exists hdatMemDumpExists : 1, // 1 = Memory dump exists hdatHdwDumpErrs : 1, // 1 = Errors occurred during // hardware dump collection hdatMemDumpErrs : 1, // 1 = Errors occurred during // memory dump collection hdatHdwDumpReq : 1, // 1 = Hardware dump requested hdatMemDumpReq : 1, // 1 = Memory dump requested hdatUserReq : 1, // 1 = User requested the dump hdatErrReq : 1, // 1 = Hardware or software // error caused the dump hdatReserved1 : 7;}; // Reserved for future use uint8_t hdatReserved2; uint8_t hdatHypDumpPolicy; uint32_t hdatDumpId; uint8_t hdatReserved3[8]; uint64_t hdatActPlatformDumpSize; uint32_t hdatMaxHdwSize; uint32_t hdatActHdwSize; uint32_t hdatMaxSpSize; uint32_t hdatPlid; } __attribute__ ((packed)); /** @brief Structure definition for hardware management console information */ struct hdatHmc_t { uint8_t hdatHmcFlags; uint8_t hdatReserved1[3]; } __attribute__ ((packed)); const uint8_t HDAT_HMC_MANAGED = 0x80; /** @brief Structure definition for capacity upgrade on demand information */ struct hdatCuod_t { uint8_t hdatCuodFlags; uint8_t hdatReserved1[3]; } __attribute__ ((packed)); const uint32_t HDAT_POWER_LOST = 0x80; const uint32_t HDAT_POWER_OFF = 0x40; const uint32_t HDAT_MNFG_MAX_CELLS = 0x04; /** @brief Structure definition for manufacturing mode information */ struct hdatManf_t { uint32_t hdatPolicyFlags[HDAT_MNFG_MAX_CELLS]; // 4 cells of mfg mode data } __attribute__ ((packed)); /** @brief Structure definition for SP serial port information */ const uint32_t hdatMaxPorts = 2; // maximum number of serial ports struct hdatPortCodes_t { char hdatLocCode[80]; // serial port location code uint16_t hdatResourceId; // serial port resource id uint16_t hdatCallHome : 1, // 1 = designated as the "Call Home" port hdatReserved1 : 15;// Reserved for future use } __attribute__ ((packed)); #define HDAT_CHIP_TYPE_MURANO "MURANO" #define HDAT_CHIP_TYPE_VENICE "VENICE" #define HDAT_CHIP_TYPE_NIMBUS "NIMBUS" #define HDAT_CHIP_TYPE_CUMULUS "CUMULUS" #define HDAT_SYSTEM_TYPE_BASE_FIRENZE 0x30000000 #define HDAT_SYSTEM_TYPE_PLUS_FIRENZE 0x30000001 #define HDAT_SYSTEM_TYPE_MISC_OPENPOWER 0x00150000 #define HDAT_FIRMWARE_SIDE_GOLDEN 0x00 #define HDAT_FIRMWARE_SIDE_WORKING 0x22 #define HDAT_KEYLOCK_MANUAL 0x02 #define HDAT_KEYLOCK_NORMAL 0x04 #define HDAT_MULT_TPMDS 0x80000000 #define HDAT_SMM_ENABLED 0x40000000 #define HDAT_CRYPTO_DISABLED_BIT 0x20000000 #define HDAT_ECO_ENABLED 0x80000000 #define HDAT_ECO_CAPABLE 0x40000000 #define HDAT_TURBO_CORE_MODE_PART_SIZE_128 0x0080 #define HDAT_NONTURBO_EIGHT_CORE_PART_SIZE_32 0x0020 #define HDAT_NONTURBO_EIGHT_CORE_PART_SIZE_256 0x8020 #define HDAT_NONTURBO_SIX_CORE_PART_SIZE_24 0x0018 #define HDAT_NONTURBO_SIX_CORE_PART_SIZE_256 0x8018 #define HDAT_MFG_FLAGS_CELL_0 0x00000000 #define HDAT_MFG_FLAGS_CELL_1 0x00020000 #define HDAT_MFG_FLAGS_CELL_2 0x00040000 #define HDAT_MFG_FLAGS_CELL_3 0x00080000 #define HDAT_MFG_FLAG_AVP_ENABLED 0x00000100 #define HDAT_MFG_FLAG_HDAT_AVP_ENABLED 0x00000010 #define HDAT_MNFG_FLAG_SRC_TERM 0x00000200 #define HDAT_MNFG_IPL_MEM_CE_CHECKING_ACTIVE 0x00000008 #define HDAT_MNFG_FAST_BKG_SCRUB_ACTIVE 0x00000080 #define HDAT_MNFG_TEST_DRAM_REPAIRS 0x00000200 #define HDAT_MNFG_DISABLE_DRAM_REPAIRS 0x00000008 #define HDAT_MNFG_ENABLE_EXHAUSTIVE_PATTERN_TEST 0x00000001 #define HDAT_MNFG_ENABLE_STANDARD_PATTERN_TEST 0x00000002 #define HDAT_MNFG_ENABLE_MIN_PATTERN_TEST 0x00000004 #define HDAT_MNFG_DISABLE_FABRIC_ERPAIR 0x00000010 #define HDAT_MNFG_DISABLE_MEMORY_ERPAIR 0x00000020 #define HDAT_MNFG_FABRIC_DEPLOY_LANE_SPARES 0x00000200 #define HDAT_MNFG_DMI_DEPLOY_LANE_SPARES 0x00000100 #define HDAT_MNFG_PSI_DIAGNOSTIC 0x00000001 #define HDAT_MNFG_FSP_UPDATE_SBE_IMAGE 0x00000004 #define HDAT_MNFG_UPDATE_BOTH_SIDES_OF_SBE 0x00000008 enum hdatIPLParamsDataPtrs { HDAT_IPL_PARAMS_SYS_PARAMS = 0, HDAT_IPL_PARAMS_IPL_PARAMS = 1, HDAT_IPL_PARAMS_TIME_DATA = 2, HDAT_IPL_PARAMS_SPPL_PARAMS = 3, HDAT_IPL_PARAMS_PDUMP_DATA = 4, HDAT_IPL_PARAMS_HMC_CONNS = 5, HDAT_IPL_PARAMS_CUOD_DATA = 6, HDAT_IPL_PARAMS_MFG_DATA = 7, HDAT_IPL_PARAMS_SERIAL_PORTS = 8, HDAT_IPL_PARAMS_DA_CNT = 9, HDAT_IPL_PARAMS_DA_LAST = 10 }; struct hdatIPLParameters_t{ /** Object Instance Data * * @li iv_sysParms - system model/feature code * @li iv_iplParms - IPL parameter information * @li iv_iplTime - IPL time information * @li iv_pvt - SP private IPL information * @li iv_dump - dump information * @li iv_hmc - hardware management console information * @li iv_cuod - Capacity upgrade on demand information * @li iv_manf - manufacturing flags * @li iv_portArrayHdr - serial port array header * @li iv_ports - serial port location codes and resource ids */ hdatHDIF_t hdatHdr; hdatHDIFDataHdr_t hdatIPLParamsIntData[HDAT_IPL_PARAMS_DA_LAST]; hdatSysParms_t iv_sysParms; hdatIPLParams_t iv_iplParms; hdatIplTimeData_t iv_iplTime; hdatIplSpPvt_t iv_pvt; hdatDump_t iv_dump; hdatHmc_t iv_hmc; hdatCuod_t iv_cuod; hdatManf_t iv_manf; hdatHDIFDataArray_t iv_portArrayHdr; hdatPortCodes_t iv_ports[hdatMaxPorts]; }; /*----------------------------------------------------------------------------*/ /* C++ class definition */ /*----------------------------------------------------------------------------*/ /** Begin Class Description * * @brief The HdatIplParms class is used to construct the IPL Parameters * hypervisor data area. * * Description: This class defines a specialized object. It is not intended * that any component can create an object of this type. * In particular, the object is built only by the hdat component. * * The real purpose of the object is to create the IPL parameters * data structure as defined by the PHYP Initialization * architecture. This data structure is eventually copied to * main memory. The class is not defined to be a general purpose * interface for building this object by anyone other than the * hdat process. * * Thread safety: An HdatIplParms object is not thread safe. That is, a * single object cannot be shared and used concurrently by * multiple threads at the same time. An object can be used by * multiple threads if the threads serialize access. And of * course, each thread can use its own object with no concerns * about what other threads are doing. * * Signal handler usage: This class is not intended to be used in a signal * handler and nothing has been done to try and make * it safe to use in a signal handler. * * End Class Description */ class HdatIplParms { public: /* * @brief Construct an HdatIplParms object. * * This is the constructor for the HdatIplParms object. * * If you are constructing this object on the heap by using new, * then you must check the pointer returned from new to see if * it is null. * If it is null, new failed to allocate storage and the * constructor was not called. If it is not null, then you must * check o_errlHndl to see if the constructor ran successfully. * If o_errlHndl indicates an error was reported by the * constructor, new has already allocated heap storage and the * object must be deleted in order to free the heap storage. * * @pre None * * @post An HdatIplParms object has been constructed. * Heap storage has been allocated. * * @param o_errlHndl - output parameter - If any errors occur, the * HdatIplParms object is NOT * constructed and errors are * returned in this parameter * @param i_msAddr - input parameter - The main memory address that * the service processor subsystem * structure will be DMA'd to. * * @return A null error log handle if successful, else the return * code pointed to by o_errlHndl contains one of: * * @retval HDAT_REGISTRY_ERROR */ HdatIplParms(errlHndl_t &o_errlHndl, const HDAT::hdatMsAddr_t &i_msAddr); /** * @brief HdatIplParms object destructor * * This is the destructor for an HdatIplParms object. * Any heap storage allocated for the object is dallocated. * * @pre No preconditions exist * * @post The HdatIplParms object has been destroyed and can * no longer be used. * */ ~HdatIplParms(); /** * @brief Load IPL Paramsters to Mainstore * * @pre None * * @post None * * @param o_size - output parameter - Size of IPL Parameters structure * o_count - output parameter - Number of IPL Parameters * structures * * @return None * * @retval HDAT_OTHER_COMP_ERROR */ errlHndl_t hdatLoadIplParams(uint32_t &o_size,uint32_t &o_count); private: void hdatGetSystemParamters(void); void hdatGetIplParmsData(void); HDAT::hdatMsAddr_t iv_msAddr; hdatIPLParameters_t *iv_hdatIPLParams; }; // end of HdatIplParms class } #endif // HDATIPLPARMS_H