[U-Boot] Regarding NAND flash support in IMX31

Hai
I am trying to port U-boot 2.0.0 for my custom imx31 board and I am able to boot and load linux etc successfully.
I want to add NAND flash support and it is observed that the NAND flash is been detected but with lot of "Bad erase block messages"
Please help
Arun
=========================================
U-Boot 2.0.0-rc9 (Oct 14 2009 - 12:03:04)
Board: Phytec phyCORE-i.MX31 *NAND device: Manufacturer ID: 0xec, Chip ID: 0xda (Samsung NAND 256MiB 3,3V 8-bi t)* Scanning device for bad blocks *Bad erase block at .... Bad erase block at .... Bad erase block at .... Bad erase block at .... Bad erase block at .... Bad erase block at .... Bad erase block at .... * got MAC address from EEPROM: 00:08:EE:01:86:71 mx31 cpu clock: 513MHz ipg clock : 64133247Hz Malloc space: 0x87b00000 -> 0x87f00000 (size 4 MB) Stack space : 0x87af8000 -> 0x87b00000 (size 32 kB) Open /dev/env0 No such file or directory no valid environment found on /dev/env0. Using default environment running /env/bin/init...
Hit any key to stop autoboot: 5
type update_kernel nand|nor [<imagename>] to update kernel into flash type update_root nand|nor [<imagename>] to update rootfs into flash
uboot:/
=======================================================

Arun,
On Mittwoch, 14. Oktober 2009, R Arun Kumar wrote:
I am trying to port U-boot 2.0.0 for my custom imx31 board and I am able to boot and load linux etc successfully.
Does Linux work with your the NAND flash?
I want to add NAND flash support and it is observed that the NAND flash is been detected but with lot of "Bad erase block messages"
The first time u-boot-v2 detects this NAND? Or after Linux had at least used it one time? Maybe a OOB layout confusion.
Regards, jbe

Hai,
Yes the NAND flash is working fine in linux and i am able to load the filesystem and boot etc. Since our NOR flash is of small size 2MB and the linux kernel needs to be programmed in NAND, I am trying to use the NAND in uboot for saving the kernel and boot the linux kernel from NAND flash
Arun
On Wed, Oct 14, 2009 at 2:17 PM, Juergen Beisert jbe@pengutronix.de wrote:
Arun,
On Mittwoch, 14. Oktober 2009, R Arun Kumar wrote:
I am trying to port U-boot 2.0.0 for my custom imx31 board and I am able to boot and load linux etc successfully.
Does Linux work with your the NAND flash?
I want to add NAND flash support and it is observed that the NAND flash
is
been detected but with lot of "Bad erase block messages"
The first time u-boot-v2 detects this NAND? Or after Linux had at least used it one time? Maybe a OOB layout confusion.
Regards, jbe
-- Pengutronix e.K. | Juergen Beisert | Linux Solutions for Science and Industry | Phone: +49-8766-939 228 | Vertretung Sued/Muenchen, Germany | Fax: +49-5121-206917-5555 | Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de/ |

Arun,
On Mittwoch, 14. Oktober 2009, R Arun Kumar wrote:
Yes the NAND flash is working fine in linux and i am able to load the filesystem and boot etc. Since our NOR flash is of small size 2MB and the linux kernel needs to be programmed in NAND, I am trying to use the NAND in uboot for saving the kernel and boot the linux kernel from NAND flash
Seems Linux is using a different OOB layout than u-boot does. Compare the OOB layout definition in (u-boot)/drivers/nand/nand_imx.c and (kernel)/drivers/mtd/nand/mxc_nand.c
Regards, jbe

Hai,
The OOB layout of the (u-boot)/drivers/nand/nand_imx.c and (kernel)/drivers/mtd/nand/mxc_nand.c are same. I think the problem should be in the nand_bbt driver, since we run the command *nand -a /dev/nand0.* *after the *addpart *command. The command *nand -a /dev/nand0.* *seems to be hanging .
u-boot/drivers/nand/nand-imx.c ------------------------------
/* * OOB placement block for use with hardware ecc generation */ static struct nand_ecclayout nand_hw_eccoob_8 = { .eccbytes = 5, .eccpos = {6, 7, 8, 9, 10}, .oobfree = {{0, 5}, {11, 5}} };
static struct nand_ecclayout nand_hw_eccoob_16 = { .eccbytes = 5, .eccpos = {6, 7, 8, 9, 10}, .oobfree = {{0, 6}, {12, 4}} };
kernel/drivers/mtd/nand/mxc_nd.c --------------------------------
/* * OOB placement block for use with hardware ecc generation */ static struct nand_ecclayout nand_hw_eccoob_8 = { .eccbytes = 5, .eccpos = {6, 7, 8, 9, 10}, .oobfree = {{0, 5}, {11, 5}} };
static struct nand_ecclayout nand_hw_eccoob_16 = { .eccbytes = 5, .eccpos = {6, 7, 8, 9, 10}, .oobfree = {{0, 6}, {12, 4}} };
Arun
On Wed, Oct 14, 2009 at 5:42 PM, Juergen Beisert jbe@pengutronix.de wrote:
Arun,
On Mittwoch, 14. Oktober 2009, R Arun Kumar wrote:
Yes the NAND flash is working fine in linux and i am able to load the filesystem and boot etc. Since our NOR flash is of small size 2MB and the linux kernel needs to be programmed in NAND, I am trying to use the NAND in uboot for saving the kernel and boot the linux kernel from NAND flash
Seems Linux is using a different OOB layout than u-boot does. Compare the OOB layout definition in (u-boot)/drivers/nand/nand_imx.c and (kernel)/drivers/mtd/nand/mxc_nand.c
Regards, jbe
-- Pengutronix e.K. | Juergen Beisert | Linux Solutions for Science and Industry | Phone: +49-8766-939 228 | Vertretung Sued/Muenchen, Germany | Fax: +49-5121-206917-5555 | Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de/ |
participants (2)
-
Juergen Beisert
-
R Arun Kumar