summaryrefslogtreecommitdiffstats
path: root/src/include/securerom
diff options
context:
space:
mode:
authorStephen Cprek <smcprek@us.ibm.com>2017-01-06 16:26:20 -0600
committerDaniel M. Crowell <dcrowell@us.ibm.com>2017-01-30 11:20:12 -0500
commitb83556b80737f7098ce5cae73a61068f8bf56184 (patch)
treebc3d819601baba51459664152955c70da0bc2111 /src/include/securerom
parent6b650f5428297e8dde075d25e7862a20c8d47f04 (diff)
downloadtalos-hostboot-b83556b80737f7098ce5cae73a61068f8bf56184.tar.gz
talos-hostboot-b83556b80737f7098ce5cae73a61068f8bf56184.zip
Use common ROM header files for rom, bootloader, and hostboot
Change-Id: I4d7db7293d44633cf1646f69ab98ddc8d66338ca RTC: 143902 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/34525 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> Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com> Reviewed-by: Michael Baiocchi <mbaiocch@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/include/securerom')
-rw-r--r--src/include/securerom/ROM.H89
1 files changed, 87 insertions, 2 deletions
diff --git a/src/include/securerom/ROM.H b/src/include/securerom/ROM.H
index 808a87468..b8ace6e71 100644
--- a/src/include/securerom/ROM.H
+++ b/src/include/securerom/ROM.H
@@ -35,8 +35,6 @@
#define HASH_ALG_SHA512 1
#define SIG_ALG_ECDSA521 1
-#define ROM_MAGIC_NUMBER 0x17082011
-
typedef struct
{
uint16_t version; // (1: see versions above)
@@ -130,4 +128,91 @@ extern void ROM_sreset (void);
extern "C" ROM_response ROM_verify (ROM_container_raw* container,
ROM_hw_params* params);
+/************************* END OF ORIGINAL ROM CODE ***************************/
+
+/* Offsets needed to call functions in jump table at start of ROM code.
+ See img/securerom.list.bz2 and search for SHA512_Hash and ROM_verify
+ E.g.
+ 0000000000000018 <_SHA512_Hash>:
+ 0000000000000028 <_ROM_verify>:
+*/
+#define SHA512_HASH_FUNCTION_OFFSET 0x18
+#define ROM_VERIFY_FUNCTION_OFFSET 0x28
+
+// Need this for the following definition
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+// Interfaces for Assembly Functions to call into Secure ROM
+// - 1st parameter is address of function offset into Secure ROM,
+// followed by additional parameters as necssary
+
+/**
+ * @brief Call rom verify code against system hash keys
+ *
+ * @param[in] void* Address of function offset into Secure ROM
+ * @param[in] ROM_container_raw* Pointer to effective address of container
+ * @param[in] ROM_hw_params* HW params to pass in. Includes HW keys' hash
+ *
+ * @return ROM_response ROM_DONE on sucess ROM_FAILURE otherwise
+ */
+ROM_response call_rom_verify(void*, ROM_container_raw*, ROM_hw_params*);
+
+/**
+ * @brief Call rom SHA512 code
+ *
+ * @param[in] void* Address of function offset into Secure ROM
+ * @param[in] sha2_byte* Pointer to effective address of blob to hash
+ * @param[in] size_t Size of blob to hash
+ * @param[in/out] sha2_hash_t* Pointer to resulting hash value
+ *
+ * @return N/A
+ */
+void call_rom_SHA512(void*, const sha2_byte *, size_t, sha2_hash_t*);
+
+#ifdef __cplusplus
+}
+#endif
+
+// Consts used for container header validation
+const uint32_t ROM_MAGIC_NUMBER = 0x17082011;
+const uint16_t ROM_VERSION = 1;
+const uint8_t ROM_HASH_ALG = 1;
+const uint8_t ROM_SIG_ALG = 1;
+const uint8_t HW_KEY_COUNT = 3;
+const uint8_t SW_KEY_COUNT_MIN = 1;
+const uint8_t SW_KEY_COUNT_MAX = 3;
+const size_t MAX_SECURE_HEADER_SIZE = 4096;
+
+// Security Flags
+
+// HW Security Flags
+enum HW_SB_FLAGS
+{
+ HB_FW_FLAG = 0x80000000,
+ OPAL_FLAG = 0x40000000,
+ PHYP_FLAG = 0x20000000,
+ KEY_TRANSITION_FLAG = 0x00000001
+};
+
+// SW Security Flags
+enum SW_SB_FLAGS
+{
+ // placeholder
+};
+
+// Structure to store all hw and sw flag values in a container header
+struct sb_flags_t
+{
+ sb_flags_t() : hw_hb_fw(false), hw_opal(false), hw_phyp(false),
+ hw_key_transition(false) {}
+ bool hw_hb_fw;
+ bool hw_opal;
+ bool hw_phyp;
+ bool hw_key_transition;
+};
+
+
#endif
OpenPOWER on IntegriCloud