flash-malta-boot.tcl 963 B

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