Add qemu 2.4.0
[kvmfornfv.git] / qemu / roms / openbios / arch / ppc / qemu / tree.fs
1 \   QEMU specific initialization code
2 \
3 \   This program is free software; you can redistribute it and/or
4 \   modify it under the terms of the GNU General Public License
5 \   as published by the Free Software Foundation
6 \
7
8 include config.fs
9
10 \ -------------------------------------------------------------
11 \ device-tree
12 \ -------------------------------------------------------------
13
14 " /" find-device
15 \ Apple calls the root node device-tree
16 " device-tree" device-name
17 [IFDEF] CONFIG_PPC64 2 [ELSE] 1 [THEN] encode-int " #address-cells" property
18 1 encode-int " #size-cells" property
19 h# 05f5e100 encode-int " clock-frequency" property
20
21 new-device
22         " cpus" device-name
23         1 encode-int " #address-cells" property
24         0 encode-int " #size-cells" property
25         external
26
27         : encode-unit ( unit -- str len )
28                 pocket tohexstr
29         ;
30
31         : decode-unit ( str len -- unit )
32                 parse-hex
33         ;
34
35 finish-device
36
37 new-device
38         " memory" device-name
39         " memory" device-type
40         external
41         : open true ;
42         : close ;
43 finish-device
44
45 \ -------------------------------------------------------------
46 \ /packages
47 \ -------------------------------------------------------------
48
49 " /packages" find-device
50
51         " packages" device-name
52         external
53         \ allow packages to be opened with open-dev
54         : open true ;
55         : close ;
56
57 \ /packages/terminal-emulator
58 new-device
59         " terminal-emulator" device-name
60         external
61         : open true ;
62         : close ;
63         \ : write ( addr len -- actual )
64         \       dup -rot type
65         \ ;
66 finish-device
67
68 \ -------------------------------------------------------------
69 \ The END
70 \ -------------------------------------------------------------
71 device-end