diff options
author | Prachi Gupta <pragupta@us.ibm.com> | 2016-01-26 10:08:02 -0600 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2016-06-16 00:38:21 -0400 |
commit | f85d0f09cc63c3e1625d5a183a9e6a6d4e216693 (patch) | |
tree | f3f2998d96a6b98a3eedff20420e5580ff9ca8a0 | |
parent | ea9529b786d03381bb92d2f89353c035df929102 (diff) | |
download | talos-hostboot-f85d0f09cc63c3e1625d5a183a9e6a6d4e216693.tar.gz talos-hostboot-f85d0f09cc63c3e1625d5a183a9e6a6d4e216693.zip |
p9_xip_customize HWP - L2
- Added all the mailbox attributes to the required xmls
- HWP is able to customize the image with new attribute
values based on the environment
RTC:138900
Change-Id: I51e9ccbd3ceba2381594d40dcb2c44ebd890fe0d
Original-Change-Id: Idfadd53a747a2cab90d2b977bce178ba7e0c170a
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/23664
Tested-by: Jenkins Server
Reviewed-by: Claus Michael Olsen <cmolsen@us.ibm.com>
Reviewed-by: Martin Peschke <mpeschke@de.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/25883
Tested-by: FSP CI Jenkins
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
3 files changed, 144 insertions, 0 deletions
diff --git a/src/import/chips/p9/procedures/hwp/customize/p9_xip_customize.C b/src/import/chips/p9/procedures/hwp/customize/p9_xip_customize.C new file mode 100644 index 000000000..0e5a01bf4 --- /dev/null +++ b/src/import/chips/p9/procedures/hwp/customize/p9_xip_customize.C @@ -0,0 +1,85 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: chips/p9/procedures/hwp/customize/p9_xip_customize.C $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* EKB Project */ +/* */ +/* COPYRIGHT 2016 */ +/* [+] International Business Machines Corp. */ +/* */ +/* */ +/* The source code for this program is not published or otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* IBM_PROLOG_END_TAG */ +#include <p9_xip_customize.H> +#include <p9_xip_image.h> + +#define MBOX_ATTR_WRITE(ID,TARGET,IMAGE) \ + { \ + fapi2::ID##_Type ID##_attrVal; \ + FAPI_TRY(FAPI_ATTR_GET(fapi2::ID,TARGET,ID##_attrVal),\ + "MBOX_ATTR_WRITE: Error getting %s", #ID); \ + p9_xip_set_scalar(IMAGE,#ID,ID##_attrVal); \ + } + +fapi2::ReturnCode writeMboxRegs ( + const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_proc_target, + const fapi2::Target<fapi2::TARGET_TYPE_SYSTEM>& i_system_target, + void* io_image) +{ + FAPI_DBG ("writeMboxRegs Entering..."); + + MBOX_ATTR_WRITE (ATTR_I2C_BUS_DIV_REF, i_proc_target, io_image); + MBOX_ATTR_WRITE (ATTR_FUNCTIONAL_EQ_EC_VALID, i_proc_target, io_image); + MBOX_ATTR_WRITE (ATTR_EQ_GARD, i_proc_target, io_image); + MBOX_ATTR_WRITE (ATTR_EC_GARD, i_proc_target, io_image); + MBOX_ATTR_WRITE (ATTR_I2C_BUS_DIV_REF_VALID, i_proc_target, io_image); + MBOX_ATTR_WRITE (ATTR_FW_MODE_FLAGS_VALID, i_proc_target, io_image); + MBOX_ATTR_WRITE (ATTR_ISTEP_MODE, i_proc_target, io_image); + MBOX_ATTR_WRITE (ATTR_SBE_RUNTIME_MODE, i_proc_target, io_image); + MBOX_ATTR_WRITE (ATTR_IS_MPIPL, i_system_target, io_image); + MBOX_ATTR_WRITE (ATTR_IS_SP_MODE, i_proc_target, io_image); + MBOX_ATTR_WRITE (ATTR_SBE_FFDC_ENABLE, i_proc_target, io_image); + MBOX_ATTR_WRITE (ATTR_SBE_INTERNAL_FFDC_ENABLE, i_proc_target, io_image); + MBOX_ATTR_WRITE (ATTR_BOOT_FREQUENCY_VALID, i_proc_target, io_image); + MBOX_ATTR_WRITE (ATTR_NEST_PLL_BUCKET, i_proc_target, io_image); + MBOX_ATTR_WRITE (ATTR_BOOT_FREQ_MULT, i_proc_target, io_image); + MBOX_ATTR_WRITE (ATTR_HWP_CONTROL_FLAGS_VALID, i_proc_target, io_image); + MBOX_ATTR_WRITE (ATTR_SYSTEM_IPL_PHASE, i_system_target, io_image); + MBOX_ATTR_WRITE (ATTR_SYS_FORCE_ALL_CORES, i_proc_target, io_image); + MBOX_ATTR_WRITE (ATTR_RISK_LEVEL, i_proc_target, io_image); + MBOX_ATTR_WRITE (ATTR_DISABLE_HBBL_VECTORS, i_proc_target, io_image); + MBOX_ATTR_WRITE (ATTR_CHIP_SELECTION_VALID, i_proc_target, io_image); + MBOX_ATTR_WRITE (ATTR_CHIP_SELECTION, i_proc_target, io_image); + MBOX_ATTR_WRITE (ATTR_NODE_POS, i_proc_target, io_image); + MBOX_ATTR_WRITE (ATTR_CHIP_POS, i_proc_target, io_image); + MBOX_ATTR_WRITE (ATTR_SCRATCH6_VALID, i_proc_target, io_image); + MBOX_ATTR_WRITE (ATTR_SCRATCH7_VALID, i_proc_target, io_image); + +fapi_try_exit: + FAPI_DBG ("writeMboxRegs Exiting..."); + return fapi2::current_err; +} + +fapi2::ReturnCode p9_xip_customize ( + const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_proc_target, + const fapi2::Target<fapi2::TARGET_TYPE_SYSTEM>& i_system_target, + void* io_image) +{ + FAPI_DBG ("Entering p9_xip_customize..."); + + FAPI_TRY(writeMboxRegs(i_proc_target, i_system_target, io_image), + "p9_xip_customize: error writing mbox regs in SBE image rc=0x%.8x", + (uint64_t)fapi2::current_err); + + +fapi_try_exit: + FAPI_DBG("Exiting p9_xip_customize"); + return fapi2::current_err; + +} diff --git a/src/import/chips/p9/procedures/hwp/customize/p9_xip_customize.H b/src/import/chips/p9/procedures/hwp/customize/p9_xip_customize.H new file mode 100644 index 000000000..0653ac1bb --- /dev/null +++ b/src/import/chips/p9/procedures/hwp/customize/p9_xip_customize.H @@ -0,0 +1,37 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: chips/p9/procedures/hwp/customize/p9_xip_customize.H $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* EKB Project */ +/* */ +/* COPYRIGHT 2016 */ +/* [+] International Business Machines Corp. */ +/* */ +/* */ +/* The source code for this program is not published or otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* IBM_PROLOG_END_TAG */ +#ifndef _P9_XIP_CUSTOMIZE_ +#define _P9_XIP_CUSTOMIZE_ + +#include <fapi2.H> + +typedef fapi2::ReturnCode (*p9_xip_customize_FP_t) ( + const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_proc_target, + const fapi2::Target<fapi2::TARGET_TYPE_SYSTEM>& i_system_target, + void* io_image); + +extern "C" +{ + fapi2::ReturnCode p9_xip_customize ( + const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_proc_target, + const fapi2::Target<fapi2::TARGET_TYPE_SYSTEM>& i_system_target, + void* io_image); + +} +#endif diff --git a/src/import/chips/p9/procedures/hwp/customize/p9_xip_customize.mk b/src/import/chips/p9/procedures/hwp/customize/p9_xip_customize.mk new file mode 100644 index 000000000..09ee398a9 --- /dev/null +++ b/src/import/chips/p9/procedures/hwp/customize/p9_xip_customize.mk @@ -0,0 +1,22 @@ +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: chips/p9/procedures/hwp/customize/p9_xip_customize.mk $ +# +# IBM CONFIDENTIAL +# +# EKB Project +# +# COPYRIGHT 2016 +# [+] International Business Machines Corp. +# +# +# The source code for this program is not published or otherwise +# divested of its trade secrets, irrespective of what has been +# deposited with the U.S. Copyright Office. +# +# IBM_PROLOG_END_TAG +PROCEDURE=p9_xip_customize +lib$(PROCEDURE)_DEPLIBS+=p9_xip_image +$(call ADD_MODULE_INCDIR,$(PROCEDURE),$(ROOTPATH)/chips/p9/xip) +$(call BUILD_PROCEDURE) |