aboutsummaryrefslogtreecommitdiffstats
path: root/cpu/arm/mmp3/ariel/ofw.bth
blob: f847e4e827f2dc74a52f31e5d040359737d0778a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
purpose: Construct the Open Firmware module collection

command: &builder &this
in: ${BP}/cpu/arm/mmp3/ariel/build/fw.img
in: ${BP}/cpu/arm/mmp3/ariel/build/resetvec.img
in: ${BP}/dev/usb2/device/hub/build/hub.fc
in: ${BP}/dev/usb2/device/generic/build/generic.fc
in: ${BP}/dev/usb2/device/net/build/usbnet.fc
in: ${BP}/dev/usb2/device/keyboard/build/usbkbd.fc
in: ${BP}/dev/usb2/device/mouse/build/usbmouse.fc
in: ${BP}/dev/usb2/device/serial/build/usbserial.fc
in: ${BP}/dev/usb2/device/storage/build/usbstorage.fc
in: ${BP}/clients/emacs/arm/emacs
in: cforth.img
build-now

fload ${BP}/cpu/arm/mmp3/ariel/config.fth

\ Always re-create the builton.fth file when we make a new rom.img
fload ${BP}/cpu/x86/pc/builton.bth

fload ${BP}/forth/lib/crc32.fth

hex

: pad-file  ( location -- )
   ofd @ fsize
   2dup u< abort" The ROM image is too large"
   ?do  h# ff ofd @ fputc  loop
;

fload ${BP}/cpu/arm/marvell/tim.fth

\ Marvell Non-Trusted Image Module image creation script for XO-4.0 platform.

tim: 00030400 0 DELL PXA212x
  flash: SPI'10
  timh:  TIMH        0 d101f000
  image: OBMI     2000 d1000000 cforth.img
  reserved:
    \ Disable USB download/init by enabling the FFUART for download
    \ This works around a PHY init erratum for the B0 chip
    uart: 00004646 1
    term:
  end-reserved
end-tim

h# 20.0000 to reserved-start
h# 20.0000 to reserved-end

.( --- Saving as ofw.rom ) cr
writing ofw.rom
   tim$ ofd @ fputs

   dropin-offset  pad-file

\ Loads the set of drivers that is common to different output formats

   " ${BP}/cpu/arm/build/inflate.bin"        " inflate"         $add-dropin
   " fw.img"   " firmware"  $add-deflated-dropin
\   " fw.img"   " firmware"  $add-dropin
   " resetvec.img"  " reset" $add-dropin

   " ${BP}/cpu/arm/mmp3/gic.fth" " mmp3-gic-" $add-dropin
   " ${BP}/cpu/arm/olpc/4.0/compat.fth" " olpc-compat-" $add-dropin
\   " ${BP}/dev/usb2/hcd/ehci/build/ehci.fc"	" class0c0320"      $add-deflated-dropin
   " ${BP}/dev/usb2/device/hub/build/hub.fc"     " usb,class9"      $add-deflated-dropin
   " ${BP}/dev/usb2/device/generic/build/generic.fc"  " usbdevice"  $add-deflated-dropin
   " ${BP}/dev/usb2/device/net/build/usbnet.fc"       " usbnet"     $add-deflated-dropin
   " ${BP}/dev/usb2/device/keyboard/build/usbkbd.fc" " usb,class3,1,1" $add-deflated-dropin
   " ${BP}/dev/usb2/device/mouse/build/usbmouse.fc"  " usb,class3,1,2" $add-deflated-dropin
   " ${BP}/dev/usb2/device/serial/build/usbserial.fc" " usbserial"  $add-deflated-dropin
   " ${BP}/dev/usb2/device/storage/build/usbstorage.fc" " usbstorage"   $add-deflated-dropin

   " builton.fth"                       " probe-"          $add-dropin

   " ${BP}/ofw/inet/telnetd.fth"          " telnetd"             $add-deflated-dropin

   " ${BP}/ofw/termemu/gallant.obf"             " font"          $add-deflated-dropin

   " ${BP}/clients/emacs/x86/emacs.rc"          " emacs.rc"      $add-deflated-dropin
   " ${BP}/clients/emacs/emacs.hlp"             " emacs.hlp"     $add-deflated-dropin
   " ${BP}/clients/emacs/arm/emacs"             " emacs"         $add-deflated-dropin

.( Dropin top is )  ofd @ fsize  .x cr

/rom pad-file

\ Insert the machine signature
h# 10 buffer: signature
signature h# 10 blank
signature$  signature  swap move
signature-offset ofd @ fseek
signature h# 10  ofd @ fputs

/l buffer: crcbuf
/rom buffer: filebuf

\ Read the entire image, compute the CRC, and store it in the CRC location
0 ofd @ fseek
filebuf /rom ofd @ fgets /rom <> abort" Can't read back image"
0 crctab  filebuf /rom  ($crc)  crcbuf !

crc-offset ofd @ fseek
crcbuf /l ofd @ fputs

ofd @ fclose

\ LICENSE_BEGIN
\ Copyright (c) 2010 FirmWorks
\ Copyright (c) 2020 Lubomir Rintel <lkundrak@v3.sk>
\
\ Permission is hereby granted, free of charge, to any person obtaining
\ a copy of this software and associated documentation files (the
\ "Software"), to deal in the Software without restriction, including
\ without limitation the rights to use, copy, modify, merge, publish,
\ distribute, sublicense, and/or sell copies of the Software, and to
\ permit persons to whom the Software is furnished to do so, subject to
\ the following conditions:
\
\ The above copyright notice and this permission notice shall be
\ included in all copies or substantial portions of the Software.
\
\ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
\ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
\ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
\ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
\ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
\ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
\ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\
\ LICENSE_END