
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 + 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" Index: u-boot-v2.git/arch/arm/Kconfig =================================================================== --- u-boot-v2.git.orig/arch/arm/Kconfig 2008-05-09 17:40:32.000000000 -0500 +++ u-boot-v2.git/arch/arm/Kconfig 2008-05-09 18:06:44.000000000 -0500 @@ -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
Index: u-boot-v2.git/arch/m68k/Kconfig =================================================================== --- u-boot-v2.git.orig/arch/m68k/Kconfig 2008-05-09 18:07:01.000000000 -0500 +++ u-boot-v2.git/arch/m68k/Kconfig 2008-05-09 18:09:48.000000000 -0500 @@ -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)