Skip to content

Commit

Permalink
Framework for NVDIMM update
Browse files Browse the repository at this point in the history
This includes framework to update the firmware
running on the NV controller.  The controller requires
12V power to update, so this function in inside hostboot.

Change-Id: I0733d83ff6ba2fc3f026d49c72784b1295bd3eed
RTC:201197
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/69879
Reviewed-by: Roland Veloz <rveloz@us.ibm.com>
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
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: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
mderkse1 authored and dcrowell77 committed Feb 28, 2019
1 parent 80cea86 commit 37e6769
Show file tree
Hide file tree
Showing 14 changed files with 1,010 additions and 14 deletions.
5 changes: 4 additions & 1 deletion src/include/usr/isteps/istep20list.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2012,2017 */
/* Contributors Listed Below - COPYRIGHT 2012,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -92,6 +92,9 @@ const DepModInfo g_istep20Dependancies = {
DEP_LIB(libistep20.so),
DEP_LIB(libxz.so),
DEP_LIB(libruntime.so),
#ifdef CONFIG_NVDIMM
DEP_LIB(libnvdimm.so),
#endif
NULL
}
};
Expand Down
15 changes: 15 additions & 0 deletions src/include/usr/isteps/nvdimm/nvdimm.H
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,21 @@ enum nvdimm_err_status
*
**/
void nvdimm_restore(TARGETING::TargetHandleList &i_nvdimmList);


/**
* @brief Entry function for updating NV controller code on the NVDIMMs
* Each nvdimm will be checked for a possible update. The update
* will be performed if the dimm is a known type and its version level
* does not match its corresponding lid's version level.
*
* @param[in] i_nvdimmList - list of nvdimm targets
*
* @return true if no errors were logged, else false
*
**/
bool nvdimm_update(TARGETING::TargetHandleList &i_nvdimmList);

#endif


Expand Down
2 changes: 2 additions & 0 deletions src/include/usr/isteps/nvdimm/nvdimmreasoncodes.H
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ enum nvdimmModuleId
NVDIMM_ARM_ERASE = 0x17,
NVDIMM_CHECK_READY = 0x18,
NOTIFY_NVDIMM_PROTECTION_CHG = 0x19,
NVDIMM_RUN_UPDATE = 0x1A,
};

/**
Expand Down Expand Up @@ -112,6 +113,7 @@ enum nvdimmReasonCode
NVDIMM_RESTORE_FAILED = NVDIMM_COMP_ID | 0x1A, // Failure to restore
NVDIMM_NOT_READY = NVDIMM_COMP_ID | 0x1B, // NVDIMM not ready for host to access
NVDIMM_NULL_FIRMWARE_REQUEST_PTR = NVDIMM_COMP_ID | 0x1C, // Firmware request is NULL
NVDIMM_UNSUPPORTED_NVDIMM_TYPE = NVDIMM_COMP_ID | 0x1D, // Unsupported NVDIMM type for update
};

enum UserDetailsTypes
Expand Down
8 changes: 7 additions & 1 deletion src/include/usr/util/utillidmgr.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2013,2018 */
/* Contributors Listed Below - COPYRIGHT 2013,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -61,6 +61,12 @@ enum LidId
HCODE_CONTAINER_LIDID = 0x80d0000c,
HWREFIMG_RINGOVD_LIDID = 0x81e00620,
TARGETING_BINARY_LIDID = 0x81e00630,

// two lids for 16GB and 32GB NVDIMMs
// @todo RTC 201197 - update when valid lids are created
NVDIMM_16GB_LIDID = 0xBADBAD16,
NVDIMM_32GB_LIDID = 0xBADBAD32,

INVALID_LIDID = 0xFFFFFFFF
};

Expand Down
6 changes: 4 additions & 2 deletions src/include/usr/vpd/spdenums.H
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ enum
DRAM_STEPPING = SPD_FIRST_NORM_KEYWORD | 0x57,
MANUFACTURING_SECTION_CRC = SPD_FIRST_NORM_KEYWORD | 0x58,
NVM_INIT_TIME = SPD_FIRST_NORM_KEYWORD | 0x59,
SPD_LAST_NORM_KEYWORD = SPD_FIRST_NORM_KEYWORD | 0x59,
RAW_MODULE_PRODUCT_ID = SPD_FIRST_NORM_KEYWORD | 0x5a,
RAW_MODULE_MANUFACTURER_ID = SPD_FIRST_NORM_KEYWORD | 0x5b,
SPD_LAST_NORM_KEYWORD = SPD_FIRST_NORM_KEYWORD | 0x5b,

// ==============================================================
// Module Specific Keywords (Available for both DDR3 and DDR4 DIMMs)
Expand Down Expand Up @@ -343,7 +345,7 @@ enum
};

enum
{
{
// These are LRDIMM values for Module Type attribute
// according to ver3 and ver4 JEDEC specs
JEDEC_VER3_LRDIMM_VAL = 0x0b,
Expand Down
13 changes: 12 additions & 1 deletion src/usr/isteps/istep20/call_host_load_payload.C
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2016,2017 */
/* Contributors Listed Below - COPYRIGHT 2016,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -40,6 +40,11 @@
#include <xz/xz.h>
#include <config.h>

#ifdef CONFIG_NVDIMM
#include "call_nvdimm_update.H"
#endif


using namespace ERRORLOG;
using namespace ISTEP;
using namespace ISTEP_ERROR;
Expand Down Expand Up @@ -129,6 +134,12 @@ void* call_host_load_payload (void *io_pArgs)
}
}

#ifdef CONFIG_NVDIMM
// Update the NVDIMM controller code, if necessary
// Need to do this after LIDs are accessible
NVDIMM_UPDATE::call_nvdimm_update();
#endif

}while(0);

return l_err;
Expand Down
76 changes: 76 additions & 0 deletions src/usr/isteps/istep20/call_nvdimm_update.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/* IBM_PROLOG_BEGIN_TAG */
/* This is an automatically generated prolog. */
/* */
/* $Source: src/usr/isteps/istep20/call_nvdimm_update.C $ */
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 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 */
#include <trace/interface.H>
#include <errl/errlentry.H>
#include <initservice/isteps_trace.H>
#include <targeting/common/commontargeting.H>
#include <targeting/common/utilFilter.H>

