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.

Linux: NAND flash supported on DM385

Other Parts Discussed in Thread: DM385

Tool/software: Linux

Hi Sir,

The original design was working fine.For some reason we need to change the NAND flash.But when we changed to new NAND flash.the system can not boot up.Please help to check it.

1.the informations of new NAND flash are

Toshiba TC58NVG0S3HYA00 (128M + 8 bit)

page size is 2176 bytes

block size is (128+8k)bytes

Do I need to modify the information in the driver?where do I modify it?

2.The error message are be below.

U-Boot 2010.06 (Jul 20 2017 - 16:40:41) DM385_IPNC_3.50.00

NAND device: Manufacturer ID: 0x98, Chip ID: 0xf1 (Toshiba NAND 128MiB 3,3V 8-bit)


Data (writethrough) Cache is ON

Loading from NAND 128MiB 3,3V 8-bit, offset 0x280000
Image Name: Linux-2.6.37_DM385_3.50.0
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 1763520 Bytes = 1.7 MiB
Load Address: 80008000
Entry Point: 80008000
## Booting kernel from Legacy Image at 80007fc0 ...
Image Name: Linux-2.6.37_DM385_3.50.0
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 1763520 Bytes = 1.7 MiB
Load Address: 80008000
Entry Point: 80008000
OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
Trying to install type control for IRQ375
Trying to set irq flags for IRQ375
omap_voltage_domain_lookup: Voltage driver init not yet happened.Faulting!
omap_voltage_late_init: Voltage driver support not added
INIT: version 2.86 booting
Kernel panic - not syncing: Attempted to kill init!
Backtrace:
[<c0041f70>] (dump_backtrace+0x0/0x110) from [<c027317c>] (dump_stack+0x18/0x1c)
r6:c6826000 r5:00007f00 r4:c0391998 r3:60000013
[<c0273164>] (dump_stack+0x0/0x1c) from [<c02731dc>] (panic+0x5c/0x178)
[<c0273180>] (panic+0x0/0x178) from [<c0068858>] (do_exit+0x68/0x5d0)
r3:c036fedc r2:c6829f18 r1:00000001 r0:c030e131
r7:000000f8
[<c00687f0>] (do_exit+0x0/0x5d0) from [<c0069070>] (do_group_exit+0x84/0xb4)
r7:000000f8
[<c0068fec>] (do_group_exit+0x0/0xb4) from [<c00690b8>] (sys_exit_group+0x18/0x20)
r4:00000005 r3:0000007f
[<c00690a0>] (sys_exit_group+0x0/0x20) from [<c003e3c0>] (ret_fast_syscall+0x0/0x30)

Best Regards,

