]> git.sur5r.net Git - u-boot/blobdiff - tools/rkcommon.h
rockchip: mkimage: Allow encoding of loader code in spl images
[u-boot] / tools / rkcommon.h
index c69540f5f38a35cab4bd9566af073716175e2139..b4f6f327dc17f85be0933dc927336ca153b5de33 100644 (file)
@@ -55,4 +55,26 @@ int rkcommon_get_spl_size(struct image_tool_params *params);
 int rkcommon_set_header(void *buf, uint file_size,
                        struct image_tool_params *params);
 
+/**
+ * rkcommon_need_rc4_spl() - check if rc4 encoded spl is required
+ *
+ * Some socs cannot disable the rc4-encryption of the spl binary.
+ * rc4 encryption is disabled normally except on socs that cannot
+ * handle unencrypted binaries.
+ * @return true or false depending on rc4 being required.
+ */
+bool rkcommon_need_rc4_spl(struct image_tool_params *params);
+
+/**
+ * rkcommon_rc4_encode_spl() - encode the spl binary
+ *
+ * Encrypts the SPL binary using the generic rc4 key as required
+ * by some socs.
+ *
+ * @buf:       Pointer to the SPL data (header and SPL binary)
+ * @offset:    offset inside buf to start at
+ * @size:      number of bytes to encode
+ */
+void rkcommon_rc4_encode_spl(void *buf, unsigned int offset, unsigned int size);
+
 #endif