Skip to contentSkip to conversation

U-Boot-V2: Replace CONFIG_SKIP_LOWLEVEL_INIT with CONFIG_MACH_HAS_INIT_LOWLEVEL

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

Subsystems (2)
lore
Share & tools
lore

Menon

#0 lore raw

PATCH 1/1 U-Boot-V2: Replace CONFIG_SKIP_LOWLEVEL_INIT with CONFIG_MACH_HAS_INIT_LOWLEVEL

Hi Sascha,
Based on http://sourceforge.net/mailarchive/forum.php?thread_name=20080508151609.GB9467%40pengutronix.de&forum_name=u-boot-users
This is the second separate patch which introducing Machine dependent init lowlevel config.

Regards,
Nishanth Menon

This introduces CONFIG_MACH_HAS_INIT_LOWLEVEL which is the opposite of the current CONFIG_SKIP_LOWLEVEL_INIT. CONFIG_SKIP_LOWLEVEL_INIT which was used by ARM platform configurations previously, is made platform independent configuration.

CONFIG_MACH_HAS_INIT_LOWLEVEL can be enabled to do board level initialization and disabled to allow U-Boot to function as the second level boot loader in certain scenarios by skipping SDRAM initialization.

arch/arm/cpu/start-arm.S +1 -1
Index: u-boot-v2.git/arch/arm/cpu/start-arm.S
===================================================================
@@ -156,7 +156,7 @@
 	 * because memory timing is board-dependend, you will
 	 * find a lowlevel_init.S in your board directory.
 	 */
-#ifndef CONFIG_SKIP_LOWLEVEL_INIT
+#ifdef CONFIG_MACH_HAS_INIT_LOWLEVEL
 	bl	board_init_lowlevel
 #endif
 
arch/m68k/cpu/start-mcfv4e.S +2 -2
Index: u-boot-v2.git/arch/m68k/cpu/start-mcfv4e.S
===================================================================
@@ -448,7 +448,7 @@
 	 *
 	 * Do not jump/call other u-boot code here!
 	 */
-#ifndef CONFIG_SKIP_LOWLEVEL_INIT
+#ifdef CONFIG_MACH_HAS_INIT_LOWLEVEL
 	bsr.l	board_init_lowlevel
 	nop
 #endif
@@ -512,7 +512,7 @@
 	nop
 #endif
 
