diff options
author | Stefan Roese <sr@denx.de> | 2008-06-02 14:35:44 +0200 |
---|---|---|
committer | Stefan Roese <sr@denx.de> | 2008-06-03 20:21:49 +0200 |
commit | 64852d09e06dd6db2b2db2a3c59bc2db176a54d6 (patch) | |
tree | 9a55c856efb307be7fd5a95432f0f3c79ce9191c /nand_spl | |
parent | 8a24c07ba5da2c72ad1f05e3eb8a463750200c98 (diff) | |
download | u-boot-64852d09e06dd6db2b2db2a3c59bc2db176a54d6.tar.gz u-boot-64852d09e06dd6db2b2db2a3c59bc2db176a54d6.tar.bz2 u-boot-64852d09e06dd6db2b2db2a3c59bc2db176a54d6.zip |
ppc4xx/NAND_SPL: Consolidate 405 and 440 NAND booting code in start.S
This patch consolidates the 405 and 440 parts of the NAND booting code
selected via CONFIG_NAND_SPL. Now common code is used to initialize the
SDRAM by calling initdram() and to "copy/relocate" to SDRAM/OCM/etc.
Only *after* running from this location, nand_boot() is called.
Please note that the initsdram() call is now moved from nand_boot.c
to start.S. I experienced problems with some boards like Kilauea
(405EX), which don't have internal SRAM (OCM) and relocation needs to
be done to SDRAM before the NAND controller can get accessed. When
initdram() is called later on in nand_boot(), this can lead to problems
with variables in the bss sections like nand_ecc_pos[].
Signed-off-by: Stefan Roese <sr@denx.de>
Acked-by: Scott Wood <scottwood@freescale.com>
Diffstat (limited to 'nand_spl')
-rw-r--r-- | nand_spl/nand_boot.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/nand_spl/nand_boot.c b/nand_spl/nand_boot.c index bc577252cf..563a80b953 100644 --- a/nand_spl/nand_boot.c +++ b/nand_spl/nand_boot.c @@ -221,20 +221,19 @@ static int nand_load(struct mtd_info *mtd, int offs, int uboot_size, uchar *dst) return 0; } +/* + * The main entry for NAND booting. It's necessary that SDRAM is already + * configured and available since this code loads the main U-Boot image + * from NAND into SDRAM and starts it from there. + */ void nand_boot(void) { - ulong mem_size; struct nand_chip nand_chip; nand_info_t nand_info; int ret; void (*uboot)(void); /* - * Init sdram, so we have access to memory - */ - mem_size = initdram(0); - - /* * Init board specific nand support */ nand_info.priv = &nand_chip; |