1 \ *****************************************************************************
2 \ * Copyright (c) 2004, 2008 IBM Corporation
3 \ * All rights reserved.
4 \ * This program and the accompanying materials
5 \ * are made available under the terms of the BSD License
6 \ * which accompanies this distribution, and is available at
7 \ * http://www.opensource.org/licenses/bsd-license.php
10 \ * IBM Corporation - initial implementation
11 \ ****************************************************************************/
13 \ Set by update-flash -f to true, preventing update-flash -c
16 : update-flash-help ( -- )
17 cr ." update-flash tool to flash host FW " cr
18 ." -f <filename> : Flash from file (e.g. net:\boot_rom.bin)" cr
19 ." -l : Flash from load-base" cr
20 ." -d : Flash from old load base (used by drone)" cr
21 ." -c : Flash from temp to perm" cr
22 ." -r : Flash from perm to temp" cr
25 : flash-read-temp ( -- success? )
26 get-flashside 1 = IF flash-addr get-load-base over flash-image-size rmove true
32 : flash-read-perm ( -- success? )
34 flash-addr get-load-base over flash-image-size rmove true
40 : flash-switch-side ( side -- success? )
42 s" Cannot change flashside" type cr false
48 : flash-ensure-temp ( -- success? )
50 cr ." Cannot flash perm! Switching to temp side!"
57 \ update-flash -f <filename>
62 : update-flash ( "text" )
63 get-flashside >r \ Save old flashside
64 parse-word ( str len ) \ Parse first string
65 drop dup c@ ( str first-char )
67 update-flash-help r> 2drop EXIT
73 parse-word cr s" do-load" evaluate
74 flash-ensure-temp TO flash-new
80 flash-load-base get-load-base 200000 move
84 flash-read-temp 0= flash-new or IF
85 ." Cannot commit temp, need to boot on temp first " cr false
92 ." Cannot commit perm, need to boot on perm first " cr false
105 update-flash-help r> drop EXIT
108 get-load-base flash-write 0= IF ." Flash write failed !! " cr THEN
109 r> set-flashside drop \ Restore old flashside