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.

Why my flash nand cannot run well in mvl 5 ???

Now i am using DM365 in ramdisk.

Refer to http://wiki.davincidsp.com/index.php/LSP210DeviceDrivers

I can re-compile those flash nand related functions successfully.

Now i wanna do is just flash my filesystem in nand.

# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 003c0000 00004000 "bootloader"
mtd1: 00040000 00004000 "params"
mtd2: 00400000 00004000 "kernel"
mtd3: 03800000 00004000 "filesystem1"
mtd4: 00000000 00004000 "filesystem2"
mtd5: 00002000 00000010 "spi_eeprom"

But in executing ,

# flash_eraseall /dev/mtd3
Erasing 16 Kibyte @ 410000 --  7 % complete.
Skipping bad block at 0x00414000
Erasing 16 Kibyte @ 17ec000 -- 42 % complete.
Skipping bad block at 0x017f0000

Skipping bad block at 0x017f4000

Skipping bad block at 0x017f8000

Skipping bad block at 0x017fc000
Erasing 16 Kibyte @ 2410000 -- 64 % complete.
Skipping bad block at 0x02414000
Erasing 16 Kibyte @ 37ec000 -- 99 % complete.
Skipping bad block at 0x037f0000

Skipping bad block at 0x037f4000

Skipping bad block at 0x037f8000

Skipping bad block at 0x037fc000

It flash whole of nand... ( uboot ,kernal ,and filesystem are flashed! I don't wanna this! )

Could someone have the same problem? Please give me a hand...

Thank you very much.

 

 

  • I think you broke the mtd list table... In particular mtd4 has size 0. This is not correct.

    But why do you say that it flashes the whole nand? I think that the output of flash_eraseall is the offset within the mtd device. So for example 0x37ec000 is well within the declared size of mtd3. From your table it seems to be 0x3800000 bytes in size.

    The value printed by flash_eraseall is not the absolute address from the start of the flash. I think it's the offset from the start of that specific mtd device. For the absolute start address, check the output of the kernel during boot (or use dmesg command).

  • Thanks Macro.

    And could you please tell me , how to recover this MTD list table?

    ( P.S. I do not change any nand partition settings in kernal's board-dm365-evm.c )

    ===

    I am sure my nand is totally erased by this "flash_eraseall" command.

    Bacause after this command and reboot , i cannot see any uboot information.

    :)

     

     

  • Now the situation is...

    I am using DM365 EVM,and i would operate my linux OS in ramdisk.
    I am using flash binaries from
    PSP_02_10_00_14/examples/mtd-utils-v1.1-lsp200
    But i cannot clean my filesystem only by following command.
    "flash_eraseall /dev/mtd3"
    (For erase kernal only , flash_eraseall /dev/mtd2 , it's ok!)

    So i trace it , and modify my nand partition by editting
    /arch/arm/mach-davinci/board-dm365-evm.c
     
    the boot infomation is:
    Creating 5 MTD partitions on "nand_davinci.0":
    0x00000000-0x00780000 : "bootloader"
    0x00780000-0x00800000 : "params"
    0x00800000-0x00c00000 : "kernel"
    0x00c00000-0x04c00000 : "filesystem1"
    mtd: partition "filesystem1" extends beyond the end of device "nand_davinci.0" -- size truncated to 0x3400000
    0x04c00000-0x04000000 : "filesystem2"
    mtd: partition "filesystem2" is out of reach -- disabled

    (1) Partition for the filesystem is downsize to 32MB , still with the same problem)
    (2) My boot argument is assigned 128MB for linux

    After booting , i check my mtd information by
    cat /proc/mtd

    dev:    size   erasesize  name
    mtd0: 00780000 00004000 "bootloader"
    mtd1: 00080000 00004000 "params"
    mtd2: 00400000 00004000 "kernel"
    mtd3: 03400000 00004000 "filesystem1"
    mtd4: 00000000 00004000 "filesystem2"
    mtd5: 00002000 00000010 "spi_eeprom"
     
    Is it the reason why the command  "flash_eraseall -j /dev/mtd3" is always clean ALL my nand???
    Could someone give me a hand?

  • Hi,

    the flash partitioning on DM365EVM is static and is defined in the kernel source file "arch/arm/mach-davinci/board-dm365-evm.c", check the C structure named "nand_partitions". It is basically an array of structures defining each partition, its name, size and attributes. What's strange is that in the default configuration  "filesystem2" has size "MTDPART_SIZ_FULL", that means to fill up the entire flash until its end with that partition. So it should be a big partition, but instead your kernels says that it is 0 bytes long. This is wrong...

    Notice that the size of the nand flash is not written anywhere in the code, it is asked directly to the nand flash chip. So if you didn't touch the partitioning scheme, something must be wrong elsewhere. Perhaps you opened the nand socked and misplaced the chip?

  • Hi,

    I've noticed another thing: I don't know what chip is installed in your EVM board, but the "erasesize" of 0x4000 is "strange". Normally a nand chip is composed of several pages and the pages are grouped into blocks. "erasesize" refers to the size of the minimum eraseable unit on the nand chip. Normally it is the block. Notice that common erase sizes nowdays is 128K or 256K. I can't say for sure that 0x4000 is wrong, but please check it.

    In my EVM page size is 2K, block size is 128K and total flash size is 1GB.

    BUT if you installed a very small nand chip, then 0x4000 erasesize can be correct. It is better if you check the total size of your flash. Perhaps your partitioning scheme is bigger that the real chip you have in your board.