flash-malta-boot.tcl 967 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #
  2. # Copyright (C) 2013 Imagination Technologies
  3. #
  4. # Programs a MIPS Malta boot flash with a flat binary image.
  5. #
  6. # SPDX-License-Identifier: GPL-2.0+
  7. #
  8. proc flash-boot { binfile } {
  9. puts "flash monitor binary $binfile"
  10. config Coherent on
  11. config CoherencyDuringLoad on
  12. if {[endian]=="big"} {
  13. puts "CPU in BE mode"
  14. flash device sharp_16x32_be;
  15. } else {
  16. puts "CPU in LE mode"
  17. flash device sharp_16x32;
  18. }
  19. flash clear all;
  20. flash set 0xBE000000..0xBE0FFFFF
  21. flash erase sector 0xbe000000;
  22. flash erase sector 0xbe020000;
  23. flash erase sector 0xbe040000;
  24. flash erase sector 0xbe060000;
  25. flash erase sector 0xbe080000;
  26. flash erase sector 0xbe0a0000;
  27. flash erase sector 0xbe0c0000;
  28. flash erase sector 0xbe0e0000;
  29. puts "finished erasing boot flash";
  30. puts "programming flash, please be patient"
  31. load bin 0xbe000000 $binfile size4
  32. flash clear all
  33. config CoherencyDuringLoad off
  34. puts "finished programming boot flash";
  35. }