summaryrefslogtreecommitdiffstats
path: root/src/include/usr/i2c
diff options
context:
space:
mode:
authorMatt Derksen <mderkse1@us.ibm.com>2019-01-14 16:34:04 -0600
committerDaniel M. Crowell <dcrowell@us.ibm.com>2019-01-21 08:50:48 -0600
commitad1c30eb712f64b0cb826b9592090d4a218b2a81 (patch)
tree88cd798ead90906e5ef5d280e240fd6cef43f91d /src/include/usr/i2c
parent868b68df85eb7aeed7eba3392303fa3be854e2a6 (diff)
downloadtalos-hostboot-ad1c30eb712f64b0cb826b9592090d4a218b2a81.tar.gz
talos-hostboot-ad1c30eb712f64b0cb826b9592090d4a218b2a81.zip
Move NVDIMM operations under NVDIMM modules
Makes it easier to find and include NVDIMM operations. Also makes it easier to exclude from non-nvdimm supported systems. Change-Id: I870c2246e1bb9201e6e8032f1868e6e4e6a2b91a Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/70489 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Roland Veloz <rveloz@us.ibm.com> Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/include/usr/i2c')
-rw-r--r--src/include/usr/i2c/i2cif.H5
-rw-r--r--src/include/usr/i2c/nvdimmddreasoncodes.H125
-rw-r--r--src/include/usr/i2c/nvdimmif.H48
3 files changed, 5 insertions, 173 deletions
diff --git a/src/include/usr/i2c/i2cif.H b/src/include/usr/i2c/i2cif.H
index c33c83e32..4d9aa2ef0 100644
--- a/src/include/usr/i2c/i2cif.H
+++ b/src/include/usr/i2c/i2cif.H
@@ -26,6 +26,11 @@
#define __I2CIF_H
#include <list>
+// Handy macros to check i2c ranges
+// Pass in an instance of a TARGETING::ATTR_I2C_BUS_SPEED_ARRAY_type
+#define I2C_BUS_MAX_ENGINE(var) (sizeof(var)/sizeof(var[0]))
+#define I2C_BUS_MAX_PORT(var) (sizeof(var[0])/sizeof(var[0][0]))
+
namespace I2C
{
diff --git a/src/include/usr/i2c/nvdimmddreasoncodes.H b/src/include/usr/i2c/nvdimmddreasoncodes.H
deleted file mode 100644
index 509d19d25..000000000
--- a/src/include/usr/i2c/nvdimmddreasoncodes.H
+++ /dev/null
@@ -1,125 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/include/usr/i2c/nvdimmddreasoncodes.H $ */
-/* */
-/* OpenPOWER HostBoot Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2011,2018 */
-/* [+] 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 nvdimmddreasoncodes.H
- *
- * @brief Reason codes and module ids for the NVDIMM device driver
- *
- */
-#ifndef __NVDIMMDDREASONCODES_H
-#define __NVDIMMDDREASONCODES_H
-// -----------------------------------------------
-// Includes
-// -----------------------------------------------
-#include <hbotcompid.H>
-
-namespace NVDIMM
-{
-
-/**
-* @enum nvdimmModuleid
-*
-* @brief Module Ids used in created errorlogs. Indicates which
-* functions an error log was created in.
-*
-*/
-enum nvdimmModuleId
-{
- NVDIMM_INVALID_MODULE = 0x00, // Invalid Module Id
- NVDIMM_PERFORM_OP = 0x01,
- NVDIMM_READ = 0x02,
- NVDIMM_WRITE = 0x03,
- NVDIMM_PREPAREADDRESS = 0x04,
- NVDIMM_READATTRIBUTES = 0x05,
- NVDIMM_GETI2CMASTERTARGET = 0x06,
- NVDIMM_CROSSESNVDIMMPAGEBOUNDARY = 0x07,
- NVDIMM_POLL_BACKUP = 0x08,
- NVDIMM_POLL_RESTORE = 0x09,
- NVDIMM_POLL_ERASE = 0x0A,
- NVDIMM_POLL_ARM = 0x0B,
- NVDIMM_POLL_CHARGE = 0x0C,
- NVDIMM_CHECK_RESTORE = 0x0D,
- NVDIMM_CHECK_IMAGE = 0x0E,
- NVDIMM_SET_ES = 0x0F,
- NVDIMM_SET_ARM = 0x10,
- NVDIMM_SET_PAGE = 0x11,
- NVDIMM_GET_TIMEOUT = 0x12,
- NVDIMM_RESTORE = 0x13,
- NVDIMM_OPEN_PAGE = 0x14,
- NVDIMM_POLL_STATUS = 0x15,
- NVDIMM_CHECK_ERASE = 0x16,
- NVDIMM_ARM_ERASE = 0x17,
- NVDIMM_CHECK_READY = 0x18,
-
-};
-
-/**
- * @enum nvdimmReasonCode
- *
- * @brief Reasoncodes used to describe what errors are being indicated.
- *
- */
-enum nvdimmReasonCode
-{
- NVDIMM_INVALID_REASONCODE = NVDIMM_COMP_ID | 0x00, // Invalid Reasoncode
- NVDIMM_INVALID_OPERATION = NVDIMM_COMP_ID | 0x01,
- NVDIMM_INVALID_DEVICE_TYPE = NVDIMM_COMP_ID | 0x02,
- NVDIMM_ATTR_INFO_NOT_FOUND = NVDIMM_COMP_ID | 0x03,
- NVDIMM_INVALID_CHIP = NVDIMM_COMP_ID | 0x04,
- NVDIMM_I2C_MASTER_PATH_ERROR = NVDIMM_COMP_ID | 0x05,
- NVDIMM_TARGET_NULL = NVDIMM_COMP_ID | 0x06,
- NVDIMM_INVALID_ADDR_OFFSET_SIZE = NVDIMM_COMP_ID | 0x07,
- NVDIMM_OVERFLOW_ERROR = NVDIMM_COMP_ID | 0x08,
- NVDIMM_I2C_WRITE_PAGE_SIZE_ZERO = NVDIMM_COMP_ID | 0x09,
- NVDIMM_INVALID_OFFSET = NVDIMM_COMP_ID | 0x0A,
- NVDIMM_READ_FAILURE = NVDIMM_COMP_ID | 0x0B, // NV Controller read failure
- NVDIMM_WRITE_FAILURE = NVDIMM_COMP_ID | 0x0C, // NV Controller write failure
- NVDIMM_BACKUP_TIMEOUT = NVDIMM_COMP_ID | 0x0D, // Backup/save timeout
- NVDIMM_RESTORE_TIMEOUT = NVDIMM_COMP_ID | 0x0E, // Restore timeout
- NVDIMM_ERASE_TIMEOUT = NVDIMM_COMP_ID | 0x0F, // Erase timeout
- NVDIMM_CHARGE_TIMEOUT = NVDIMM_COMP_ID | 0x10, // Battery charging timeout
- NVDIMM_ARM_TIMEOUT = NVDIMM_COMP_ID | 0x11, // Arming timeout
- NVDIMM_SET_ES_ERROR = NVDIMM_COMP_ID | 0x12, // Failure to set the ES policy
- NVDIMM_MSS_STR_ENTRY_ERROR = NVDIMM_COMP_ID | 0x13, // Failure to enter STR
- NVDIMM_MSS_STR_EXIT_ERROR = NVDIMM_COMP_ID | 0x14, // Failure to exit STR
- NVDIMM_MSS_POST_RSTR_ERROR = NVDIMM_COMP_ID | 0x15, // Failure to perform post restore work
- NVDIMM_OPEN_PAGE_TIMEOUT = NVDIMM_COMP_ID | 0x16, // Open page timeout
- NVDIMM_STATUS_TIMEOUT = NVDIMM_COMP_ID | 0x17, // Status timeout
- NVDIMM_ARM_FAILED = NVDIMM_COMP_ID | 0x18, // Failure to arm reset_n
- NVDIMM_ERASE_FAILED = NVDIMM_COMP_ID | 0x19, // Failure to erase
- NVDIMM_RESTORE_FAILED = NVDIMM_COMP_ID | 0x1A, // Failure to restore
- NVDIMM_NOT_READY = NVDIMM_COMP_ID | 0x1B, // NVDIMM not ready for host to access
-
-};
-
-enum UserDetailsTypes
-{
- NVDIMM_UDT_NO_FORMAT = 0x0,
- NVDIMM_UDT_PARAMETERS = 0x1,
-};
-
-}; // end NVDIMM
-
-#endif
diff --git a/src/include/usr/i2c/nvdimmif.H b/src/include/usr/i2c/nvdimmif.H
deleted file mode 100644
index 2b60ac4de..000000000
--- a/src/include/usr/i2c/nvdimmif.H
+++ /dev/null
@@ -1,48 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/include/usr/i2c/nvdimmif.H $ */
-/* */
-/* OpenPOWER HostBoot Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2013,2018 */
-/* [+] 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 __NVDIMMIF_H
-#define __NVDIMMIF_H
-
-#include <list>
-#include "eepromif.H"
-
-namespace NVDIMM
-{
-
-/**
- * @brief Return a set of information related to every unique
- * NVDIMM in the system
- *
- * @param[out] o_info - list of NVDIMM Information
- *
- * @return errlHndl_t - Null if successful, otherwise a pointer to
- * the error log.
- */
-void getNVDIMMs( std::list<EEPROM::EepromInfo_t>& o_info );
-
-}; // end namespace NVDIMM
-
-#endif // end __NVDIMMIF_H
-
OpenPOWER on IntegriCloud