Byron

  • Hi Byron Tien,

    I am not seeing any NAND related errors above. Have you shared the entire boot logs or is quiet being passed in bootargs ? Can you stop the booting at uboot and try nand commands like
    $nand dump 0
    $nand read 0 0 1000

  • Hi Sirs,

    How do I stop the booting.I type any key on console.No any response.

    U-Boot 2010.06 (Aug 30 2017 - 15:04:29) DM385_IPNC_3.50.00

    NAND device: Manufacturer ID: 0x98, Chip ID: 0xf1 (Toshiba NAND 128MiB 3,3V 8-bit)



    NAND read: device 0 offset 0x20000, size 0x1e000
    122880 bytes read: OK

    U-Boot 2010.06 (Aug 30 2017 - 15:04:50) DM385_IPNC_3.50.00

    NAND device: Manufacturer ID: 0x98, Chip ID: 0xf1 (Toshiba NAND 128MiB 3,3V 8-bit)


    Data (writethrough) Cache is ON

    Loading from NAND 128MiB 3,3V 8-bit, offset 0x280000
    Image Name: Linux-2.6.37_DM385_CARDVR_3.50.0
    Image Type: ARM Linux Kernel Image (uncompressed)
    Data Size: 1763796 Bytes = 1.7 MiB
    Load Address: 80008000
    Entry Point: 80008000
    ## Booting kernel from Legacy Image at 80007fc0 ...
    Image Name: Linux-2.6.37_DM385_CARDVR_3.50.0
    Image Type: ARM Linux Kernel Image (uncompressed)
    Data Size: 1763796 Bytes = 1.7 MiB
    Load Address: 80008000
    Entry Point: 80008000
    OK
    OK

    Starting kernel ...

    Uncompressing Linux... done, booting the kernel.
    Trying to install type control for IRQ375
    Trying to set irq flags for IRQ375
    omap_voltage_domain_lookup: Voltage driver init not yet happened.Faulting!
    omap_voltage_late_init: Voltage driver support not added
    gUBIFS error (pid 1): ubifs_decompress: cannot decompress 2865 bytes, compressor lzo, error -22
    UBIFS error (pid 1): read_block: bad data node (block 114, inode 3914)
    UBIFS error (pid 1): do_readpage: cannot read page 114 of inode 3914, error -22
    UBIFS error (pid 1): ubifs_decompress: cannot decompress 2865 bytes, compressor lzo, error -22
    UBIFS error (pid 1): read_block: bad data node (block 114, inode 3914)
    UBIFS error (pid 1): do_readpage: cannot read page 114 of inode 3914, error -22
    Kernel panic - not syncing: Attempted to kill init!
    Backtrace:
    [<c0041f70>] (dump_backtrace+0x0/0x110) from [<c02730a4>] (dump_stack+0x18/0x1c)
    r6:c6826000 r5:00000007 r4:c0391b58 r3:60000113
    [<c027308c>] (dump_stack+0x0/0x1c) from [<c0273104>] (panic+0x5c/0x178)
    [<c02730a8>] (panic+0x0/0x178) from [<c0068858>] (do_exit+0x68/0x5d0)
    r3:c0370084 r2:c6829e18 r1:00000001 r0:c030e22b
    r7:c682a000
    [<c00687f0>] (do_exit+0x0/0x5d0) from [<c0069070>] (do_group_exit+0x84/0xb4)
    r7:c682a000
    [<c0068fec>] (do_group_exit+0x0/0xb4) from [<c0072f3c>] (get_signal_to_deliver+0x2d0/0x304)
    r4:01060013 r3:20000113
    [<c0072c6c>] (get_signal_to_deliver+0x0/0x304) from [<c0040f9c>] (do_signal+0x70/0x5f4)
    [<c0040f2c>] (do_signal+0x0/0x5f4) from [<c0041ac4>] (do_notify_resume+0x20/0x64)
    [<c0041aa4>] (do_notify_resume+0x0/0x64) from [<c003e418>] (work_pending+0x24/0x28)
    r4:ffffffff r3:00000001


    Best Regards,
    Byron
  • Hi Byron,

    Looks like your kernel is loaded from NAND and it is fine to access NAND.

    Loading from NAND 128MiB 3,3V 8-bit, offset 0x280000

    Image Name: Linux-2.6.37_DM385_3.50.0

    Image Type: ARM Linux Kernel Image (uncompressed)

     


    What was the NAND size used before ? Can you share your mkfs.ubifs and ubinize commands at build time ? 

  • Hi Sirs,

    sudo mkfs.ubifs -r $(TARGET_FS) -F -o ./tmp/ubifs.img -m 2048 -e 126976 -c 827
    sudo ubinize -o $(TFTP_HOME)/ubifs_cardvr.bin -m 2048 -p 128KiB -s 512 -O 2048 $(IPNC_INSTALL_DIR)/ubinize.cfg


    Best Regards,
    Byron
  • Hi Byron,

    Can you check the following link for creating ubifs. Need to make sure the calculations are done as per the new NAND.

    processors.wiki.ti.com/.../UBIFS_Support
  • Hi Sirs,

    It's mean the kernel is loaded from NAND and worked fine?why did they uncompress the image?
    The following are the old NAND design.
    Do I need to check the parameter for creating ubifs?How about the nand_ids.c ?
    ============================================================
    U-Boot 2010.06 (Aug 30 2017 - 15:04:29) DM385_IPNC_3.50.00

    NAND device: Manufacturer ID: 0x01, Chip ID: 0xf1 (Spansion/AMD NAND 128MiB 3,3V 8-bit)



    NAND read: device 0 offset 0x20000, size 0x1e000
    122880 bytes read: OK

    U-Boot 2010.06 (Aug 30 2017 - 15:04:50) DM385_IPNC_3.50.00

    NAND device: Manufacturer ID: 0x01, Chip ID: 0xf1 (Spansion/AMD NAND 128MiB 3,3V 8-bit)


    Data (writethrough) Cache is ON

    Loading from NAND 128MiB 3,3V 8-bit, offset 0x280000
    Image Name: Linux-2.6.37_DM385_3.50.0
    Image Type: ARM Linux Kernel Image (uncompressed)
    Data Size: 1763796 Bytes = 1.7 MiB
    Load Address: 80008000
    Entry Point: 80008000
    ## Booting kernel from Legacy Image at 80007fc0 ...
    Image Name: Linux-2.6.37_DM385_3.50.0
    Image Type: ARM Linux Kernel Image (uncompressed)
    Data Size: 1763796 Bytes = 1.7 MiB
    Load Address: 80008000
    Entry Point: 80008000
    OK
    OK

    Starting kernel ...

    Uncompressing Linux... done, booting the kernel.
    Trying to install type control for IRQ375
    Trying to set irq flags for IRQ375
    omap_voltage_domain_lookup: Voltage driver init not yet happened.Faulting!
    omap_voltage_late_init: Voltage driver support not added
    INIT: version 2.86 booting
    First Runlevel
    SysLink version : 2.20.02.20
    SysLink module created on Date:Aug 30 2017 Time:15:08:43
    Trace enabled
    Trace SetFailureReason enabled
    /dev/mem opened.
    hwclock: RTC_RD_TIME: Invalid argument
    Finish Runlevel

    [host] Loaded file ./firmware/ipnc_rdk_fw_m3video.xem3 on slave procId 0.

    Best Regards,
    Byron
  • It's mean the kernel is loaded from NAND and worked fine?

    Yes, I am seeing kernel getting loaded from NAND.

    why did they uncompress the image?

    The root filesystems is stored in the ubifs format and ubifs compresses the files.



    Do I need to check the parameter for creating ubifs?

    Yes, you need to correctly configure the creation of ubifs as mentioned in above post link

    How about the nand_ids.c ?

    NAND part is correctly detected in uboot and kernel as Toshiba 8-bit and kernel loaded from u-boot.

     

    Hope you are flashing the images as before, done in the other NAND case and there is no change in kernel configurations related to ECC

  • Hi Sirs,

    I have changed it more times.it still was failed.Do we loste something in the make ubifs?

    sudo mkfs.ubifs -r $(TARGET_FS) -F -o ./tmp/ubifs.img -m 2048 -e 129024 -c 827
    sudo ubinize -o $(TFTP_HOME)/ubifs_cardvr.bin -m 2048 -p 136KiB -s 2048 -O 2048 $(IPNC_INSTALL_DIR)/ubinize.cfg

    >>ubinize.cfg

    [ubifs]
    mode=ubi
    image=tmp/ubifs.img
    vol_id=0
    vol_size=100MiB
    vol_type=dynamic
    vol_name=rootfs
    vol_flags=autoresize

    ======================

    the information of toshiba 1G Bit nand EEPROM

    The page size is (2048+128)bytes

    The block size is (2048+128)bytes*64 pages

    The device size is (2048+128)bytes * 64 pages * 1024 blocks

    ======================

    U-Boot 2010.06 (Aug 30 2017 - 15:04:29) DM385_IPNC_3.50.00

    NAND device: Manufacturer ID: 0x98, Chip ID: 0xf1 (Toshiba NAND 128MiB 3,3V 8-bit)

    NAND read: device 0 offset 0x20000, size 0x1e000
    122880 bytes read: OK

    U-Boot 2010.06 (Aug 30 2017 - 15:04:50) DM385_IPNC_3.50.00

    NAND device: Manufacturer ID: 0x98, Chip ID: 0xf1 (Toshiba NAND 128MiB 3,3V 8-bit)


    Data (writethrough) Cache is ON

    Loading from NAND 128MiB 3,3V 8-bit, offset 0x280000
    Image Name: Linux-2.6.37_DM385_3.50.0
    Image Type: ARM Linux Kernel Image (uncompressed)
    Data Size: 1763972 Bytes = 1.7 MiB
    Load Address: 80008000
    Entry Point: 80008000
    ## Booting kernel from Legacy Image at 80007fc0 ...
    Image Name: Linux-2.6.37_DM385_3.50.0
    Image Type: ARM Linux Kernel Image (uncompressed)
    Data Size: 1763972 Bytes = 1.7 MiB
    Load Address: 80008000
    Entry Point: 80008000
    OK
    OK

    Starting kernel ...

    Uncompressing Linux... done, booting the kernel.
    Trying to install type control for IRQ375
    Trying to set irq flags for IRQ375
    omap_voltage_domain_lookup: Voltage driver init not yet happened.Faulting!
    omap_voltage_late_init: Voltage driver support not added
    UBIFS error (pid 1): ubifs_read_node: bad node type (255 but expected 6)
    UBIFS error (pid 1): ubifs_read_node: bad node at LEB 0:0, LEB mapping status 0
    Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
    Backtrace:
    [<c0041f70>] (dump_backtrace+0x0/0x110) from [<c02730cc>] (dump_stack+0x18/0x1c)
    r6:00008000 r5:c6814006 r4:c0391b58 r3:60000013
    [<c02730b4>] (dump_stack+0x0/0x1c) from [<c027312c>] (panic+0x5c/0x178)
    [<c02730d0>] (panic+0x0/0x178) from [<c0008e70>] (mount_block_root+0x23c/0x28c)
    r3:00000000 r2:00000020 r1:c6829f78 r0:c030071e
    r7:c0024e9c
    [<c0008c34>] (mount_block_root+0x0/0x28c) from [<c0008fb8>] (prepare_namespace+0x94/0x188)
    [<c0008f24>] (prepare_namespace+0x0/0x188) from [<c0008a9c>] (kernel_init+0x114/0x154)
    r5:c0024684 r4:c0024684
    [<c0008988>] (kernel_init+0x0/0x154) from [<c00687f0>] (do_exit+0x0/0x5d0)
    r5:c0008988 r4:00000000

    ======================

    Best Regards,

    Byron

  • Hi,

    I hope you would have tried with "-p 128KiB"

    Also can you try reducing the volume size vol_size=80MiB in the config ?
  • Hi Sirs,

    Yes,I have tried it.the same situation.Do you have any suggestion? or what's the driver option I need to enable?

    Best Regards,

    Byron

  • Hi Sirs,

    Any update on this question?

    Best Regards,

    Byron

  • Hi Byron,

    Will it possible to share the Toshiba NAND datasheet ?
  • Hi Sir,

    The file pleas take it.thanks.

    Best Regards,

    Byron0743.TC58NVG0S3HTA00.pdf

  • Hi Byron,
    I missed to point out that Toshiba NAND is having spare area of 128 bytes(2048 + 128 = 2176). Generally it is expected for a 2048 page to have 64 bytes spare area. This should make difference only when loading MLO by the ROM code. May I know where MLO, uboot, kernel and filesystems get flashed? What procedure is used ?
  • Hi Sirs,

    Sorry,Could you describe it in detail.You mean when will I get flashed?

    Best Regards,
    Byron
  • Hi Byron,

    Where do you flash(into NAND or NOR or any other memory) the binaries like MLO, uboot, kernel, and filesystems ? From where do you flash (from uboot or user space in filesystems or any other)?
  • Hi Sirs,

    I flash the image to NAND using SD boot.

    Best Regards,
    Byron
  • Hi Sirs,

    Do you have any suggestion on this issue?

    Best regards,

    Byron

  • Hi Byron,

    This is strange if MLO, uboot and kernel are too flashed into NAND like ubifs filesystems. What is the ECC being used ? You are sure there is no change in kernel(i.e. the kernel that flashes into NAND and the kernel that get flashed into NAND). Both are same kernel with same cocnfiguration ?
    Also you can try mounting NAND filesystems from commandline in SDCard boot. Please use the link shared before to check how to mount ubifs filesystems from user space.
  • Hi Sirs,

    We used the H/W ECC BCH8. Is it any different between 64 bytes pages size and 128 bytes page size?

    Old flash is Spansion

    Page size : (2048+64) bytes

    Block size : (128K+4K) bytes

    Total : (2048+64) bytes * 64 pages * 1024 blocks

    New is Toshiba flash

    Page size : (2048+128) bytes

    Block size : (128K+8K) bytes

    Total : (2048+128) bytes * 64 pages * 1024 blocks

    Best Regards,

    Byron

  • Hi,

    AFAIK, it should not make any difference. But you can check with BCH16. Also please check in this link, if there is any patch that can help : arago-project.org/.../linux-davinci.git

  • Hi Sirs,

    The driver do not support BCH16.

    BTW,when we changed the parameter of mkfs.ubifs and ubinize. we would get the different error message.Will the error come from here?Do you have any suggestion for those two commands?

    Best Regards,

    Byron

  • Hi,

    AFAIK, the ubifs commands do not vary with different size in spare area. But can you past here the difference in ubifs commands and the log changes ?