Tom Rini | 781a144 | 2022-06-22 11:23:03 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
| 2 | |
| 3 | recover_file=openbmc-hpe-recovery-image.mtd |
| 4 | recover_cmd=usb start; mw.b 0xD100000D 0x40; |
| 5 | if fatload usb 0 0x50000000 $recover_file 0x4C0000 0x80000; then |
| 6 | setenv bootargs console=ttyS0,115200 recovery; |
| 7 | setenv force_recovery; |
| 8 | saveenv; |
| 9 | bootm 0x50000000; |
| 10 | else |
| 11 | while itest 0 < 1; do |
| 12 | mw.b 0xd1000005 0xc0; |
| 13 | sleep .1; |
| 14 | mw.b 0xd1000005 0x00; |
| 15 | sleep .1; |
| 16 | done; |
| 17 | fi; |
| 18 | reset; |
| 19 | spiboot=if itest.b *0xD10000B2 == 6; then |
| 20 | run recover_cmd; |
| 21 | fi; |
| 22 | if printenv force_recovery; then |
| 23 | run recover_cmd; |
| 24 | else |
| 25 | bootm 0xfc080000; |
| 26 | run recover_cmd; |
| 27 | fi; |