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 91108C3A5A7 for ; Tue, 6 Dec 2022 22:50:07 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 235DF854D4; Tue, 6 Dec 2022 23:49:47 +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=1670366987; bh=7eH8Ug7UcQrFwi4+ob9eEr/pMJgECTMKBFoi81E9gVc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=yLPE7PXsDc9XjiSKBDtgRS1+fBAO08HHpxP+TdL+SkQWcGf+G9B3+0Y218KVkQUc4 pz92bJ+AQG4oc76C1s9yuL2SLe550NN8AZ1Q2e1ufRO/1xYeDfrH3KMCgKUB8tnqNV FFTVirwDEfDG9OmN6KrwJpvUj+Ch1iOlUNtcJPzDNa5VooL7XfpZMtOpePdihOUx+1 adxbVA45Vdng14q4V/BA9v32odMhvcHj9yolhf2x5vSDDw/7LYhQmD948w8OD3ObNm siI0Ty6fnOQvHUiYfrhtUupiAZE9nTN5i2G0wumh96Qjaiy5lOYhQ2LkGGXOVcEB+f 9ozOE5ctLd7fg== 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 EDCCF84931; Tue, 6 Dec 2022 23:49:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1670366979; bh=7eH8Ug7UcQrFwi4+ob9eEr/pMJgECTMKBFoi81E9gVc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d6Nsv+urMozNdOJg4NspZSJqDFdJqq6r7eaPz+JJswqRI1x134eys/XqMULbjHCvF seKrzp4/hjm86eLZCUIiQZSl2+GH5WSBDZ6GtsT68ZDY6rDIZhAM68NPScvksBjSG9 SG+xf0lUpBKEOQjvXlSzNJIFjmJxf9JEnL+BXEH/QlA0k34lDXBBQltH3FE9oX5AOx xSx03lGz/5loUKa+wgBSkR96BTE+lWVKznam6KmNQdr8lC3/Zz++UGBJwnM3IUZSji v4VNWe7+yp2ZTH9FmVSN8yxfI0QBGVzlB6RcZiZP6tUZvkp226MWb6OWvLmZQEliFb MV6fF9DBPbpyQ== From: Marek Vasut To: u-boot@lists.denx.de Cc: Marek Vasut , Alexandru Gagniuc , Patrice Chotard , Patrick Delaunay Subject: [PATCH v2 3/4] ARM: stm32: Pass ROM API table pointer to U-Boot proper Date: Tue, 6 Dec 2022 23:49:28 +0100 Message-Id: <20221206224929.33015-3-marex@denx.de> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221206224929.33015-1-marex@denx.de> References: <20221206224929.33015-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 --- V2: - Rename image_entry_noargs_t to image_entry_stm32_t - Add missing __noreturn --- 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.35.1