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.

PROCESSOR-SDK-OMAPL138: u-boot and NAND

Part Number: PROCESSOR-SDK-OMAPL138
Other Parts Discussed in Thread: OMAP-L138

I have been trying to load the various boot components into NAND from a u-boot terminal to allow booting from NAND. At the moment I'm manually punching in commands to the u-boot terminal, but my expectation is that I will be able to prepare a minicom script (much like what is done at setup stage) that will allow this to be carried out as a semi-automated step.

If possible, I would not like to rely on the windows tool provided as I don't have access to a windows development PC.

I have a bootable SD card, which I have added the following to its boot partition:

  • u-boot.ais (output of make u-boot)
  • u-boot.bin (output of make u-boot)
  • zImage (output of make linux)

To keep things simple, Im not looking at TFTP for now...

These are the steps Im carrying out so far:

  • boot the board using the SD card, and bring up u-boot terminal (using U-Boot 2017.01-g9fd60700db)
  • Copy the AIS bootloader from the SD to the start of NAND
nand device 0
nand erase.spread 0 0x20000
fatload mmc 0 0x81600000 u-boot.ais
nand write 0x81600000 0 0x20000
  • Copy the u-boot binary from the SD card to NAND
nand erase.spread 0x80000 0x40000
fatload mmc 0 0x81600000 u-boot.bin
nand write 0x81600000 0x80000 0x40000
  • Copy the kernel image from SD card to NAND
nand erase.spread 0x280000 0x300000
fatload mmc 0 0x81600000 zImage
nand write 0x81600000 0x280000 0x300000

At this stage I would have thought that the required components have been copied to NAND, meaning the board will load u-boot successfully. I could then go off an configure the way u-boot loads the kernel... but I'm not seeing this at all. I'm not seeing any activity at all. Besides the Ethernet lights slowly blinking at me - 1Hz or slower)