// NVDIMM support
#include <isteps/nvdimm/nvdimm.H>

#include "call_nvdimm_update.H"

namespace NVDIMM_UPDATE
{

/**
* @brief This function updates the NVDIMM firmware code
*/
void call_nvdimm_update()
{
TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,ENTER_MRK"call_nvdimm_update()");

TARGETING::TargetHandleList l_nvdimmTargetList;
TARGETING::TargetHandleList l_procList;
TARGETING::getAllChips(l_procList, TARGETING::TYPE_PROC, false);

// grab the NVDIMMs under each processor and add to overall list
for (auto l_proc : l_procList)
{
TARGETING::TargetHandleList tmpList =
TARGETING::getProcNVDIMMs(l_proc);
l_nvdimmTargetList.insert(l_nvdimmTargetList.end(),
tmpList.begin(), tmpList.end());
}

// Run the nvdimm update function if the list is not empty
if ( !l_nvdimmTargetList.empty() )
{
TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
"call_nvdimm_update(): found %d nvdimms to check for update",
l_nvdimmTargetList.size());
bool updateWorked = NVDIMM::nvdimm_update(l_nvdimmTargetList);
if (!updateWorked)
{
TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
"call_nvdimm_update(): nvdimm update failed");
}
}

TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,EXIT_MRK"call_nvdimm_update()");
}

};
38 changes: 38 additions & 0 deletions src/usr/isteps/istep20/call_nvdimm_update.H
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/* IBM_PROLOG_BEGIN_TAG */
/* This is an automatically generated prolog. */
/* */
/* $Source: src/usr/isteps/istep20/call_nvdimm_update.H $ */
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 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 __CALL_NVDIMM_UPDATE_H
#define __CALL_NVDIMM_UPDATE_H

namespace NVDIMM_UPDATE
{
/**
* @brief This function updates the NVDIMM firmware code
* Will locate functional NVDIMMs and update their
* nv controller code if necessary.
*/
void call_nvdimm_update();
}

#endif
1 change: 1 addition & 0 deletions src/usr/isteps/istep20/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ ROOTPATH = ../../../..
MODULE = istep20

OBJS += call_host_load_payload.o
OBJS += $(if $(CONFIG_NVDIMM),call_nvdimm_update.o,)

include ${ROOTPATH}/config.mk
10 changes: 10 additions & 0 deletions src/usr/isteps/nvdimm/nvdimm.mk
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
# nvdimmm.mk should only be called when CONFIG_NVDIMM is set
# Called by src/makefile with the condition that CONFIG_NVDIMM is defined

PROCEDURE_PATH = ${ROOTPATH}/src/import/chips/p9/procedures

#Add all the extra include paths
Expand All @@ -45,4 +48,11 @@ OBJS += nvdimm.o
OBJS += nvdimmdd.o
OBJS += errlud_nvdimm.o

ifneq (${HOSTBOOT_RUNTIME},1)

# code update path for NVDIMMs (not at RUNTIME)
OBJS += nvdimm_update.o

endif

VPATH += ${PROCEDURE_PATH}/hwp/memory/lib/dimm/ddr4/

0 comments on commit 37e6769

Please sign in to comment.