Skip to contentSkip to conversation

U-Boot-V2: Introduce CONFIG_ARCH_HAS_INIT_LOWLEVEL

PATCH New Menon 2 participants 4 messages May 8, 2008 – May 12, 2008

Subsystems (2)
lore
Share & tools
lore

Menon

#0 lore raw

PATCH 1/1 U-Boot-V2: Introduce CONFIG_ARCH_HAS_INIT_LOWLEVEL

Based on http://sourceforge.net/mailarchive/forum.php?thread_name=20080508151609.GB9467%40pengutronix.de&forum_name=u-boot-users
I am splitting the patches into two. This is the first one for introducing arch specific config.

This introduces CONFIG_ARCH_HAS_INIT_LOWLEVEL which can be enabled for SOC designs which require additional initialization.

arch/arm/cpu/start-arm.S +1 -1
Index: u-boot-v2.git/arch/arm/cpu/start-arm.S
===================================================================
@@ -131,7 +131,7 @@
 	orr	r0,r0,#0xd3
 	msr	cpsr,r0
 
-#ifdef ARCH_HAS_INIT_LOWLEVEL
+#ifdef CONFIG_ARCH_HAS_INIT_LOWLEVEL
 	bl arch_init_lowlevel
 #endif
 	/*
arch/m68k/cpu/start-mcfv4e.S +1 -1
Index: u-boot-v2.git/arch/m68k/cpu/start-mcfv4e.S
===================================================================
@@ -406,7 +406,7 @@
 	 * standard reset vector file, but also do some special things
 	 * required only on their specific CPU.
 	 */
-#ifdef ARCH_HAS_INIT_LOWLEVEL
+#ifdef CONFIG_ARCH_HAS_INIT_LOWLEVEL
 	bsr.l	arch_init_lowlevel
 	nop
 #endif
common/Kconfig +7 -0
Index: u-boot-v2.git/common/Kconfig
===================================================================
@@ -65,6 +65,13 @@
 	  allowing it to relocate to the end of the available RAM. This
 	  way you have the whole memory in a single piece.
 
+config ARCH_HAS_INIT_LOWLEVEL
+	bool "Architecture has low level init"
+	default n
+	help
+	  Architectures that have additional initialization can enable
+	  this functionality.
+
 config PROMPT
 	string
 	prompt "U-Boot command prompt"
#1 lore raw

PATCH 1/1 U-Boot-V2: Introduce CONFIG_ARCH_HAS_INIT_LOWLEVEL

Quoted 38 lines · Nishanth

Based on http://sourceforge.net/mailarchive/forum.php?thread_name=20080508151609.GB9467%40pengutronix.de&forum_name=u-boot-users
I am splitting the patches into two. This is the first one for introducing arch specific config.

This introduces CONFIG_ARCH_HAS_INIT_LOWLEVEL which can be enabled for SOC designs which require additional initialization.

Index: u-boot-v2.git/arch/arm/cpu/start-arm.S
===================================================================

arch/arm/cpu/start-arm.S +1 -1
@@ -131,7 +131,7 @@
 	orr	r0,r0,#0xd3
 	msr	cpsr,r0
 
-#ifdef ARCH_HAS_INIT_LOWLEVEL
+#ifdef CONFIG_ARCH_HAS_INIT_LOWLEVEL
 	bl arch_init_lowlevel
 #endif
 	/*

Index: u-boot-v2.git/arch/m68k/cpu/start-mcfv4e.S
===================================================================

arch/m68k/cpu/start-mcfv4e.S +1 -1
@@ -406,7 +406,7 @@
 	 * standard reset vector file, but also do some special things
 	 * required only on their specific CPU.
 	 */
-#ifdef ARCH_HAS_INIT_LOWLEVEL
+#ifdef CONFIG_ARCH_HAS_INIT_LOWLEVEL
 	bsr.l	arch_init_lowlevel
 	nop
 #endif

Index: u-boot-v2.git/common/Kconfig
===================================================================

common/Kconfig line 74

Quoted 10 lines
common/Kconfig +7 -0
@@ -65,6 +65,13 @@
 	  allowing it to relocate to the end of the available RAM. This
 	  way you have the whole memory in a single piece.
 
+config ARCH_HAS_INIT_LOWLEVEL
+	bool "Architecture has low level init"
+	default n
+	help
+	  Architectures that have additional initialization can enable
+	  this functionality.
+

This won't work out. The user is prompted for a question he cannot answer. The wrong answer will result in a linker error if he says 'yes' here and the architecture does not have a lowlevel init function. Other possibility would be that the user ends up with a unusable U-Boot if he answers 'no' here while the architecture has (and probably needs) a lowlevel init function.
Another problem is that for example powerpc users will be prompted for this option which effectively does nothing.

Moving this to the config system is generally a good idea, but ARCH_HAS_INIT_LOWLEVEL should be an invisible option which gets selected by architectures that actually need it.

Sascha