-#ifndef CONFIG_SKIP_LOWLEVEL_INIT
+#ifdef CONFIG_MACH_HAS_INIT_LOWLEVEL
 	/*
 	 * Call other half of initcode in relocated code
 	 *
common/Kconfig +8 -8
Index: u-boot-v2.git/common/Kconfig
===================================================================
@@ -72,6 +72,14 @@
 	  Architectures that have additional initialization can enable
 	  this functionality.
 
+config MACH_HAS_INIT_LOWLEVEL
+	bool
+	default y
+	prompt "Board has low level init"
+	help
+	  This entry skips the SDRAM initialising on many platforms.
+	  It enables using U-boot as a second stage bootloader.
+
 config PROMPT
 	string
 	prompt "U-Boot command prompt"
@@ -223,14 +231,6 @@
 	help
 	  Enable build of u-boot with -g.
 
-config SKIP_LOWLEVEL_INIT
-	bool
-	depends on ARM
-	prompt "Skip lowlevel init"
-	help
-	  This entry skips the SDRAM initialising on many ARM based boards.
-	  It enables using U-boot as a second stage bootloader.
-
 config ENABLE_FLASH_NOISE
 	bool
 	prompt "verbose flash handling"
arch/arm/configs/netx_nxdb500_defconfig +1 -1
Index: u-boot-v2.git/arch/arm/configs/netx_nxdb500_defconfig
===================================================================
@@ -29,6 +29,7 @@
 # General Settings              
 #
 CONFIG_BROKEN=y
+# CONFIG_MACH_HAS_INIT_LOWLEVEL is not set
 CONFIG_PROMPT="uboot:"
 CONFIG_BAUDRATE=115200
 CONFIG_CMDLINE_EDITING=y
@@ -48,7 +49,6 @@
 #
 # Debugging                     
 #
-CONFIG_SKIP_LOWLEVEL_INIT=y
 
 #
 # Commands                      
arch/arm/configs/pcm037_defconfig +1 -1
Index: u-boot-v2.git/arch/arm/configs/pcm037_defconfig
===================================================================
@@ -33,6 +33,7 @@
 CONFIG_TEXT_BASE=0x87f00000
 # CONFIG_BROKEN is not set
 # CONFIG_EXPERIMENTAL is not set
+# CONFIG_MACH_HAS_INIT_LOWLEVEL is not set
 CONFIG_PROMPT="uboot:"
 CONFIG_BAUDRATE=115200
 CONFIG_CMDLINE_EDITING=y
@@ -54,7 +55,6 @@
 #
 # Debugging                     
 #
-CONFIG_SKIP_LOWLEVEL_INIT=y
 # CONFIG_ENABLE_FLASH_NOISE is not set
 # CONFIG_ENABLE_PARTITION_NOISE is not set
 # CONFIG_ENABLE_DEVICE_NOISE is not set
arch/arm/configs/pcm038_defconfig +1 -1
Index: u-boot-v2.git/arch/arm/configs/pcm038_defconfig
===================================================================
@@ -36,6 +36,7 @@
 CONFIG_TEXT_BASE=0xa7f00000
 # CONFIG_BROKEN is not set
 # CONFIG_EXPERIMENTAL is not set
+CONFIG_MACH_HAS_INIT_LOWLEVEL=y
 CONFIG_PROMPT="uboot:"
 CONFIG_BAUDRATE=115200
 CONFIG_CMDLINE_EDITING=y
@@ -58,7 +59,6 @@
 # Debugging                     
 #
 # CONFIG_DEBUG_INFO is not set
-# CONFIG_SKIP_LOWLEVEL_INIT is not set
 # CONFIG_ENABLE_FLASH_NOISE is not set
 # CONFIG_ENABLE_PARTITION_NOISE is not set
 # CONFIG_ENABLE_DEVICE_NOISE is not set
arch/arm/configs/scb9328_defconfig +1 -1
Index: u-boot-v2.git/arch/arm/configs/scb9328_defconfig
===================================================================
@@ -34,6 +34,7 @@
 CONFIG_TEXT_BASE=0x08f80000
 # CONFIG_BROKEN is not set
 # CONFIG_EXPERIMENTAL is not set
+# CONFIG_MACH_HAS_INIT_LOWLEVEL is not set
 CONFIG_PROMPT="uboot:"
 CONFIG_BAUDRATE=115200
 CONFIG_CMDLINE_EDITING=y
@@ -55,7 +56,6 @@
 #
 # Debugging                     
 #
-CONFIG_SKIP_LOWLEVEL_INIT=y
 # CONFIG_ENABLE_FLASH_NOISE is not set
 # CONFIG_ENABLE_PARTITION_NOISE is not set
 # CONFIG_ENABLE_DEVICE_NOISE is not set
#1 lore raw

PATCH 1/1 U-Boot-V2: Replace CONFIG_SKIP_LOWLEVEL_INIT with CONFIG_MACH_HAS_INIT_LOWLEVEL

Quoted 54 lines · Nishanth

Hi Sascha,
Based on http://sourceforge.net/mailarchive/forum.php?thread_name=20080508151609.GB9467%40pengutronix.de&forum_name=u-boot-users
This is the second separate patch which introducing Machine dependent init lowlevel config.

Regards,
Nishanth Menon

This introduces CONFIG_MACH_HAS_INIT_LOWLEVEL which is the opposite of the current CONFIG_SKIP_LOWLEVEL_INIT. CONFIG_SKIP_LOWLEVEL_INIT which was used by ARM platform configurations previously, is made platform independent configuration.

CONFIG_MACH_HAS_INIT_LOWLEVEL can be enabled to do board level initialization and disabled to allow U-Boot to function as the second level boot loader in certain scenarios by skipping SDRAM initialization.

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

arch/arm/cpu/start-arm.S +1 -1
@@ -156,7 +156,7 @@
 	 * because memory timing is board-dependend, you will
 	 * find a lowlevel_init.S in your board directory.
 	 */
-#ifndef CONFIG_SKIP_LOWLEVEL_INIT
+#ifdef CONFIG_MACH_HAS_INIT_LOWLEVEL
 	bl	board_init_lowlevel
 #endif
 

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

