if ((i != IMAGE_ID_ATF) && (i != IMAGE_ID_OPTEE))
#endif
{
+ ti_secure_image_check_binary(p_image, p_size);
ti_secure_image_post_process(p_image, p_size);
}
+#if IS_ENABLED(CONFIG_SYS_K3_SPL_ATF)
+ else
+ ti_secure_image_check_binary(p_image, p_size);
+#endif
}
#endif
void ti_secure_image_post_process(void **p_image, size_t *p_size);
struct ti_sci_handle *get_ti_sci_handle(void);
void do_board_detect(void);
+void ti_secure_image_check_binary(void **p_image, size_t *p_size);
return seq_length + 4;
}
-void ti_secure_image_post_process(void **p_image, size_t *p_size)
+void ti_secure_image_check_binary(void **p_image, size_t *p_size)
{
- struct ti_sci_handle *ti_sci = get_ti_sci_handle();
- struct ti_sci_proc_ops *proc_ops = &ti_sci->ops.proc_ops;
- size_t cert_length;
- u64 image_addr;
u32 image_size;
- int ret;
-
+ size_t cert_length;
image_size = *p_size;
- if (!image_size)
+ if (!image_size) {
+ debug("%s: Image size is %d\n", __func__, image_size);
return;
+ }
if (get_device_type() == K3_DEVICE_TYPE_GP) {
if (ti_secure_cert_detected(*p_image)) {
"This will fail on Security Enforcing(HS-SE) devices\n");
return;
}
+}
+
+void ti_secure_image_post_process(void **p_image, size_t *p_size)
+{
+ struct ti_sci_handle *ti_sci = get_ti_sci_handle();
+ struct ti_sci_proc_ops *proc_ops = &ti_sci->ops.proc_ops;
+ u64 image_addr;
+ u32 image_size;
+ int ret;
+
+ image_size = *p_size;
+ if (!image_size) {
+ debug("%s: Image size is %d\n", __func__, image_size);
+ return;
+ }
+
+ if (get_device_type() != K3_DEVICE_TYPE_HS_SE &&
+ get_device_type() != K3_DEVICE_TYPE_HS_FS)
+ return;
/* Clean out image so it can be seen by system firmware */
image_addr = dma_map_single(*p_image, *p_size, DMA_BIDIRECTIONAL);