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

Last change on this file was 3629, checked in by quozl, 2 months ago

OLPC XO-1.75 - fix overlap with manufacturing data again, this time it was because components delivered to the image with $add-file were not included in the reserved area check. Rather than move the reserved area check deeper into the mkdropin.fth logic, it was easier to reorder the build so that such components were added early. #12627.

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