]> git.sur5r.net Git - u-boot/commitdiff
fsl_elbc_nand: redirect the pointer of bbt pattern to RAM
authorMingkai Hu <Mingkai.hu@freescale.com>
Thu, 18 Jun 2009 10:23:27 +0000 (18:23 +0800)
committerScott Wood <scottwood@freescale.com>
Tue, 7 Jul 2009 22:58:10 +0000 (17:58 -0500)
The bbt descriptors contains the pointer to the bbt pattern which
are statically initialized memory struct. When relocated to RAM,
these pointers will continue point to NOR flash(or L2 SRAM, or
other boot device). If the contents of NOR flash changed or L2
SRAM disabled, it'll hang the system.

Signed-off-by: Mingkai Hu <Mingkai.hu@freescale.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
drivers/mtd/nand/fsl_elbc_nand.c

index 3f318e02e2b5d32aa04b0f84d09d23cfa3e64a18..77a33c0781196ca4f6693ddb3f15a322f59efc0c 100644 (file)
@@ -766,6 +766,9 @@ int board_nand_init(struct nand_chip *nand)
        nand->waitfunc = fsl_elbc_wait;
 
        /* set up nand options */
+       /* redirect the pointer of bbt pattern to RAM */
+       bbt_main_descr.pattern = bbt_pattern;
+       bbt_mirror_descr.pattern = mirror_pattern;
        nand->bbt_td = &bbt_main_descr;
        nand->bbt_md = &bbt_mirror_descr;
 
@@ -812,6 +815,7 @@ int board_nand_init(struct nand_chip *nand)
        /* Large-page-specific setup */
        if (or & OR_FCM_PGS) {
                priv->page_size = 1;
+               largepage_memorybased.pattern = scan_ff_pattern;
                nand->badblock_pattern = &largepage_memorybased;
 
                /* adjust ecc setup if needed */