Author: wmb
Date: Wed Oct 12 23:49:29 2011
New Revision: 2598
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2598
Log:
OLPC XO-1.75 - trac # 11329 - Eliminated, or at least greatly reduced, pops at the beginning and end of the startup sound. The beginning pop was fixed by reordering the CODEC power-up sequence so the DAC is turned on before the output amp. The ending pop was fixed by appending zeros to the upsampling buffer so the filter does not pick up unrelated garbage after the end.
Modified:
cpu/arm/firfilter.fth
cpu/arm/olpc/1.75/alc5631.fth
cpu/arm/olpc/1.75/sound.fth
Modified: cpu/arm/firfilter.fth
==============================================================================
--- cpu/arm/firfilter.fth Wed Oct 12 23:27:50 2011 (r2597)
+++ cpu/arm/firfilter.fth Wed Oct 12 23:49:29 2011 (r2598)
@@ -21,7 +21,9 @@
\ Taps/phase=16
\ Stride=2 (mono)
-code 16tap-upsample ( 'out 'in /in 'weights #phases -- )
+d# 16 constant taps/phase
+
+code 16tap-upsample ( 'out 'in /in 'weights #phases -- 'out' )
ldmia sp!,{r0,r1,r2,r3} \ r0:'weights r1:/in r2:'in r3:'out tos:#phases
mov r4,#15 \ Multiplier scale factor
@@ -88,7 +90,7 @@
decs r1,#2 \ Decrement input length by the sample size
0<= until
- pop tos,sp
+ mov tos,r3
c;
\ Filter coefficients for 6x upsampling. The following filter was
@@ -152,9 +154,19 @@
end
[then]
+taps/phase 2+ 2* /w* constant /end-buf
+/end-buf buffer: end-buf
+
: upsample6 ( src-adr /src dst-adr -- )
- enable-iwmmx ( src-adr #src-samples dst-adr )
- -rot weights-6phase #phases 16tap-upsample ( )
+ enable-iwmmx ( src-adr /src dst-adr )
+ >r taps/phase /w* - ( src-adr /src' r: dst-adr )
+ r> third third ( src-adr /src dst-adr src-adr /src )
+ weights-6phase #phases 16tap-upsample ( src-adr /src dst-adr' )
+ -rot + ( dst-adr src-adr' )
+ end-buf /end-buf erase ( dst-adr src-adr' )
+ end-buf taps/phase /w* move ( dst-adr )
+ end-buf taps/phase /w* weights-6phase #phases 16tap-upsample ( dst-adr' )
+ drop
;
\ LICENSE_BEGIN
Modified: cpu/arm/olpc/1.75/alc5631.fth
==============================================================================
--- cpu/arm/olpc/1.75/alc5631.fth Wed Oct 12 23:27:50 2011 (r2597)
+++ cpu/arm/olpc/1.75/alc5631.fth Wed Oct 12 23:49:29 2011 (r2598)
@@ -1,12 +1,6 @@
\ See license at end of file
purpose: Driver for Realtek ALC5631Q audio CODEC chip
-: adc-on ( -- ) h# 0c00 h# 3a codec-set ;
-: adc-off ( -- ) h# 0c00 h# 3a codec-clr ;
-: dac-on ( -- ) h# 0300 h# 3a codec-set ;
-: dac-off ( -- ) h# 0300 h# 3a codec-clr ;
-: adc+dac-on ( -- ) h# 0f00 h# 3a codec-set ;
-
: set-routing ( -- )
h# c0c0 h# 02 codec-set \ SPKMIXLR -> SPKVOLLR, muted
h# c0c0 h# 04 codec-set \ OUTMIXLR -> HPOVOLLR, muted
@@ -45,14 +39,6 @@
h# 1010 h# 38 codec! \ Divisors; the values in this register don't seem to make much
\ difference unless you set the divisors to very high values.
;
-: elided ( -- )
- \ The ADC and DAC will be turned on as needed by adc-on and dac-on, after
- \ the BCLK clock from the SoC is on. If you turn on the ADC when BCLK is
- \ not clocking, the ADC often doesn't output any data.
- b# 1001.0000.1110.0000 h# 3a codec! \ All on except ADC and DAC
- b# 1111.1100.0011.1100 h# 3b codec! \ All on except PLL
- b# 1111.1100.0000.0000 h# 3e codec! \ AXI and MONO IN off
-;
: mic-bias-off ( -- ) h# 000c h# 3b codec-clr ;
: mic-bias-on ( -- ) h# 000c h# 3b codec-set ;
@@ -176,11 +162,13 @@
\ h# 0000 pwr3b! \ Power off PLL
;
: open-out-specific ( -- )
+ \ Turning on the DAC here at the beginning seems to prevent pops better than doing
+ \ it a few steps later at the point that Realtek suggested.
+ h# 0300 h# 3a codec-set \ Power on DACs
h# 0060 h# 3a codec-set \ Power on DAC to mixer
speakers-on? if h# 1000 h# 3a codec-set then \ Power on ClassD amp
speakers-on? if h# c000 h# 3e codec-set then \ Power on SPKL/RVOL
headphones-on? if h# 0c00 h# 3e codec-set then \ Power on HPOVOLL/R
-\ h# 0300 h# 3a codec-set \ Power on DACL/R - defer until dac-on is called by start-audio-out or out-in
h# c000 pwr3b! \ Power on OUTMIXL/R
speakers-on? if h# 3000 h# 3b codec-set then \ Power on SPKMIXL/R
@@ -192,7 +180,7 @@
open-common
open-out-specific
;
-
+
: close-out-specific ( -- )
speakers-on? if mute-speakers then
headphones-on? if hp-powerdown-depop then
@@ -218,7 +206,7 @@
adc-stereo
h# 0c00 h# 3b codec-set \ Power on RECMIXLR
h# 0030 h# 3b codec-set \ Power on MIC1/2 boost gain
-\ h# 0c00 h# 3a codec-set \ Power on ADCL/R - defer until adc-on is called by audio-in or out-in
+ h# 0c00 h# 3a codec-set \ Power on ADCL/R
;
: open-in ( -- )
\ h# 46f0 h# 44 codec! \ pll: 256000 -> 2048000 ??? why is this different from playback? - 8khz record?
Modified: cpu/arm/olpc/1.75/sound.fth
==============================================================================
--- cpu/arm/olpc/1.75/sound.fth Wed Oct 12 23:27:50 2011 (r2597)
+++ cpu/arm/olpc/1.75/sound.fth Wed Oct 12 23:49:29 2011 (r2598)
@@ -345,7 +345,6 @@
out-len if copy-out then \ Prefill the second buffer
start-out-ring
master-tx
- dac-on
install-playback-alarm
true to playing?
;
@@ -390,7 +389,6 @@
make-in-ring ( actual )
start-in-ring ( actual )
master-rx ( actual )
- adc-on ( actual )
begin in-len while ( actual )
wait-in ( actual )
copy-in ( actual )
@@ -436,8 +434,6 @@
master-rx ( ) \ Now the clock is on
slave-tx ( )
- adc+dac-on ( )
-
true to playing?
begin in-len playing? or while ( )
@@ -453,11 +449,8 @@
reset-rx
reset-tx
- dac-off adc-off ( )
-
- mono? if collapse-in then ( )
-
close-out-in
+ mono? if collapse-in then ( )
;
0 [if] \ Interactive test words for out-in
Author: quozl
Date: Wed Oct 12 23:27:50 2011
New Revision: 2597
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2597
Log:
Q3B20
(note that this version was not svn head at this point, but rather svn
2318 with 2589)
Modified:
cpu/x86/pc/olpc/via/ec-version.fth
cpu/x86/pc/olpc/via/fw-version.fth
Modified: cpu/x86/pc/olpc/via/ec-version.fth
==============================================================================
--- cpu/x86/pc/olpc/via/ec-version.fth Wed Oct 12 20:49:37 2011 (r2596)
+++ cpu/x86/pc/olpc/via/ec-version.fth Wed Oct 12 23:27:50 2011 (r2597)
@@ -1,5 +1,5 @@
\ The EC microcode
-macro: EC_VERSION 2_2_8
+macro: EC_VERSION 2_2_9
\ Alternate command for getting EC microcode, for testing new versions.
\ Temporarily uncomment the line and modify the path as necessary
Modified: cpu/x86/pc/olpc/via/fw-version.fth
==============================================================================
--- cpu/x86/pc/olpc/via/fw-version.fth Wed Oct 12 20:49:37 2011 (r2596)
+++ cpu/x86/pc/olpc/via/fw-version.fth Wed Oct 12 23:27:50 2011 (r2597)
@@ -1,3 +1,3 @@
\ The overall firmware revision
macro: FW_MAJOR B
-macro: FW_MINOR 19
+macro: FW_MINOR 20
Author: quozl
Date: Wed Oct 12 02:48:03 2011
New Revision: 2594
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2594
Log:
Q2E47
(note that this version was not svn head at this point, but rather svn
2393 with svn 2585 and 2589)
Modified:
cpu/x86/pc/olpc/versions.fth
Modified: cpu/x86/pc/olpc/versions.fth
==============================================================================
--- cpu/x86/pc/olpc/versions.fth Wed Oct 12 02:30:09 2011 (r2593)
+++ cpu/x86/pc/olpc/versions.fth Wed Oct 12 02:48:03 2011 (r2594)
@@ -2,7 +2,7 @@
\ The overall firmware revision
macro: FW_MAJOR E
-macro: FW_MINOR 46
+macro: FW_MINOR 47
\ The EC microcode
macro: EC_VERSION e35
Author: wmb
Date: Tue Oct 11 23:59:39 2011
New Revision: 2590
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2590
Log:
USB keyboard driver - flash the keyboard LEDs on open as a clue that the keyboard has been attached.
Modified:
dev/usb2/device/keyboard/kbd.fth
Modified: dev/usb2/device/keyboard/kbd.fth
==============================================================================
--- dev/usb2/device/keyboard/kbd.fth Tue Oct 11 22:19:10 2011 (r2589)
+++ dev/usb2/device/keyboard/kbd.fth Tue Oct 11 23:59:39 2011 (r2590)
@@ -339,6 +339,8 @@
\ Some USB keyboards don't implement set-idle properly, and it's not critical,
\ so we suppress the message to avoid confusing the user
idle-rate set-idle drop \ if ." Failed to set USB keyboard idle" cr then
+ 7 set-leds \ Flash the LEDs to indicate that OFW has attached the keyboard
+ d# 200 ms
0 set-leds
false
;