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.

failed to boot jffs2-filesystem from nand flash in TMS320DM8168

Other Parts Discussed in Thread: PMP, TMS320DM8168

hi

I have two questions here 

first is about TI81XX_PSP_U-boot.pdf, the chapter about creating JFFS2 File-system said:(refer flash layout for individual flash devices and partition creation order for exact number. Use 'cat /proc/partitions' at Linux prompt for the list of partitions)

I can figure out how to get the exact number of the partition. And the command as "cat /proc/partitions" ,i do not know where to use. it can not be used in u-boot.

second problem is that when i flash u-boot and kernel and fs all to nand, but when set the bootargs and bootcmd as below. it didn't come up.

bootargs=console=ttyO2,115200n8 root=/dev/mtdblock 7 rw rootfstype=jffs2 mem=100M earlyprintk

setenv bootargs 'console=ttyO2,115200n8 root=/dev/mtdblock 7 rw rootfstype=jffs2 mem=100M earlyprintk ip=none'

the following the last info when boot failed.

ALSA device list:
#0: TI81XX EVM
#1: TI81XX EVM (HDMI)
TCP cubic registered
NET: Registered protocol family 17
VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
omap_voltage_late_init: Voltage driver support not added
Power Management for TI81XX.
smartreflex-ti816x: ti816x_sr_probe done!
omap_rtc omap_rtc: setting system clock to 2000-01-01 00:00:01 UTC (946684801)
usb 2-1: new high speed USB device using musb-hdrc and address 2
usb 2-1: New USB device found, idVendor=0424, idProduct=2512
usb 2-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
hub 2-1:1.0: USB hub found
hub 2-1:1.0: 2 ports detected
mmc0: error -110 whilst initialising SD card
ata1: SATA link down (SStatus 0 SControl 300)
ata2: SATA link down (SStatus 0 SControl 300)
Root-NFS: no NFS server address
VFS: Unable to mount root fs via NFS, trying floppy.
List of all partitions:
1f00 131072 mtdblock0 (driver?)
1f01 2432 mtdblock1 (driver?)
1f02 128 mtdblock2 (driver?)
1f03 3072 mtdblock3 (driver?)
1f04 4352 mtdblock4 (driver?)
1f05 514304 mtdblock5 (driver?)
No filesystem could mount root, tried: jffs2
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)
Backtrace:
[<c0048b90>] (dump_backtrace+0x0/0x110) from [<c0376580>] (dump_stack+0x18/0x1c)
r7:c2c15000 r6:c006dac0 r5:c002db04 r4:c04e6b90
[<c0376568>] (dump_stack+0x0/0x1c) from [<c03765e4>] (panic+0x60/0x17c)
[<c0376584>] (panic+0x0/0x17c) from [<c0009254>] (mount_block_root+0x1e0/0x220)
r3:00000000 r2:00000020 r1:c2c25f58 r0:c0427eac
[<c0009074>] (mount_block_root+0x0/0x220) from [<c0009340>] (mount_root+0xac/0xcc)
[<c0009294>] (mount_root+0x0/0xcc) from [<c00094d0>] (prepare_namespace+0x170/0x1d4)
r4:c04e6464
[<c0009360>] (prepare_namespace+0x0/0x1d4) from [<c0008784>] (kernel_init+0x114/0x154)
r5:c0008670 r4:c04e6400
[<c0008670>] (kernel_init+0x0/0x154) from [<c006dac0>] (do_exit+0x0/0x5e4)
r5:c0008670 r4:00000000

