diff options
| author | Tsung Yeung <tyeung@us.ibm.com> | 2018-06-04 14:12:42 -0500 |
|---|---|---|
| committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2018-09-18 15:48:56 -0500 |
| commit | 1f6ed77b32b629f5cd316f2f3e1d8a432f037881 (patch) | |
| tree | 24b56ee17587dc2311cbb63936e405590c62d282 /src/include/usr | |
| parent | 2968366be4705757b8766c8c422f608f491f0e0b (diff) | |
| download | blackbird-hostboot-1f6ed77b32b629f5cd316f2f3e1d8a432f037881.tar.gz blackbird-hostboot-1f6ed77b32b629f5cd316f2f3e1d8a432f037881.zip | |
Targeting support for NVDIMM-N P9 on ZZ
(Redo from previous change https://ralgit01.raleigh.ibm.com/gerrit1/#/c/56096/)
-Added interfaces for accessing NVDIMM via I2C
-Added attributes to support NV controller on NVDIMM
-Moved all attributes to common file
Change-Id: Ief68d9d5e0aaadfa017b4fe117bdb3e29739e772
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/59995
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Reviewed-by: Dean Sanner <dsanner@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')
| -rw-r--r-- | src/include/usr/devicefw/userif.H | 8 | ||||
| -rw-r--r-- | src/include/usr/hbotcompid.H | 10 | ||||
| -rw-r--r-- | src/include/usr/i2c/nvdimmddreasoncodes.H | 89 | ||||
| -rw-r--r-- | src/include/usr/i2c/nvdimmif.H | 56 |
4 files changed, 161 insertions, 2 deletions
diff --git a/src/include/usr/devicefw/userif.H b/src/include/usr/devicefw/userif.H index 68f923f95..5bdd3b238 100644 --- a/src/include/usr/devicefw/userif.H +++ b/src/include/usr/devicefw/userif.H @@ -69,6 +69,7 @@ namespace DeviceFW DVPD, // Direct access memory VPD DEPRECATED_MEMD_VPD, NODECOMM, + NVDIMM, LAST_ACCESS_TYPE, }; @@ -365,7 +366,12 @@ namespace DeviceFW static_cast<uint64_t>(( i_mode )),\ static_cast<uint64_t>(( i_link_id )),\ static_cast<uint64_t>(( i_mailbox_id )) - + /** + * Construct the device addressing parameters for the NVDIMM device ops. + * @param[i] i_address - NVDIMM address to internal register + */ + #define DEVICE_NVDIMM_ADDRESS(i_address)\ + DeviceFW::NVDIMM, static_cast<uint64_t>((i_address)) /** * @brief Perform a hardware read operation. diff --git a/src/include/usr/hbotcompid.H b/src/include/usr/hbotcompid.H index 6f1c90675..53ba8cf74 100644 --- a/src/include/usr/hbotcompid.H +++ b/src/include/usr/hbotcompid.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2011,2017 */ +/* Contributors Listed Below - COPYRIGHT 2011,2018 */ /* [+] Google Inc. */ /* [+] International Business Machines Corp. */ /* */ @@ -421,6 +421,14 @@ const compId_t HBBL_COMP_ID = 0x3400; const char HBBL_COMP_NAME[] = "hbbl"; //@} +/** @name NVDIMM + * NVDIMM NV Controller Interface + */ +//@{ +const compId_t NVDIMM_COMP_ID = 0x3500; +const char NVDIMM_COMP_NAME[] = "nvdimm"; +//@} + /** @name HDAT * HDAT component * @Note HDAT_COMP_ID=0x9000 matches with what diff --git a/src/include/usr/i2c/nvdimmddreasoncodes.H b/src/include/usr/i2c/nvdimmddreasoncodes.H new file mode 100644 index 000000000..d01755bc0 --- /dev/null +++ b/src/include/usr/i2c/nvdimmddreasoncodes.H @@ -0,0 +1,89 @@ +/* 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, +}; + +/** + * @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, +}; + +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 new file mode 100644 index 000000000..8c332e1c5 --- /dev/null +++ b/src/include/usr/i2c/nvdimmif.H @@ -0,0 +1,56 @@ +/* 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 Determine if the given dimm target is an NVDIMM + * + * @param[in] i_target : dimm target to check + * + * @return bool - True if the given target is an NVDIMM + */ +bool isNVDIMM( TARGETING::Target * i_target ); + +/** + * @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 + |

