diff options
author | Dan Crowell <dcrowell@us.ibm.com> | 2012-12-03 22:12:51 -0600 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2012-12-17 11:30:52 -0600 |
commit | 26a86256282eb6ff0e5816207785e4382c258980 (patch) | |
tree | 2d4da5788e610dbd59616c5ea96e134bd66b2fa6 /src/include | |
parent | 5d55351d61c004588b2e3449d67bbfbc6af87a4d (diff) | |
download | talos-hostboot-26a86256282eb6ff0e5816207785e4382c258980.tar.gz talos-hostboot-26a86256282eb6ff0e5816207785e4382c258980.zip |
VPD Write
Enable SPD writes and send a message to the FSP to update
the real VPD.
Change-Id: Ia398a49b4b5e2505c3ac25176cf37a5a0fc28111
RTC: 41365
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/2549
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Tested-by: Jenkins Server
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/usr/mbox/mbox_queues.H | 4 | ||||
-rw-r--r-- | src/include/usr/spd/spdenums.H | 41 | ||||
-rw-r--r-- | src/include/usr/spd/spdif.H | 34 |
3 files changed, 78 insertions, 1 deletions
diff --git a/src/include/usr/mbox/mbox_queues.H b/src/include/usr/mbox/mbox_queues.H index bb8b9e2b3..1941aec1b 100644 --- a/src/include/usr/mbox/mbox_queues.H +++ b/src/include/usr/mbox/mbox_queues.H @@ -57,8 +57,10 @@ namespace MBOX FSP_ERROR_MSGQ = 0x80000004, IPL_SERVICE_QUEUE = 0x80000008, // Defined by Fsp team FSP_ATTR_SYNC_MSGQ = 0x80000009, - FSP_HWPF_ATTR_MSGQ = 0x8000000b, // HWPF Attribute override/sync + FSP_HWPF_ATTR_MSGQ = 0x8000000B, // HWPF Attribute override/sync + FSP_VPD_MSGQ = 0x8000000C, // Add FSP services here: + FSP_ECHO_MSGQ = 0xFFFFFFFF, // Fake FSP for test }; diff --git a/src/include/usr/spd/spdenums.H b/src/include/usr/spd/spdenums.H index 2c2d6582a..09178c96f 100644 --- a/src/include/usr/spd/spdenums.H +++ b/src/include/usr/spd/spdenums.H @@ -30,6 +30,8 @@ #ifndef __SPDENUMS_H #define __SPDENUMS_H +#include <mbox/mbox_queues.H> + namespace SPD { @@ -258,6 +260,45 @@ enum INVALID_SPD_KEYWORD = 0xFFFF, }; +/** + * @brief VPD Message Types + */ +enum VPD_MSG_TYPE +{ + VPD_WRITE_DIMM = 0x00C1, //< DIMM SPD + VPD_WRITE_PROC = 0x00C2, //< Processor MVPD + VPD_WRITE_MEMBUF = 0x00C3, //< Centaur FRU VPD +}; + +/** + * @brief Message definition for VPD Write Request + * + * - data0 : + * - [16] VPD Record Number + * - [32] 4-byte ASCII String for record name + * 'XXXX'=Entire VPD section from PNOR + * - [16] 2-byte ASCII String for keyword or offset into SPD + * 'XX'=Entire VPD record + * - data1 : + * - [64] Size of binary data in bytes + * - extra data : Binary VPD Data + */ +union VpdWriteMsg_t +{ + uint64_t data0; + struct + { + uint16_t rec_num; //< VPD_REC_NUM + char record[4]; //< ASCII Record Name + union + { + char keyword[2]; //< ASCII Keyword (for IBM VPD) + uint16_t offset; //< Offset into record in bytes (for DIMM SPD) + }; + } PACKED; +}; + + }; // end SPD #endif diff --git a/src/include/usr/spd/spdif.H b/src/include/usr/spd/spdif.H index c56a8dabf..41bd94ffc 100644 --- a/src/include/usr/spd/spdif.H +++ b/src/include/usr/spd/spdif.H @@ -83,6 +83,40 @@ errlHndl_t readPNOR ( uint64_t i_byteAddr, uint64_t &io_cachedAddr, mutex_t * i_mutex ); +/** + * @brief This function will write the PNOR at the correct offset and number + * of bytes for the keyword requested. + * + * @param[in] i_byteAddr - The offset to access in the PNOR. + * + * @param[in] i_numBytes - The number of bytes to write. + * + * @param[in] i_data - The data buffer of the data to be written. + * + * @param[in] i_target - The chip target to access the data for. + * + * @param[in] i_pnorInfo - Information about the PNOR section and side that we + * need to know to make the request. + * + * @param[in/out] io_cachedAddr - The address offset to the data chunk in + * PNOR. + * + * @param[in] i_mutex - The mutex to lock/unlock while setting io_isAddrCached + * and io_cachedAddr. It is assumed that those parameters are global + * variables in the code where they reside. + * + * @return errlHndl_t - NULL if successful, otherwise a pointer to the error + * log. + */ +errlHndl_t writePNOR ( uint64_t i_byteAddr, + size_t i_numBytes, + void * i_data, + TARGETING::Target * i_target, + pnorInformation & i_pnorInfo, + uint64_t &io_cachedAddr, + mutex_t * i_mutex ); + + }; // end SPD #endif |