This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to fit my new NAND chip

Other Parts Discussed in Thread: AM3517

Hi,

I am testing a new board which is of the same hardware with AM3517EVM except NAND chip, I substitute Samsung NAND(8 bit) for Micron NAND(16 bit),

what changes in kernel should I do to make Android works on my NAND, as I flashed x-loader, u-boot, uImage, and ubi.img to NAND.

Should NAND driver be changed to fit my Samsung NAND chip? How ?

Any suggestions?

 

Thanks,

Kevin

  • Hi Kevin,

    Which kernel you are using?

    Regards,
    Amit Pundir

  • Hi Amit Pundir,

    My kernel is of version 2.6.32, it is along with TI_Android_GingerBread_2_3_DevKit_1_0.

    ps,

    Processor:

    AM3517.

    Android DevKit:

    TI_Android_GingerBread_2_3_DevKit_1_0.

    Platform:

    Custom board, which is the same as am3517evm except NAND, I substitute Samsung NAND (512MiB 3,3V 8-bit) for Micron NAND (512MiB 1,8V 16-bit).

    Steps to reproduce:

    Fastboot the ubi.img which works ok on am3517evm NAND to the custom board NAND, then reboot, I have already made some changes to xloader and uboot, and they works. the system can start up, but not completely. Android processes are not started, and android desktop doesn't start up. system seems read only. and kernel errors log like this:

    UBI error: ubi_io_write: error -5 while writing 2048 bytes to PEB 2040:32768, written 0 bytes
    UBI warning: ubi_eba_write_leb: failed to write data to PEB 2040
    UBI: recover PEB 2040, move data to PEB 1522
    UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB 1522:512, written 0 bytes
    UBI warning: recover_peb: failed to write to PEB 1522
    UBI: try again
    UBI: recover PEB 2040, move data to PEB 1523
    UBI: run torture test for PEB 1522
    UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB 1523:512, written 0 bytes
    UBI warning: recover_peb: failed to write to PEB 1523
    UBI: try again
    UBI: recover PEB 2040, move data to PEB 1524
    UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB 1524:512, written 0 bytes
    UBI warning: recover_peb: failed to write to PEB 1524
    UBI: try again
    UBI: recover PEB 2040, move data to PEB 1525
    UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB 1525:512, written 0 bytes
    UBI warning: recover_peb: failed to write to PEB 1525
    UBI warning: ubi_ro_mode: switch to read-only mode
    UBIFS error (pid 828): ubifs_wbuf_write_nolock: cannot write 4144 bytes to LEB 477:30720, error -5
    UBIFS warning (pid 828): ubifs_ro_mode: switched to read-only mode, error -5
    UBIFS error (pid 828): do_writepage: cannot write page 8 of inode 769, error -5
    UBI error: ubi_io_write: read-only mode
    UBI error: erase_worker: failed to erase PEB 1522, error -30
    UBI error: do_work: work failed with error code -30
    UBI error: ubi_thread: ubi_bgt0d: work failed with error code -30
    UBIFS error (pid 780): make_reservation: cannot reserve 392 bytes in jhead 1, error -30
    UBIFS error (pid 780): ubifs_mkdir: cannot create directory, error -30
    UBIFS error (pid 782): make_reservation: cannot reserve 424 bytes in jhead 1, error -30
    UBIFS error (pid 782): ubifs_create: cannot create regular file, error -30
    UBIFS error (pid 782): make_reservation: cannot reserve 416 bytes in jhead 1, error -30
    UBIFS error (pid 782): ubifs_create: cannot create regular file, error -30
    UBIFS error (pid 782): make_reservation: cannot reserve 424 bytes in jhead 1, error -30
    UBIFS error (pid 782): ubifs_create: cannot create regular file, error -30
    UBIFS error (pid 782): make_reservation: cannot reserve 424 bytes in jhead 1, error -30
    UBIFS error (pid 782): ubifs_create: cannot create regular file, error -30

    Complete log is here:8662.nand_samsung_log.txt

     

    Thanks,

    Kevin

     

  • I may not be able to help you from UBIFS or Android point of view, but from Linux kernel and HW configuration point of view I can help you. Couple of pointers/options -

     

    - The kernel (2.6.32) doesn't configure GPMC so the configuration responsibility is with X-loader and u-boot only.

    - Another important point here is, u-boot doesn't enable cache and MMU to work with, so GPMC access would be slower than kernel. Please review your GPMC timing configuration, it might possible that, from kernel they are more pronounced.

    - Another important options is, you may want to boot the system with different filesystem and try mounting from Linux prompt (either JFFS2 or UBIFS) and try to do some low level operations.

    Thanks,

    Vaibhav

  • Hi Vaibhav,

    Thanks for your advices.

    I tried mtd-utils in the system running on MMC, the procedure and logs are posted on Thu, May 26 2011 2:46 AM at

    http://e2e.ti.com/support/embedded/f/509/p/111277/400322.aspx#400322

    From the log, it seems something wrong with the ubi.img.

     

    Thanks,

    Kevin

  • Hi,

    I found the following bold errors are printed in ubi driver in kernel, kernel/drivers/mtd/ubi/io.c, could be the ubi driver's problem?

    UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB 2326:0, written 0 bytes
    UBI error: erase_worker: failed to erase PEB 2326, error -5
    UBI: mark PEB 2326 as bad
    UBI: 38 PEBs left in the reserve
    UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB 2599:0, written 0 bytes
    UBI error: erase_worker: failed to erase PEB 2599, error -5
    UBI: mark PEB 2599 as bad
    UBI error: ubi_io_mark_bad: cannot mark PEB 2599 bad, error -5
    UBI warning: ubi_ro_mode: switch to read-only mode
    UBI error: do_work: work failed with error code -5
    UBI error: ubi_thread: ubi_bgt0d: work failed with error code -5
    UBIFS error (pid 870): ubifs_wbuf_write_nolock: cannot write 3778 bytes to LEB 477:0, error -30
    UBIFS warning (pid 870): ubifs_ro_mode: switched to read-only mode, error -30
    UBIFS error (pid 870): do_writepage: cannot write page 0 of inode 769, error -30
    UBIFS error (pid 802): make_reservation: cannot reserve 424 bytes in jhead 1, error -30
    UBIFS error (pid 802): ubifs_create: cannot create regular file, error -30
    UBIFS error (pid 802): make_reservation: cannot reserve 416 bytes in jhead 1, error -30
    UBIFS error (pid 802): ubifs_create: cannot create regular file, error -30
    UBIFS error (pid 802): make_reservation: cannot reserve 424 bytes in jhead 1, error -30
    UBIFS error (pid 802): ubifs_create: cannot create regular file, error -30


    I haven't found a better way to solve it. any suggestions?

    Thanks,
  • In my opinion, I think NAND drivers is OK.

    The layers of the UBI, is Hardware Driver -> MTD -> UBI -> UBIFS, since rootfs.jffs2 works ok,  the layer of Hardware Drivers -> MTD should be ok.

    In the kernel log,

    UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB 3935:0, written 0 bytes
    UBI error: erase_worker: failed to erase PEB 3935, error -5
    UBI: mark PEB 3935 as bad
    UBI error: ubi_io_mark_bad: cannot mark PEB 3935 bad, error -5
    UBI warning: ubi_ro_mode: switch to read-only mode
    UBI error: do_work: work failed with error code -5
    UBI error: ubi_thread: ubi_bgt0d: work failed with error code -5
    omaplfb: OMAPLFB_Init: OMAPLFBInit failed
    UBIFS error (pid 845): ubifs_wbuf_write_nolock: cannot write 3778 bytes to LEB 477:0, error -30
    UBIFS warning (pid 845): ubifs_ro_mode: switched to read-only mode, error -30
    UBIFS error (pid 845): do_writepage: cannot write page 0 of inode 770, error -30
    UBIFS error (pid 782): make_reservation: cannot reserve 424 bytes in jhead 1, error -30
    UBIFS error (pid 782): ubifs_create: cannot create regular file, error -30

    UBI error printed firstly, and then the UBIFS errors, so the problem may be in the layer MTD -> UBI, this problem leads to another problem in the above layer   UBI -> UBIFS,

     

    Thanks,

    Kevin

  • Hi Kevin,

    Replied on a similar thread of yours http://e2e.ti.com/support/embedded/f/509/p/111434/410995.aspx#410995

    Requesting you stick to one E2E thread, that will help us in tracking this issue.

    Regards,
    Amit Pundir

  • The problem has been fixed.

    The AM3517 processor supports NAND prefetch and prefetch DMA, so I enabled MTD_NAND_OMAP_PREFETCH and MTD_NAND_OMAP_PREFETCH_DMA in kernel config, then the errors didn't come up any more, the android system can start up from NAND successfully now.

     

    Regards,

    Kevin