arch/m68k/cpu/start-mcfv4e.S +2 -2
@@ -448,7 +448,7 @@
 	 *
 	 * Do not jump/call other u-boot code here!
 	 */
-#ifndef CONFIG_SKIP_LOWLEVEL_INIT
+#ifdef CONFIG_MACH_HAS_INIT_LOWLEVEL
 	bsr.l	board_init_lowlevel
 	nop
 #endif
@@ -512,7 +512,7 @@
 	nop
 #endif
 
-#ifndef CONFIG_SKIP_LOWLEVEL_INIT
+#ifdef CONFIG_MACH_HAS_INIT_LOWLEVEL
 	/*
 	 * Call other half of initcode in relocated code
 	 *

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

common/Kconfig +0 -0
@@ -72,6 +72,14 @@
 	  Architectures that have additional initialization can enable

common/Kconfig line 82

Quoted 10 lines
common/Kconfig +8 -0
 	  this functionality.
 
+config MACH_HAS_INIT_LOWLEVEL
+	bool
+	default y
+	prompt "Board has low level init"
+	help
+	  This entry skips the SDRAM initialising on many platforms.
+	  It enables using U-boot as a second stage bootloader.
+

This has the same problems as stated in my last mail about ARCH_HAS_INIT_LOWLEVEL, although the situation is slightly different here.
The user cannot decide whether the machine actually _has_ a lowlevel init function, it simply has or has not. The user only can decide whether he wants to use it after reading the help text (which describes the situation the wrong way around btw).

I have a feeling that this option is unnessecary anyway because when you look at the board_init_lowlevel functions you'll see that the board code detects at runtime whether or not they run from SDRAM and thus have to skip initialization. This way you can start the same U-Boot binary from SDRAM Flash or whatever which is a convenient thing to have.

I tend to remove these two options completely. Architectures and boards which do not need lowlevel init functions can just provide an empty function here. If we end up introducing many similar options on a board or architecture level we can still decide to turn them into common options.

So far arch_init_lowlevel is unused. I only introduced it because the original start.S had some S3C2400 #ifdefs here and I did not want to encourage anyone to put more architecture dependent stuff here.

BTW you can skip the defconfig bits in your patches. It's probably better when I regenerate them from time to time myself because otherwise we'll increase the risk of merge conflicts.

Regards,
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: Replace CONFIG_SKIP_LOWLEVEL_INIT with CONFIG_MACH_HAS_INIT_LOWLEVEL

Sascha,

Quoted 7 lines

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

Quoted 5 lines

This has the same problems as stated in my last mail about ARCH_HAS_INIT_LOWLEVEL, although the situation is slightly different here.
The user cannot decide whether the machine actually _has_ a lowlevel init function, it simply has or has not.

You are missing the requirement of having to do a second level boot. I may choose not to enable board level initialization in a specific configuration for the same platform. The requirement I have in OMAP is this: boot up tiny u-boot (very minimal functionality, which needs to be less than 32K) which does SDRAM init (among other things), load the normal u-boot (around 200-400K) from UART, USB, NAND or ONENAND to SDRAM, and give control to it. In the "Normal functionality" U-Boot I'd not want to do a SDRAM and additional arch and board initialization - something that is redundant as it is already done by the tiny u-boot. Now I can also have a configuration for U-Boot booting from NOR. In that case, I'd want SDRAM initialization to be done. In such a case, the user should have the flexibility to be able to enable/disable board low level initialization while creating multiple configurations. All of these configurations are for the same board and same architecture.

Quoted 3 lines

The user only can decide
whether he wants to use it after reading the help text (which describes the situation the wrong way around btw).

Yep. will fix it.

Quoted 6 lines

I have a feeling that this option is unnessecary anyway because when you look at the board_init_lowlevel functions you'll see that the board code detects at runtime whether or not they run from SDRAM and thus have to skip initialization. This way you can start the same U-Boot binary from SDRAM Flash or whatever which is a convenient thing to have.

It may not just be SDRAM initialization that I'd choose to do in a board level initialization. This could be a sizeable code in some cases. There is no need to duplicate functionality (in the case of two stage boot) if we can provide a method for a board developer to isolate his/her code out in the required configurations.

Quoted 5 lines

I tend to remove these two options completely. Architectures and boards which do not need lowlevel init functions can just provide an empty function here. If we end up introducing many similar options on a board or architecture level we can still decide to turn them into common options.

I do not agree to it. ARCH_INIT_LOWLEVEL makes complete sense in terms of a config option. Why would we want to force 50 odd ARM based developers to write dummy functions when just one or two folks need it? On MACH_INIT_LOWLEVEL I have explained above.

Quoted 9 lines

So far arch_init_lowlevel is unused. I only introduced it because the original start.S had some S3C2400 #ifdefs here and I did not want to encourage anyone to put more architecture dependent stuff here.

BTW you can skip the defconfig bits in your patches. It's probably better when I regenerate them from time to time myself because otherwise we'll increase the risk of merge conflicts.

I provided it to handle the inverted case of SKIP_LOWLEVEL Vs HAS_LOWLEVEL. Just trying to be helpful ;)..

Regards,
Nishanth Menon

#3 lore raw

PATCH 1/1 U-Boot-V2: Replace CONFIG_SKIP_LOWLEVEL_INIT with CONFIG_MACH_HAS_INIT_LOWLEVEL

Quoted 14 lines · Nishanth

Sascha,

Quoted 7 lines

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

Quoted 5 lines

This has the same problems as stated in my last mail about ARCH_HAS_INIT_LOWLEVEL, although the situation is slightly different here.
The user cannot decide whether the machine actually _has_ a lowlevel init function, it simply has or has not.

Quoted 16 lines

You are missing the requirement of having to do a second level boot. I may choose not to enable board level initialization in a specific configuration for the same platform. The requirement I have in OMAP is
this: boot up tiny u-boot (very minimal functionality, which needs to be less than 32K) which does SDRAM init (among other things), load the normal u-boot (around 200-400K) from UART, USB, NAND or ONENAND to SDRAM, and give control to it. In the "Normal functionality" U-Boot I'd not want to do a SDRAM and additional arch and board initialization - something that is redundant as it is already done by the tiny u-boot. Now I can also have a configuration for U-Boot booting from NOR. In that case, I'd want SDRAM initialization to be done. In such a case, the user should have the flexibility to be able to enable/disable board low level initialization while creating multiple configurations. All of these configurations are for the same board and same architecture.

OK, can we agree on the following then?

config MACH_DO_LOWLEVEL_INIT
bool "run machine lowlevel init"
depends on MACH_HAS_LOWLEVEL_INIT
default y

Quoted 10 lines
Quoted 5 lines

I tend to remove these two options completely. Architectures and boards which do not need lowlevel init functions can just provide an empty function here. If we end up introducing many similar options on a board or architecture level we can still decide to turn them into common options.

I do not agree to it. ARCH_INIT_LOWLEVEL makes complete sense in terms of a config option. Why would we want to force 50 odd ARM based developers to write dummy functions when just one or two folks need it? On MACH_INIT_LOWLEVEL I have explained above.

You're right.

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/ <-
#4 lore raw

PATCH v2 1/1 U-Boot-V2: Replace CONFIG_SKIP_LOWLEVEL_INIT with CONFIG_MACH_HAS_INIT_LOWLEVEL

Sascha,

Quoted 24 lines

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

Quoted 7 lines

You are missing the requirement of having to do a second level boot. I may choose not to enable board level initialization in a specific configuration for the same platform. The requirement I have in OMAP is
this: boot up tiny u-boot (very minimal functionality, which needs to be less than 32K) which does SDRAM init (among other things), load the normal u-boot (around 200-400K) from UART, USB, NAND or ONENAND to SDRAM, and give control to it. In the "Normal functionality" U-Boot

Quoted 9 lines

I'd not want to do a SDRAM and additional arch and board initialization - something that is redundant as it is already done by the tiny u-boot. Now I can also have a configuration for U-Boot booting from NOR. In that case, I'd want SDRAM initialization to be done. In such a case, the user should have the flexibility to be able to enable/disable board low level initialization while creating multiple configurations. All of these configurations are for the same board and same architecture.

Quoted 6 lines

OK, can we agree on the following then?

config MACH_DO_LOWLEVEL_INIT
bool "run machine lowlevel init"
depends on MACH_HAS_LOWLEVEL_INIT
default y

Yes. It is a good idea. I have searched thru the boards and have the following revisited patch:

arch/arm/cpu/start-arm.S +1 -1
Index: u-boot-v2.git/arch/arm/cpu/start-arm.S
===================================================================
@@ -156,7 +156,7 @@
 	 * because memory timing is board-dependend, you will
 	 * find a lowlevel_init.S in your board directory.
 	 */
