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.

OMAP-L138 spi write

Other Parts Discussed in Thread: OMAP-L138

boot OMAP-L138 from spi flash.


Hit any key to stop autoboot:  0                                                 
 U-Boot >tftp c0700000 uImage
U-Boot > md 0xc0700000   

c0700000: 56190527 edf33e8a 93acd94f f8d32100    '..V.>..O....!..               
 
c0700010: 008000c0 008000c0 51cbb308 00020205    ...........Q....               
 
c0700020: 756e694c 2e322d78 37332e36 00000000    Linux-2.6.37....               
 
c0700030: 00000000 00000000 00000000 00000000    ................     
U-Boot > sf probe 0                                                             
 
SF: Detected M25P64 with page size 256, total 8 MiB                             
 
8192 KiB M25P64 at 0:0 is now current device         
U-Boot >sf erase 200000 200000
 
U-Boot > sf write 0xc0700000 0x200000 0x200000
 
U-Boot > md 0x00200000                                                           
 
00200000: 00000000 00000000 00000000 00000000    ................               
 
00200010: 00000000 00000000 00000000 00000000    ................               
 
00200020: 00000000 00000000 00000000 00000000    ................   


Address 0xc0700000 content should not address the contents of 0x200000 ?

why?

boot from nand flash is also the case .


Thanks,

all


  • Hi,

    boot OMAP-L138 from spi flash.


    Hit any key to stop autoboot:  0                                                 
     U-Boot >tftp c0700000 uImage
    U-Boot > md 0xc0700000   

    c0700000: 56190527 edf33e8a 93acd94f f8d32100    '..V.>..O....!..               
     
    c0700010: 008000c0 008000c0 51cbb308 00020205    ...........Q....               
     
    c0700020: 756e694c 2e322d78 37332e36 00000000    Linux-2.6.37....               
     
    c0700030: 00000000 00000000 00000000 00000000    ................     
    U-Boot > sf probe 0                                                             
     
    SF: Detected M25P64 with page size 256, total 8 MiB                             
     
    8192 KiB M25P64 at 0:0 is now current device         
    U-Boot >sf erase 200000 200000
     
    U-Boot >
     
    U-Boot > md 0x00200000                                                           
     
    00200000: 00000000 00000000 00000000 00000000    ................               
     
    00200010: 00000000 00000000 00000000 00000000    ................               
     
    00200020: 00000000 00000000 00000000 00000000    ................   


    Address 0xc0700000 content should not address the contents of 0x200000 ?

    why?

    boot from nand flash is also the case .

    Why are you displaying the contents at 0x00200000 ?

    md command is used to display the contents of memory.

    sf write 0xc0700000 0x200000 0x200000 , in this command you are writing the contents

    of ram which is at address 0xc0700000 into SPI flash at address 0x200000, and length to be written is 0x200000.

    So how can you expect md 0x200000 to show some value?

    Refer this link http://www.stlinux.com/u-boot/flash

    Thx,

    --Prabhakar Lad

  • thank you very much.

    What i want to do is boot OMAP-L138 only from nand flash.

    After i rebuilt the u-boot and kernel according to the TI date,and i according to the following make the jffs2 rootfs support for nand flash.

    NAND Flash (jffs2 image as rootfs)

    1. Download uImage and copy it to the NAND partition:

    U-Boot> tftp 0xc0700000 uImage
    U-Boot> nand erase 0x200000 0x200000
    U-Boot> nand write.e 0xc0700000 0x200000 0x200000

    2. Boot Linux using NFS, Download the jffs2 image, erase the NAND partition and write the jffs2 file system image to the NAND partition

    target$ tftp -r rootfs-base.jffs2 -g <ip_address_of_tftp_server>
    target$ flash_eraseall  /dev/mtd4
    target$ nandwrite -p /dev/mtd4  rootfs-base.jffs2

    3. Reset the board, Set up the bootargs and bootcmd environment variables to boot from NAND flash:

    U-Boot> setenv bootcmd 'nand read.e 0xc1180000 0x400000 0x400000; nboot.e 0xc0700000 0 0x200000; bootm'
    U-Boot> setenv bootargs mem=32M console=ttyS2,115200n8 root=/dev/mtdblock4  rw rootfstype=jffs2 ip=dhcp eth=${ethaddr}

    after do it ,the OMAP-L138 can normal boot from nand flash with the jffs2 rootfs. 

    but if after i trun off the power,reset the board,the terminal output 

    Load Address: c0008000
    Entry Point: c0008000
    Verifying Checksum ... Bad Data CRC
    ERROR: can't get kernel image!

    I do not know why this happened.

    So I think the likelihood is nand command was wrong. Try it, and found that spi flash will also such, feel very confused. 

    until now,I don't know where is the problem ?

    if the jffs2 rootfs is wrong ? or the uboot command ?

    Thanks

  • Hi,

    Refer this link http://processors.wiki.ti.com/index.php/Booting_Linux_kernel_using_U-Boot#NAND_Flash_.28ramdisk_as_rootfs.29

    Once you write the uImage to NAND just confirm that it has been written to NAND flash correctly.

    "Also if you see any bad blocks during the erase operation you'll need to make sure they don't occur in the middle of your kernel code. It seems that the bootloader doesn't understand bad blocks and will NOT skip them. So you need to have a contiguous set of good blocks for your kernel or you will see a CRC failure message when booting. "

    Thx,

    --Prabhakar Lad

  • Thank you, I think you said is the problem.

    it should bad blocks, because i write the kernel in mtd3 can work normal.

    thanks