diff options
author | Dan Crowell <dcrowell@us.ibm.com> | 2016-09-28 09:39:55 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2016-10-16 21:45:43 -0400 |
commit | 560a3667e8a581005586f9c731bfa5c1fe0e911d (patch) | |
tree | 7eb981aa83d018bcfb41d2122e32b19825b55673 /src | |
parent | af6a053e12c60b67a951b578275ce2e0968de344 (diff) | |
download | talos-hostboot-560a3667e8a581005586f9c731bfa5c1fe0e911d.tar.gz talos-hostboot-560a3667e8a581005586f9c731bfa5c1fe0e911d.zip |
Add interfaces for HDAT to fetch new data
New interfaces added:
I2C::getDeviceInfo()
IPMI::getBmcInfo()
CONSOLE::getUartInfo()
New attributes:
SYSTEM_FAMILY
SYSTEM_TYPE
Change-Id: I7d1a018c01067a19b8a66f853e11922c910fcc54
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/30405
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Elizabeth K. Liner <eliner@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/include/usr/console/uartif.H | 59 | ||||
-rw-r--r-- | src/include/usr/i2c/i2cif.H | 67 | ||||
-rw-r--r-- | src/include/usr/ipmi/ipmiif.H | 23 | ||||
-rw-r--r-- | src/usr/console/uart.C | 13 | ||||
-rwxr-xr-x | src/usr/i2c/i2c.C | 12 | ||||
-rw-r--r-- | src/usr/ipmi/ipmirp.C | 11 | ||||
-rw-r--r-- | src/usr/targeting/common/xmltohb/attribute_types.xml | 44 | ||||
-rwxr-xr-x | src/usr/targeting/common/xmltohb/target_types.xml | 2 |
8 files changed, 229 insertions, 2 deletions
diff --git a/src/include/usr/console/uartif.H b/src/include/usr/console/uartif.H new file mode 100644 index 000000000..8cbd0c0ff --- /dev/null +++ b/src/include/usr/console/uartif.H @@ -0,0 +1,59 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/include/usr/console/uartif.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 __CONSOLE_UARTIF_H +#define __CONSOLE_UARTIF_H + +#include <config.h> +#include <stdarg.h> + +namespace CONSOLE +{ + +/** + * Structure to return UART information in + */ +struct UartInfo_t +{ + //@TODO-RTC:161647-Add more details/comments + uint64_t lpcBaseAddr; + uint32_t lpcSize; + uint32_t clockFreqHz; + uint32_t freqHz; + uint8_t interruptNum; + uint8_t interruptTrigger; +}; + +/** + * Retrieve some information about the UART and the connection + * we have to it. + * + * @return Structure of UART data + */ +UartInfo_t getUartInfo(void); + + +}; + +#endif diff --git a/src/include/usr/i2c/i2cif.H b/src/include/usr/i2c/i2cif.H index ccedce873..e7f8cfac1 100644 --- a/src/include/usr/i2c/i2cif.H +++ b/src/include/usr/i2c/i2cif.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2012,2015 */ +/* Contributors Listed Below - COPYRIGHT 2012,2016 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -203,6 +203,71 @@ errlHndl_t i2cDisableSensorCache( TARGETING::Target * i_target, errlHndl_t i2cEnableSensorCache( TARGETING::Target * i_target ); #endif //__HOSTBOOT_RUNTIME + +/** + * Enumeration that defines possible I2C device types + */ +enum DeviceType_t +{ + //@TODO-RTC:161649-Map these directly to some HDAT constants? + // Or something from MRW? + DEVTYPE_955x = 0x01, + DEVTYPE_SEEPROM = 0x02, + DEVTYPE_NUVOTON_TPM = 0x03, + DEVTYPE_MEX_FPGA = 0x04, + DEVTYPE_UCX90XX = 0x05, + DEVTYPE_UNKNOWN = 0xFF, +}; + +/** + * Enumeration that defines possible I2C device purposes + */ +enum DevicePurpose_t +{ + //@TODO-RTC:161649-Map these directly to some HDAT constants? + // Or something from MRW? + PURPOSE_CABLE_CARD_PRES = 0x01, + PURPOSE_CABLE_CARD_POWER_SENSE = 0x02, + PURPOSE_CABLE_CARD_POWER_CONTROL = 0x03, + PURPOSE_TPM = 0x04, + PURPOSE_MODULE_VPD = 0x05, + PURPOSE_DOMM_SPD = 0x06, + PURPOSE_PROC_MODULE_VPD = 0x07, + PURPOSE_SBE_SEEPROM = 0x08, + PURPOSE_PLANAR_VPD = 0x09, + PURPOSE_PCI_HOTPLUG = 0x0A, + PURPOSE_UNKNOWN = 0xFF, +}; + +/** + * Structure to return I2C information in + */ +struct DeviceInfo_t +{ + //@TODO-RTC:161649-Add more details/comments + TARGETING::Target* masterChip; + uint8_t engine; + uint8_t masterPort; + DeviceType_t deviceType; + uint8_t addr; //Is this left-shifted or not? + uint8_t slavePort; + uint8_t busFreqKhz; + DevicePurpose_t devicePurpose; +}; + +/** + * Retrieve some information about I2C devices that the Host + * needs to know about. + * + * @param[in] i_i2cMaster I2C master to query, pass in NULL + * to get a system-wide list + * @param[out] o_deviceInfo list of I2C device structures + * + * @return <none> + */ +void getDeviceInfo( TARGETING::Target* i_i2cMaster, + std::vector<DeviceInfo_t>& o_deviceInfo ); + }; // end namespace I2C #endif // end __I2CIF_H diff --git a/src/include/usr/ipmi/ipmiif.H b/src/include/usr/ipmi/ipmiif.H index a62f722d3..d382a3df1 100644 --- a/src/include/usr/ipmi/ipmiif.H +++ b/src/include/usr/ipmi/ipmiif.H @@ -346,6 +346,29 @@ namespace IPMI size_t max_buffer(void); + /** + * Structure to return BMC/IPMI information in + */ + struct BmcInfo_t + { + //@TODO-RTC:161648-Add more details/comments + uint64_t bulkTransferLpcBaseAddr; + uint32_t bulkTransferSize; + uint8_t chipVersion; + uint8_t smsAttnInterrupt; + uint8_t bmcToHostInterrupt; + char bmcVendor[32]; + }; + + /** + * Retrieve some information about the BMC and the connection + * we have to it. + * + * @return Structure of BMC data + */ + BmcInfo_t getBmcInfo(void); + + }; // end namespace IPMI #endif diff --git a/src/usr/console/uart.C b/src/usr/console/uart.C index aa85df50b..e282fd834 100644 --- a/src/usr/console/uart.C +++ b/src/usr/console/uart.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2014,2015 */ +/* Contributors Listed Below - COPYRIGHT 2014,2016 */ /* [+] Google Inc. */ /* [+] International Business Machines Corp. */ /* */ @@ -32,6 +32,7 @@ #include <errl/errlmanager.H> #include <hwas/common/hwasCallout.H> #include <console/console_reasoncodes.H> +#include <console/uartif.H> namespace CONSOLE { @@ -219,4 +220,14 @@ namespace CONSOLE Uart* Uart::g_device = NULL; + /** + * Retrieve some information about the UART and the connection + * we have to it. + */ + UartInfo_t getUartInfo(void) + { + //@TODO-RTC:161647-Fill in information for HDAT + UartInfo_t l_info; + return l_info; + }; } diff --git a/src/usr/i2c/i2c.C b/src/usr/i2c/i2c.C index 9265d1cfa..eb3fdb6ee 100755 --- a/src/usr/i2c/i2c.C +++ b/src/usr/i2c/i2c.C @@ -3723,6 +3723,18 @@ void getMasterInfo( const TARGETING::Target* i_chip, } /** + * Retrieve some information about all I2C devices that the Host + * needs to know about + */ +void getDeviceInfo( TARGETING::Target* i_i2cMaster, + std::vector<DeviceInfo_t>& o_deviceInfo ) +{ + //@TODO-RTC:161649-Fill in information for HDAT + return; +}; + + +/** * @brief Utility Function to capture error log user data consisting of * the I2C Master Status Register and the I2C Master Target HUID */ diff --git a/src/usr/ipmi/ipmirp.C b/src/usr/ipmi/ipmirp.C index ae3cf0048..b4fbfc047 100644 --- a/src/usr/ipmi/ipmirp.C +++ b/src/usr/ipmi/ipmirp.C @@ -1097,4 +1097,15 @@ namespace IPMI return err; } + /** + * Retrieve some information about the BMC and the connection + * we have to it. + */ + BmcInfo_t getBmcInfo(void) + { + //@TODO-RTC:161648-Fill in data + BmcInfo_t l_info; + return l_info; + } + }; diff --git a/src/usr/targeting/common/xmltohb/attribute_types.xml b/src/usr/targeting/common/xmltohb/attribute_types.xml index a5014d84b..2554f89a5 100644 --- a/src/usr/targeting/common/xmltohb/attribute_types.xml +++ b/src/usr/targeting/common/xmltohb/attribute_types.xml @@ -31915,6 +31915,50 @@ Measured in GB</description> </attribute> <attribute> + <id>SYSTEM_FAMILY</id> + <description> + This field is of the form "vendor,name" where the name indicates + the family of the systems. The textual portion of the string has + a maximum length of 63 characters to accommodate a terminating NULL. + Both vendor and name fields are lower case US ASCII. No special + characters other than ",", "-", and "+" as described below should + be used in the string. + </description> + <simpleType> + <string> + <default>ibm,p9</default> + <sizeInclNull>64</sizeInclNull> + </string> + </simpleType> + <persistency>non-volatile</persistency> + <readable/> +</attribute> + +<attribute> + <id>SYSTEM_TYPE</id> + <description> + This field is of the form ?vendor,type? where the type indicates + a type of system within the System Family. The textual portion of + the string has a maximum length of 63 characters to accommodate a + terminating NULL. Both vendor and name fields are lower case US + ASCII. No special characters other than ",", "-", and "+" as described + below should be used in the string. If identification of specific + models within a system type is desired, "-model" should be appended + to the end of the name. The "-model" portion is optional and could be + used to identify the packaging, specific model numbers, etc. + NOTE: No Hostboot code should ever key off of this value. + </description> + <simpleType> + <string> + <default>ibm,miscopenpower</default> + <sizeInclNull>64</sizeInclNull> + </string> + </simpleType> + <persistency>non-volatile</persistency> + <readable/> +</attribute> + +<attribute> <id>TOD_CPU_DATA</id> <description>TOD CHIP DATA for each CHIP The size of the TOD CHIP DATA must be equal to the sizeof(TodChipData) diff --git a/src/usr/targeting/common/xmltohb/target_types.xml b/src/usr/targeting/common/xmltohb/target_types.xml index c21ad760f..16d577a30 100755 --- a/src/usr/targeting/common/xmltohb/target_types.xml +++ b/src/usr/targeting/common/xmltohb/target_types.xml @@ -881,6 +881,8 @@ <attribute><id>STOP8_DISABLE</id></attribute> <attribute><id>STOP4_DISABLE</id></attribute> <attribute><id>SUPPORTED_STOP_STATES</id></attribute> + <attribute><id>SYSTEM_FAMILY</id></attribute> + <attribute><id>SYSTEM_TYPE</id></attribute> </targetType> <!-- enc-node-power9 --> |