arm: mach-omap2: Move common image process functions out of board files
authorAndrew Davis <afd@ti.com>
Thu, 20 Oct 2022 17:12:19 +0000 (12:12 -0500)
committerTom Rini <trini@konsulko.com>
Mon, 12 Dec 2022 19:03:11 +0000 (14:03 -0500)
The functions board_fit_image_post_process() and board_tee_image_process()
are not actually board specific (despite their names). Any board using the
OMAP2 family can use these functions. Move them to boot-common.c.

Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
arch/arm/mach-omap2/boot-common.c
board/ti/am335x/board.c
board/ti/am43xx/board.c
board/ti/am57xx/board.c
board/ti/dra7xx/evm.c

index c463c96..f955d49 100644 (file)
@@ -15,6 +15,7 @@
 #include <spl.h>
 #include <asm/global_data.h>
 #include <asm/omap_common.h>
+#include <asm/omap_sec_common.h>
 #include <asm/arch/omap.h>
 #include <asm/arch/mmc_host_def.h>
 #include <asm/arch/sys_proto.h>
@@ -22,6 +23,7 @@
 #include <scsi.h>
 #include <i2c.h>
 #include <remoteproc.h>
+#include <image.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -331,3 +333,17 @@ void arch_preboot_os(void)
        ahci_reset((void __iomem *)DWC_AHSATA_BASE);
 }
 #endif
+
+#ifdef CONFIG_TI_SECURE_DEVICE
+void board_fit_image_post_process(const void *fit, int node, void **p_image,
+                                 size_t *p_size)
+{
+       secure_boot_verify_image(p_image, p_size);
+}
+
+static void tee_image_process(ulong tee_image, size_t tee_size)
+{
+       secure_tee_install((u32)tee_image);
+}
+U_BOOT_FIT_LOADABLE_HANDLER(IH_TYPE_TEE, tee_image_process);
+#endif
index 9e58281..ecb9fa0 100644 (file)
@@ -33,7 +33,6 @@
 #include <asm/emif.h>
 #include <asm/gpio.h>
 #include <asm/omap_common.h>
-#include <asm/omap_sec_common.h>
 #include <asm/omap_mmc.h>
 #include <i2c.h>
 #include <miiphy.h>
@@ -983,14 +982,6 @@ int board_fit_config_name_match(const char *name)
 }
 #endif
 
-#ifdef CONFIG_TI_SECURE_DEVICE
-void board_fit_image_post_process(const void *fit, int node, void **p_image,
-                                 size_t *p_size)
-{
-       secure_boot_verify_image(p_image, p_size);
-}
-#endif
-
 #if !CONFIG_IS_ENABLED(OF_CONTROL)
 static const struct omap_hsmmc_plat am335x_mmc0_plat = {
        .base_addr = (struct hsmmc *)OMAP_HSMMC1_BASE,
index d0b7a14..87e552a 100644 (file)
@@ -9,7 +9,6 @@
 
 #include <common.h>
 #include <eeprom.h>
-#include <image.h>
 #include <asm/global_data.h>
 #include <dm/uclass.h>
 #include <env.h>
@@ -20,7 +19,6 @@
 #include <linux/errno.h>
 #include <spl.h>
 #include <usb.h>
-#include <asm/omap_sec_common.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/arch/mux.h>
@@ -867,18 +865,3 @@ int embedded_dtb_select(void)
        return 0;
 }
 #endif
-
-#ifdef CONFIG_TI_SECURE_DEVICE
-void board_fit_image_post_process(const void *fit, int node, void **p_image,
-                                 size_t *p_size)
-{
-       secure_boot_verify_image(p_image, p_size);
-}
-
-void board_tee_image_process(ulong tee_image, size_t tee_size)
-{
-       secure_tee_install((u32)tee_image);
-}
-
-U_BOOT_FIT_LOADABLE_HANDLER(IH_TYPE_TEE, board_tee_image_process);
-#endif
index 652c40f..0e57ee5 100644 (file)
@@ -11,7 +11,6 @@
 #include <env.h>
 #include <fastboot.h>
 #include <fdt_support.h>
-#include <image.h>
 #include <init.h>
 #include <malloc.h>
 #include <net.h>
@@ -22,7 +21,6 @@
 #include <errno.h>
 #include <asm/global_data.h>
 #include <asm/omap_common.h>
-#include <asm/omap_sec_common.h>
 #include <asm/emif.h>
 #include <asm/gpio.h>
 #include <asm/arch/gpio.h>
@@ -1197,18 +1195,3 @@ static int board_bootmode_has_emmc(void)
        return 0;
 }
 #endif
-
-#ifdef CONFIG_TI_SECURE_DEVICE
-void board_fit_image_post_process(const void *fit, int node, void **p_image,
-                                 size_t *p_size)
-{
-       secure_boot_verify_image(p_image, p_size);
-}
-
-void board_tee_image_process(ulong tee_image, size_t tee_size)
-{
-       secure_tee_install((u32)tee_image);
-}
-
-U_BOOT_FIT_LOADABLE_HANDLER(IH_TYPE_TEE, board_tee_image_process);
-#endif
index 1c00e25..9cb7e21 100644 (file)
@@ -13,7 +13,6 @@
 #include <env.h>
 #include <fdt_support.h>
 #include <fastboot.h>
-#include <image.h>
 #include <init.h>
 #include <spl.h>
 #include <net.h>
@@ -26,7 +25,6 @@
 #include <usb.h>
 #include <linux/usb/gadget.h>
 #include <asm/omap_common.h>
-#include <asm/omap_sec_common.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/dra7xx_iodelay.h>
 #include <asm/emif.h>
@@ -1063,18 +1061,3 @@ int fastboot_set_reboot_flag(enum fastboot_reboot_reason reason)
        return 0;
 }
 #endif
-
-#ifdef CONFIG_TI_SECURE_DEVICE
-void board_fit_image_post_process(const void *fit, int node, void **p_image,
-                                 size_t *p_size)
-{
-       secure_boot_verify_image(p_image, p_size);
-}
-
-void board_tee_image_process(ulong tee_image, size_t tee_size)
-{
-       secure_tee_install((u32)tee_image);
-}
-
-U_BOOT_FIT_LOADABLE_HANDLER(IH_TYPE_TEE, board_tee_image_process);
-#endif