-#ifndef CONFIG_SKIP_LOWLEVEL_INIT
+#ifdef CONFIG_MACH_DO_LOWLEVEL_INIT
 	bl	board_init_lowlevel
 #endif
 
arch/m68k/cpu/start-mcfv4e.S +2 -2
Index: u-boot-v2.git/arch/m68k/cpu/start-mcfv4e.S
===================================================================
@@ -448,7 +448,7 @@
 	 *
 	 * Do not jump/call other u-boot code here!
 	 */
-#ifndef CONFIG_SKIP_LOWLEVEL_INIT
+#ifdef CONFIG_MACH_DO_LOWLEVEL_INIT
 	bsr.l	board_init_lowlevel
 	nop
 #endif
@@ -512,7 +512,7 @@
 	nop
 #endif
 
-#ifndef CONFIG_SKIP_LOWLEVEL_INIT
+#ifdef CONFIG_MACH_DO_LOWLEVEL_INIT
 	/*
 	 * Call other half of initcode in relocated code
 	 *
common/Kconfig +12 -8
Index: u-boot-v2.git/common/Kconfig
===================================================================
@@ -68,6 +68,18 @@
 config ARCH_HAS_INIT_LOWLEVEL
 	bool
 
+config MACH_HAS_INIT_LOWLEVEL
+	bool
+
+config MACH_DO_LOWLEVEL_INIT
+	bool "run machine low-level init"
+	depends on MACH_HAS_LOWLEVEL_INIT
+	default y
+	help
+	  This entry enables SDRAM and other board low level initialization
+	  on many platforms. Disabling this option allows configurations to use
+	  U-boot as a second stage boot loader.
+
 config PROMPT
 	string
 	prompt "U-Boot command prompt"
@@ -219,14 +231,6 @@
 	help
 	  Enable build of u-boot with -g.
 
-config SKIP_LOWLEVEL_INIT
-	bool
-	depends on ARM
-	prompt "Skip lowlevel init"
-	help
-	  This entry skips the SDRAM initializing on many ARM based boards.
-	  It enables using U-boot as a second stage boot loader.
-
 config ENABLE_FLASH_NOISE
 	bool
 	prompt "verbose flash handling"
arch/arm/Kconfig +4 -0
Index: u-boot-v2.git/arch/arm/Kconfig
===================================================================
@@ -89,6 +89,7 @@
 	select HAS_DM9000
 	select HAS_CFI
 	select ARCH_IMX1
+	select MACH_HAS_INIT_LOWLEVEL
 	help
 	  Say Y here if you are using the Synertronixx scb9328 board
 
@@ -96,6 +97,7 @@
 	bool "phyCORE-i.MX27"
 	select HAS_CFI
 	select ARCH_IMX27
+	select MACH_HAS_INIT_LOWLEVEL
 	help
 	  Say Y here if you are using Phytec's phyCORE-i.MX27 (pcm038) equipped
 	  with a Freescale i.MX27 Processor
@@ -104,6 +106,7 @@
 	bool "Freescale i.MX27ADS"
 	select HAS_CFI
 	select ARCH_IMX27
+	select MACH_HAS_INIT_LOWLEVEL
 	help
 	  Say Y here if you are using the Freescale i.MX27ads board equipped
 	  with a Freescale i.MX27 Processor
@@ -121,6 +124,7 @@
 	select HAS_NETX_ETHER
 	select HAS_CFI
 	select ARCH_NETX
+	select MACH_HAS_INIT_LOWLEVEL
 	help
 	  Say Y here if you are using the Hilscher Netx nxdb500 board
 
arch/m68k/Kconfig +4 -0
Index: u-boot-v2.git/arch/m68k/Kconfig
===================================================================
@@ -84,6 +84,7 @@
 	bool "konzeptpark UKD R1 + phyCore MCF5475 NUM"
 	select HAS_CFI
 	select ARCH_MCF54xx
+	select MACH_HAS_INIT_LOWLEVEL
 	help
 	  Say Y here if you are using the konzeptpark UKD R1 with a
 	  Phytec Phycore PCM-024-NUM equipped with a Freescale MC5475 Processor
@@ -108,6 +109,7 @@
 	bool "Phytec pcm982 + phyCore MCF5485"
 	select HAS_CFI
 	select ARCH_MCF54xx
+	select MACH_HAS_INIT_LOWLEVEL
 	help
 	  Say Y here if you are using the Phytec Phycore PCM-024 equipped
 	  with a Freescale MC5485 Processor
@@ -116,6 +118,7 @@
 	bool "Phytec pcm982 + phyCore MCF5475"
 	select HAS_CFI
 	select ARCH_MCF54xx
+	select MACH_HAS_INIT_LOWLEVEL
 	help
 	  Say Y here if you are using the Phytec Phycore PCM-024 equipped
 	  with a Freescale MC5475 Processor
@@ -124,6 +127,7 @@
 	bool "Phytec pcm982 + phyCore MCF5475 NUM"
 	select HAS_CFI
 	select ARCH_MCF54xx
+	select MACH_HAS_INIT_LOWLEVEL
 	help
 	  Say Y here if you are using the Phytec Phycore PCM-024 equipped
 	  with a Freescale MC5475 Processor (NUM Variant)
#5 lore raw

PATCH v2 1/1 U-Boot-V2: Replace CONFIG_SKIP_LOWLEVEL_INIT with CONFIG_MACH_HAS_INIT_LOWLEVEL

Quoted 76 lines · Nishanth

Sascha,

Quoted 24 lines

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

Quoted 7 lines

You are missing the requirement of having to do a second level boot. I may choose not to enable board level initialization in a specific configuration for the same platform. The requirement I have in OMAP is
this: boot up tiny u-boot (very minimal functionality, which needs to be less than 32K) which does SDRAM init (among other things), load the normal u-boot (around 200-400K) from UART, USB, NAND or ONENAND to SDRAM, and give control to it. In the "Normal functionality" U-Boot

Quoted 9 lines

I'd not want to do a SDRAM and additional arch and board initialization - something that is redundant as it is already done by the tiny u-boot. Now I can also have a configuration for U-Boot booting from NOR. In that case, I'd want SDRAM initialization to be done. In such a case, the user should have the flexibility to be able to enable/disable board low level initialization while creating multiple configurations. All of these configurations are for the same board and same architecture.

Quoted 6 lines

OK, can we agree on the following then?

config MACH_DO_LOWLEVEL_INIT
bool "run machine lowlevel init"
depends on MACH_HAS_LOWLEVEL_INIT
default y

Yes. It is a good idea. I have searched thru the boards and have the following revisited patch:

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

arch/arm/cpu/start-arm.S +1 -1
@@ -156,7 +156,7 @@
 	 * because memory timing is board-dependend, you will
 	 * find a lowlevel_init.S in your board directory.
 	 */
