Changeset 3090
- Timestamp:
- Jul 30, 2012 9:11:20 AM (10 months ago)
- File:
-
- 1 edited
-
cpu/arm/marvell/tim.fth (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cpu/arm/marvell/tim.fth
r1998 r3090 1 1 : >hex ( n -- n' ) d# 10 /mod h# 10 * + ; 2 3 0 value tim-version 4 : tim-v3? ( -- flag ) tim-version h# 00ffff00 and h# 00030400 = ; 5 2 6 : today>hex ( -- n ) 3 7 today ( day month year ) … … 6 10 rot >hex >r ( yr century r: hex-month hex-day ) 7 11 >hex >r ( yr r: hex-month hex-day hex-century ) 8 >hex r> r> r> bljoin ( n ) 12 >hex r> r> r> 13 tim-v3? if 2swap then 14 bljoin ( n ) 9 15 ; 10 16 … … 72 78 image-adr image-size free-mem 73 79 ; 74 : tim: \ version trusted ID Processor 75 0 to last-image-adr 76 here to tim-adr 77 hex, 78 " TIMH" 4c, 79 hex, \ Trusted 80 \ hex, \ Date 81 today>hex l, 82 get-word -4c, \ OEM ID 83 get-word 2drop \ Processor 84 ; 85 : flash: \ id (e.g. NAN6) 86 5 0 do -1 l, loop 87 80 : id, ( -- ) 88 81 get-word ( adr len ) 89 82 \ Convert trailing number to binary byte value - e.g. NAN'6 -> NAN(06) … … 92 85 nip over 3 + c! 4 ( adr 4 ) 93 86 4c, 87 ; 88 : tim: \ version trusted ID Processor 89 0 to last-image-adr 90 here to tim-adr 91 get-hex dup l, to tim-version 92 " TIMH" 4c, 93 hex, \ Trusted 94 \ hex, \ Date 95 today>hex l, 96 id, \ OEM ID 97 get-word 2drop \ Processor 98 ; 99 : flash: \ id (e.g. NAN6) 100 5 0 do -1 l, loop 101 102 id, 94 103 95 104 here to #images-adr 0 l, … … 113 122 over <> abort" Read failed" ( size ) 114 123 ifd @ fclose ( size ) 115 \ h# 1000 round-up 116 h# 800 round-up 117 \ 4 round-up 124 \ Older BOOTROMs seem to want the size to be strongly aligned 125 tim-v3? if 4 else h# 800 then round-up ( size' ) 118 126 ; 119 127 : place-hash \ XXX need to implement non-null hash info 120 d# 10 0 do 0 l, loop 128 tim-v3? if 129 0 l, \ Size to hash (should be -1 but 0 is in the examples) 130 d# 20 l, \ HashAlgorithmID - SHA-160 131 d# 16 0 do 0 l, loop \ Hash 132 0 l, \ Partition number 133 else 134 d# 10 0 do 0 l, loop \ Hash 135 then 121 136 ; 122 137 : +#images ( -- ) #images-adr l@ 1+ #images-adr l! ; … … 169 184 here tim-adr - my-timh-adr 4 la+ l! 170 185 tim-adr image-adr my-timh-adr 2 la+ l@ + here tim-adr - move 186 else 187 tim-adr image-adr here tim-adr - move 171 188 then 172 189 ; … … 199 216 " CMCC" start-package 200 217 ; 218 : usb: \ Port# Enabled? 219 " "(00)USB" start-package hex, hex, end-package 220 ; 221 : uart: \ Port# Enabled? 222 " "UART" start-package hex, hex, end-package 223 ; 224 : cmon: \ 225 " CMON" start-package end-package 226 ; 227 : core: \ number mapping 228 " CORE" start-package hex, hex, end-package 229 ; 201 230 : term: " Term" start-package end-package ;
Note: See TracChangeset
for help on using the changeset viewer.
