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 X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 38585C07E96 for ; Thu, 15 Jul 2021 08:46:24 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 8ED916128D for ; Thu, 15 Jul 2021 08:46:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8ED916128D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 65DF880A22; Thu, 15 Jul 2021 10:46:20 +0200 (CEST) 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=1626338780; bh=YuR2MSjPREM9cB6nw/Sqw3ehCZd0aWt2E+0rmZJRrLo=; h=Subject:To:Cc:References:From:Date:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=WNGNWnbBHMsrLPY/CFS0+SK9cQd6pLQKfg/jzdAri3N0LLdquSFeFXaB+UUoqKVdn VRoeOk421dR6nQLOmkP+i8Vfqtews4Bals3z52t0Cw7JYvhAn42Bpj1eIUAFQJb9eF fdITbFb78338PSU/PsK9C8n9Y+Gx5zFZjhO+peqEMYRtLLHKAzMv+ii5I4PEcbckQq 45xeOy/ad9hbSv0b64WMiiIN/nnGOC1QYaOhro7qSozC84t3yZGfNT4S8ssP8Bdgtv ulk7pJUH24FkSFwOmgHRNvintyIfq5oQqUC3tP4UdP8d3Lsk10Rj3YfnjRSAkpIck4 E0xLgDAVVji1A== Received: by phobos.denx.de (Postfix, from userid 109) id BB86680A22; Thu, 15 Jul 2021 10:46:18 +0200 (CEST) Received: from mout-u-204.mailbox.org (mout-u-204.mailbox.org [91.198.250.253]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id AD19481E53 for ; Thu, 15 Jul 2021 10:46:15 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sr@denx.de Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:105:465:1:1:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-204.mailbox.org (Postfix) with ESMTPS id 4GQSdg4Tv7zQkB9; Thu, 15 Jul 2021 10:46:15 +0200 (CEST) Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter05.heinlein-hosting.de (spamfilter05.heinlein-hosting.de [80.241.56.123]) (amavisd-new, port 10030) with ESMTP id fOHGEBBPd9Hd; Thu, 15 Jul 2021 10:46:12 +0200 (CEST) Subject: Re: [PATCH u-boot-mvebu 20/31] arm: mvebu: Implement return_to_bootrom() via U-Boot's SPL framework To: =?UTF-8?Q?Marek_Beh=c3=ban?= , u-boot@lists.denx.de, Chris Packham , Baruch Siach , Dirk Eibach , Chris Packham Cc: Dennis Gilmore , Mario Six , Jon Nettleton , =?UTF-8?Q?Pali_Roh=c3=a1r?= References: <20210708173032.27999-1-marek.behun@nic.cz> <20210708173032.27999-21-marek.behun@nic.cz> From: Stefan Roese Message-ID: Date: Thu, 15 Jul 2021 10:46:11 +0200 MIME-Version: 1.0 In-Reply-To: <20210708173032.27999-21-marek.behun@nic.cz> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-DE Content-Transfer-Encoding: 8bit X-MBO-SPAM-Probability: X-Rspamd-Score: -5.06 / 15.00 / 15.00 X-Rspamd-Queue-Id: ADBEA18B1 X-Rspamd-UID: dbc9d4 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean On 08.07.21 19:30, Marek Behún wrote: > From: Pali Rohár > > U-Boot's SPL framework already has an API for loading U-Boot via > BootROM. > > Implement the function board_return_to_bootrom() for mvebu SPL code. > > Signed-off-by: Pali Rohár > Reviewed-by: Marek Behún Reviewed-by: Stefan Roese Thanks, Stefan > --- > arch/arm/mach-mvebu/Kconfig | 4 ++++ > arch/arm/mach-mvebu/spl.c | 12 ++++++++++++ > 2 files changed, 16 insertions(+) > > diff --git a/arch/arm/mach-mvebu/Kconfig b/arch/arm/mach-mvebu/Kconfig > index cda65f7478..2133d9a172 100644 > --- a/arch/arm/mach-mvebu/Kconfig > +++ b/arch/arm/mach-mvebu/Kconfig > @@ -257,6 +257,7 @@ config MVEBU_SPL_BOOT_DEVICE_SPI > select SPL_SPI_FLASH_SUPPORT > select SPL_SPI_LOAD > select SPL_SPI_SUPPORT > + select SPL_BOOTROM_SUPPORT > > config MVEBU_SPL_BOOT_DEVICE_MMC > bool "SDIO/MMC card" > @@ -267,14 +268,17 @@ config MVEBU_SPL_BOOT_DEVICE_MMC > select SPL_GPIO_SUPPORT > select SPL_LIBDISK_SUPPORT > select SPL_MMC_SUPPORT > + select SPL_BOOTROM_SUPPORT > > config MVEBU_SPL_BOOT_DEVICE_SATA > bool "SATA" > select SPL_SATA_SUPPORT > select SPL_LIBDISK_SUPPORT > + select SPL_BOOTROM_SUPPORT > > config MVEBU_SPL_BOOT_DEVICE_UART > bool "UART" > + select SPL_BOOTROM_SUPPORT > > endchoice > > diff --git a/arch/arm/mach-mvebu/spl.c b/arch/arm/mach-mvebu/spl.c > index 16ebb7a59e..836eb18889 100644 > --- a/arch/arm/mach-mvebu/spl.c > +++ b/arch/arm/mach-mvebu/spl.c > @@ -79,6 +79,18 @@ u32 spl_boot_device(void) > return get_boot_device(); > } > > +int board_return_to_bootrom(struct spl_image_info *spl_image, > + struct spl_boot_device *bootdev) > +{ > + u32 *regs = *(u32 **)CONFIG_SPL_BOOTROM_SAVE; > + > + printf("Returning to BootROM (return address 0x%08x)...\n", regs[13]); > + return_to_bootrom(); > + > + /* NOTREACHED - return_to_bootrom() does not return */ > + hang(); > +} > + > void board_init_f(ulong dummy) > { > int ret; > Viele Grüße, Stefan -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de