http://processors.wiki.ti.com/index.php/Booting_Linux_kernel_using_U-Boot#SDRAM
Booting the kernel requires a valid kernel image (uImage) and a target filesystem.
U-Boot implements tftp command to download the kernel and filesystem (in case of ramdisk) images to SDRAM. You can then choose to directly boot the newly downloaded images or write them to non-volatile memory using U-Boot commands and then copy the the images to SDRAM from this memory for subsequent boots.
To use TFTP download, you must first set up the DUT IP parameters. The easiest way to do this is to use the DHCP server on your network.
host$ cp <path to uImage file> /tftpboot
NOTE: For Community Linux based SDK, use the RAM disk filesystem arago-base-image-arago.ext2.gz from Arago project. The SDK download page for OMAP-L1 or AM18x has a filesystem tarball with demo which can be exported as NFS (Network Filesystem) or converted to a ramdisk and used as root filesystem in case there is enough RAM available.
For Montavista Linux based releases for OMAP-L137, use the file /opt/mv_pro_5.0/montavista/pro/devkit/arm/v5t_le/images/ramdisk.gz from your MontaVista Linux installation.
host$ cp <path to ramdisk file> /tftpboot
U-Boot> setenv autoload no U-Boot> dhcp
U-Boot> setenv ipaddr <static ip address>
host /sbin/ifconfig
U-Boot> setenv serverip <ip addr of server>
U-Boot> setenv bootfile <Linux kernel image file name>
You can get help on U-Boot commands by using the U-Boot "help" command. Typing help at the U-Boot command prompt gives a list of commands supported. Typing help followed by a command name gives help regarding that particular command. Help on U-Boot commands is also available at http://www.denx.de/wiki/view/DULG/UBoot.
Default U-Boot comes with SPI flash support. To enable support for other flash types (NAND, NOR), you need to re-build U-Boot. Once you have a new U-Boot image, please flash the new U-Boot images. Here is the procedure for OMAP-L137 (or DA830, AM17xx) and OMAP-L138 (or DA850, AM18xx) EVMs.
NOTE: If you are trying to use the TFTP server on Windows host machine, you may observe Timeouts as the server is not able to get the ACK block from the target. Root cause of this issue is the inability of the Windows based TFTP server to handle large TFTP block size. To fix this, issue the following command:
U-Boot> setenv tftpblocksize 512
Other way of fixing this problem is to switch to Linux based TFTP servers.
Note that bootargs in these examples sets ip=dhcp. If your EVM is not connected to a network with a DHCP server, you will want to set ip=off. For booting with NFS as root file system, having a valid IP address is a must.
This method downloads the kernel and ramdisk image from ethernet using TFTP into SDRAM, then boots the kernel image from SDRAM. Use the following settings for U-Boot environment variables bootargs and bootcmd and reboot the DUT:
U-Boot> setenv bootargs mem=32M console=ttyS2,115200n8 root=/dev/ram0 rw initrd=0xc1180000,4M ip=dhcp eth=${ethaddr} U-Boot> setenv bootcmd 'tftp 0xc0700000 uImage; tftp 0xc1180000 <ramdisk file name>; bootm 0xc0700000'
The SPI flash on the OMAP-L137 (or DA830, AM17xx) EVM board is 4 MBytes and that on OMAP-L138 (or DA850, AM18xx) EVM board is 8 MBytes in size. Depending on the size of the kernel and filesystem, you may not be able to fit both of them on the SPI flash. If both of them do not fit, we recommend that you keep the kernel image on SPI flash and use another medium to the store the filesystem.
In the example below, both kernel and filesystem reside on the SPI flash. While booting, U-Boot copies both kernel and filesystem from SPI flash to external RAM and boots the kernel which later mounts the filesystem as a ramdisk.
U-Boot> sf probe 0
IMPORTANT
The size and offset values given below are to be considered representative only. To know the exact value of offset, please refer to the SPI flash partition information from Kernel bootlog. Size parameter depends on the actual size of respective images.
U-Boot> tftp 0xc0700000 uImage U-Boot> sf erase 0x80000 0x200000 U-Boot> sf write 0xc0700000 0x80000 0x200000
U-Boot> tftp 0xc1180000 <ramdisk file name> U-Boot> sf erase 0x280000 0x400000 U-Boot> sf write 0xc1180000 0x280000 0x400000
U-Boot> setenv bootargs mem=32M console=ttyS2,115200n8 root=/dev/ram0 rw initrd=0xc1180000,4M ip=dhcp eth=${ethaddr} U-Boot> setenv bootcmd 'sf probe 0;sf read 0xc0700000 0x80000 0x200000;sf read 0xc1180000 0x280000 0x400000;bootm 0xc0700000'
All these steps can be made a part of the bootcmd environment variable.
U-Boot> setenv bootcmd 'sf probe 0; sf read 0xc0700000 0x1E0000 0x220000; bootm 0xc0700000'
NOTE: You can also probe 1 if the flash is connected to SPI1.
NOTE: The value 0x220000 is a byte count denoting the size of uImage and may need to be modified if the size of the Linux kernel increases.
IMPORTANT
The size and offset values given below are to be considered representative only. To know the exact value of offset, please refer to the NAND flash partition information from Kernel bootlog. Size parameter depends on the actual size of respective images.
U-Boot> tftp 0xc0700000 uImage U-Boot> nand erase 0x200000 0x200000 U-Boot> nand write.e 0xc0700000 0x200000 0x200000
U-Boot> tftp 0xc1180000 <ramdisk file name> U-Boot> nand erase 0x400000 0x400000 U-Boot> nand write.e 0xc1180000 0x400000 0x400000
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/ram0 rw initrd=0xc1180000,4M ip=dhcp eth=${ethaddr}
IMPORTANT
The size and offset values given below are to be considered representative only. To know the exact value of offset, please refer to the NAND flash partition information from Kernel bootlog. Size parameter depends on the actual size of respective images.
U-Boot> tftp 0xc0700000 uImage U-Boot> nand erase 0x200000 0x200000 U-Boot> nand write.e 0xc0700000 0x200000 0x200000
target$ tftp -r rootfs-base.jffs2 -g <ip_address_of_tftp_server> target$ flash_eraseall /dev/mtdX target$ nandwrite -p /dev/mtdX <jffs2_file_system_image>
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/mtdblockX rw rootfstype=jffs2 ip=dhcp eth=${ethaddr}
Note: In the above commands 'X' in '/dev/mtdX' and '/dev/mtdblockX' refer to the NAND partition which is reserved for file system.
IMPORTANT
The size and offset values given below are to be considered representative only. To know the exact value of offset, please refer to the NAND flash partition information from Kernel bootlog. Size parameter depends on the actual size of respective images.
U-Boot> tftp 0xc0700000 uImage U-Boot> nand erase 0x400000 0x400000 U-Boot> nand write.e 0xc0700000 0x400000 0x400000
target$ tftp -r ubi.img -g <ip_address_of_tftp_server> target$ flash_eraseall /dev/mtdX target$ ubiformat /dev/mtdX -f ubi.img -s 512 -O 2048
UBIFS Image can also be flashed from U-Boot.
U-Boot> setenv bootcmd 'nand read.e 0xc1180000 0x400000 0x400000; nboot.e 0xc0700000 0 0x400000; bootm' U-Boot> setenv bootargs mem=32M console=ttyS2,115200n8 root=ubi0:rootfs rw rootfstype=ubifs ubi.mtd=X,2048 ip=dhcp
Note: In the above commands 'X' in '/dev/mtdX' refer to the NAND partition which is reserved for file system.
Note: Currently, booting from NOR is supported only on OMAP-L138 (or DA850, AM18xx).
The NOR flash on the EVM boards is 8 MBytes in size. Depending on the size of the kernel and filesystem, you may not be able to fit both of them on the NOR flash. If both of them do not fit, we recommend that you keep the kernel image on NOR flash and use another medium to the store the file system.
In the example below, both kernel and filesystem reside on the NOR flash. While booting, U-Boot copies both kernel and filesystem from NOR flash to external RAM and boots the kernel which later mounts the filesystem as a ramdisk.
IMPORTANT
The size and offset values given below are to be considered representative only. To know the exact value of offset, please refer to the NOR flash partition information from Kernel bootlog. Size parameter depends on the actual size of respective images.
U-Boot> tftp 0xc0700000 uImage U-Boot> erase 60080000 +200000 U-Boot> cp.b c0700000 60080000 200000
U-Boot> tftp 0xc1180000 <ramdisk file name> U-Boot> erase 60280000 +400000 U-Boot> cp.b c1180000 60280000 400000
U-Boot> setenv bootargs mem=32M console=ttyS2,115200n8 root=/dev/ram0 rw initrd=0xc1180000,4M ip=dhcp U-Boot> setenv bootcmd 'cp.b 60080000 c0700000 200000;cp.b 60280000 c1180000 400000;bootm 0xc0700000'
U-boot includes support for loading files from USB mass storage devices into memory. This section explains steps for configuring U-Boot to enable USB and mass storage support in U-Boot. It also shows U-Boot commands used for initializing and loading files from mass storage devices connected to USB 2.0 port on the EVM.
The default U-Boot image provided in the with PSP installation has USB MSC support enabled.
Use the following sequence of U-Boot commands to load the Linux kernel image from the USB mass storage device. The files need to be loaded onto the USB disk by mounting it on a host machine first. Note: that the USB device should be connected to the EVM before running these commands.
U-Boot> usb reset
U-Boot> fatload usb 0:1 0xC0700000 uImage
You can use the following additional commands to identify the device attached:
U-Boot> fatls usb 0:1
All these steps can be made a part of the bootcmd environment variable.
U-Boot> setenv bootcmd 'usb start; fatload usb 0:1 0xC0700000 uImage; bootm 0xc0700000'