AnsweredAssumed Answered

Trouble with NAND bad block table

Question asked by yensid on Nov 21, 2013
Latest reply on Nov 22, 2013 by yensid

Hi I'm working with a custom board based off of the P1010RDB.  We are booting from NAND and are using Micron MT29F8G08ABABA as a replacement NAND.  I can program the nand using jtag and uboot recognizes the NAND, after some minor changes. Uboot successfully boots to the command prompt.  During boot "Bad block table not found for chip 0  No space left to write bad block table" is displayed and I cannot write to the nand chip from u-boot to save the environment or program new u-boot. The chip is 1GByte and has a 512K block size, and 4K pagesize with 224byte oob size.


If I run nand bad the whole flash chip is reported as bad.


Has anyone had a similar experiance?  Any ideas what might be causing this?


Thanks for your help.


Code Changes to nand_ids.c

{"NAND 1GiB 3,3V 8-bit Custom",0x38, 0, 1024, 0, LP_OPTIONS}


Code Changes nand_boot.c:

U-boot Output:

/* Check Micron device */
/* Check for 5 byte ID + Micron + read more 0x00 */
else if (id_data[0] == NAND_MFR_MICRON && id_data[4] != 0x00
&& id_data[5] == 0x00
&& id_data[6] == 0x00) {



/* Calc pagesize */
mtd->writesize = 1024 << (extid & 0x03);
extid >>= 2;



/* OOB is 218B/224B per 4KiB pagesize */
mtd->oobsize = ((extid & 0x03) == 0x03 ? 218 :
224) << (mtd->writesize >> 13);
extid >>= 3;
/* Blocksize is multiple of 64KiB */
mtd->erasesize = mtd->writesize <<
(extid & 0x03) << 6;
/* All Micron have busw x8? */
busw = 0;



printf("Micron id_data[0] = 0x%X, id_data[1] = 0x%X\n", id_data[0], id_data[1]);
printf("Micron mtd->erasesize (block):%d\n", mtd->erasesize);
printf("Micron mtd->writesize (page):%d\n", mtd->writesize);
printf("Micron mtd->oobsize:%d\n", mtd->oobsize);




NAND boot...



U-Boot 2013.01-dirty (Nov 20 2013 - 15:55:35)



CPU:   P1010, Version: 1.0, (0x80f10010)

Core:  E500, Version: 5.1, (0x80212151)

Clock Configuration:

       CPU0:800  MHz,

       CCB:400  MHz,

       DDR:333.333 MHz (666.667 MT/s data rate) (Asynchronous), IFC:100  MHz

L1:    D-cache 32 kB enabled

       I-cache 32 kB enabled

Board: P1010RDB

I2C:   ready

SPI:   ready

DRAM:  Detected UDIMM Fixed DDR on board

1 GiB (DDR3, 32-bit, CL=5, ECC off)

Now running in RAM - U-Boot at: 3ff30000

L2:    256 KB enabled


**** Additional Debug Information added ***

Micron id_data[0] = 0x2C, id_data[1] = 0x38

Micron mtd->erasesize (block):524288

Micron mtd->writesize (page):4096

Micron mtd->oobsize:224

1024 MiB


Bad block table not found for chip 0

Bad block table not found for chip 0

No space left to write bad block table

*** Warning - readenv() failed, using default environment



PCIe1: Root Complex of mini PCIe Slot, no link, regs @ 0xffe0a000

PCIe1: Bus 00 - 00

PCIe2: Root Complex of PCIe Slot, no link, regs @ 0xffe09000

PCIe2: Bus 01 - 01

In:    serial

Out:   serial

Err:   serial

Net:   PHY reset timed out

PHY reset timed out


Hit any key to stop autoboot:  0

=> saveenv

Saving Environment to NAND...

Erasing Nand...



Skipping bad block at  0x00100000                                         



Skipping bad block at  0x00180000                                         



Skipping bad block at  0x00200000                                         



Writing to Nand... FAILED!

=> nand info



Device 0: nand0, sector size 512 KiB

  Page size      4096 b

  OOB size        224 b

  Erase size   524288 b