Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | # SPDX-License-Identifier: GPL-2.0+ |
Paul Burton | b62cd89 | 2013-11-08 11:18:58 +0000 | [diff] [blame] | 2 | # |
| 3 | # Copyright (C) 2013 Imagination Technologies |
| 4 | # |
| 5 | # Programs a MIPS Malta boot flash with a flat binary image. |
Paul Burton | b62cd89 | 2013-11-08 11:18:58 +0000 | [diff] [blame] | 6 | |
| 7 | proc flash-boot { binfile } { |
| 8 | puts "flash monitor binary $binfile" |
| 9 | config Coherent on |
| 10 | config CoherencyDuringLoad on |
| 11 | |
| 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 | |
| 20 | flash clear all; |
| 21 | flash set 0xBE000000..0xBE0FFFFF |
| 22 | flash erase sector 0xbe000000; |
| 23 | flash erase sector 0xbe020000; |
| 24 | flash erase sector 0xbe040000; |
| 25 | flash erase sector 0xbe060000; |
| 26 | flash erase sector 0xbe080000; |
| 27 | flash erase sector 0xbe0a0000; |
| 28 | flash erase sector 0xbe0c0000; |
| 29 | flash erase sector 0xbe0e0000; |
| 30 | puts "finished erasing boot flash"; |
| 31 | |
| 32 | puts "programming flash, please be patient" |
| 33 | load bin 0xbe000000 $binfile size4 |
| 34 | |
| 35 | flash clear all |
| 36 | config CoherencyDuringLoad off |
| 37 | puts "finished programming boot flash"; |
| 38 | } |