Author: wmb
Date: 2009-07-20 23:30:47 +0200 (Mon, 20 Jul 2009)
New Revision: 1245
Modified:
cpu/x86/pc/olpc/copynand.fth
cpu/x86/pc/olpc/fw.bth
cpu/x86/pc/olpc/life.fth
cpu/x86/pc/olpc/security.fth
cpu/x86/pc/olpc/sound.fth
cpu/x86/pc/olpc/via/config.fth
cpu/x86/pc/olpc/via/devices.fth
cpu/x86/pc/olpc/via/fw.bth
cpu/x86/pc/olpc/via/olpc.bth
cpu/x86/pc/olpc/via/versions.fth
dev/hdaudio/core.fth
dev/via/unichrome/unichrome.fth
ofw/core/banner.fth
Log:
Via - omnibus checkin to enable support for numerous OLPC features
that had been deferred, including pretty boot, security, startu sound, ...
Modified: cpu/x86/pc/olpc/copynand.fth
===================================================================
--- cpu/x86/pc/olpc/copynand.fth 2009-07-17 21:47:18 UTC (rev 1244)
+++ cpu/x86/pc/olpc/copynand.fth 2009-07-20 21:30:47 UTC (rev 1245)
@@ -228,40 +228,6 @@
: written? ( adr len -- flag ) h# ffffffff lskip 0<> ;
-
-d# 24 d# 24 2value ulhc
-
-d# 22 constant status-line
-
-8 constant glyph-w
-8 constant glyph-h
-
-9 constant grid-w
-9 constant grid-h
-
-d# 128 value #cols
-: xy+ ( x1 y1 x2 y2 -- x3 y3 ) rot + -rot + swap ;
-: xy* ( x y w h -- x*w y*h ) rot * >r * r> ;
-
-: do-fill ( color x y w h -- ) " fill-rectangle" $call-screen ;
-
-\ States: 0:erased 1:bad 2:waiting for write 3:written
-
-: >loc ( eblock# -- x y ) #cols /mod grid-w grid-h xy* ulhc xy+ ;
-
-: show-state ( eblock# state -- ) swap >loc glyph-w glyph-h do-fill ;
-
-code map-color ( color24 -- color565 )
- bx pop
- bx ax mov 3 # ax shr h# 1f # ax and \ Blue in correct place
- bx cx mov 5 # cx shr h# 7e0 # cx and cx ax or \ Green and blue in place
- 8 # bx shr h# f800 # bx and bx ax or \ Red, green and blue in place
- ax push
-c;
-: show-color ( eblock# color32 -- ) map-color show-state ;
-
-dev screen : erase-screen erase-screen ; dend
-
h# 80 h# 80 h# 80 rgb>565 constant bbt-color \ gray
0 0 0 rgb>565 constant erased-color \ black
h# ff 0 0 rgb>565 constant bad-color \ red
@@ -272,6 +238,8 @@
0 h# ff h# ff rgb>565 constant strange-color \ cyan
h# ff h# ff h# ff rgb>565 constant starting-color \ white
+d# 22 constant status-line
+
: gshow-init ( #eblocks -- )
cursor-off " erase-screen" $call-screen
Modified: cpu/x86/pc/olpc/fw.bth
===================================================================
--- cpu/x86/pc/olpc/fw.bth 2009-07-17 21:47:18 UTC (rev 1244)
+++ cpu/x86/pc/olpc/fw.bth 2009-07-20 21:30:47 UTC (rev 1245)
@@ -326,6 +326,7 @@
fload ${BP}/cpu/x86/pc/olpc/suspend.fth \ Suspend/resume setup
fload ${BP}/dev/olpc/keyboard/selftest.fth \ Keyboard diagnostic
fload ${BP}/dev/olpc/touchpad/touchpad.fth \ Touchpad diagnostic
+fload ${BP}/cpu/x86/pc/olpc/gridmap.fth \ Gridded display tools
fload ${BP}/cpu/x86/pc/olpc/copynand.fth
\ fload ${BP}/cpu/x86/pc/olpc/carousel.fth \ Carouseled NAND writing
fload ${BP}/cpu/x86/pc/olpc/crypto.fth \ Cryptographic image validation
Modified: cpu/x86/pc/olpc/life.fth
===================================================================
--- cpu/x86/pc/olpc/life.fth 2009-07-17 21:47:18 UTC (rev 1244)
+++ cpu/x86/pc/olpc/life.fth 2009-07-20 21:30:47 UTC (rev 1245)
@@ -13,12 +13,12 @@
/board buffer: lf_board_work
\ some macros to get a linear address o a cell of board or working area
-: >offset ( i j -- lin_addr ) swap lf_width * + ;
+: ij>offset ( i j -- lin_addr ) swap lf_width * + ;
: >cell ( i j -- adr ) swap lf_width * + lf_board + ;
: >work ( i j -- adr ) swap lf_width * + lf_board_work + ;
: show-cell ( state y x -- )
- >offset swap if lf_fg else lf_bg then show-state
+ ij>offset swap if lf_fg else lf_bg then show-state
;
\ display the board of life
@@ -33,7 +33,7 @@
\ working variable
variable cell-sum
-: xy+ ( x1 y1 x2 y2 -- x3 y3 ) rot + -rot + swap ;
+\needs xy+ : xy+ ( x1 y1 x2 y2 -- x3 y3 ) rot + -rot + swap ;
code sumcell ( adr -- sum )
bx pop
@@ -69,7 +69,7 @@
1 1 +sum ( i j )
2drop cell-sum @ ( sum )
[else]
- >offset lf_board + sumcell
+ ij>offset lf_board + sumcell
[then]
;
Modified: cpu/x86/pc/olpc/security.fth
===================================================================
--- cpu/x86/pc/olpc/security.fth 2009-07-17 21:47:18 UTC (rev 1244)
+++ cpu/x86/pc/olpc/security.fth 2009-07-20 21:30:47 UTC (rev 1245)
@@ -287,7 +287,7 @@
\ string is shorter than n, head$ is the input string and tail$ is
\ the null string.
-: break$ ( $ n -- tail$ head$ )
+: cut$ ( $ n -- tail$ head$ )
2dup < if drop null$ 2swap exit then
dup >r /string ( tail$ )
over r@ - r> ( tail$ head$ )
@@ -307,7 +307,7 @@
: key-in-list? ( key$ -- flag ) \ Sets thiskey$ as an important side effect
2>r ( r: key$ )
pubkey$ begin dup while ( rem$ r: key$ )
- pubkeylen break$ ( rem$' thiskey$ r: key$ )
+ pubkeylen cut$ ( rem$' thiskey$ r: key$ )
2r@ 2over tail$= if ( rem$ thiskey$ r: key$ )
to thiskey$ ( rem$ r: key$ )
2r> 4drop true ( true )
@@ -373,7 +373,7 @@
\ numfield is a factor used for parsing 2-digit fields from date/time strings.
: numfield ( exp$ min max -- exp$' )
>r >r ( exp$ r: max min )
- 2 break$ $number throw ( exp$' num r: max min )
+ 2 cut$ $number throw ( exp$' num r: max min )
dup r> < throw ( exp$ num r: max )
dup r> > throw ( exp$ num )
;
@@ -383,10 +383,10 @@
\ according to the simplified calculation described above for "get-date"
: (expiration-to-seconds) ( expiration$ -- d.seconds )
- 4 break$ $number throw >r ( exp$' r: y )
+ 4 cut$ $number throw >r ( exp$' r: y )
1 d# 12 numfield >r ( exp$' r: y m )
1 d# 31 numfield >r ( exp$' r: y m d )
- 1 break$ " T" $= 0= throw ( exp$' r: y m d )
+ 1 cut$ " T" $= 0= throw ( exp$' r: y m d )
0 d# 23 numfield >r ( exp$' r: y m d h )
0 d# 59 numfield >r ( exp$' r: y m d h m )
0 d# 59 numfield >r ( exp$' r: y m d h m s )
@@ -906,7 +906,7 @@
: secure-startup ( -- )
in-factory? if
button-check button-x or button-o or button-square or button-rotate or ( mask )
- game-key-mask = if exit then
+ game-key-mask = if sound-end exit then
then
['] noop to ?show-device
@@ -923,11 +923,14 @@
else
freeze dcon-freeze
+[ifdef] jffs2-support
\ The following is a hack to let the user unfreeze the screen during
\ the several-second period while JFFS2 is scanning the NAND
" dev /jffs2-file-system ' ?unfreeze to scan-callout dend" eval
+[then]
then
+ sound-end
\ The screen may be frozen when we exit, because we want pretty
\ boot even when not secure.
Modified: cpu/x86/pc/olpc/sound.fth
===================================================================
--- cpu/x86/pc/olpc/sound.fth 2009-07-17 21:47:18 UTC (rev 1244)
+++ cpu/x86/pc/olpc/sound.fth 2009-07-20 21:30:47 UTC (rev 1245)
@@ -37,8 +37,10 @@
r> to load-started
r> to playback-volume
;
+: sound-end ( -- )
+ " wait-sound" ['] $call-audio catch if 2drop then
+;
-
\ LICENSE_BEGIN
\ Copyright (c) 2006 FirmWorks
\
Modified: cpu/x86/pc/olpc/via/config.fth
===================================================================
--- cpu/x86/pc/olpc/via/config.fth 2009-07-17 21:47:18 UTC (rev 1244)
+++ cpu/x86/pc/olpc/via/config.fth 2009-07-20 21:30:47 UTC (rev 1245)
@@ -31,15 +31,12 @@
create resident-packages
\ create use-watch-all
-\ create use-root-isa \ If defined, isa node is in the devtree root, not under /pci
create no-floppy-node
create no-com2-node
create no-lpt-node
-create use-pci-isa
-create basic-isa
+create basic-isa \ Disables some CHRP stuff in the ISA legacy nodes
create isa-dma-only
create use-ega
-create save-msrs
create use-null-nvram \ Don't store configuration variables
\ create use-flash-nvram \ Store configuration variables in firmware FLASH
Modified: cpu/x86/pc/olpc/via/devices.fth
===================================================================
--- cpu/x86/pc/olpc/via/devices.fth 2009-07-17 21:47:18 UTC (rev 1244)
+++ cpu/x86/pc/olpc/via/devices.fth 2009-07-20 21:30:47 UTC (rev 1245)
@@ -56,31 +56,18 @@
\ devalias screen /ega-text
[then]
-[ifdef] use-root-isa
-0 0 " " " /" begin-package
- fload ${BP}/cpu/x86/pc/isabus.fth \ ISA Bus Bridge under root node
-end-package
-[then]
-
-[ifdef] use-pci-isa
-
[ifdef] addresses-assigned
-[ifdef] use-pci-isa
\ This must precede isamisc.fth in the load file, to execute it first
fload ${BP}/cpu/x86/pc/moveisa.fth
[then]
-[then]
0 0 " 0" " /pci" begin-package
fload ${BP}/dev/pci/isa.fth \ ISA bus bridge under PCI node
fload ${BP}/dev/pci/isamisc.fth
end-package
-[then]
-
fload ${BP}/cpu/x86/pc/olpc/timertest.fth \ Selftest for PIT timer
-1 [if]
warning @ warning off
: probe-pci ( -- )
probe-pci
@@ -258,7 +245,6 @@
\needs md5init fload ${BP}/ofw/ppp/md5.fth \ MD5 hash
-[ifdef] use-ec
fload ${BP}/dev/olpc/kb3700/ecspi.fth \ EC chip SPI FLASH access
warning @ warning off
@@ -272,7 +258,6 @@
fload ${BP}/dev/olpc/kb3700/ecio.fth \ I/O space access to EC chip
fload ${BP}/cpu/x86/pc/olpc/via/boardrev.fth \ Board revision decoding
-[then]
: cpu-mhz ( -- n )
" /cpu@0" find-package drop ( phandle )
@@ -280,12 +265,10 @@
decode-int nip nip d# 1000000 /
;
-[ifdef] use-ec-Later
stand-init: Date to EC
time&date d# 2000 - ['] ec-date! catch if 3drop then
3drop
;
-[then]
[ifdef] use-wlan
stand-init: Wireless reset
@@ -297,31 +280,12 @@
;
[then]
-[ifdef] use-ec-Later
-stand-init: PCI properties
- " /pci" find-device
- board-revision h# b18 < if
- d# 33,333,333
- else
- \ We switched to 66 MHz at B2
- d# 66,666,667
- then
- " clock-frequency" integer-property
- dend
-;
-[then]
-
-[ifdef] use-ec
fload ${BP}/cpu/x86/pc/olpc/mfgdata.fth \ Manufacturing data
fload ${BP}/cpu/x86/pc/olpc/mfgtree.fth \ Manufacturing data in device tree
.( XXX Reinstate kbdtype.fth) cr
\ fload ${BP}/cpu/x86/pc/olpc/kbdtype.fth \ Export keyboard type
-[ifdef] use-ec
fload ${BP}/dev/olpc/kb3700/battery.fth \ Battery status reports
-[else]
-: ?enough-power ;
-[then]
fload ${BP}/dev/olpc/spiflash/spiflash.fth \ SPI FLASH programming
fload ${BP}/dev/olpc/spiflash/spiui.fth \ User interface for SPI FLASH programming
@@ -330,15 +294,9 @@
: ofw-fw-filename$ " disk:\boot\olpc.rom" ;
' ofw-fw-filename$ to fw-filename$
-[then]
: +i encode-int encode+ ; : 0+i 0 +i ;
-[ifdef] Later
-fload ${BP}/cpu/x86/pc/olpc/via/gpioinit.fth
-fload ${BP}/cpu/x86/pc/olpc/via/chipinit.fth
-[then]
-
0 0 " 1,0" " /pci" begin-package
fload ${BP}/dev/via/unichrome/loadpkg.fth \ Geode display
fload ${BP}/dev/via/unichrome/dconsmb.fth \ SMB access to DCON chip
@@ -355,7 +313,6 @@
fload ${BP}/cpu/x86/adpcm.fth \ ADPCM decoding
-[ifdef] use-ec-Later
warning @ warning off
: stand-init
stand-init
@@ -386,10 +343,9 @@
dend
;
warning !
-[then]
[ifdef] Later
-fload ${BP}/cpu/x86/pc/olpc/micin.fth \ Microphone input AC/DC coupling
+\ Add support for DC-couple microphone input
[then]
\ LICENSE_BEGIN
Modified: cpu/x86/pc/olpc/via/fw.bth
===================================================================
--- cpu/x86/pc/olpc/via/fw.bth 2009-07-17 21:47:18 UTC (rev 1244)
+++ cpu/x86/pc/olpc/via/fw.bth 2009-07-20 21:30:47 UTC (rev 1245)
@@ -98,10 +98,6 @@
fload ${BP}/cpu/x86/pc/olpc/port80.fth \ Port 80 debug messages
-[ifdef] Later
-fload ${BP}/dev/geode/gpio.fth \ Rudimentary GPIO driver
-[then]
-
fload ${BP}/cpu/x86/pc/isaio.fth
fload ${BP}/dev/pci/configm1.fth \ Generic PCI configuration access
@@ -259,7 +255,6 @@
: protect-fw ( -- ) secure? if ec-indexed-io-off then ;
-\ stand-init-debug? [if]
warning @ warning off
: init
\ initial-heap add-memory
@@ -272,14 +267,9 @@
protect-fw
." Interacting" cr hex interact
then
-
- [ifdef] Later
- setup
- [then]
then
;
warning !
-[then]
: (.firmware) ( -- )
." Open Firmware " .built cr
@@ -316,7 +306,6 @@
;
' screen-#lines to lines/page
-[ifdef] Later
fload ${BP}/cpu/x86/pc/olpc/disptest.fth
: setup-for-linux ( -- )
[ ' linux-hook behavior compile, ] \ Chain to old behavior
@@ -326,17 +315,17 @@
fload ${BP}/cpu/x86/pc/olpc/help.fth
fload ${BP}/cpu/x86/pc/olpc/gui.fth
-[then]
fload ${BP}/cpu/x86/pc/olpc/via/suspend.fth \ Suspend/resume setup
fload ${BP}/dev/olpc/keyboard/selftest.fth \ Keyboard diagnostic
fload ${BP}/dev/olpc/touchpad/touchpad.fth \ Touchpad diagnostic
+fload ${BP}/cpu/x86/pc/olpc/gridmap.fth \ Gridded display tools
[ifdef] Later
fload ${BP}/cpu/x86/pc/olpc/copynand.fth
+[then]
\ fload ${BP}/cpu/x86/pc/olpc/carousel.fth \ Carouseled NAND writing
fload ${BP}/cpu/x86/pc/olpc/crypto.fth \ Cryptographic image validation
fload ${BP}/cpu/x86/pc/olpc/lzip.fth \ Access zip images from memory
-[then]
fload ${BP}/cpu/x86/pc/olpc/gamekeys.fth
: emacs ( -- )
@@ -354,22 +343,21 @@
\ fload ${BP}/cpu/x86/pc/biosload/rmenter.fth
fload ${BP}/cpu/x86/pc/biosints.fth
fload ${BP}/cpu/x86/pc/olpc/biosresume.fth
+[then]
fload ${BP}/cpu/x86/pc/olpc/setwp.fth
+fload ${BP}/cpu/x86/pc/olpc/sound.fth
fload ${BP}/cpu/x86/pc/olpc/security.fth
fload ${BP}/ofw/gui/ofpong.fth
fload ${BP}/cpu/x86/pc/olpc/life.fth
-fload ${BP}/cpu/x86/pc/olpc/sound.fth
[ifdef] wlan-wackup
fload ${BP}/cpu/x86/pc/olpc/wlantest.fth
' gx-power-off to power-off
[then]
-[then]
fload ${BP}/cpu/x86/pc/olpc/rtcwake.fth
-[ifdef] Later
[ifdef] use-ega
: ega-output ( -- )
\ This only works if stdout is currently /display
@@ -379,7 +367,6 @@
" /ega-text" output
;
[then]
-[then]
" /xp u:\boot\olpc.fth sd:\boot\olpc.fth c:\boot\olpc.fth nand:\boot\olpc.fth /prober /usb/ethernet /usb/wlan"
' boot-device set-config-string-default
@@ -410,7 +397,6 @@
: dimmer ( -- ) screen-ih if " dimmer" screen-ih $call-method then ;
: brighter ( -- ) screen-ih if " brighter" screen-ih $call-method then ;
-[ifdef] Later
dev /8042/keyboard
0 value waiting-up?
: olpc-check-abort ( scan-code -- abort? ) \ Square pressed?
@@ -440,7 +426,6 @@
;
' handle-volume? to scan-handled?
dend
-[then]
\ Eliminate 4 second delay in install console for the case where
\ there is no keyboard. The delay is unnecessary because the screen
@@ -448,13 +433,12 @@
patch drop ms install-console
: via-reset-all ( -- )
-[ifdef] Later
" screen" " dcon-off" ['] execute-device-method catch if
2drop 2drop
then
ec-reboot \ Tell the EC to reboot us, so the EC can reset too
-[then]
+
\ Prevent "resume from S3" on restart
4 acpi-w@ h# 1c00 invert and 4 acpi-w!
@@ -532,7 +516,6 @@
\ fload ${BP}/cpu/x86/pc/report.fth
fload ${BP}/ofw/core/dualconsole.fth
-[ifdef] Later
: fast-boot? ( -- flag )
[ifdef] rom-loaded
button-x game-key? 0=
@@ -540,7 +523,6 @@
false
[then]
;
-[then]
: set-mc ( 19-val 1a-val -- )
lbsplit h# 66 h# 69 do i cmos! -1 +loop
@@ -561,7 +543,6 @@
\ .built cr
;
-[ifdef] Later
: ?factory-boot-sequence ( -- flag )
\ TS is the "test station" tag. Its value is set to "DL" at the
\ end of manufacturing test.
@@ -569,14 +550,17 @@
?-null " DL" $= 0= ( in-factory? )
else ( )
\ Missing TS tag is treated as in factory
+[ifdef] Later
true ( in-factory? )
+[else]
+ false
+[then]
then ( in-factory? )
if ( )
" /prober /usb/ethernet disk:\boot\olpc.fth nand:\boot\olpc.fth /xp sd:\boot\olpc.fth /usb/wlan"
to boot-device
then ( )
;
-[then]
: console-start ( -- )
" screen" open-dev ?dup if
@@ -603,7 +587,6 @@
then
;
-[ifdef] Later
: ?games ( -- )
rocker-right game-key? if
protect-fw
@@ -623,6 +606,7 @@
then
;
+[ifdef] Later
: ?scan-nand ( -- )
rocker-up game-key? if
protect-fw text-on ['] scan-nand guarded
@@ -633,6 +617,7 @@
game-key-mask = if protect-fw try-fs-update then
;
[then]
+
: open-keyboard ( -- )
" keyboard" open-dev ?dup if set-stdin then
;
@@ -640,13 +625,11 @@
: startup ( -- )
standalone? 0= if exit then
-[ifdef] Later
block-exceptions
no-page
?factory-mode
?factory-boot-sequence
-[then]
console-start
@@ -658,33 +641,29 @@
read-game-keys
-[ifdef] Later
stdout off \
-[then]
" probe-" do-drop-in
probe-pci
-[ifdef] Later
sound
-[then]
open-keyboard
-[ifdef] Later
?games
-[then]
['] false to interrupt-auto-boot?
probe-usb
" probe+" do-drop-in
+
setup-smbios \ Must be done after build-date is defined via do-drop-in
interpreter-init
+
+ ?diags
[ifdef] Later
?scan-nand
- ?diags
?fs-update
+[then]
secure-startup
unblock-exceptions
-[then]
['] (interrupt-auto-boot?) to interrupt-auto-boot?
?usb-keyboard
\ install-console
@@ -692,14 +671,12 @@
banner
auto-boot
-[ifdef] Later
frozen? ( frozen? )
unfreeze visible ( frozen? )
if banner then \ Reissue banner if it was suppressed
blue-letters ." Type 'help' for more information." black-letters
cr cr
-[then]
quit
;
@@ -711,10 +688,8 @@
;
: urom " flash! u:\new.rom" eval ;
-[ifdef] use-ec-Later
\ Fancy battery charge logger.
fload ${BP}/cpu/x86/pc/olpc/charge.fth
-[then]
\ This helps with TeraTerm, which sends ESC-O as the arrow key prefix
also hidden also keys-forth definitions
Modified: cpu/x86/pc/olpc/via/olpc.bth
===================================================================
--- cpu/x86/pc/olpc/via/olpc.bth 2009-07-17 21:47:18 UTC (rev 1244)
+++ cpu/x86/pc/olpc/via/olpc.bth 2009-07-20 21:30:47 UTC (rev 1245)
@@ -113,7 +113,6 @@
" ${BP}/ofw/fcode/memtest.fth" " memtest.fth" $add-deflated-dropin
" ${BP}/dev/hdaudio/build/hdaudio.fc" " class040300" $add-deflated-dropin
-[ifdef] Later
" ${BP}/ofw/inet/telnetd.fth" " telnetd" $add-deflated-dropin
@@ -138,7 +137,6 @@
" ${BP}/cpu/x86/pc/olpc/images/wireless.565" " wlan.565" $add-deflated-dropin
" ${BP}/cpu/x86/pc/olpc/images/xo.565" " xo.565" $add-deflated-dropin
" ${BP}/cpu/x86/pc/olpc/images/sd.565" " sd.565" $add-deflated-dropin
-[then]
" ${BP}/ofw/termemu/15x30pc.psf" " font" $add-deflated-dropin
[ifdef] use-ega
Modified: cpu/x86/pc/olpc/via/versions.fth
===================================================================
--- cpu/x86/pc/olpc/via/versions.fth 2009-07-17 21:47:18 UTC (rev 1244)
+++ cpu/x86/pc/olpc/via/versions.fth 2009-07-20 21:30:47 UTC (rev 1245)
@@ -2,7 +2,7 @@
\ The overall firmware revision
macro: FW_MAJOR A
-macro: FW_MINOR 05
+macro: FW_MINOR 05b
\ The EC microcode
macro: EC_VERSION 1_9_5
Modified: dev/hdaudio/core.fth
===================================================================
--- dev/hdaudio/core.fth 2009-07-17 21:47:18 UTC (rev 1244)
+++ dev/hdaudio/core.fth 2009-07-20 21:30:47 UTC (rev 1245)
@@ -232,10 +232,10 @@
: low-rate? ( Hz ) dup d# 48.000 < swap d# 44.100 <> and ;
: set-sample-rate ( Hz -- )
- to sample-rate
- dup low-rate? if
+ dup to sample-rate ( Hz )
+ dup low-rate? if ( Hz )
48kHz d# 48.000 swap / to scale-factor
- else
+ else ( Hz )
1 to scale-factor
d# 48.000 / case \ find nearest supported rate
0 of 44.1kHz endof
@@ -413,10 +413,6 @@
/sound-buffer ( actual )
;
-: write ( adr len -- actual )
- open-out audio-out
-;
-
: release-sound-buffer ( -- )
sound-buffer sound-buffer-phys /sound-buffer dma-map-out
upsampling? if sound-buffer /sound-buffer dma-free then
@@ -429,6 +425,14 @@
release-sound-buffer
;
+: write ( adr len -- actual )
+ open-out audio-out
+;
+
+\ XXX remove when write is fixed to set up a completion handler
+: wait-sound ( -- ) write-done ;
+
+
: set-volume ( dB -- ) dac to node step# output-gain ;
\ \\ Recording
Modified: dev/via/unichrome/unichrome.fth
===================================================================
--- dev/via/unichrome/unichrome.fth 2009-07-17 21:47:18 UTC (rev 1244)
+++ dev/via/unichrome/unichrome.fth 2009-07-20 21:30:47 UTC (rev 1245)
@@ -602,6 +602,8 @@
defer init-display ' init-primary-display is init-display
+0 instance value graphmem
+
: init-frame-buffer ( -- ) \ Initializes the controller
\ smb-init
\ set-dac-colors \ Set up initial color map
@@ -616,6 +618,8 @@
( default ) nip nip
endcase
h# f to background-color
+
+ frame-buffer-adr /fb + to graphmem
;
: set-fb ( -- )
Modified: ofw/core/banner.fth
===================================================================
--- ofw/core/banner.fth 2009-07-17 21:47:18 UTC (rev 1244)
+++ ofw/core/banner.fth 2009-07-20 21:30:47 UTC (rev 1245)
@@ -69,12 +69,12 @@
" size" memory-node @ $call-method 1meg um/mod nip
;
: .memory ( -- )
- memory-size dup d# 1024 / ?dup if ( mb gb )
- nip " GiB" rot ( gb$ gb )
- else ( mb )
- " MiB " rot ( mb$ mb )
- then ( m$ m )
- .d type ." memory installed" ( )
+ memory-size dup d# 1024 / ?dup if ( mb gb )
+ nip " GiB" rot ( gb$ gb )
+ else ( mb )
+ " MiB" rot ( mb$ mb )
+ then ( m$ m )
+ .d type ." memory installed" ( )
;
: .serial ( -- )
push-decimal ." Serial #" serial# (.) type