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 208CBC7619A for ; Wed, 12 Apr 2023 08:30:12 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9A93A85FBB; Wed, 12 Apr 2023 10:29:04 +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="LdqaylIL"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D9B8A85FB4; Wed, 12 Apr 2023 10:28:43 +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 19B1A85F92 for ; Wed, 12 Apr 2023 10:28:35 +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=m-chawdhry@ti.com Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 33C8SYuI041009; Wed, 12 Apr 2023 03:28:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1681288114; bh=X81oSEaOZ/Zqo2d3Az04hQ4/+TvhyrssuhPF+cYsZ68=; h=From:Date:Subject:References:In-Reply-To:To:CC; b=LdqaylILd+d0NYxjtbToXfkQGGuWM4VbAL+0STfbdZSK2qJzpKUbP7dbSc0WE9aFJ Y233RytwHpvs4DObDb6qDHJba4FBWkdET0GONv4x1s9l5qXBCFm3zcvbplfa2W4QXN xQiLIQAQsJMFdNUP5wQgT567/Pi7Sm/y+xJuc4zI= Received: from DLEE104.ent.ti.com (dlee104.ent.ti.com [157.170.170.34]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 33C8SYdJ011016 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 12 Apr 2023 03:28:34 -0500 Received: from DLEE105.ent.ti.com (157.170.170.35) by DLEE104.ent.ti.com (157.170.170.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16; Wed, 12 Apr 2023 03:28:34 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DLEE105.ent.ti.com (157.170.170.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16 via Frontend Transport; Wed, 12 Apr 2023 03:28:33 -0500 Received: from [127.0.1.1] (ileaxei01-snat.itg.ti.com [10.180.69.5]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 33C8SAAW098022; Wed, 12 Apr 2023 03:28:32 -0500 From: Manorit Chawdhry Date: Wed, 12 Apr 2023 13:58:07 +0530 Subject: [PATCH 10/10] arm: mach-k3: common: re-locate authentication for atf/optee MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-ID: <20230411-upstream-firewalling-v1-10-44771ffee620@ti.com> References: <20230411-upstream-firewalling-v1-0-44771ffee620@ti.com> In-Reply-To: <20230411-upstream-firewalling-v1-0-44771ffee620@ti.com> To: Tom Rini CC: , Andrew Davis , Vignesh Raghavendra , Kamlesh Gurudasani , Manorit Chawdhry X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1681288090; l=1728; i=m-chawdhry@ti.com; s=20230324; h=from:subject:message-id; bh=F83X1ZytlxduLJn7vAuZTVqcJtoT0tnb/ZeeCwJCnUg=; b=ZRUdGaXJbT5AUyXSrpYt5BGPqqX92KTlvmuuEl2m8Rp/Pf9cagO2wWXaLG3ZE+nuS+EpiNOub RUnqwBmG/V5BfeQIIZ5IpV5wAI61p3cHMcwUaBy84a5cm4Sc4RQ+84A X-Developer-Key: i=m-chawdhry@ti.com; a=ed25519; pk=Z51yAzxWCcDqKRLHiDBrUxIdXbB21R89ms8xgECdiak= 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.8 at phobos.denx.de X-Virus-Status: Clean For setting up the master firewalls present in the K3 SoCs, the arm64 clusters need to be powered on. Re-locates the code for atf/optee authentication. Signed-off-by: Manorit Chawdhry --- arch/arm/mach-k3/common.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-k3/common.c b/arch/arm/mach-k3/common.c index a2adb791f6c0..6e04cc7a24aa 100644 --- a/arch/arm/mach-k3/common.c +++ b/arch/arm/mach-k3/common.c @@ -227,6 +227,21 @@ void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image) if (ret) panic("%s: ATF failed to load on rproc (%d)\n", __func__, ret); + if (IS_ENABLED(CONFIG_FIT_IMAGE_POST_PROCESS) && + IS_ENABLED(CONFIG_SYS_K3_SPL_ATF)) { + for (int i = IMAGE_ID_ATF; i < IMAGE_ID_SPL; i++) { + void *image_addr = + (void *)fit_image_info[i].image_start; + + debug("%s: Authenticating image: addr=%x, size=%d, os=%s\n", + __func__, fit_image_info[i].image_start, + fit_image_info[i].image_len, image_os_match[i]); + + ti_secure_image_post_process(&image_addr, + &fit_image_info[i].image_len); + } + } + if (!fit_image_info[IMAGE_ID_DM_FW].image_len && !(size > 0 && valid_elf_image(loadaddr))) { shut_cpu = 1; @@ -288,9 +303,13 @@ void board_fit_image_post_process(const void *fit, int node, void **p_image, break; } } + /* + * Only DM and the DTBs are being authenticated here, + * rest will be authenticated when A72 cluster is up + */ + if (i >= IMAGE_ID_SPL) #endif - - ti_secure_image_post_process(p_image, p_size); + ti_secure_image_post_process(p_image, p_size); } #endif -- 2.34.1