summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMike Jones <mjjones@us.ibm.com>2012-10-09 16:34:56 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2012-10-17 10:11:02 -0500
commit399b036c4c27776a2a8577274ed6cb3657f15518 (patch)
tree15190aac1d96e46a44640063a6dfd2fd05e87ec8 /src
parent3602edd91b57506d18b9aedbf4f98dd4ef275463 (diff)
downloadtalos-hostboot-399b036c4c27776a2a8577274ed6cb3657f15518.tar.gz
talos-hostboot-399b036c4c27776a2a8577274ed6cb3657f15518.zip
HWPF: Add fapiSetMvpdField function
Change-Id: I112708de8f5de7af9cf328034b2b612cd53b74e9 RTC: 50183 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/2006 Tested-by: Jenkins Server Reviewed-by: Van H. Lee <vanlee@us.ibm.com> Reviewed-by: Brian H. Horton <brianh@linux.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r--src/include/usr/hwpf/fapi/fapiMvpdAccess.H75
-rw-r--r--src/usr/hwpf/plat/fapiPlatMvpdAccess.C60
2 files changed, 110 insertions, 25 deletions
diff --git a/src/include/usr/hwpf/fapi/fapiMvpdAccess.H b/src/include/usr/hwpf/fapi/fapiMvpdAccess.H
index 85a5c089b..4e806a849 100644
--- a/src/include/usr/hwpf/fapi/fapiMvpdAccess.H
+++ b/src/include/usr/hwpf/fapi/fapiMvpdAccess.H
@@ -1,27 +1,26 @@
-/* IBM_PROLOG_BEGIN_TAG
- * This is an automatically generated prolog.
- *
- * $Source: src/include/usr/hwpf/fapi/fapiMvpdAccess.H $
- *
- * IBM CONFIDENTIAL
- *
- * COPYRIGHT International Business Machines Corp. 2012
- *
- * p1
- *
- * Object Code Only (OCO) source materials
- * Licensed Internal Code Source Materials
- * IBM HostBoot Licensed Internal Code
- *
- * The source code for this program is not published or other-
- * wise divested of its trade secrets, irrespective of what has
- * been deposited with the U.S. Copyright Office.
- *
- * Origin: 30
- *
- * IBM_PROLOG_END_TAG
- */
-// $Id: fapiMvpdAccess.H,v 1.1 2012/07/19 22:00:12 mjjones Exp $
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/include/usr/hwpf/fapi/fapiMvpdAccess.H $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2012 */
+/* */
+/* p1 */
+/* */
+/* Object Code Only (OCO) source materials */
+/* Licensed Internal Code Source Materials */
+/* IBM HostBoot Licensed Internal Code */
+/* */
+/* 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. */
+/* */
+/* Origin: 30 */
+/* */
+/* IBM_PROLOG_END_TAG */
+// $Id: fapiMvpdAccess.H,v 1.2 2012/10/09 21:32:55 mjjones Exp $
/**
* @file fapiMvpdAccess.H
*
@@ -29,6 +28,13 @@
*
*/
+/*
+ * Change Log ******************************************************************
+ * Flag Defect/Feature User Date Description
+ * ------ -------------- ---------- ----------- ----------------------------
+ * mjjones 10/09/2012 Added fapiGetMvpdField
+ */
+
#ifndef _FAPI_FAPIMVPDACCESS_H_
#define _FAPI_FAPIMVPDACCESS_H_
@@ -121,7 +127,7 @@ extern "C"
*
* @param[in] i_record Record enumerator
* @param[in] i_keyword Keyword enumerator
- * @param[in] i_procTarget Pointer to processor chip target for the record
+ * @param[in] i_procTarget Reference to processor chip target for the record
* @param[in] i_pBuffer Pointer to buffer where record will be stored. If
* NULL then the size of record will be stored in
* io_fieldSize
@@ -134,6 +140,25 @@ fapi::ReturnCode fapiGetMvpdField(const fapi::MvpdRecord i_record,
const fapi::Target &i_procTarget,
uint8_t * const i_pBuffer,
uint32_t &io_fieldSize);
+
+/**
+ * @brief Set Module VPD field.
+ *
+ * A Module VPD field is specified using a record and keyword enumerator
+ *
+ * @param[in] i_record Record enumerator
+ * @param[in] i_keyword Keyword enumerator
+ * @param[in] i_procTarget Reference to processor chip target for the record
+ * @param[in] i_pBuffer Pointer to buffer where data to set is stored
+ * @param[io] i_fieldSize Size of i_pBuffer in bytes
+ *
+ * @return fapi::ReturnCode. FAPI_RC_SUCCESS, or failure value.
+ */
+fapi::ReturnCode fapiSetMvpdField(const fapi::MvpdRecord i_record,
+ const fapi::MvpdKeyword i_keyword,
+ const fapi::Target &i_procTarget,
+ const uint8_t * const i_pBuffer,
+ const uint32_t i_fieldSize);
}
#endif
diff --git a/src/usr/hwpf/plat/fapiPlatMvpdAccess.C b/src/usr/hwpf/plat/fapiPlatMvpdAccess.C
index 5328145e9..977a9a7cc 100644
--- a/src/usr/hwpf/plat/fapiPlatMvpdAccess.C
+++ b/src/usr/hwpf/plat/fapiPlatMvpdAccess.C
@@ -268,4 +268,64 @@ fapi::ReturnCode fapiGetMvpdField(const fapi::MvpdRecord i_record,
return l_rc;
}
+//******************************************************************************
+// fapiSetMvpdField
+//******************************************************************************
+fapi::ReturnCode fapiSetMvpdField(const fapi::MvpdRecord i_record,
+ const fapi::MvpdKeyword i_keyword,
+ const fapi::Target &i_procTarget,
+ const uint8_t * const i_pBuffer,
+ const uint32_t i_fieldSize)
+{
+ fapi::ReturnCode l_rc;
+ FAPI_DBG("fapiSetMvpdField entry");
+
+ do
+ {
+ // Translate the FAPI record to a Hostboot record
+ MVPD::mvpdRecord l_hbRecord = MVPD::MVPD_INVALID_RECORD;
+
+ l_rc = fapi::MvpdRecordXlate(i_record, l_hbRecord);
+
+ if (l_rc)
+ {
+ break;
+ }
+
+ // Translate the FAPI keyword to a Hostboot keyword
+ MVPD::mvpdKeyword l_hbKeyword = MVPD::INVALID_MVPD_KEYWORD;
+
+ l_rc = fapi::MvpdKeywordXlate(i_keyword, l_hbKeyword);
+
+ if (l_rc)
+ {
+ break;
+ }
+
+ size_t l_fieldLen = i_fieldSize;
+
+ errlHndl_t l_errl = deviceWrite(
+ reinterpret_cast< TARGETING::Target*>(i_procTarget.get()),
+ const_cast<uint8_t *>(i_pBuffer),
+ l_fieldLen,
+ DEVICE_MVPD_ADDRESS(l_hbRecord, l_hbKeyword));
+
+ if (l_errl)
+ {
+ FAPI_ERR("fapiSetMvpdField: ERROR: deviceWrite : errorlog PLID=0x%x",
+ l_errl->plid());
+
+ // Add the error log pointer as data to the ReturnCode
+ l_rc.setPlatError(reinterpret_cast<void *> (l_errl));
+
+ break;
+ }
+
+ } while(0);
+
+ FAPI_DBG( "fapiSetMvpdField: exit" );
+
+ return l_rc;
+}
+
} // extern "C"
OpenPOWER on IntegriCloud