public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: "Pali Rohár" <pali@kernel.org>
To: Stefan Roese <sr@denx.de>, Marek Behun <marek.behun@nic.cz>
Cc: u-boot@lists.denx.de
Subject: [PATCH 1/5] arm: Add new config option ARCH_VERY_EARLY_INIT
Date: Fri,  6 May 2022 11:05:13 +0200	[thread overview]
Message-ID: <20220506090517.5935-2-pali@kernel.org> (raw)
In-Reply-To: <20220506090517.5935-1-pali@kernel.org>

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 <pali@kernel.org>
---
 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).
  */
-- 
2.20.1


  reply	other threads:[~2022-05-06  9:06 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-06  9:05 [PATCH 0/5] arm: mvebu: turris_omnia: Fix hangup in debug UART Pali Rohár
2022-05-06  9:05 ` Pali Rohár [this message]
2022-05-16  6:37   ` [PATCH 1/5] arm: Add new config option ARCH_VERY_EARLY_INIT Stefan Roese
2022-05-06  9:05 ` [PATCH 2/5] arm: mvebu: Move internal registers in arch_very_early_init() function Pali Rohár
2022-05-06 12:04   ` Stefan Roese
2022-05-06 12:09     ` Pali Rohár
2022-05-06 12:16       ` Stefan Roese
2022-05-06 12:35         ` Stefan Roese
2022-05-06 12:44           ` Pali Rohár
2022-06-01 10:27             ` Pali Rohár
2022-06-01 10:44               ` Stefan Roese
2022-06-01 10:54                 ` Pali Rohár
2022-08-16 18:41                   ` Fix KWBOOT_MSG_RSP_TIMEO_AXP in kwboot for Armada XP Pali Rohár
2022-08-19  7:30                     ` Stefan Roese
2022-08-19  7:34                       ` Pali Rohár
2022-05-16  6:37   ` [PATCH 2/5] arm: mvebu: Move internal registers in arch_very_early_init() function Stefan Roese
2022-05-06  9:05 ` [PATCH 3/5] serial: Add new config option SPL_DEBUG_UART_BASE Pali Rohár
2022-05-16  6:37   ` Stefan Roese
2022-05-06  9:05 ` [PATCH 4/5] serial: ns16550: Add support for SPL_DEBUG_UART_BASE Pali Rohár
2022-05-16  6:38   ` Stefan Roese
2022-05-06  9:05 ` [PATCH 5/5] arm: mvebu: turris_omnia: Fix DEBUG_UART_BASE Pali Rohár
2022-05-06 12:21   ` Stefan Roese
2022-05-06 12:30     ` Pali Rohár
2022-05-09 18:18       ` Pali Rohár
2022-05-16  6:38   ` Stefan Roese
2022-05-09 18:17 ` [PATCH 6/5] arm: mvebu: Fix DEBUG_UART_BASE for all 32-bit boards Pali Rohár
2022-05-16  6:39   ` Stefan Roese
2022-05-16 14:52 ` [PATCH 0/5] arm: mvebu: turris_omnia: Fix hangup in debug UART Stefan Roese
2022-05-16 16:50   ` Pali Rohár
2022-05-16 16:49 ` [PATCH 7/5] serial: Add new config option TPL_DEBUG_UART_BASE Pali Rohár
2022-05-17  7:51   ` Stefan Roese
2022-05-17  7:53 ` [PATCH 0/5] arm: mvebu: turris_omnia: Fix hangup in debug UART Stefan Roese

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220506090517.5935-2-pali@kernel.org \
    --to=pali@kernel.org \
    --cc=marek.behun@nic.cz \
    --cc=sr@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox