
On Fri, May 09, 2008 at 06:19:35PM -0500, Menon, Nishanth wrote:
Sascha,
-----Original Message----- From: Sascha Hauer [mailto:s.hauer@pengutronix.de] Sent: Friday, May 09, 2008 10:13 AM To: Menon, Nishanth Cc: u-boot-users@lists.sourceforge.net Subject: Re: [Patch] U-Boot-V2: Replace CONFIG_SKIP_LOWLEVEL_INIT withCONFIG_MACH_HAS_INIT_LOWLEVEL
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
Yes. It is a good idea. I have searched thru the boards and have the following revisited patch:
Signed-off-by: Nishanth Menon x0nishan@ti.com
Index: u-boot-v2.git/arch/arm/cpu/start-arm.S
--- u-boot-v2.git.orig/arch/arm/cpu/start-arm.S 2008-05-09 10:33:46.000000000 -0500 +++ u-boot-v2.git/arch/arm/cpu/start-arm.S 2008-05-09 10:35:30.000000000 -0500 @@ -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
--- u-boot-v2.git.orig/arch/m68k/cpu/start-mcfv4e.S 2008-05-09 10:33:46.000000000 -0500 +++ u-boot-v2.git/arch/m68k/cpu/start-mcfv4e.S 2008-05-09 10:36:49.000000000 -0500 @@ -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 =================================================================== --- u-boot-v2.git.orig/common/Kconfig 2008-05-09 10:33:46.000000000 -0500 +++ u-boot-v2.git/common/Kconfig 2008-05-09 10:34:25.000000000 -0500 @@ -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