so who can help me find the problem? thank you all very much.

  • hi,

    I do not use the SPI Flash, So I have a try with a kernel disable the SPI flash support. Following is the boot log, I think maybe the problem is always the ecc, because I sam a display in the boot log as "jffs2_scan_eraseblock(): Node at 0x00e029c8 {0x1985, 0xe041, 0x00000031) has invalid CRC 0x4282d91d (calculated 0x4ddad371)"

    5758.spi.txt


    When you created rd-jffs2.bin file, which root fs you have pass to it?

    # mkfs.jffs2 -lqn –e 128 -r target -o /tftpboot/rd-jffs2.bin

    What you pass for "-r target"? What is the "target"?

    I use the  rootfs decompressed from "arago-base-tisdk-image-dm816x-evm.tar.gz" and In order to make the rootfs be smaller, I remove the "arago-base-tisdk-image-dm816x-evm.tar.gz" under the decompressed directory.

  • Fire Lord said:
    Following is the boot log, I think maybe the problem is always the ecc, because I sam a display in the boot log as "jffs2_scan_eraseblock(): Node at 0x00e029c8 {0x1985, 0xe041, 0x00000031) has invalid CRC 0x4282d91d (calculated 0x4ddad371)"

    You are flashing the default linux kernel, just remove SPI flash support from it, nothing else changed? Do you roll back from 8-bit ECC to 1-bit ECC? If no, can you try leaving the u-boot with the default BCH8 (do not switch to 1-bit ECC when booting the board).
     Can you provide me the exact steps when flashing the kernel?

    Can you provide me the exact steps when flashing the rd-jffs2.bin file?

    BR
    Pavel

  • You are flashing the default linux kernel, just remove SPI flash support from it, nothing else changed? 

    BR
    Pavel

    1.remove SPI support; 2.change host usb to gadget usb; 3.change the ecc_opt,like following pictures:

    /arch/arm/ mach-omap2/board-flash.c

    /drivers/mtd/nand/omap2.c:omap_nand_probe()

    1.flashing u-boot:

    mmc rescan 0

    mw.b 0x81000000 0xFF 0x260000

    fatload mmc 0 81000000 u-boot.noxip.bin

    nand erase 0x0 0x260000

    nandecc hw 2

    nand write.i 0x81000000 0x0 0x260000

    nandecc hw 0

    2.flashing kernel:

    mw.b 0x81000000 0xFF 0x440000

    fatload mmc 0 81000000 uImage

    nand erase 0x00280000 0x00440000

    nand write 0x81000000 0x00280000 0x00351000

    3.flashing fs:

    mw.b 0x81000000 0xFF 0x00ED0000

    fatload mmc 0 81000000 rd-jffs2.bin

    nand erase clean 0x006C0000 0x0C820000

    nand write 0x81000000 0x006C0000 0x00ED0000

    4.boot

    I have tried to boot using BCH0 and BCH8 and SW. All failed.

  • hi,
    1.The u-boot is defaultly be BCH8 and the same as kernel.
    2.Flashing the u-boot with BCH8. Flashing kernel and rd-jffs2.bin with BCH0.
    3.The ecc schemes in bootcmd have tried "nandecc hw 0", "nandecc hw 2", "nandecc sw", they all failed to boot from nand.

    So all the steps with the ecc schemes are right?
  • Fire Lord,

    Can we first try the below setup:

    - never switch to 1-bit ECC (BCH0), stay with BCH8 from end to end
    - keep the default kernel, just remove SPI Flash and USB host, keep it in BCH8 (default)

    How to flash uImage from u-boot:
    TI8168_EVM#mw.b 0x81000000 0xFF 0x440000
    TI8168_EVM#tftp 0x81000000 uImage
    TI8168_EVM#nand erase 0x00280000 0x00440000
    TI8168_EVM#nand write 0x81000000 0x00280000 <uImage size, in example 0x280000>

    How to flash rd-jffs2.bin from u-boot:
    TI8168_EVM#mw.b 0x81000000 0xFF 0x0C820000
    TI8168_EVM#tftp 0x81000000 rd-jffs2.bin
    TI8168_EVM#nand erase clean 0x006C0000 0x0C820000
    TI8168_EVM#nand write 0x81000000 0x006C0000 <rd-jffs2.bin szie, in example 0xE01000>

    How to set up bootargs and boot:

    TI8168_EVM#setenv bootargs console=ttyO2,115200n8 root=/dev/mtdblock3 rw rootfstype=jffs2 mem=100M earlyprintk
    TI8168_EVM#nand read 0x81000000 0x00280000 <uImage size, in example 0x280000>
    TI8168_EVM#bootm 0x81000000

    Let me know if this works for you.

    BR
    Pavel

  • hi,

    can you tell about how to enable the tftp function?

    I can only get the infomation like below. But I do not know how to set on my computer.

  • hi,

    hello,pavel,

    I can not get across the tftp setting. So can you teach me about that?

    I use the SD card "fatload" to replace "tftp", what's the differences between these two ways?

    I have tested with SD, here is the boot log:

    5141.full_test.txt

    After about two minutes, the login interface will come out. I can login but with nothing under the directory of "root". For normal login of SD boot, there will be a 'dm816x-evm' in the directory of 'root'.

    whit's more, after a few minutes, it will come out the warning of 

    Read of newly-erased block at 0x0b040000 failed: -74. Putting on bad_list
    Read of newly-erased block at 0x0b040000 failed: -74. Putting on bad_list
    JFFS2: marking eraseblock at 0b040000
    as bad

    Can you explain that?

    '

  • hi,
    In the boot log, we can see "WARNING: at drivers/dsp/syslink/omap_notify/notify.c:776 notify_send_event+0xd4/0x26c()". Does it mean there is something wrong with DSP?
  • You can use SD card (instead of TFTP) to load the u-boot/kernel/fs to DDR3 and flash to NAND, this is OK.

    Can you try to add in the bootrgs 'notifyk.vpssm3_sva=0xBF900000'? If does not work, try with 'notifyk.vpssm3_sva=0xA0000000'
  • Fire Lord said:
    In the boot log, we can see "WARNING: at drivers/dsp/syslink/omap_notify/notify.c:776 notify_send_event+0xd4/0x26c()". Does it mean there is something wrong with DSP?

    Actually keep the boot args as we already discussed:

    console=ttyO2,115200n8 root=/dev/mtdblock3 rw rootfstype=jffs2 mem=100M earlyprintk

    This error occur as the udev is trying to insert the vpss module in the kernel, but there are several steps that should be done prior to insert this vpss module. To workaround this problem:

    1. Delete the vpss.ko module from the arago fs: /lib/modules/2.6.37/kernel/drivers/video/ti81xx/vpss/vpss.ko

    2. Delete the sii9022a.ko module from the arago fs: /lib/modules/2.6.37/kernel/drivers/video/ti81xx/sii9022a/sii9022a.ko

    3. Create new rd-jffs2.bin file based on the new arago fs (with delete modules from it)

    4. Flash the new rd-jffs2.bin file in NAND

    Thus you will boot up properly, but not have vpss.ko and sii9022a.ko auto inserted by udev in the kernel. If you need these modules inserted in your kernel, you can do this manually after the board boot up, follow the below wiki pages how to do:

    Regards,
    Pavel

  • hi,

    Glad to tell you I have saw hope of success.

    First try:

    """Can you try to add in the bootrgs 'notifyk.vpssm3_sva=0xBF900000'? If does not work, try with 'notifyk.vpssm3_sva=0xA0000000'""""

    I tried this for both BCH0 and BCH8 which failed. Here is the boot log:

    8270.txt

    6087.txt

    0523.txt

    7331.txt

    Second try: I made a new fs under your guide ( delete the two kos)---rd1-jffs2.bin

    Similarly, I tested BCH0 and BCH8. When use BCH0, coming the problem as """mtd->read(0x800 bytes from 0xa02000) returned ECC error"""", When use BCH8, coming the problem as """"Read of newly-erased block at 0x09de0000 failed: -74. Putting on bad_list     Read of newly-erased block at 0x09de0000 failed: -74. Putting on bad_list    JFFS2: marking eraseblock at 09de0000     as bad"""". And when use BCH8, this problem isn't coming immediately but after about 3 minutes. I have tried to scrub the all nand which do not take effect. Here is the boot log:

    3581.txt

    6136.txt

    And are you sure that BCH8 is not support jffs2 filesystem? If yes, need i test for BCH8 when boot from nand with jffs2?If yes, the most important and right thing I should do is to solve the problem of ""mtd->read(0x800 bytes from 0xa99000) returned ECC error"". Do I get it?

    Another question, if I boot from nand successfully, can I see a diretory called "dm8168-evm" under the directory of "/home/root/" which can be seen from SD boot?Because I can not confirm that if I have boot from nand successfully.

  • Fire Lord said:
    Another question, if I boot from nand successfully, can I see a diretory called "dm8168-evm" under the directory of "/home/root/" which can be seen from SD boot?Because I can not confirm that if I have boot from nand successfully.

    This is strange. By default, there is no "dm8168-evm" under the directory of "/home/root/" of the default arago fs.

    When you boot up from NAND, check about the presence of the vpss.ko and sii9022a.ko. These two modules should miss in NAND, and present in SD.

    Regards,
    Pavel

  • Fire Lord said:
    Similarly, I tested BCH0 and BCH8. When use BCH0, coming the problem as """mtd->read(0x800 bytes from 0xa02000) returned ECC error"""", When use BCH8, coming the problem as """"Read of newly-erased block at 0x09de0000 failed: -74. Putting on bad_list     Read of newly-erased block at 0x09de0000 failed: -74. Putting on bad_list    JFFS2: marking eraseblock at 09de0000     as bad"""". And when use BCH8, this problem isn't coming immediately but after about 3 minutes. I have tried to scrub the all nand which do not take effect. Here is the boot log:

    Fire Lord said:
    And are you sure that BCH8 is not support jffs2 filesystem? If yes, need i test for BCH8 when boot from nand with jffs2?If yes, the most important and right thing I should do is to solve the problem of ""mtd->read(0x800 bytes from 0xa99000) returned ECC error"". Do I get it?

    Seems to me you have two options here:

    1. Move to UBIFS

    2. Roll back to BCH0 (1-bit ECC).

    See the below e2e thread which explains in details your error and how to resolve.

    Regards,
    Pavel

  • hi,
    pavel,
    I will try to move to ubifs latter.
    What means to "Roll back to BCH0(1-bit ECC)"? Does it mean I should flashing kernel and fs with BCH0 and boot with BCH0? If yes, Do you have any suggestion to solve the problem of "mtd->read(0x800 bytes from 0xaeb000) returned ECC error"?
  • Fire Lord said:
    What means to "Roll back to BCH0(1-bit ECC)"? Does it mean I should flashing kernel and fs with BCH0 and boot with BCH0? If yes, Do you have any suggestion to solve the problem of "mtd->read(0x800 bytes from 0xaeb000) returned ECC error"?

    This one is fully described in the below e2e thread:

    e2e.ti.com/.../239237

  • hi,
    I am glad to tell you that I have solve the problem of "mtd->read(0x800 bytes from 0xaeb000) returned ECC error".

    And then I wnat to have a conclusion.
    I have a custom board based on TMS320DM8168.
    When I want to boot from nand with jffs2, the ecc schemes are very important. What I use is following:
    u-boot, BCH8, defaultly, no need to change;
    kernel,BCH0, default is BCH8, need to change. here is the way:e2e.ti.com/.../808995
    uboot should be flashed into nand in BCH8; But kernel and fs should be BCH0;
    why BCH0? Beacause the jffs2 only support hw 0 and sw 0, But I found sw 0 is not work, So i chose hw 0.


    Here, I want to thank pavel very much. This two weeks, thanks for your help whcih really help me. Thank you very much.
    May you be good every day.

    sincere firelord
  • JFFS2 support only 1-bit HW ECC Hamming code (hw 0) (bch0).

    Regards,
    Pavel