| 1 | purpose: Construct the Open Firmware module collection |
|---|
| 2 | |
|---|
| 3 | command: &builder &this |
|---|
| 4 | in: ${BP}/cpu/arm/olpc/1.75/build/ec.img |
|---|
| 5 | in: ${BP}/cpu/arm/olpc/1.75/build/fw.img |
|---|
| 6 | in: ${BP}/cpu/arm/olpc/1.75/build/resetvec.img |
|---|
| 7 | in: ${BP}/cpu/arm/olpc/1.75/build/mcastnand.bin |
|---|
| 8 | in: sd8686.bin |
|---|
| 9 | in: verify.img |
|---|
| 10 | in: ${BP}/dev/usb2/device/hub/build/hub.fc |
|---|
| 11 | in: ${BP}/dev/usb2/device/generic/build/generic.fc |
|---|
| 12 | in: ${BP}/dev/usb2/device/net/build/usbnet.fc |
|---|
| 13 | in: ${BP}/dev/usb2/device/keyboard/build/usbkbd.fc |
|---|
| 14 | in: ${BP}/dev/usb2/device/mouse/build/usbmouse.fc |
|---|
| 15 | in: ${BP}/dev/usb2/device/serial/build/usbserial.fc |
|---|
| 16 | in: ${BP}/dev/usb2/device/storage/build/usbstorage.fc |
|---|
| 17 | in: testicons.bin |
|---|
| 18 | in: ${BP}/clients/emacs/arm/emacs |
|---|
| 19 | in: cforth.img |
|---|
| 20 | build-now |
|---|
| 21 | |
|---|
| 22 | fload ${BP}/cpu/arm/olpc/1.75/fw-version.fth |
|---|
| 23 | |
|---|
| 24 | " macro: FW_VERSION ${FW_PREFIX}${FW_MAJOR}${FW_MINOR}" expand$ eval |
|---|
| 25 | |
|---|
| 26 | fload ${BP}/cpu/arm/olpc/1.75/config.fth |
|---|
| 27 | |
|---|
| 28 | \ Always re-create the builton.fth file when we make a new rom.img |
|---|
| 29 | fload ${BP}/cpu/x86/pc/builton.bth |
|---|
| 30 | fload ${BP}/cpu/arm/olpc/sourceurl.fth |
|---|
| 31 | |
|---|
| 32 | fload ${BP}/forth/lib/crc32.fth |
|---|
| 33 | |
|---|
| 34 | hex |
|---|
| 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 | |
|---|
| 42 | fload ${BP}/cpu/arm/marvell/tim.fth |
|---|
| 43 | |
|---|
| 44 | \ Marvel Trusted Image Module image creation script for |
|---|
| 45 | \ XO-1.75 platform. |
|---|
| 46 | |
|---|
| 47 | tim: 00030102 0 Sky! PXA688 |
|---|
| 48 | flash: SPI'10 |
|---|
| 49 | timh: TIMH 0 d101f000 |
|---|
| 50 | \ Main Processor code loaded into DRAM |
|---|
| 51 | image: OBMI 800 d101c000 ${BP}/cpu/arm/olpc/dummy.img |
|---|
| 52 | \ Secure Processor code loaded into SRAM |
|---|
| 53 | image: WTMI 1000 d1018000 shim.img |
|---|
| 54 | image: CFTH 2000 d1000000 cforth.img |
|---|
| 55 | reserved: |
|---|
| 56 | term: |
|---|
| 57 | end-reserved |
|---|
| 58 | end-tim |
|---|
| 59 | |
|---|
| 60 | h# e.0000 to reserved-start |
|---|
| 61 | h# f.0000 to reserved-end |
|---|
| 62 | |
|---|
| 63 | .( --- Saving as ) |
|---|
| 64 | " ${FW_VERSION}.rom" expand$ 2dup lower ( adr len ) |
|---|
| 65 | 2dup 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 |
|---|
| 162 | h# 10 buffer: signature |
|---|
| 163 | signature h# 10 blank |
|---|
| 164 | signature$ signature swap move |
|---|
| 165 | " ${FW_VERSION}" expand$ signature 6 + swap move |
|---|
| 166 | " ${FW_PREFIX}${FW_MAJOR}" expand$ signature d# 13 + swap move |
|---|
| 167 | signature-offset ofd @ fseek |
|---|
| 168 | signature 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 |
|---|
| 174 | 0 ofd @ fseek |
|---|
| 175 | filebuf /rom ofd @ fgets /rom <> abort" Can't read back image" |
|---|
| 176 | 0 crctab filebuf /rom ($crc) crcbuf ! |
|---|
| 177 | |
|---|
| 178 | crc-offset ofd @ fseek |
|---|
| 179 | crcbuf /l ofd @ fputs |
|---|
| 180 | |
|---|
| 181 | ofd @ 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 | |
|---|
| 187 | writing olpc.version |
|---|
| 188 | " ${FW_VERSION}" expand$ 2dup lower ofd @ fputs |
|---|
| 189 | ofd @ 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 | |
|---|