README.sha1 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. SHA1 usage:
  2. -----------
  3. In the U-Boot Image for the pcs440ep board is a SHA1 checksum integrated.
  4. This SHA1 sum is used, to check, if the U-Boot Image in Flash is not
  5. corrupted.
  6. The following command is available:
  7. => help sha1
  8. sha1 address len [addr] calculate the SHA1 sum [save at addr]
  9. -p calculate the SHA1 sum from the U-Boot image in flash and print
  10. -c check the U-Boot image in flash
  11. "sha1 -p"
  12. calculates and prints the SHA1 sum, from the Image stored in Flash
  13. "sha1 -c"
  14. check, if the SHA1 sum from the Image stored in Flash is correct
  15. It is possible to calculate a SHA1 checksum from a memoryrange with:
  16. "sha1 address len"
  17. If you want to store a new Image in Flash for the pcs440ep board,
  18. which has no SHA1 sum, you can do the following:
  19. a) cp the new Image on a position in RAM (here 0x300000)
  20. (for this example we use the Image from Flash, stored at 0xfffa0000 and
  21. 0x60000 Bytes long)
  22. "cp.b fffa0000 300000 60000"
  23. b) Initialize the SHA1 sum in the Image with 0x00
  24. The SHA1 sum is stored in Flash at:
  25. CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN + SHA1_SUM_POS
  26. for the pcs440ep Flash: 0xfffa0000 + 0x60000 + -0x20
  27. = 0xffffffe0
  28. for the example in RAM: 0x300000 + 0x60000 + -0x20
  29. = 0x35ffe0
  30. note: a SHA1 checksum is 20 bytes long.
  31. "mw.b 35ffe0 0 14"
  32. c) now calculate the SHA1 sum from the memoryrange and write
  33. the calculated checksum at the right place:
  34. "sha1 300000 60000 35ffe0"
  35. Now you have a U-Boot-Image for the pcs440ep board with the correct SHA1 sum.
  36. If you do a "buildman -k pcs440ep" or a "make all" to get the U-Boot image,
  37. which will be found in ../current/ipam390/ - the correct SHA1 sum will be
  38. automagically included in the U-Boot image.
  39. Heiko Schocher, 11 Jul 2007