README.ipam390 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. Summary
  2. =======
  3. The README is for the boot procedure on the ipam390 board
  4. In the context of U-Boot, the board is booted in three stages. The initial
  5. bootloader which executes upon reset is the ROM Boot Loader (RBL) and sits
  6. in the internal ROM. The RBL initializes the internal memory and then
  7. depending on the exact board and pin configurations will initialize another
  8. controller (such as NAND) to continue the boot process by loading
  9. the secondary program loader (SPL). The SPL will initialize the system
  10. further (some clocks, SDRAM). As on this board is used the falcon boot
  11. mode, now 2 ways are possible depending on the GPIO 7_14 input pin,
  12. connected with the "soft reset switch"
  13. If this pin is logical 1 (high level):
  14. spl code starts the kernel image without delay
  15. If this pin is logical 0 (low level):
  16. spl code starts the u-boot image
  17. AIS is an image format defined by TI for the images that are to be loaded
  18. to memory by the RBL. The image is divided into a series of sections and
  19. the image's entry point is specified. Each section comes with meta data
  20. like the target address the section is to be copied to and the size of the
  21. section, which is used by the RBL to load the image. At the end of the
  22. image the RBL jumps to the image entry point. The AIS format allows for
  23. other things such as programming the clocks and SDRAM if the header is
  24. programmed for it. We do not take advantage of this and instead use SPL as
  25. it allows for additional flexibility (run-time detect of board revision,
  26. loading the next image from a different media, etc).
  27. Compilation
  28. ===========
  29. run "tools/buildman/buildman -k ipam390" in the u-boot source tree.
  30. Once this build completes you will have a ../current/ipam390/u-boot.ais file
  31. that needs to be written to the nand flash.
  32. Flashing the images to NAND
  33. ==========================
  34. The AIS image can be written to NAND flash using the following commands.
  35. Assuming that the network is configured and enabled and the u-boot.ais file
  36. is tftp'able.
  37. U-Boot > print upd_uboot
  38. upd_uboot=tftp c0000000 ${u-boot};nand erase.part u-boot;nand write c0000000 20000 ${filesize}
  39. U-Boot >
  40. U-Boot > run upd_uboot
  41. Using DaVinci-EMAC device
  42. TFTP from server 192.168.1.1; our IP address is 192.168.20.71
  43. Filename '/tftpboot/ipam390/u-boot.ais'.
  44. Load address: 0xc0000000
  45. Loading: ##################################
  46. 1.5 MiB/s
  47. done
  48. Bytes transferred = 493716 (78894 hex)
  49. NAND erase.part: device 0 offset 0x20000, size 0x160000
  50. Erasing at 0x160000 -- 100% complete.
  51. OK
  52. NAND write: device 0 offset 0x20000, size 0x78894
  53. 493716 bytes written: OK
  54. U-Boot >
  55. Recovery
  56. ========
  57. In the case of a "bricked" board, you need to use the TI tools found
  58. here[1] to create an uboot-uart-ais.bin file
  59. - cd to the u-boot source tree
  60. - compile the u-boot for the ipam390 board:
  61. $ tools/buildman/buildman -k ipam390
  62. -> Now we shall have u-boot.bin
  63. - Create u-boot-uart-ais.bin
  64. $ mono HexAIS_OMAP-L138.exe -entrypoint 0xC1080000 -ini ipam390-ais-uart.cfg \
  65. -o ../current/ipam390/uboot-uart-ais.bin ./u-boot.bin@0xC1080000;
  66. Note: The ipam390-ais-uart.cfg is found in the board directory
  67. for the ipam390 board, u-boot:/board/Barix/ipam390/ipam390-ais-uart.cfg
  68. - We can now run bootloader on IPAM390 via UART using the command below:
  69. $ mono ./slh_OMAP-L138.exe -waitForDevice -v -p /dev/tty.UC-232AC uboot-uart-ais.bin
  70. NOTE: Do not cancel the command execution! The command takes 20+ seconds
  71. to upload u-boot over serial and run it!
  72. Outcome:
  73. Waiting for the OMAP-L138...
  74. (AIS Parse): Read magic word 0x41504954.
  75. (AIS Parse): Waiting for BOOTME... (power on or reset target now)
  76. (AIS Parse): BOOTME received!
  77. (AIS Parse): Performing Start-Word Sync...
  78. (AIS Parse): Performing Ping Opcode Sync...
  79. (AIS Parse): Processing command 0: 0x5853590D.
  80. (AIS Parse): Performing Opcode Sync...
  81. (AIS Parse): Executing function...
  82. (AIS Parse): Processing command 1: 0x5853590D.
  83. (AIS Parse): Performing Opcode Sync...
  84. (AIS Parse): Executing function...
  85. (AIS Parse): Processing command 2: 0x5853590D.
  86. (AIS Parse): Performing Opcode Sync...
  87. (AIS Parse): Executing function...
  88. (AIS Parse): Processing command 3: 0x5853590D.
  89. (AIS Parse): Performing Opcode Sync...
  90. (AIS Parse): Executing function...
  91. (AIS Parse): Processing command 4: 0x5853590D.
  92. (AIS Parse): Performing Opcode Sync...
  93. (AIS Parse): Executing function...
  94. (AIS Parse): Processing command 5: 0x58535901.
  95. (AIS Parse): Performing Opcode Sync...
  96. (AIS Parse): Loading section...
  97. (AIS Parse): Loaded 326516-Byte section to address 0xC1080000.
  98. (AIS Parse): Processing command 6: 0x58535906.
  99. (AIS Parse): Performing Opcode Sync...
  100. (AIS Parse): Performing jump and close...
  101. (AIS Parse): AIS complete. Jump to address 0xC1080000.
  102. (AIS Parse): Waiting for DONE...
  103. (AIS Parse): Boot completed successfully.
  104. Operation completed successfully.
  105. Falcon Bootmode (boot linux without booting U-Boot)
  106. ===================================================
  107. The Falcon Mode extends this way allowing to start the Linux kernel directly
  108. from SPL. A new command is added to U-Boot to prepare the parameters that SPL
  109. must pass to the kernel, using ATAGS or Device Tree.
  110. In normal mode, these parameters are generated each time before
  111. loading the kernel, passing to Linux the address in memory where
  112. the parameters can be read.
  113. With Falcon Mode, this snapshot can be saved into persistent storage and SPL is
  114. informed to load it before running the kernel.
  115. To boot the kernel, these steps under a Falcon-aware U-Boot are required:
  116. 1. Boot the board into U-Boot.
  117. Use the "spl export" command to generate the kernel parameters area or the DT.
  118. U-Boot runs as when it boots the kernel, but stops before passing the control
  119. to the kernel.
  120. Here the command sequence for the ipam390 board:
  121. - load the linux kernel image into ram:
  122. U-Boot > nand read c0100000 2 200000 400000
  123. NAND read: device 0 offset 0x200000, size 0x400000
  124. 4194304 bytes read: OK
  125. - generate the bootparms image:
  126. U-Boot > spl export atags c0100000
  127. ## Booting kernel from Legacy Image at c0100000 ...
  128. Image Name: Linux-3.5.1
  129. Image Type: ARM Linux Kernel Image (uncompressed)
  130. Data Size: 2504280 Bytes = 2.4 MiB
  131. Load Address: c0008000
  132. Entry Point: c0008000
  133. Verifying Checksum ... OK
  134. Loading Kernel Image ... OK
  135. subcommand not supported
  136. subcommand not supported
  137. Argument image is now in RAM at: 0xc0000100
  138. - copy the bootparms image into nand:
  139. U-Boot > mtdparts
  140. device nand0 <davinci_nand.0>, # parts = 6
  141. #: name size offset mask_flags
  142. 0: u-boot-env 0x00020000 0x00000000 0
  143. 1: u-boot 0x00160000 0x00020000 0
  144. 2: bootparms 0x00020000 0x00180000 0
  145. 3: factory-info 0x00060000 0x001a0000 0
  146. 4: kernel 0x00400000 0x00200000 0
  147. 5: rootfs 0x07a00000 0x00600000 0
  148. active partition: nand0,0 - (u-boot-env) 0x00020000 @ 0x00000000
  149. defaults:
  150. mtdids : nand0=davinci_nand.0
  151. mtdparts: mtdparts=davinci_nand.0:128k(u-boot-env),1408k(u-boot),128k(bootparms),384k(factory-info),4M(kernel),-(rootfs)
  152. U-Boot > nand erase.part bootparms
  153. NAND erase.part: device 0 offset 0x180000, size 0x20000
  154. Erasing at 0x180000 -- 100% complete.
  155. OK
  156. U-Boot > nand write c0000100 180000 20000
  157. NAND write: device 0 offset 0x180000, size 0x20000
  158. 131072 bytes written: OK
  159. U-Boot >
  160. You can use also the predefined U-Boot Environment variable "setbootparms",
  161. which will do all the above steps in one command:
  162. U-Boot > print setbootparms
  163. setbootparms=nand read c0100000 200000 400000;spl export atags c0100000;nand erase.part bootparms;nand write c0000100 180000 20000
  164. U-Boot > run setbootparms
  165. NAND read: device 0 offset 0x200000, size 0x400000
  166. 4194304 bytes read: OK
  167. ## Booting kernel from Legacy Image at c0100000 ...
  168. Image Name: Linux-3.5.1
  169. Image Type: ARM Linux Kernel Image (uncompressed)
  170. Data Size: 2504280 Bytes = 2.4 MiB
  171. Load Address: c0008000
  172. Entry Point: c0008000
  173. Verifying Checksum ... OK
  174. Loading Kernel Image ... OK
  175. subcommand not supported
  176. subcommand not supported
  177. Argument image is now in RAM at: 0xc0000100
  178. NAND erase.part: device 0 offset 0x180000, size 0x20000
  179. Erasing at 0x180000 -- 100% complete.
  180. OK
  181. NAND write: device 0 offset 0x180000, size 0x20000
  182. 131072 bytes written: OK
  183. U-Boot >
  184. Links
  185. =====
  186. [1]
  187. http://sourceforge.net/projects/dvflashutils/files/OMAP-L138/