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 12C25C433EF for ; Mon, 16 May 2022 06:37:38 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8A3E88395F; Mon, 16 May 2022 08:37:36 +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=1652683056; bh=sGCVq8Bz3uhjxJE6NLsRv/YszQ+7wZp4QEcWeaS+Ql8=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=YKq/31MKgt52f0miCFU3JmbcGLWvva4rnNPWVe7rnw+l811h6lFxv8oXTO5kYXhXs +sJFFPem4vrqBpciWEGwdAABmNFh0RGpYyM6EaBSx3Lmk6YQwl+v/2nI0RvK7oaTsm DVtfrrQYf7YzhP4qblxlha5eHrYsONjrj6ojmZU66zmdPYWJahUsaIaOPs+trOVe6o TILJoqblzqsne+Qi/24xMDC15DZojIwZDaWn9RHBtxK1tfZSQ2HeqTbRLemKHqCKga WiOMn3PMeUJwO4dzfuEhUz24tLYIkUU554eTic+0pW6bCaoWYgxbHtdYCTXFJi11En UjPp1pAvBi90w== Received: by phobos.denx.de (Postfix, from userid 109) id DB82B832C3; Mon, 16 May 2022 08:37:34 +0200 (CEST) Received: from mout-u-107.mailbox.org (mout-u-107.mailbox.org [IPv6:2001:67c:2050:101:465::107]) (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 54210832C3 for ; Mon, 16 May 2022 08:37:32 +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 smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:b231:465::2]) (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-107.mailbox.org (Postfix) with ESMTPS id 4L1qLH2lNTz9syc; Mon, 16 May 2022 08:37:27 +0200 (CEST) Message-ID: Date: Mon, 16 May 2022 08:37:26 +0200 MIME-Version: 1.0 Subject: Re: [PATCH 1/5] arm: Add new config option ARCH_VERY_EARLY_INIT Content-Language: en-US To: =?UTF-8?Q?Pali_Roh=c3=a1r?= , Marek Behun Cc: u-boot@lists.denx.de References: <20220506090517.5935-1-pali@kernel.org> <20220506090517.5935-2-pali@kernel.org> From: Stefan Roese In-Reply-To: <20220506090517.5935-2-pali@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4L1qLH2lNTz9syc 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.5 at phobos.denx.de X-Virus-Status: Clean On 06.05.22 11:05, Pali Rohár wrote: > When this option is set then ARM _main() function would call > arch_very_early_init() function at the beginning. It would be before > calling any other functions like debug_uart_init() and also before > initializing C runtime environment. > > Signed-off-by: Pali Rohár Reviewed-by: Stefan Roese Thanks, Stefan > --- > arch/arm/Kconfig | 6 ++++++ > arch/arm/lib/crt0.S | 5 +++++ > 2 files changed, 11 insertions(+) > > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig > index 0afec5155b1b..9898c7d68e1b 100644 > --- a/arch/arm/Kconfig > +++ b/arch/arm/Kconfig > @@ -401,6 +401,12 @@ config SYS_ARM_CACHE_WRITEALLOC > write is performed. > endchoice > > +config ARCH_VERY_EARLY_INIT > + bool > + > +config SPL_ARCH_VERY_EARLY_INIT > + bool > + > config ARCH_CPU_INIT > bool "Enable ARCH_CPU_INIT" > help > diff --git a/arch/arm/lib/crt0.S b/arch/arm/lib/crt0.S > index ba312901f331..612a2d5b698e 100644 > --- a/arch/arm/lib/crt0.S > +++ b/arch/arm/lib/crt0.S > @@ -90,6 +90,11 @@ clbss_l:cmp r0, r1 /* while not at end of BSS */ > > ENTRY(_main) > > +/* Call arch_very_early_init before initializing C runtime environment. */ > +#if CONFIG_IS_ENABLED(ARCH_VERY_EARLY_INIT) > + bl arch_very_early_init > +#endif > + > /* > * Set up initial C runtime environment and call board_init_f(0). > */ Viele Grüße, Stefan Roese -- 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