Re: [PATCH] arm: mach-omap2: Move common image process functions out of board files

2022-12-12 Thread Tom Rini
On Thu, Oct 20, 2022 at 12:12:19PM -0500, Andrew Davis wrote:

> 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 
> Reviewed-by: Tom Rini 

Applied to u-boot/next, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH] arm: mach-omap2: Move common image process functions out of board files

2022-10-21 Thread Tom Rini
On Thu, Oct 20, 2022 at 12:12:19PM -0500, Andrew Davis wrote:

> 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 

Reviewed-by: Tom Rini 

-- 
Tom


signature.asc
Description: PGP signature


[PATCH] arm: mach-omap2: Move common image process functions out of board files

2022-10-20 Thread Andrew Davis
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 
---
 arch/arm/mach-omap2/boot-common.c | 16 
 board/ti/am335x/board.c   |  9 -
 board/ti/am43xx/board.c   | 17 -
 board/ti/am57xx/board.c   | 17 -
 board/ti/dra7xx/evm.c | 17 -
 5 files changed, 16 insertions(+), 60 deletions(-)

diff --git a/arch/arm/mach-omap2/boot-common.c 
b/arch/arm/mach-omap2/boot-common.c
index c463c96c74..f955d49471 100644
--- a/arch/arm/mach-omap2/boot-common.c
+++ b/arch/arm/mach-omap2/boot-common.c
@@ -15,6 +15,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -22,6 +23,7 @@
 #include 
 #include 
 #include 
+#include 
 
 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
diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c
index b97fe5..2a09b6480b 100644
--- a/board/ti/am335x/board.c
+++ b/board/ti/am335x/board.c
@@ -33,7 +33,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -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,
diff --git a/board/ti/am43xx/board.c b/board/ti/am43xx/board.c
index 529129ecc7..9fa894d700 100644
--- a/board/ti/am43xx/board.c
+++ b/board/ti/am43xx/board.c
@@ -9,7 +9,6 @@
 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -20,7 +19,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -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
diff --git a/board/ti/am57xx/board.c b/board/ti/am57xx/board.c
index cfc825e52a..511c44104e 100644
--- a/board/ti/am57xx/board.c
+++ b/board/ti/am57xx/board.c
@@ -11,7 +11,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -22,7 +21,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -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
diff --git a/board/ti/dra7xx/evm.c b/board/ti/dra7xx/evm.c
index a854d615c1..0b1fc99b94 100644
--- a/board/ti/dra7xx/evm.c
+++ b/board/ti/dra7xx/evm.c
@@ -13,7 +13,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -26,7 +25,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -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
-- 
2.37.3