From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 108B6C433FE for ; Thu, 20 Oct 2022 17:12:30 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3CAD584E73; Thu, 20 Oct 2022 19:12:28 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.b="VW7reqwR"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3908484E9D; Thu, 20 Oct 2022 19:12:27 +0200 (CEST) Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id BE92984D94 for ; Thu, 20 Oct 2022 19:12:23 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=afd@ti.com Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 29KHCKHJ125495; Thu, 20 Oct 2022 12:12:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1666285940; bh=5wUUYS6VL58JRBiet+jQlkZKeEwSu7DXiLSZXY3n2Qc=; h=From:To:CC:Subject:Date; b=VW7reqwRDjDRD/nOi5M4v8Qky7DTvevUGPKIy5BaFvDsan6MZJDxTCoeHCvxYvGMC XdyXiVcr9mGeeYQGHOK62UZyJ4ZtHPCz3ZfCHyT39bm6VMiqnOqyOzYzOIiBD5lKNb g62LYbuhnKs94Pa1AOO4CBzn3VuPn9aL7BQ0EZHA= Received: from DLEE113.ent.ti.com (dlee113.ent.ti.com [157.170.170.24]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 29KHCKmi060497 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 20 Oct 2022 12:12:20 -0500 Received: from DLEE111.ent.ti.com (157.170.170.22) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6; Thu, 20 Oct 2022 12:12:20 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE111.ent.ti.com (157.170.170.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6 via Frontend Transport; Thu, 20 Oct 2022 12:12:20 -0500 Received: from ula0226330.dal.design.ti.com (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 29KHCJGC034494; Thu, 20 Oct 2022 12:12:20 -0500 From: Andrew Davis To: Simon Glass , Tom Rini , CC: Andrew Davis Subject: [PATCH] arm: mach-omap2: Move common image process functions out of board files Date: Thu, 20 Oct 2022 12:12:19 -0500 Message-ID: <20221020171219.1482-1-afd@ti.com> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean 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 b97fedddd5..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