arm: mach-k3: security: Bypass image signing at runtime for GP devices
authorAndrew Davis <afd@ti.com>
Fri, 15 Jul 2022 16:34:34 +0000 (11:34 -0500)
committerTom Rini <trini@konsulko.com>
Thu, 4 Aug 2022 19:32:20 +0000 (15:32 -0400)
We can skip the image authentication check at runtime if the device is GP.
This reduces the delta between GP and HS U-Boot builds. End goal is
to re-unify the two build types into one build that can run on all
device types.

Signed-off-by: Andrew Davis <afd@ti.com>
arch/arm/mach-k3/Makefile
arch/arm/mach-k3/common.c
arch/arm/mach-k3/security.c

index 0dce880..6ac2b61 100644 (file)
@@ -8,7 +8,6 @@ obj-$(CONFIG_SOC_K3_J721S2) += j721s2/
 obj-$(CONFIG_SOC_K3_AM625) += am62x/
 obj-$(CONFIG_ARM64) += arm64-mmu.o
 obj-$(CONFIG_CPU_V7R) += r5_mpu.o lowlevel_init.o
-obj-$(CONFIG_TI_SECURE_DEVICE) += security.o
 obj-$(CONFIG_ARM64) += cache.o
 ifeq ($(CONFIG_SPL_BUILD),y)
 obj-$(CONFIG_SOC_K3_AM654) += am654_init.o
@@ -18,4 +17,4 @@ obj-$(CONFIG_SOC_K3_AM642) += am642_init.o
 obj-$(CONFIG_SOC_K3_AM625) += am625_init.o
 obj-$(CONFIG_K3_LOAD_SYSFW) += sysfw-loader.o
 endif
-obj-y += common.o
+obj-y += common.o security.o
index ac14975..3962f28 100644 (file)
@@ -290,9 +290,7 @@ void board_fit_image_post_process(const void *fit, int node, void **p_image,
        }
 #endif
 
-#if IS_ENABLED(CONFIG_TI_SECURE_DEVICE)
        ti_secure_image_post_process(p_image, p_size);
-#endif
 }
 #endif
 
index 5bfcecd..add7f41 100644 (file)
@@ -41,6 +41,9 @@ void ti_secure_image_post_process(void **p_image, size_t *p_size)
        image_addr = (uintptr_t)*p_image;
        image_size = *p_size;
 
+       if (!image_size || get_device_type() == K3_DEVICE_TYPE_GP)
+               return;
+
        if (get_device_type() != K3_DEVICE_TYPE_HS_SE &&
            !ti_secure_cert_detected(*p_image)) {
                printf("Warning: Did not detect image signing certificate. "