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 EA081C63797 for ; Thu, 12 Jan 2023 17:59:28 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BF5B5855BF; Thu, 12 Jan 2023 18:59:12 +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=1673546352; bh=z/oVUdiU03J/bgzSPxKaXqFfCbJsPX8UU5/ZzX7DuEI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=xsnkInFubUtp375JLOY3rwlMf/z1+lV8k516Icxi546jGXg7FZbkT9j7WRgoaJTvL 7mlSjkzNnpW7j/LeP3wCUzX37HdwSmPbzYj+hj7Xy2npwh8VXbuqUdTgsMVAbgaShG 8g3c/XzLE16D+VZrN1YOb1+jcn5yIZDkZ8cs6PtWCInCdVerrp+QMYXzMrSMXOOJpX QZxixEKRt7vyUCKoSJ3gFbFb0HUOWrKbCid8IBRVXc6/hJ46Pf2vxisq8IdI4tl/Yp /YazB8FrKIX/EntM2Z59NHooa0hPwjJ1jXoxl3HDc45dY+fx/PQ4vaevMSvGiOS76Z CC8TUOecsETeA== 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 2E30285408; Thu, 12 Jan 2023 18:58:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1673546339; bh=z/oVUdiU03J/bgzSPxKaXqFfCbJsPX8UU5/ZzX7DuEI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UXfRHAb/TuhXlB/qEX7aBHOChIKc4lnDuYwvzyNtqiHYfvGtNFp4LoixuicQUFifP 2WFNpzu56ZQDdxYM/z3gI7D4hF/mIzMq7k9W7sACWDKznJHu7vVrv0FR81WnUFXkJL AXppdmvdunag5HATGTPGJRNabddrdtD8ZgmuFFaZHbt8O0jhcrswfsVUCMn8eSIaUG 0ZGFQTajKleJ6ZcmvnHaLIMYjx2vBjP4vXh7kKjx6pPgvc83IRTo8an0OOwl9o/OVN AFS+4AgunVFr5w1By2fKz1W+5K2qYs94XEb6KRixh5ZFZFhe8/2DrpIstVfZnYat/n gRrcS3t/33IZw== From: Marek Vasut To: u-boot@lists.denx.de Cc: Marek Vasut , Patrice Chotard , Patrick Delaunay , Alexandru Gagniuc Subject: [PATCH v4 3/4] ARM: stm32: Pass ROM API table pointer to U-Boot proper Date: Thu, 12 Jan 2023 18:58:41 +0100 Message-Id: <20230112175842.25032-3-marex@denx.de> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230112175842.25032-1-marex@denx.de> References: <20230112175842.25032-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. Reviewed-by: Patrice Chotard Reviewed-by: Patrick Delaunay Signed-off-by: Marek Vasut --- Cc: Alexandru Gagniuc Cc: Patrice Chotard Cc: Patrick Delaunay --- V2: - Rename image_entry_noargs_t to image_entry_stm32_t - Add missing __noreturn V3: No change V4: Add RB from Patrick --- 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 ee59866bb73..dc4112d5e6c 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 __noreturn jump_to_image_no_args(struct spl_image_info *spl_image) +{ + typedef void __noreturn (*image_entry_stm32_t)(u32 romapi); + uintptr_t romapi = get_stm32mp_rom_api_table(); + + image_entry_stm32_t image_entry = + (image_entry_stm32_t)spl_image->entry_point; + + printf("image entry point: 0x%lx\n", spl_image->entry_point); + image_entry(romapi); +} +#endif -- 2.39.0