README.da850 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. Summary
  2. =======
  3. The README is for the boot procedure used for various DA850 (or compatible
  4. parts such as the AM1808) based boards.
  5. In the context of U-Boot, the board is booted in three stages. The initial
  6. bootloader which executes upon reset is the ROM Boot Loader (RBL) and sits
  7. in the internal ROM. The RBL initializes the internal memory and then
  8. depending on the exact board and pin configurations will initialize another
  9. controller (such as SPI or NAND) to continue the boot process by loading
  10. the secondary program loader (SPL). The SPL will initialize the system
  11. further (some clocks, SDRAM) and then load the full u-boot from a
  12. predefined location in persistent storage to DDR and jumps to the u-boot
  13. entry point.
  14. AIS is an image format defined by TI for the images that are to be loaded
  15. to memory by the RBL. The image is divided into a series of sections and
  16. the image's entry point is specified. Each section comes with meta data
  17. like the target address the section is to be copied to and the size of the
  18. section, which is used by the RBL to load the image. At the end of the
  19. image the RBL jumps to the image entry point. The AIS format allows for
  20. other things such as programming the clocks and SDRAM if the header is
  21. programmed for it. We do not take advantage of this and instead use SPL as
  22. it allows for additional flexibility (run-time detect of board revision,
  23. loading the next image from a different media, etc).
  24. Compilation
  25. ===========
  26. The exact build target you need will depend on the board you have. For
  27. Logic PD boards, or other boards which store the ethernet MAC address at
  28. the end of SPI flash, run 'make da850evm'. For boards which store the
  29. ethernet MAC address in the i2c EEPROM located at 0x50, run
  30. 'make da850_am18xxevm'. Once this build completes you will have a
  31. u-boot.ais file that needs to be written to the correct persistent
  32. storage.
  33. Flashing the images to SPI
  34. ==========================
  35. The AIS image can be written to SPI flash using the following commands.
  36. Assuming that the network is configured and enabled and the u-boot.ais file
  37. is tftp'able.
  38. U-Boot > sf probe 0
  39. U-Boot > sf erase 0 +320000
  40. U-Boot > tftp u-boot.ais
  41. U-Boot > sf write c0700000 0 $filesize
  42. Flashing the images to NAND
  43. ===========================
  44. The AIS image can be written to NAND using the u-boot "nand" commands.
  45. Example:
  46. OMAPL138_LCDK requires the AIS image to be written to the second block of
  47. the NAND flash.
  48. From the "nand info" command we see that the second block would start at
  49. offset 0x20000:
  50. U-Boot > nand info
  51. sector size 128 KiB (0x20000)
  52. Page size 2048 b
  53. From the tftp command we see that we need to copy 0x74908 bytes from
  54. memory address 0xc0700000 (0x75000 if we align a page of 2048):
  55. U-Boot > tftp u-boot.ais
  56. Load address: 0xc0700000
  57. Bytes transferred = 477448 (74908 hex)
  58. The commands to write the image from memory to NAND would be:
  59. U-Boot > nand erase 0x20000 0x75000
  60. U-Boot > nand write 0xc0700000 0x20000 0x75000
  61. Alternatively, MTD partitions may be defined. Using "mtdparts" to
  62. conveniently have a bootloader partition starting at the second block
  63. (offset 0x20000):
  64. setenv mtdids nand0=davinci_nand.0
  65. setenv mtdparts mtdparts=davinci_nand.0:128k(bootenv),2m(bootloader)
  66. In this case the commands would be simplified to:
  67. U-Boot > tftp u-boot.ais
  68. U-Boot > nand erase.part bootloader
  69. U-Boot > nand write 0xc0700000 bootloader
  70. Flashing the images to MMC
  71. ==========================
  72. If the boot pins are set to boot from mmc, the RBL will try to load the
  73. next boot stage form the first couple of sectors of an external mmc card.
  74. As sector 0 is usually used for storing the partition information, the
  75. AIS image should be written at least after the first sector, but before the
  76. first partition begins. (e.g: make sure to leave at least 500KB of unallocated
  77. space at the start of the mmc when creating the partitions)
  78. CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR is used by SPL, and should
  79. point to the sector were the u-boot image is located. (eg. After SPL)
  80. There are 2 ways to copy the AIS image to the mmc card:
  81. 1 - Using the TI tool "uflash"
  82. $ uflash -d /dev/mmcblk0 -b ./u-boot.ais -p OMAPL138 -vv
  83. 2 - using the "dd" command
  84. $ dd if=u-boot.ais of=/dev/mmcblk0 seek=117 bs=512 conv=fsync
  85. uflash writes the AIS image at offset 117. For compatibility with uflash,
  86. CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR is set to take into account this
  87. offset, and the dd command is adjusted accordingly.
  88. Recovery
  89. ========
  90. In the case of a "bricked" board, you need to use the TI tools found
  91. here[1] to write the u-boot.ais file. An example of recovering to the SPI
  92. flash of an AM1808 would be:
  93. $ mono sfh_OMAP-L138.exe -targetType AM1808 -p /dev/ttyUSB0 \
  94. -flash_noubl /path/to/u-boot.ais
  95. For other target types and flash locations:
  96. $ mono sfh_OMAP-L138.exe -h
  97. Links
  98. =====
  99. [1]
  100. http://processors.wiki.ti.com/index.php/Serial_Boot_and_Flash_Loading_Utility_for_OMAP-L138