Signature · 4 lines
Pengutronix e.K. - Linux Solutions for Science and Industry
-----------------------------------------------------------
Kontakt-Informationen finden Sie im Header dieser Mail oder
auf der Webseite -> http://www.pengutronix.de/impressum/ <-
#2 lore raw

PATCH 1/1 U-Boot-V2: Introduce CONFIG_ARCH_HAS_INIT_LOWLEVEL

Sascha,

Quoted 16 lines

-----Original Message-----
From: Sascha Hauer [mailto:s.hauer at pengutronix.de]
Sent: Friday, May 09, 2008 2:45 AM
To: Menon, Nishanth
Cc: u-boot-users at lists.sourceforge.net
Subject: Re: [Patch] U-Boot-V2: Introduce CONFIG_ARCH_HAS_INIT_LOWLEVEL

This won't work out. The user is prompted for a question he cannot answer. The wrong answer will result in a linker error if he says 'yes' here and the architecture does not have a lowlevel init function. Other possibility would be that the user ends up with a unusable U-Boot if he answers 'no' here while the architecture has (and probably needs) a lowlevel init function.
Another problem is that for example powerpc users will be prompted for this option which effectively does nothing.

Quoted 3 lines

Moving this to the config system is generally a good idea, but ARCH_HAS_INIT_LOWLEVEL should be an invisible option which gets selected by architectures that actually need it.

Yes. Accepted. Here is try 2 of the patch.

arch/arm/cpu/start-arm.S +1 -1
Index: u-boot-v2.git/arch/arm/cpu/start-arm.S
===================================================================
@@ -131,7 +131,7 @@
 	orr	r0,r0,#0xd3
 	msr	cpsr,r0
 
-#ifdef ARCH_HAS_INIT_LOWLEVEL
+#ifdef CONFIG_ARCH_HAS_INIT_LOWLEVEL
 	bl arch_init_lowlevel
 #endif
 	/*
arch/m68k/cpu/start-mcfv4e.S +1 -1
Index: u-boot-v2.git/arch/m68k/cpu/start-mcfv4e.S
===================================================================
@@ -406,7 +406,7 @@
 	 * standard reset vector file, but also do some special things
 	 * required only on their specific CPU.
 	 */
-#ifdef ARCH_HAS_INIT_LOWLEVEL
+#ifdef CONFIG_ARCH_HAS_INIT_LOWLEVEL
 	bsr.l	arch_init_lowlevel
 	nop
 #endif
common/Kconfig +3 -0
Index: u-boot-v2.git/common/Kconfig
===================================================================
@@ -65,6 +65,9 @@
 	  allowing it to relocate to the end of the available RAM. This
 	  way you have the whole memory in a single piece.
 
+config ARCH_HAS_INIT_LOWLEVEL
+	bool
+
 config PROMPT
 	string
 	prompt "U-Boot command prompt"
#3 lore raw

PATCH 1/1 U-Boot-V2: Introduce CONFIG_ARCH_HAS_INIT_LOWLEVEL

Sascha,

Quoted 11 lines

-----Original Message-----
From: u-boot-users-bounces at lists.sourceforge.net [mailto:u-boot-users-bounces at lists.sourceforge.net] On Behalf Of Menon, Nishanth
Sent: Friday, May 09, 2008 6:49 AM
To: Sascha Hauer
Cc: u-boot-users at lists.sourceforge.net
Subject: Re: [U-Boot-Users] [Patch] U-Boot-V2: IntroduceCONFIG_ARCH_HAS_INIT_LOWLEVEL

Quoted 3 lines

Moving this to the config system is generally a good idea, but ARCH_HAS_INIT_LOWLEVEL should be an invisible option which gets selected by architectures that actually need it.

Resending the patch with proper subject

arch/arm/cpu/start-arm.S +1 -1
Index: u-boot-v2.git/arch/arm/cpu/start-arm.S
===================================================================
@@ -131,7 +131,7 @@
 	orr	r0,r0,#0xd3
 	msr	cpsr,r0
 
-#ifdef ARCH_HAS_INIT_LOWLEVEL
+#ifdef CONFIG_ARCH_HAS_INIT_LOWLEVEL
 	bl arch_init_lowlevel
 #endif
 	/*
arch/m68k/cpu/start-mcfv4e.S +1 -1
Index: u-boot-v2.git/arch/m68k/cpu/start-mcfv4e.S
===================================================================
@@ -406,7 +406,7 @@
 	 * standard reset vector file, but also do some special things
 	 * required only on their specific CPU.
 	 */
-#ifdef ARCH_HAS_INIT_LOWLEVEL
+#ifdef CONFIG_ARCH_HAS_INIT_LOWLEVEL
 	bsr.l	arch_init_lowlevel
 	nop
 #endif
common/Kconfig +3 -0
Index: u-boot-v2.git/common/Kconfig
===================================================================
@@ -77,6 +77,9 @@
 	  on many platforms. Disabling this option allows configurations to use
 	  U-boot as a second stage boot loader.
 
+config ARCH_HAS_INIT_LOWLEVEL
+	bool
+
 config PROMPT
 	string
 	prompt "U-Boot command prompt"