2008-11-24 12:16:22 +00:00
|
|
|
\ Qemu specific initialization code
|
|
|
|
|
\
|
|
|
|
|
\ This program is free software; you can redistribute it and/or
|
|
|
|
|
\ modify it under the terms of the GNU General Public License
|
|
|
|
|
\ as published by the Free Software Foundation
|
|
|
|
|
\
|
|
|
|
|
|
|
|
|
|
\ -------------------------------------------------------------
|
|
|
|
|
\ device-tree
|
|
|
|
|
\ -------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
" /" find-device
|
|
|
|
|
|
2008-12-31 16:18:34 +00:00
|
|
|
1 encode-int " #address-cells" property
|
2008-11-24 12:16:22 +00:00
|
|
|
1 encode-int " #size-cells" property
|
2009-01-05 20:08:04 +00:00
|
|
|
h# 05f5e100 encode-int " clock-frequency" property
|
2008-12-31 16:18:34 +00:00
|
|
|
|
|
|
|
|
new-device
|
|
|
|
|
" cpus" device-name
|
|
|
|
|
1 encode-int " #address-cells" property
|
|
|
|
|
0 encode-int " #size-cells" property
|
2009-08-17 21:57:04 +00:00
|
|
|
external
|
|
|
|
|
|
|
|
|
|
: encode-unit ( unit -- str len )
|
|
|
|
|
pocket tohexstr
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
: decode-unit ( str len -- unit )
|
|
|
|
|
parse-hex
|
|
|
|
|
;
|
|
|
|
|
|
2008-12-31 16:18:34 +00:00
|
|
|
finish-device
|
2008-11-24 12:16:22 +00:00
|
|
|
|
|
|
|
|
new-device
|
|
|
|
|
" memory" device-name
|
|
|
|
|
" memory" device-type
|
|
|
|
|
external
|
|
|
|
|
: open true ;
|
|
|
|
|
: close ;
|
|
|
|
|
finish-device
|
|
|
|
|
|
|
|
|
|
\ -------------------------------------------------------------
|
|
|
|
|
\ /packages
|
|
|
|
|
\ -------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
" /packages" find-device
|
|
|
|
|
|
|
|
|
|
" packages" device-name
|
|
|
|
|
external
|
|
|
|
|
\ allow packages to be opened with open-dev
|
|
|
|
|
: open true ;
|
|
|
|
|
: close ;
|
|
|
|
|
|
|
|
|
|
\ /packages/terminal-emulator
|
|
|
|
|
new-device
|
|
|
|
|
" terminal-emulator" device-name
|
|
|
|
|
external
|
|
|
|
|
: open true ;
|
|
|
|
|
: close ;
|
|
|
|
|
\ : write ( addr len -- actual )
|
|
|
|
|
\ dup -rot type
|
|
|
|
|
\ ;
|
|
|
|
|
finish-device
|
|
|
|
|
|
|
|
|
|
\ -------------------------------------------------------------
|
|
|
|
|
\ The END
|
|
|
|
|
\ -------------------------------------------------------------
|
|
|
|
|
device-end
|