summaryrefslogtreecommitdiffstats
path: root/src/include/usr
diff options
context:
space:
mode:
authorIlya Smirnov <ismirno@us.ibm.com>2018-11-08 12:56:45 -0600
committerDaniel M. Crowell <dcrowell@us.ibm.com>2019-01-04 14:18:46 -0600
commit36bd1dae218877ae8124a0ce8a9420c04e20c1d0 (patch)
treef08fd193013bb0da0b34233442af05a6bee3e0e9 /src/include/usr
parent24f66ecb7882be36eba5ef13cbc414acb642c2af (diff)
downloadtalos-hostboot-36bd1dae218877ae8124a0ce8a9420c04e20c1d0.tar.gz
talos-hostboot-36bd1dae218877ae8124a0ce8a9420c04e20c1d0.zip
Unit Tests For NVRAM Checking/Reading
This change introduces the unit tests for testing the ported NVRAM checking and reading logic. nvram_format was also ported to be able to format the test NVRAM "partition" to then run the tests on it. Change-Id: Idca01dc84d43caf0e32ba556b6407c78d66f053a RTC: 192411 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/68612 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Roland Veloz <rveloz@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/include/usr')
-rw-r--r--src/include/usr/isteps/istep21list.H3
-rw-r--r--src/include/usr/nvram/import/nvram.h10
-rw-r--r--src/include/usr/nvram/import/skiboot.h10
3 files changed, 23 insertions, 0 deletions
diff --git a/src/include/usr/isteps/istep21list.H b/src/include/usr/isteps/istep21list.H
index ad3129217..582ecf292 100644
--- a/src/include/usr/isteps/istep21list.H
+++ b/src/include/usr/isteps/istep21list.H
@@ -129,6 +129,9 @@ const DepModInfo g_istep21Dependancies = {
DEP_LIB(libhtmgt.so),
DEP_LIB(libisteps_mss.so),
#endif
+#ifndef CONFIG_FSP_BUILD
+ DEP_LIB(libnvram.so),
+#endif
NULL
}
};
diff --git a/src/include/usr/nvram/import/nvram.h b/src/include/usr/nvram/import/nvram.h
index e335b0f4b..7f6b3b2ed 100644
--- a/src/include/usr/nvram/import/nvram.h
+++ b/src/include/usr/nvram/import/nvram.h
@@ -27,6 +27,16 @@
#include <stdint.h>
+typedef uint16_t beint16_t;
+typedef beint16_t be16;
+
+struct chrp_nvram_hdr {
+ uint8_t sig;
+ uint8_t cksum;
+ be16 len;
+ char name[12];
+};
+
extern "C"
{
int nvram_format(void *nvram_image, uint32_t nvram_size);
diff --git a/src/include/usr/nvram/import/skiboot.h b/src/include/usr/nvram/import/skiboot.h
index 689eef541..6fa141588 100644
--- a/src/include/usr/nvram/import/skiboot.h
+++ b/src/include/usr/nvram/import/skiboot.h
@@ -36,12 +36,22 @@ typedef uint16_t beint16_t;
typedef beint16_t be16;
#define BE16_TO_CPU(le_val) ((uint16_t)(le_val))
+#define CPU_TO_BE16(native) ((beint16_t)(native))
static inline uint16_t be16_to_cpu(beint16_t be_val)
{
return BE16_TO_CPU(be_val);
}
+/**
+ * cpu_to_be16 - convert a uint16_t value to big endian.
+ * @native: value to convert
+ */
+static inline beint16_t cpu_to_be16(uint16_t native)
+{
+ return CPU_TO_BE16(native);
+}
+
// For console logging
#define PR_EMERG 0
#define PR_ALERT 1
OpenPOWER on IntegriCloud