source: cpu/arm/olpc/1.75/olpc.bth @ 2159

Last change on this file since 2159 was 2159, checked in by quozl, 3 years ago

Change machine signature check to use a value stored in dictionary
instead of SPI FLASH. #10616. Not tested on XO-1.75 A2. Tested on
XO-1.5. (Build broken on XO-1 as of 2152, reset-port undefined).

File size: 9.8 KB
Line 
1purpose: Construct the Open Firmware module collection
2
3command: &builder &this
4in: ${BP}/cpu/arm/olpc/1.75/build/fw.img
5in: sd8686.bin
6in: verify.img
7in: ${BP}/dev/usb2/device/hub/build/hub.fc
8in: ${BP}/dev/usb2/device/generic/build/generic.fc
9in: ${BP}/dev/usb2/device/net/build/usbnet.fc
10in: ${BP}/dev/usb2/device/keyboard/build/usbkbd.fc
11in: ${BP}/dev/usb2/device/serial/build/usbserial.fc
12in: ${BP}/dev/usb2/device/storage/build/usbstorage.fc
13in: testicons.bin
14build-now
15
16fload ${BP}/cpu/arm/olpc/1.75/fw-version.fth
17
18" macro: FW_VERSION Q4${FW_MAJOR}${FW_MINOR}" expand$ eval
19
20fload ${BP}/cpu/arm/olpc/1.75/config.fth
21
22\ Always re-create the builton.fth file when we make a new rom.img
23fload ${BP}/cpu/x86/pc/builton.bth
24fload ${BP}/cpu/arm/olpc/1.75/sourceurl.fth
25
26fload ${BP}/forth/lib/crc32.fth
27
28hex
29
30: pad-file  ( location -- )
31   ofd @ fsize
32   2dup u< abort" The ROM image is too large"
33   ?do  h# ff ofd @ fputc  loop
34;
35
36fload ${BP}/cpu/arm/marvell/tim.fth
37
38\ Marvel Trusted Image Module image creation script for
39\ XO-1.75 platform.
40
41tim: 00030102 0 Sky! PXA688
42flash: SPI'10
43timh:  TIMH        0 d101f000
44\ Main Processor code loaded into DRAM
45image: OBMI      800 d101c000 ${BP}/cpu/arm/olpc/1.75/dummy.img
46\ Secure Processor code loaded into SRAM
47image: WTMI     1000 d1018000 ${BP}/../cforth/build/arm-xo-1.75/shim.img
48image: CFTH     2000 d1000000 ${BP}/../cforth/build/arm-xo-1.75/app.img
49\ anonymous:     20000 ${BP}/cpu/arm/olpc/1.75/build/fw.img
50reserved:
51\  fload ${BP}/cpu/arm/olpc/1.75/ddr_samsung_1g.fth
52  term:
53end-reserved
54end-tim
55
56.( --- Saving as )
57" ${FW_VERSION}.rom" expand$  2dup lower  ( adr len )
582dup type cr  ( adr len )
59$new-file
60   tim$ ofd @ fputs
61
62   dropin-offset  pad-file
63
64\ Loads the set of drivers that is common to different output formats
65
66   " ${BP}/cpu/arm/build/inflate.bin"        " inflate"         $add-dropin
67   " fw.img"   " firmware"  $add-deflated-dropin
68\   " fw.img"   " firmware"  $add-dropin
69
70\   " ${BP}/dev/usb2/hcd/ehci/build/ehci.fc"    " class0c0320"      $add-deflated-dropin
71   " ${BP}/dev/usb2/device/hub/build/hub.fc"     " usb,class9"      $add-deflated-dropin
72   " ${BP}/dev/usb2/device/generic/build/generic.fc"  " usbdevice"  $add-deflated-dropin
73   " ${BP}/dev/usb2/device/net/build/usbnet.fc"       " usbnet"     $add-deflated-dropin
74   " ${BP}/dev/usb2/device/keyboard/build/usbkbd.fc"  " usb,class3,1" $add-deflated-dropin
75   " ${BP}/dev/usb2/device/serial/build/usbserial.fc" " usbserial"  $add-deflated-dropin
76   " ${BP}/dev/usb2/device/storage/build/usbstorage.fc" " usbstorage"   $add-deflated-dropin
77
78
790 [if]
80   " ${BP}/dev/mmc/sdhci/build/sdhci2.fc"        " class080501"   $add-deflated-dropin
81[then]
82
830 [if]
84   " ${BP}/dev/mmc/sdhci/build/sdmmc.fc"         " sdmmc"         $add-deflated-dropin
85   " ${BP}/dev/mmc/sdhci/mv8686/build/mv8686.fc" " mv8686"        $add-deflated-dropin
86[then]
87
88   " sd8686_helper.bin"                          " helper_sd.bin" $add-deflated-dropin
89   " sd8686.bin"                                 " sd8686.bin"    $add-deflated-dropin
90
91   " builton.fth"                       " probe-"          $add-dropin
92
930 [if]
94   " ${BP}/clients/emacs/x86/emacs"             " emacs"         $add-deflated-dropin
95   " ${BP}/clients/emacs/x86/emacs.rc"          " emacs.rc"      $add-deflated-dropin
96   " ${BP}/clients/emacs/emacs.hlp"             " emacs.hlp"     $add-deflated-dropin
97[then]
98
99   " ${BP}/ofw/fcode/memtest.fth"  " memtest.fth"          $add-deflated-dropin
100
1010 [if]
102   " ${BP}/dev/hdaudio/build/hdaudio.fc"         " class040300"   $add-deflated-dropin
103
104   " ${BP}/ofw/inet/telnetd.fth"          " telnetd"             $add-deflated-dropin
105[then]
106
107\    " ${BP}/cpu/x86/pc/olpc/images/warnings.565"  " warnings.565"  $add-deflated-dropin
108   " ${BP}/cpu/x86/pc/olpc/images/lightdot.565"  " lightdot.565"  $add-deflated-dropin
109   " ${BP}/cpu/x86/pc/olpc/images/yellowdot.565" " yellowdot.565" $add-deflated-dropin
110   " ${BP}/cpu/x86/pc/olpc/images/darkdot.565"   " darkdot.565"   $add-deflated-dropin
111   " ${BP}/cpu/x86/pc/olpc/images/lock.565"      " lock.565"      $add-deflated-dropin
112   " ${BP}/cpu/x86/pc/olpc/images/unlock.565"    " unlock.565"    $add-deflated-dropin
113   " ${BP}/cpu/x86/pc/olpc/images/plus.565"      " plus.565"      $add-deflated-dropin
114   " ${BP}/cpu/x86/pc/olpc/images/minus.565"     " minus.565"     $add-deflated-dropin
115   " ${BP}/cpu/x86/pc/olpc/images/x.565"         " x.565"         $add-deflated-dropin
116   " ${BP}/cpu/x86/pc/olpc/images/sad.565"       " sad.565"       $add-deflated-dropin
117   " ${BP}/cpu/x86/pc/olpc/images/bigdot.565"    " bigdot.565"    $add-deflated-dropin
118
119   " ${BP}/cpu/x86/pc/olpc/images/check.565"    " check.565"     $add-deflated-dropin
120   " ${BP}/cpu/x86/pc/olpc/images/xogray.565"   " xogray.565"    $add-deflated-dropin
121   " ${BP}/cpu/x86/pc/olpc/images/ethernet.565" " ethernet.565"  $add-deflated-dropin
122   " ${BP}/cpu/x86/pc/olpc/images/usbkey.565"   " disk.565"      $add-deflated-dropin
123   " ${BP}/cpu/x86/pc/olpc/images/wireless.565" " wlan.565"      $add-deflated-dropin
124   " ${BP}/cpu/x86/pc/olpc/images/laptop.565"   " int.565"       $add-deflated-dropin
125   " ${BP}/cpu/x86/pc/olpc/images/sd.565"       " ext.565"       $add-deflated-dropin
126
1270 [if]
128   " ${BP}/ofw/termemu/15x30pc.psf"             " font"          $add-deflated-dropin
129[then]
130
1310 [if]
132   " memtest"                                   " memtest"       $add-deflated-dropin
133[then]
134
135   " verify.img"                                " verify"        $add-deflated-dropin
136   " os.public"                                 " ospubkey"      $add-dropin \ Incompressible
137   " fw.public"                                 " fwpubkey"      $add-dropin \ Incompressible
138   " fs.public"                                 " fspubkey"      $add-dropin \ Incompressible
139   " lease.public"                              " leasepubkey"   $add-dropin \ Incompressible
140   " developer.public"                          " develpubkey"   $add-dropin \ Incompressible
141
142   " sourceurl"   " sourceurl"                    $add-dropin
143
144   " ${BP}/cpu/x86/pc/olpc/images/Edge1-8k-EQ-Comp-Amp-Short.wav"  " splash"   $add-deflated-dropin
145
146   \ icons for mfg test gui
147   " testicons/play.565"        " play.565"     $add-deflated-dropin
148   " testicons/quit.565"        " quit.565"     $add-deflated-dropin
149   " testicons/cpu.565"         " cpu.565"      $add-deflated-dropin
150   " testicons/spi.565"         " spi.565"      $add-deflated-dropin
151   " testicons/ram.565"         " ram.565"      $add-deflated-dropin
152   " testicons/sdcard.565"      " sdcard.565"   $add-deflated-dropin
153   " testicons/keyboard.565"    " keyboard.565" $add-deflated-dropin
154   " testicons/display.565"     " display.565"  $add-deflated-dropin
155   " testicons/touchpad.565"    " touchpad.565" $add-deflated-dropin
156   " testicons/audio.565"       " audio.565"    $add-deflated-dropin
157   " testicons/usb.565"         " usb.565"      $add-deflated-dropin
158   " testicons/battery.565"     " battery.565"  $add-deflated-dropin
159   " testicons/camera.565"      " camera.565"   $add-deflated-dropin
160   " testicons/wifi.565"        " wifi.565"     $add-deflated-dropin
161   " testicons/clock.565"       " clock.565"    $add-deflated-dropin
162   " testicons/timer.565"       " timer.565"    $add-deflated-dropin
163   " ${BP}/cpu/x86/pc/olpc/images/bigx.di"      $add-file
164   " ${BP}/cpu/x86/pc/olpc/images/bigcheck.di"  $add-file
165   " ${BP}/cpu/x86/pc/olpc/images/leds.di"      $add-file
166   " ${BP}/cpu/x86/pc/olpc/images/ebook.di"     $add-file
167
1680 [if]
169   " ${BP}/cpu/x86/pc/olpc/via/build/nandblaster15_rx.bin" " nb15_rx"  $add-deflated-dropin
170   " ${BP}/cpu/x86/pc/olpc/via/build/nandblaster_tx.bin" " nb_tx"      $add-deflated-dropin
171
172   " ${BP}/cpu/x86/pc/olpc/images/winlogo.565"   " winlogo.565"    $add-deflated-dropin
173   " ${BP}/cpu/x86/pc/olpc/images/tux.565"       " tux.565"        $add-deflated-dropin
174   " ${BP}/cpu/x86/pc/olpc/images/settings.565"  " settings.565"   $add-deflated-dropin
175[then]
176
177.( Dropin top is )  ofd @ fsize  .x cr
178
179/rom pad-file
180
181\ Insert the revision signature
182/rom h# 40 - ofd @ fseek
183h# 10 buffer: signature
184signature h# 10 blank
185machine-signature count   signature         swap move
186" ${FW_VERSION}" expand$  signature     6 + swap move
187" Q4${FW_MAJOR}" expand$  signature d# 13 + swap move
188signature h# 10  ofd @ fputs
189
190/l buffer: crcbuf
191/rom buffer: filebuf
192
193\ Read the entire image, compute the CRC, and store it h# 28 from the end
1940 ofd @ fseek
195filebuf /rom ofd @ fgets /rom <> abort" Can't read back image"
1960 crctab  filebuf /rom  ($crc)  crcbuf !
197
198crc-offset ofd @ fseek
199crcbuf /l ofd @ fputs
200
201ofd @ fclose
202
203\ Creating olpc.version serves two purposes:
204\ a) It reports the firmware revision for use by external scripts
205\ b) It provides an olpc.* artifact for the builder dependency management.
206
207writing olpc.version
208" ${FW_VERSION}" expand$  2dup lower  ofd @ fputs
209ofd @ fclose
210
211
212
213\ LICENSE_BEGIN
214\ Copyright (c) 2010 FirmWorks
215\
216\ Permission is hereby granted, free of charge, to any person obtaining
217\ a copy of this software and associated documentation files (the
218\ "Software"), to deal in the Software without restriction, including
219\ without limitation the rights to use, copy, modify, merge, publish,
220\ distribute, sublicense, and/or sell copies of the Software, and to
221\ permit persons to whom the Software is furnished to do so, subject to
222\ the following conditions:
223\
224\ The above copyright notice and this permission notice shall be
225\ included in all copies or substantial portions of the Software.
226\
227\ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
228\ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
229\ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
230\ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
231\ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
232\ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
233\ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
234\
235\ LICENSE_END
236
Note: See TracBrowser for help on using the repository browser.