Advertisement
Guest User

Untitled

a guest
Apr 21st, 2015
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 26.18 KB | None | 0 0
  1. altbootcmd=echo "ERROR: Maximum boot count reached!"; tlv errstate;
  2.  
  3. anything_else_needs_flashing=echo "INFO: Starting anything else needs flashing..."; if test ${XLOADER_NEEDS_FLASHING} = yes || test ${ROOTFS_NEEDS_FLASHING} = yes || test ${KERNEL_NEEDS_FLASHING} = yes; then echo "INFO: kernel partition being erased"; run eraseuImage; KERNEL_NEEDS_FLASHING=yes; fi; if test ${XLOADER_NEEDS_FLASHING} = yes; then if tlv chnkhdr ${tlv_load_addr} x-loader; then echo "INFO: xloader in download partition TLV update image"; statusled green blink; nandecc hw 2; echo "INFO: xloader partition being erased"; nand erase ${TLV_CHNK_DEST}; if test ${TLV_CHNK_ENCM} = 00000001; then TLV_CHNK_SIZE=${TLV_DECRYPT_XLOADER_CHNK_SIZE}; fi; echo "INFO: writing xloader to flash..."; if nand write ${TLV_CHNK_DATA} ${TLV_CHNK_DEST} ${TLV_CHNK_SIZE}; then echo "INFO: nand write successful"; else echo "ERROR: nand write failed"; tlv errstate; fi; nandecc hw 1; XLOADER_VERS=${TLV_CHNK_VERS};fi; fi; if test ${ROOTFS_NEEDS_FLASHING} = yes; then if tlv chnkhdr ${tlv_load_addr} rootfs; then echo "INFO: rootfs in download partition TLV update image"; statusled green blink; nandecc hw 1; echo "INFO: erasing rootfs partition"; run eraseRfs; if ubi part rootfs 2048; then echo "INFO: rootfs is a valid ubi partition"; fi; if test ${TLV_CHNK_ENCM} = 00000001; then TLV_CHNK_SIZE=${TLV_DECRYPT_ROOTFS_CHNK_SIZE}; fi; echo "INFO: need to create ubi nuvo-tesla-rootfs volume first..."; if ubi create nuvo-tesla-rootfs; then echo "INFO: successfully created volume, nuvo-tesla-rootfs..."; echo "INFO: writing ubi rootfs to flash..."; if ubi write ${TLV_CHNK_DATA} nuvo-tesla-rootfs ${TLV_CHNK_SIZE}; then echo "INFO: successfully wrote rootfs to flash after volume, nuvo-tesla-rootfs, was created..."; else echo "ERROR: failed to write rootfs to flash after volume, nuvo-tesla-rootfs, was created"; tlv errstate; fi; else echo "ERROR: failed to create volume, nuvo-tesla-rootfs"; tlv errstate; fi; ROOTFS_VERS=${TLV_CHNK_VERS};else echo "ERROR: rootfs not in download partition TLV update image"; tlv errstate; fi; fi; if test ${KERNEL_NEEDS_FLASHING} = yes; then if tlv chnkhdr ${tlv_load_addr} kernel; then echo "INFO: kernel in download partition TLV update image"; statusled green blink; nandecc hw 1; if test ${TLV_CHNK_ENCM} = 00000001; then TLV_CHNK_SIZE=${TLV_DECRYPT_KERNEL_CHNK_SIZE}; fi; echo "INFO: writing kernel to flash..."; if nand write ${TLV_CHNK_DATA} ${TLV_CHNK_DEST} ${TLV_CHNK_SIZE}; then echo "INFO: nand write successful"; else echo "ERROR: nand write failed"; tlv errstate; fi; KERNEL_VERS=${TLV_CHNK_VERS};else echo "ERROR: kernel not in download partition TLV update image"; tlv errstate; fi; fi; if test ${XLOADER_NEEDS_FLASHING} = yes; then echo "INFO: setting xloader_vers in environment..."; setenv xloader_vers ${XLOADER_VERS};fi; if test ${ROOTFS_NEEDS_FLASHING} = yes; then echo "INFO: setting rootfs_vers in environment..."; setenv rootfs_vers ${ROOTFS_VERS};fi; if test ${KERNEL_NEEDS_FLASHING} = yes; then echo "INFO: setting kernel_vers in environment..."; setenv kernel_vers ${KERNEL_VERS};fi; if test ${XLOADER_NEEDS_FLASHING} = yes || test ${ROOTFS_NEEDS_FLASHING} = yes || test ${KERNEL_NEEDS_FLASHING} = yes; then echo "INFO: saving environment..."; saveenv;fi; echo "INFO: Completed anything else needs flashing.";
  4.  
  5. baudrate=115200
  6. bootcmd=run legacy_boot
  7. bootcount=1
  8. bootdelay=1
  9. bootlimit=6
  10. buildtime_uboot_version=00000001.00000000.00000004.0ab1cffc
  11.  
  12. console=ttyO2,115200n8
  13.  
  14. does_anything_else_need_flashing=echo "INFO: Start check if anything else needs flashing..."; UPDATE
  15. _ROOTFS=no; if tlv chnkhdr ${tlv_load_addr} rootfs; then echo "INFO: rootfs in download partition TL
  16. V update image"; if fwup fail || test -z ${rootfs_vers}; then if fwup fail; then echo "INFO: Fail fl
  17. ag is set"; fi; if test -z ${rootfs_vers}; then echo "INFO: rootfs_vers is missing"; fi; UPDATE_ROOT
  18. FS=yes; elif fwup update && test ${rootfs_vers}_ != ${TLV_CHNK_VERS}_; then echo "INFO: Update flag
  19. is set AND rootfs_vers(${rootfs_vers}) not equal TLV_CHNK_VERS(${TLV_CHNK_VERS})"; UPDATE_ROOTFS=yes
  20. ; fi; if test ${UPDATE_ROOTFS} = yes; then echo "INFO: rootfs needs flashing..."; run handle_cr32; r
  21. un handle_md5_; run handle_sha2; run handle_encm; if test ${TLV_CHNK_ENCM} = 00000001; then TLV_DECR
  22. YPT_ROOTFS_CHNK_SIZE=${TLV_CHNK_SIZE}; fi; ROOTFS_NEEDS_FLASHING=yes; fi; else echo "INFO: rootfs no
  23. t in download partition TLV update image"; fi; UPDATE_KERNEL=no; if tlv chnkhdr ${tlv_load_addr} ker
  24. nel; then echo "INFO: kernel in download partition TLV update image"; if fwup fail || test -z ${kern
  25. el_vers}; then if fwup fail; then echo "INFO: Fail flag is set"; fi; if test -z ${kernel_vers}; then
  26. echo "INFO: kernel_vers is missing"; fi; UPDATE_KERNEL=yes; elif fwup update && test ${kernel_vers}
  27. _ != ${TLV_CHNK_VERS}_; then echo "INFO: Update flag is set AND kernel_vers(${kernel_vers}) not equa
  28. l TLV_CHNK_VERS(${TLV_CHNK_VERS})"; UPDATE_KERNEL=yes; fi; if test ${UPDATE_KERNEL} = yes; then echo
  29. "INFO: kernel needs flashing..."; run handle_cr32; run handle_md5_; run handle_sha2; run handle_enc
  30. m; if test ${TLV_CHNK_ENCM} = 00000001; then TLV_DECRYPT_KERNEL_CHNK_SIZE=${TLV_CHNK_SIZE}; fi; KERN
  31. EL_NEEDS_FLASHING=yes; fi; else echo "INFO: kernel not in download partition TLV update image"; fi;
  32. echo "INFO: Completed check if anything else needs flashing";
  33. does_uboot_ubootenv_xloader_need_flashing=echo "INFO: Start check if uboot/ubootenv/xloader needs fl
  34. ashing..."; if fwup fail || fwup update || test -z ${xloader_vers} || test -z ${uboot_vers} || test
  35. -z ${ubootenv_vers} || test -z ${kernel_vers} || test -z ${rootfs_vers}; then if fwup fail; then ech
  36. o "INFO: Fail flag is set"; fi; if fwup update; then echo "INFO: Update flag is set"; fi; if test -z
  37. ${xloader_vers}; then echo "INFO: xloader_vers is missing"; fi; if test -z ${uboot_vers}; then echo
  38. "INFO: uboot_vers is missing"; fi; if test -z ${ubootenv_vers}; then echo "INFO: ubootenv_vers is m
  39. issing"; fi; if test -z ${kernel_vers}; then echo "INFO: kernel_vers is missing"; fi; if test -z ${r
  40. ootfs_vers}; then echo "INFO: rootfs_vers is missing"; fi; if tlv chnkhdr ${tlv_load_addr} u-boot; t
  41. hen echo "INFO: uboot in download partition TLV update image"; if test -z ${uboot_vers} || test ${ub
  42. oot_vers}_ != ${TLV_CHNK_VERS}_; then if test ${uboot_vers}_ < 00000001.00000000.00000000.00000000 |
  43. | test ${TLV_CHNK_VERS} > 00000000.ffffffff.ffffffff.ffffffff; then if test -z ${uboot_vers}; then e
  44. cho "INFO: uboot_vers is missing"; fi; if test ${uboot_vers}_ != ${TLV_CHNK_VERS}_; then echo "INFO:
  45. uboot_vers(${uboot_vers}) not equal TLV_CHNK_VERS(${TLV_CHNK_VERS})"; fi; echo "INFO: u-boot needs
  46. flashing..."; run handle_cr32; run handle_md5_; run handle_sha2; run handle_encm; if test ${TLV_CHNK
  47. _ENCM} = 00000001; then TLV_DECRYPT_UBOOT_CHNK_SIZE=${TLV_CHNK_SIZE}; fi; UBOOT_NEEDS_FLASHING=yes;
  48. else echo "INFO: u-boot cannot downgrade to below 00000001.00000000"; fi; fi; else echo "INFO: u-boo
  49. t not in download partition TLV update image"; fi; if tlv chnkhdr ${tlv_load_addr} u-boot-env; then
  50. echo "INFO: uboot environment in download partition TLV update image"; if test -z ${ubootenv_vers} |
  51. | test ${ubootenv_vers}_ != ${TLV_CHNK_VERS}_; then if test ${ubootenv_vers}_ < 00000001.00000000.00
  52. 000000.00000000 || test ${TLV_CHNK_VERS} > 00000000.ffffffff.ffffffff.ffffffff; then if test -z ${ub
  53. ootenv_vers}; then echo "INFO: ubootenv_vers is missing"; fi; if test ${ubootenv_vers}_ != ${TLV_CHN
  54. K_VERS}_; then echo "INFO: ubootenv_vers(${ubootenv_vers}) not equal TLV_CHNK_VERS(${TLV_CHNK_VERS})
  55. "; fi; echo "INFO: u-boot-env needs flashing..."; run handle_cr32; run handle_md5_; run handle_sha2;
  56. run handle_encm; if test ${TLV_CHNK_ENCM} = 00000001; then TLV_DECRYPT_UBOOTENV_CHNK_SIZE=${TLV_CHN
  57. K_SIZE}; fi; UBOOTENV_NEEDS_FLASHING=yes; else echo "INFO: u-boot environment cannot downgrade to be
  58. low 00000001.00000000"; fi; fi; else echo "INFO: u-boot-env not in download partition TLV update ima
  59. ge"; fi; if tlv chnkhdr ${tlv_load_addr} x-loader; then echo "INFO: x-loader in download partition T
  60. LV update image"; if test -z ${xloader_vers} || test ${xloader_vers}_ != ${TLV_CHNK_VERS}_; then if
  61. test ${xloader_vers}_ < 00000001.00000000.00000000.00000000 || test ${TLV_CHNK_VERS} > 00000000.ffff
  62. ffff.ffffffff.ffffffff; then if test -z ${xloader_vers}; then echo "INFO: xloader_vers is missing";
  63. fi; if test ${xloader_vers}_ != ${TLV_CHNK_VERS}_; then echo "INFO: xloader_vers(${xloader_vers}) no
  64. t equal TLV_CHNK_VERS(${TLV_CHNK_VERS})"; fi; echo "INFO: x-loader needs flashing..."; run handle_cr
  65. 32; run handle_md5_; run handle_sha2; run handle_encm; if test ${TLV_CHNK_ENCM} = 00000001; then TLV
  66. _DECRYPT_XLOADER_CHNK_SIZE=${TLV_CHNK_SIZE}; fi; XLOADER_NEEDS_FLASHING=yes; else echo "INFO: x-load
  67. er cannot downgrade to below 00000001.00000000"; fi; fi; else echo "INFO: x-loader not in download p
  68. artition TLV update image"; fi; fi; echo "INFO: Completed check if uboot/ubootenv/xloader needs flas
  69. hing";
  70. dumpTlvRamImage=run usbmount; if usb storage; then fatstore usb 0 ${tlv_load_addr} datadump.bin ${pa
  71. rtDownloadSize}; fi;
  72. eraseConstants=if nand erase constants; then echo "INFO: nand erase successful"; else echo "ERROR: n
  73. and erase failed"; tlv errstate; fi;
  74. eraseDatabase=if nand erase database; then echo "INFO: nand erase successful"; else echo "ERROR: nan
  75. d erase failed"; tlv errstate; fi;
  76. eraseDownload=if nand erase download; then echo "INFO: nand erase successful"; else echo "ERROR: nan
  77. d erase failed"; tlv errstate; fi;
  78. eraseRfs=if nand erase rootfs; then echo "INFO: nand erase successful"; else echo "ERROR: nand erase
  79. failed"; tlv errstate; fi;
  80. eraseUboot=if nand erase u-boot; then echo "INFO: nand erase successful"; else echo "ERROR: nand era
  81. se failed"; tlv errstate; fi;
  82. eraseUbootEnv=if nand erase u-boot-env; then echo "INFO: nand erase successful"; else echo "ERROR: n
  83. and erase failed"; tlv errstate; fi;
  84. eraseXloader=if nand erase x-loader; then echo "INFO: nand erase successful"; else echo "ERROR: nand
  85. erase failed"; tlv errstate; fi;
  86. eraseuImage=if nand erase kernel; then echo "INFO: nand erase successful"; else echo "ERROR: nand er
  87. ase failed"; tlv errstate; fi;
  88.  
  89. etharg=smsc95xx_mac=00:25:ED:1B:08:02
  90.  
  91. flashConstants=echo "INFO: usb thumbdrive constants check..."; run usbmount; if usb storage; then if
  92. fatfind usb 0 / constants.bin; then mw.b ${tlv_load_addr} 0x00 ${partConstantsSize}; if fatload usb
  93. 0 ${tlv_load_addr} constants.bin; then nandecc hw 1; echo "INFO: constants partition being erased";
  94. run eraseConstants; echo "INFO: writing constants to flash..."; run writeConstants; else echo "ERRO
  95. R: failed to load constants.bin from usb thumbdrive"; fi; fi; else echo "INFO: no usb storage device
  96. ..."; fi; echo "INFO: usb thumbdrive constants complete";
  97. flashUboot=echo "INFO: usb thumbdrive u-boot check..."; run usbmount; if usb storage; then if fatfin
  98. d usb 0 / u-boot.bin; then statusled green blink; mw.b ${tlv_load_addr} 0xff ${partUbootSize}; if fa
  99. tload usb 0 ${tlv_load_addr} u-boot.bin; then nandecc hw 2; echo "INFO: u-boot partition being erase
  100. d"; run eraseUboot; echo "INFO: writing u-boot to flash..."; run writeUboot; nandecc hw 1; else echo
  101. "ERROR: failed to load u-boot.bin from usb thumbdrive"; fi; fi; else echo "INFO: no usb storage dev
  102. ice..."; fi; echo "INFO: usb thumbdrive u-boot complete";
  103. flashUbootEnv=echo "INFO: usb thumbdrive u-boot environment check..."; run usbmount; if usb storage;
  104. then if fatfind usb 0 / u-boot-env; then mw.b ${tlv_load_addr} 0xff ${partUbootEnvSize}; if fatload
  105. usb 0 ${tlv_load_addr} u-boot-env; then nandecc hw 1; echo "INFO: u-boot-env partition being erased
  106. "; run eraseUbootEnv; echo "INFO: writing u-boot environment to flash..."; run writeUbootEnv; else e
  107. cho "ERROR: failed to load u-boot-env from usb thumbdrive"; fi; fi; else echo "INFO: no usb storage
  108. device..."; fi; echo "INFO: usb thumbdrive u-boot environment complete";
  109. flashXloader=echo "INFO: usb thumbdrive x-loader check..."; run usbmount; if usb storage; then if fa
  110. tfind usb 0 / x-load.bin.ift; then statusled green blink; mw.b ${tlv_load_addr} 0xff ${partXloaderSi
  111. ze}; if fatload usb 0 ${tlv_load_addr} x-load.bin.ift; then nandecc hw 2; echo "INFO: x-loader parti
  112. tion being erased"; run eraseXloader; echo "INFO: writing x-loader to flash..."; run writeXloader; n
  113. andecc hw 1; else echo "ERROR: failed to load x-load.bin.ift from usb thumbdrive"; fi; fi; else echo
  114. "INFO: no usb storage device..."; fi; echo "INFO: usb thumbdrive x-loader complete";
  115. flashall=run usbmount; if usb storage; then run flashXloader; run flashUboot; run flashuImage; run f
  116. lashrfs; fi;
  117.  
  118. flashrfs=echo "INFO: usb thumbdrive rootfs check..."; run usbmount; if usb storage; then if fatfind usb 0 / ubifs.img; then statusled green blink; nandecc hw 1; echo "INFO: erasing rootfs partition"; run eraseRfs; if ubi part rootfs 2048; then echo "INFO: rootfs is a valid ubi partition"; fi; if fatload usb 0 ${tlv_load_addr} ubifs.img; then echo "INFO: need to create ubi nuvo-tesla-rootfs volume first..."; if ubi create nuvo-tesla-rootfs; then echo "INFO: successfully created volume, nuvo-tesla-rootfs..."; if ubi write ${tlv_load_addr} nuvo-tesla-rootfs ${filesize}; then echo "INFO: successfully wrote rootfs to flash after volume, nuvo-tesla-rootfs, was created..."; else echo "ERROR: failed to write rootfs to flash after volume was created"; fi; else echo "ERROR: failed to create volume, nuvo-tesla-rootfs"; fi; else echo "ERROR: failed to load ubifs.img from usb thumbdrive"; fi; fi; else echo "INFO: no usb storage device..."; fi; echo "INFO: usb thumbdrive rootfs complete";
  119. setenv flashrfs 'echo "INFO: usb thumbdrive rootfs check..."; run usbmount; if usb storage; then if fatfind usb 0 / ubifs.img; then statusled green blink; nandecc hw 1; echo "INFO: erasing rootfs partition"; run eraseRfs; if ubi part rootfs 2048; then echo "INFO: rootfs is a valid ubi partition"; fi; if fatload usb 0 ${tlv_load_addr} ubifs.img; then echo "INFO: need to create ubi nuvo-tesla-rootfs volume first..."; if ubi create nuvo-tesla-rootfs; then echo "INFO: successfully created volume, nuvo-tesla-rootfs..."; if ubi write ${tlv_load_addr} nuvo-tesla-rootfs ${filesize}; then echo "INFO: successfully wrote rootfs to flash after volume, nuvo-tesla-rootfs, was created..."; else echo "ERROR: failed to write rootfs to flash after volume was created"; fi; else echo "ERROR: failed to create volume, nuvo-tesla-rootfs"; fi; else echo "ERROR: failed to load ubifs.img from usb thumbdrive"; fi; fi; else echo "INFO: no usb storage device..."; fi; echo "INFO: usb thumbdrive rootfs complete";'
  120.  
  121. flashuImage=echo "INFO: usb thumbdrive kernel check..."; run usbmount; if usb storage; then if fatfind usb 0 / uImage; then statusled green blink; mw.b ${tlv_load_addr} 0xff ${partuImageSize}; if fatload usb 0 ${tlv_load_addr} uImage; then nandecc hw 1; echo "INFO: kernel partition being erased"; run eraseuImage; echo "INFO: writing kernel to flash..."; run writeuImage; else echo "ERROR: failed to load uImage from usb thumbdrive"; fi; fi; else echo "INFO: no usb storage device..."; fi; echo "INFO: usb thumbdrive kernel complete";
  122.  
  123. handle_cr32=if test -n ${TLV_CHNK_CR32}; then if crc32 ${TLV_CHNK_DATA} ${TLV_CHNK_SIZE}; then if te
  124. st ${CRC32} = ${TLV_CHNK_CR32}; then echo "INFO: crc32 match"; else echo "ERROR: crc32 mismatch ${CR
  125. C32} ${TLV_CHNK_CR32}"; tlv errstate; fi; else echo "ERROR: crc32 failed"; tlv errstate; fi; else ec
  126. ho "INFO: no chunk crc32 option"; fi;
  127. handle_encm=if test ${TLV_CHNK_ENCM} = 00000001; then if tlv decrypt ${TLV_CHNK_DATA} ${TLV_CHNK_SIZ
  128. E}; then echo "INFO: chunk decrypt successful"; else echo "ERROR: chunk decrypt failed"; tlv errstat
  129. e; fi; elif test ${TLV_CHNK_ENCM} = 00000000; then echo "INFO: chunk not encrypted"; else echo "ERRO
  130. R: encryption method invalid (${TLV_CHNK_ENCM})"; tlv errstate; fi;
  131. handle_md5_=if test -n ${TLV_CHNK_MD5_}; then if md5sum ${TLV_CHNK_DATA} ${TLV_CHNK_SIZE}; then if t
  132. est ${MD5SUM} = ${TLV_CHNK_MD5_}; then echo "INFO: md5 match"; else echo "ERROR: md5 mismatch ${MD5S
  133. UM} ${TLV_CHNK_MD5_}"; tlv errstate; fi; else echo "ERROR: md5sum failed"; tlv errstate; fi; else ec
  134. ho "INFO: no chunk md5 option"; fi;
  135. handle_sha2=if test -n ${TLV_CHNK_SHA2}; then if sha256sum ${TLV_CHNK_DATA} ${TLV_CHNK_SIZE}; then i
  136. f test ${SHA256SUM} = ${TLV_CHNK_SHA2}; then echo "INFO: sha256 match"; else echo "ERROR: sha256 mis
  137. match ${SHA256SUM} ${TLV_CHNK_SHA2}"; tlv errstate; fi; else echo "ERROR: sha256sum failed"; tlv err
  138. state; fi; else echo "INFO: no chunk sha256 option"; fi;
  139.  
  140. kernel_vers=00000001.00000000.00000013.0c4ca47a
  141.  
  142. legacy_boot=echo "INFO: attempting legacy (dofwupdate) boot..."; run usbmount; if usb storage; then if fatfind usb 0 / dofwupdate; then echo "INFO: dofwupdate found on usb thumbdrive..."; run flashall; statusled white blink; run nandboot; fi; else echo "INFO: no usb storage device..."; fi; echo "INFO: legacy boot not performed...missing dofwupdate or no usb thumbdrive..."; echo "INFO: attempting TLV boot..."; run tlv_boot;
  143.  
  144. loadaddr=0x80200000
  145. mtddevname=x-loader
  146. mtddevnum=0
  147. mtdids=nand0=nand
  148. mtdpartitions=mtdparts=omap2-nand.0:0x00020000(x-loader),0x00180000(u-boot),0x00080000(u-boot-env),0x00080000(constants),0x03F00000(database),0x00560000(kernel),0x05A00000(rootfs),0x05F00000(download)
  149.  
  150. mtdparts=mtdparts=nand:0x00020000(x-loader),0x00180000(u-boot),0x00080000(u-boot-env),0x00080000(constants),0x03F00000(database),0x00560000(kernel),0x05A00000(rootfs),0x05F00000(download)
  151.  
  152. nandargs=setenv bootargs console=${console} root=${nandroot} rootfstype=${nandrootfstype} ${mtdpartitions} ${etharg} ${otherbootargs} ${panicargs} ${wdtargs} ${smsc95xx_args}
  153.  
  154. nandboot=echo "Booting from nand ..."; run nandargs; nandecc hw 1; echo "INFO: loading kernel image into RAM..."; run readuImage; echo "INFO: booting kernel image..."; bootm ${tlv_load_addr}; echo "INFO: kernel boot failed..."; echo "INFO: resetting..."; reset;
  155.  
  156. nandroot=ubi0:nuvo-tesla-rootfs ubi.mtd=6,2048 rw
  157.  
  158. nandrootfstype=ubifs
  159.  
  160. otherbootargs=db_hwid=2 db_rev=0
  161.  
  162. panicargs=panic=10 mem=127M
  163.  
  164. partConstantsBase=0x00220000
  165. partConstantsSize=0x00080000
  166. partDatabaseBase=0x002A0000
  167. partDatabaseSize=0x03F00000
  168. partDownloadBase=0x0A100000
  169. partDownloadSize=0x05F00000
  170. partRfsBase=0x04700000
  171. partRfsSize=0x05A00000
  172. partUbootBase=0x00020000
  173. partUbootEnvBase=0x001A0000
  174. partUbootEnvSize=0x00080000
  175. partUbootSize=0x00180000
  176. partXloaderBase=0x00000000
  177. partXloaderSize=0x00020000
  178. partition=nand0,0
  179. partuImageBase=0x041A0000
  180. partuImageSize=0x00560000
  181.  
  182. readuImage=nand read ${tlv_load_addr} kernel
  183.  
  184. rootfs_vers=54ec3a74.01b0009d.0df3fb19.00808799
  185.  
  186. smsc95xx_args=smsc95xx.turbo_mode=N
  187.  
  188. stderr=serial
  189. stdin=serial
  190. stdout=serial
  191. tlv_boot=echo "INFO: TLV firmware update process started..."; if fwup fail; then if test ${bootcount
  192. } -eq ${bootlimit}; then nandecc hw 1; echo "INFO: bootcount(${bootcount}) equals bootlimit(${bootli
  193. mit})"; echo "INFO: erasing database partition"; run eraseDatabase; if ubi part database 2048; then
  194. echo "INFO: database is a valid ubi partition"; echo "INFO: creating volume nuvo-tesla-database...";
  195. if ubi create nuvo-tesla-database; then echo "INFO: successfully created volume, nuvo-tesla-databas
  196. e..."; else echo "ERROR: failed to create volume, nuvo-tesla-database"; tlv errstate; fi; fi; fi; if
  197. test ${bootcount} -gt ${bootlimit}; then echo "INFO: bootcount(${bootcount}) greater than bootlimit
  198. (${bootlimit})"; statusled red on; echo "ERROR: Maximum boot count reached!"; tlv errstate; fi; fi;
  199. run usbmount; if usb storage; then if test ${bootcount} -eq 1; then echo "INFO: bootcount(${bootcoun
  200. t}) equals 1"; if fatfind usb 0 / tlvupdate; then echo "INFO: tlvupdate image found on USB thumbdriv
  201. e"; statusled green blink; run update_download; fi; fi; fi; if fwup fail || fwup update || test -z $
  202. {xloader_vers} || test -z ${uboot_vers} || test -z ${ubootenv_vers} || test -z ${kernel_vers} || tes
  203. t -z ${rootfs_vers}; then if fwup fail; then echo "INFO: Fail flag is set"; fi; if fwup update; then
  204. echo "INFO: Update flag is set"; fi; if test -z ${xloader_vers}; then echo "INFO: xloader_vers is m
  205. issing"; fi; if test -z ${uboot_vers}; then echo "INFO: uboot_vers is missing"; fi; if test -z ${ubo
  206. otenv_vers}; then echo "INFO: ubootenv_vers is missing"; fi; if test -z ${kernel_vers}; then echo "I
  207. NFO: kernel_vers is missing"; fi; if test -z ${rootfs_vers}; then echo "INFO: rootfs_vers is missing
  208. "; fi; statusled green blink; echo "INFO: Need to read the tlvupdate from download partition..."; if
  209. nand read ${tlv_load_addr} download 0x10; then if tlv magic ${tlv_load_addr}; then echo "INFO: tlvu
  210. pdate image total length is ${TLV_TOTAL_LEN}"; if nand read ${tlv_load_addr} download ${TLV_TOTAL_LE
  211. N}; then if tlv valid ${tlv_load_addr}; then echo "INFO: TLV image in download partition is valid";
  212. else echo "ERROR: TLV image in download partition is invalid"; if fwup update; then echo "INFO: tryi
  213. ng to boot old system"; run tlv_boot_kernel; else tlv errstate; fi; fi; else echo "ERROR: nand read
  214. failed"; tlv errstate; fi; else echo "ERROR: TLV image in download partition is invalid"; if fwup up
  215. date; then echo "INFO: trying to boot old system"; run tlv_boot_kernel; else tlv errstate; fi; fi; e
  216. lse echo "ERROR: nand read failed"; tlv errstate; fi; UBOOT_NEEDS_FLASHING=no; UBOOTENV_NEEDS_FLASHI
  217. NG=no; XLOADER_NEEDS_FLASHING=no; ROOTFS_NEEDS_FLASHING=no; KERNEL_NEEDS_FLASHING=no; run does_uboot
  218. _ubootenv_xloader_need_flashing; run does_anything_else_need_flashing; run uboot_or_ubootenv_need_fl
  219. ashing; run anything_else_needs_flashing; fi; echo "INFO: TLV firmware update process completed"; ru
  220. n tlv_boot_kernel;
  221.  
  222. tlv_boot_kernel=echo "INFO: clearing update flag..."; fwup clear update; echo "INFO: setting fail flag..."; fwup set fail; statusled white blink; run nandboot;
  223.  
  224. tlv_load_addr=0x80200000
  225.  
  226. uboot_or_ubootenv_need_flashing=UBOOT_RESET=no; echo "INFO: Starting u-boot or u-boot-env need flash
  227. ing..."; UBOOT_VERS=${uboot_vers}; UBOOTENV_VERS=${ubootenv_vers}; XLOADER_VERS=${xloader_vers}; ROO
  228. TFS_VERS=${rootfs_vers}; KERNEL_VERS=${kernel_vers}; if test ${UBOOT_NEEDS_FLASHING} = yes; then if
  229. tlv chnkhdr ${tlv_load_addr} u-boot; then echo "INFO: uboot in download partition TLV update image";
  230. nandecc hw 2; statusled green blink; echo "INFO: u-boot partition being erased"; nand erase ${TLV_C
  231. HNK_DEST}; if test ${TLV_CHNK_ENCM} = 00000001; then TLV_CHNK_SIZE=${TLV_DECRYPT_UBOOT_CHNK_SIZE}; f
  232. i; echo "INFO: writing uboot to flash..."; if nand write ${TLV_CHNK_DATA} ${TLV_CHNK_DEST} ${TLV_CHN
  233. K_SIZE}; then echo "INFO: nand write successful"; else echo "ERROR: nand write failed"; tlv errstate
  234. ; fi; nandecc hw 1; UBOOT_VERS=${TLV_CHNK_VERS}; UBOOT_RESET=yes; else echo "ERROR: u-boot not in do
  235. wnload partition TLV update image"; tlv errstate; fi; fi; if test ${UBOOTENV_NEEDS_FLASHING} = yes;
  236. then if tlv chnkhdr ${tlv_load_addr} u-boot-env; then echo "INFO: uboot environment in download part
  237. ition TLV update image"; nandecc hw 1; statusled green blink; echo "INFO: u-boot-env partition being
  238. erased"; nand erase ${TLV_CHNK_DEST}; if test ${TLV_CHNK_ENCM} = 00000001; then TLV_CHNK_SIZE=${TLV
  239. _DECRYPT_UBOOTENV_CHNK_SIZE}; fi; echo "INFO: writing uboot-env to flash..."; if nand write ${TLV_CH
  240. NK_DATA} ${TLV_CHNK_DEST} ${TLV_CHNK_SIZE}; then echo "INFO: nand write successful"; else echo "ERRO
  241. R: nand write failed"; tlv errstate; fi; echo "INFO: reloading uboot-env from flash to internal memo
  242. ry so new environment is used..."; env reload;UBOOTENV_VERS=${TLV_CHNK_VERS};UBOOT_RESET=yes; else e
  243. cho "ERROR: u-boot-env not in download partition TLV update image"; tlv errstate; fi; fi; if test ${
  244. UBOOT_NEEDS_FLASHING} = yes || test ${UBOOTENV_NEEDS_FLASHING} = yes; then echo "INFO: setting uboot
  245. _vers in environment..."; setenv uboot_vers ${UBOOT_VERS};fi; if test ${UBOOTENV_NEEDS_FLASHING} = y
  246. es; then echo "INFO: setting ubootenv_vers in environment..."; setenv ubootenv_vers ${UBOOTENV_VERS}
  247. ;echo "INFO: restoring xloader_vers in environment..."; setenv xloader_vers ${XLOADER_VERS};echo "IN
  248. FO: restoring rootfs_vers in environment..."; setenv rootfs_vers ${ROOTFS_VERS};echo "INFO: restorin
  249. g kernel_vers in environment..."; setenv kernel_vers ${KERNEL_VERS};fi; if test ${UBOOT_NEEDS_FLASHI
  250. NG} = yes || test ${UBOOTENV_NEEDS_FLASHING} = yes; then echo "INFO: saving environment..."; saveenv
  251. ;fi; if test ${UBOOT_RESET} = yes; then echo "INFO: Resetting ..."; reset; fi;echo "INFO: Completed
  252. u-boot or u-boot-env need flashing.";
  253.  
  254. uboot_vers=00000001.00000000.00000004.0ab1cffc
  255.  
  256. ubootenv_vers=00000001.00000000.00000000.0b506e00
  257.  
  258. update_download=echo "INFO: usb thumbdrive tlvupdate check..."; if fatload usb 0 ${tlv_load_addr} tl
  259. vupdate; then echo "INFO: TLV update image found on usb thumbdrive"; if tlv valid ${tlv_load_addr};
  260. then nandecc hw 1; echo "INFO: TLV image valid"; echo "INFO: download partition being erased"; nand
  261. erase download; echo "INFO: writing tlvupdate image to flash..."; if nand write ${tlv_load_addr} dow
  262. nload ${filesize}; then echo "INFO: nand write successful"; else echo "ERROR: nand write failed"; tl
  263. v errstate; fi; echo "INFO: setting USB update flag..."; fwup set usbupdate; echo "INFO: setting fai
  264. l flag..."; fwup set fail; echo "INFO: reseting..."; reset; else echo "INFO: TLV image invalid"; fi;
  265. else echo "INFO: TLV image USB load failed"; fi; echo "INFO: usb thumbdrive tlvupdate check complet
  266. e";
  267.  
  268. usbmount=usb reset
  269. wdt_timeout=600
  270.  
  271. wdtargs=omap_wdt.timer_margin=600 omap_wdt.pwrup_disable=0
  272.  
  273. writeConstants=if nand write ${tlv_load_addr} constants; then echo "INFO: nand write successful"; el
  274. se echo "ERROR: nand write failed"; tlv errstate; fi;
  275. writeDatabase=if nand write ${tlv_load_addr} database; then echo "INFO: nand write successful"; else
  276. echo "ERROR: nand write failed"; tlv errstate; fi;
  277. writeUboot=if nand write ${tlv_load_addr} u-boot; then echo "INFO: nand write successful"; else echo
  278. "ERROR: nand write failed"; tlv errstate; fi;
  279. writeUbootEnv=if nand write ${tlv_load_addr} u-boot-env; then echo "INFO: nand write successful"; el
  280. se echo "ERROR: nand write failed"; tlv errstate; fi;
  281. writeXloader=if nand write ${tlv_load_addr} x-loader; then echo "INFO: nand write successful"; else
  282. echo "ERROR: nand write failed"; tlv errstate; fi;
  283. writeuImage=if nand write ${tlv_load_addr} kernel; then echo "INFO: nand write successful"; else ech
  284. o "ERROR: nand write failed"; tlv errstate; fi;
  285. xloader_vers=00000001.00000000.00000002.029b1dd7
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement