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 187F2C4708C for ; Tue, 6 Dec 2022 02:34:42 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B2FC7854CB; Tue, 6 Dec 2022 03:34:23 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1670294064; bh=j1QzGRMBXhf+GGUMGwDfIUoT7ihQogdIvXL6OnGclEE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=EWVI5g1VxoTN6TR+LOhfQWk6Z9rD8Ahx6G4DGDsJRbvrDzWi/9WXj9sE2ek2zGUKl jXPjqEWvnkXKEXtJ1hErs3own6h0fqEF2XHD/Bqt1xtaUoiopxqYbaYViN0WQnzR17 hWxFj/fD/vOVLBhONDnaYzvUuoLmn34ASHRRXRIfTuTouLJ8Ujnv7yJ75nOcXT1YC7 WrdFAxOrvFNWYTEdhCqeU1ccASQc6JreOgjQprX2MBdKQwrcJlP0FkL3PWDVCIc1Qd RjQfHr2yFpPd/NOyXcy0flYDwsFmfOnmyrowKbQoUivkq9uhfQVgJczoFuxI5feEW9 jYKduV+loVJ2A== Received: from tr.lan (ip-86-49-120-218.bb.vodafone.cz [86.49.120.218]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 1B2FB85145; Tue, 6 Dec 2022 03:34:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1670294055; bh=j1QzGRMBXhf+GGUMGwDfIUoT7ihQogdIvXL6OnGclEE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qBdptP7bMY2smumvbkxWUL9J2u9J+d3lMZPw5Z6aeT/PWol3hqX3IH7pDxcFommA6 qjUglFdpOVGEppbmZeDV2qpyBqtsWRB42wRPFvBZso7q8QMSRkTIpuYGnqXOfsEwDE H3jgOQosiwRHWnagmnWCkc5QxakN5hAPeXQY4dsRAfa8/2G1Y3UbB596PR12XW52Aq OEZwX2stxWXKcRKz9mUrq/YPEVSGdL1nnqOLY/PQaR5mQkseEvWBlYP1Aes/6itdTH ztqzW2cP6ZH+12Xn15BuRB80ct5oqhUC3sA5PUrpM1yaa3VJFplIVVkms57yCbmpQ/ 6n9TuFc/bFkvQ== From: Marek Vasut To: u-boot@lists.denx.de Cc: Marek Vasut , Alexandru Gagniuc , Patrice Chotard , Patrick Delaunay Subject: [PATCH 3/4] ARM: stm32: Pass ROM API table pointer to U-Boot proper Date: Tue, 6 Dec 2022 03:33:56 +0100 Message-Id: <20221206023357.113361-3-marex@denx.de> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221206023357.113361-1-marex@denx.de> References: <20221206023357.113361-1-marex@denx.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 ROM API table pointer is no longer accessible from U-Boot, fix this by passing the ROM API pointer through. This makes it possible for U-Boot to call ROM API functions to authenticate payload like signed fitImages. Signed-off-by: Marek Vasut --- Cc: Alexandru Gagniuc Cc: Patrice Chotard Cc: Patrick Delaunay --- arch/arm/mach-stm32mp/cpu.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/arch/arm/mach-stm32mp/cpu.c b/arch/arm/mach-stm32mp/cpu.c index fa02a11d867..9553ecd243c 100644 --- a/arch/arm/mach-stm32mp/cpu.c +++ b/arch/arm/mach-stm32mp/cpu.c @@ -22,6 +22,7 @@ #include #include #include +#include /* * early TLB into the .data section so that it not get cleared @@ -413,3 +414,17 @@ uintptr_t get_stm32mp_bl2_dtb(void) { return nt_fw_dtb; } + +#ifdef CONFIG_SPL_BUILD +void jump_to_image_no_args(struct spl_image_info *spl_image) +{ + typedef void __noreturn (*image_entry_noargs_t)(u32 romapi); + uintptr_t romapi = get_stm32mp_rom_api_table(); + + image_entry_noargs_t image_entry = + (image_entry_noargs_t)spl_image->entry_point; + + printf("image entry point: 0x%lx\n", spl_image->entry_point); + image_entry(romapi); +} +#endif -- 2.35.1