-#ifndef CONFIG_SKIP_LOWLEVEL_INIT
+#ifdef CONFIG_MACH_DO_LOWLEVEL_INIT
 	bl	board_init_lowlevel
 #endif
 

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

arch/m68k/cpu/start-mcfv4e.S +2 -2
@@ -448,7 +448,7 @@
 	 *
 	 * Do not jump/call other u-boot code here!
 	 */
-#ifndef CONFIG_SKIP_LOWLEVEL_INIT
+#ifdef CONFIG_MACH_DO_LOWLEVEL_INIT
 	bsr.l	board_init_lowlevel
 	nop
 #endif
@@ -512,7 +512,7 @@
 	nop
 #endif
 
-#ifndef CONFIG_SKIP_LOWLEVEL_INIT
+#ifdef CONFIG_MACH_DO_LOWLEVEL_INIT
 	/*
 	 * Call other half of initcode in relocated code
 	 *

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

common/Kconfig line 76

Quoted 9 lines
common/Kconfig +6 -0
@@ -68,6 +68,18 @@
 config ARCH_HAS_INIT_LOWLEVEL
 	bool
 
+config MACH_HAS_INIT_LOWLEVEL
+	bool
+
+config MACH_DO_LOWLEVEL_INIT
+	bool "run machine low-level init"
+	depends on MACH_HAS_LOWLEVEL_INIT

Please test your patches next time. You add MACH_HAS_INIT_LOWLEVEL but depend on MACH_HAS_LOWLEVEL_INIT here. Fixed and applied.

Thanks,
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/ <-