This is making me think I'm writing incorrect files... However, I see the same result when trying to write the pre-built images... Where am I going wrong? Invalid addresses perhaps?

  • Hi Juan,

    I've forwarded this to the software team. Their feedback should be posted here.

    BR
    Tsvetolin Shulev
  • Hi, Juan,

    We only tested running u-boot from NAND (NAND boot). Please refer to the steps in board/davinci/da8xxevm/README.da850. Looking at the images you programmed to the NAND, it seems to me that you are missing the filesystem. As far as booting kernel from NAND, we have not tried it. you may give it a try. Do let us know if you get it working.

    Rex
  • At the moment, Im not even able to get u-boot booting...

    As this isnt working, I've moved back to booting from SD... So far, at each boot I see many "Bad Erase Block" messages...

    nand: device found, Manufacturer ID: 0x2c, Chip ID: 0xcc
    nand: Micron MT29F4G16ABADAH4
    nand: 512 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
    Bad block table not found for chip 0
    Bad block table not found for chip 0
    Scanning device for bad blocks
    Bad eraseblock 1 at 0x000000020000
    Bad eraseblock 2 at 0x000000040000
    Bad eraseblock 3 at 0x000000060000
    ** 115 printk messages dropped ** Bad eraseblock 145 at 0x000001220000
    ** 1 printk messages dropped ** Bad eraseblock 147 at 0x000001260000
    ...
    Bad eraseblock 1772 at 0x00000dd80000
    Bad eraseblock 1773 at 0x00000dda0000
    Bad eraseblock 1774 at 0x00000ddc0000
    Bad eraseblock 1775 at 0x00000dde0000
    ...
    Bad eraseblock 1945 at 0x00000f320000
    Bad eraseblock 1946 at 0x00000f340000
    Bad eraseblock 1947 at 0x00000f360000
    Bad eraseblock 1948 at 0x00000f380000
    ...
    Bad eraseblock 2047 at 0x00000ffe0000
    Bad block table written to 0x00001ffe0000, version 0x01
    Bad block table written to 0x00001ffc0000, version 0x01
    3 ofpart partitions found on MTD device davinci-nand.0
    Creating 3 MTD partitions on "davinci-nand.0":
    0x000000000000-0x000000020000 : "u-boot env"
    0x000000020000-0x0000000a0000 : "u-boot"
    0x0000000a0000-0x000020000000 : "free space"
    davinci_nand davinci-nand.0: controller rev. 2.5
    
    

    This occurs after each boot, even if I dont reflash any of the NAND... Is this related, have I messed up my NAND addresses and clobbered something I shouldnt have?

  • Hi, Juan,

    Please try the following commands in the logs I captured to boot u-boot from NAND. I tftp the image instead.

    => setenv ipaddr 158.218.109.223
    => ping 158.218.109.254
    Using DaVinci-EMAC device
    host 158.218.109.254 is alive

    => setenv serverip 158.218.109.254
    => tftp ${loadaddr} 158.218.109.254:psdk4004-omapl138/u-boot-omapl138-lcdk.ais
    Using DaVinci-EMAC device
    TFTP from server 158.218.109.254; our IP address is 158.218.109.223
    Filename 'psdk4004-omapl138/u-boot-omapl138-lcdk.ais'.
    Load address: 0xc0700000
    Loading: #################################################################
    ###############################
    528.3 KiB/s
    done
    Bytes transferred = 488024 (77258 hex)
    => print filesize
    filesize=77258
    => nand info

    Device 0: nand0, sector size 128 KiB
    Page size 2048 b
    OOB size 64 b
    Erase size 131072 b
    subpagesize 512 b
    options 0x40000002
    bbt options 0x 28000
    => nand erase 0x20000 80000

    NAND erase: device 0 offset 0x20000, size 0x80000
    Erasing at 0x80000 -- 100% complete.
    OK
    => nand info

    Device 0: nand0, sector size 128 KiB
    Page size 2048 b
    OOB size 64 b
    Erase size 131072 b
    subpagesize 512 b
    options 0x40000002
    bbt options 0x 28000
    => nand write ${loadaddr} 0x20000 80000

    NAND write: device 0 offset 0x20000, size 0x80000
    524288 bytes written: OK
    => 
     
    [ Set the Dip Switch to NAND boot according to L138 Development Kit http://processors.wiki.ti.com/index.php/L138/C6748_Development_Kit_%28LCDK%29#User_Interface ]

    The boot logs are shown as:

    U-Boot SPL 2017.01-g9fd60700db (Jun 28 2017 - 18:22:04)
    Trying to boot from NAND


    U-Boot 2017.01-g9fd60700db (Jun 28 2017 - 18:22:04 -0400)

    I2C: ready
    DRAM: 128 MiB
    WARNING: Caches not enabled
    NAND: 512 MiB
    MMC: davinci: 0
    In: serial
    Out: serial
    Err: serial
    Invalid MAC address read.
    Net: DaVinci-EMAC
    Warning: DaVinci-EMAC (eth0) using random MAC address - 1e:e8:1a:6f:e0:80

    Hit any key to stop autoboot: 0
    =>
    =>

  • Thanks Rex,
    I have followed the steps as shown, also updated my procedure to load the prebuilt-image over TFTP. The final write step fails with the following:

    => nand write ${loadaddr} 0x20000 80000
    
    NAND write: device 0 offset 0x20000, size 0x80000
    Skip bad block 0x00020000
    Skip bad block 0x00040000
    Skip bad block 0x00060000
    NAND write to offset c0000 failed -5
     131072 bytes written: ERROR
    

    The nand erase command also shows bad blocks... But does not exit with a failure...

  • The above issue is resolved if I use the spread erase option.

    setenv ipaddr 10.0.0.199;
    setenv serverip 10.0.0.69;
    tftp ${loadaddr} 10.0.0.69:u-boot.ais
    nand erase.spread 0x20000 80000;
    nand write ${loadaddr} 0x20000 80000

    I'll continue sorting out kernel and filesystem and will post back results...

  • Juan,

    That's great. I updated TI's U-boot Core User's Guide with OMAP-L138 NAND boot info. We just added OMAP-L support in recent ProcSDK and overlooked the NAND boot area.

    Please post back once you have kernel and filesystem working off NAND. We can update it to the User's Guide. Thanks!

    Rex