These changes are the raw update to qemu-2.6.
[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 new-device
46         " rom" device-name
47         h# ff800000 encode-int 0 encode-int encode+ " reg" property
48         1 encode-int " #address-cells" property
49         h# ff800000 encode-int h# 800000 encode-int encode+
50         h# ff800000 encode-int encode+ " ranges" property
51 finish-device
52
53 \ -------------------------------------------------------------
54 \ /packages
55 \ -------------------------------------------------------------
56
57 " /packages" find-device
58
59         " packages" device-name
60         external
61         \ allow packages to be opened with open-dev
62         : open true ;
63         : close ;
64
65 \ /packages/terminal-emulator
66 new-device
67         " terminal-emulator" device-name
68         external
69         : open true ;
70         : close ;
71         \ : write ( addr len -- actual )
72         \       dup -rot type
73         \ ;
74 finish-device
75
76 \ -------------------------------------------------------------
77 \ The END
78 \ -------------------------------------------------------------
79 device-end