Author: wmb
Date: Tue Jun 21 07:23:51 2011
New Revision: 2302
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2302
Log:
XO-1.75 - reorder fload of spcmd.fth vs spicmd.fth so the EC-mediated keyboard will match "/keyboard", thus fixing "test /keyboard" on unmodified XOs
Modified:
cpu/arm/olpc/1.75/devices.fth
Modified: cpu/arm/olpc/1.75/devices.fth
==============================================================================
--- cpu/arm/olpc/1.75/devices.fth Tue Jun 21 05:24:00 2011 (r2301)
+++ cpu/arm/olpc/1.75/devices.fth Tue Jun 21 07:23:51 2011 (r2302)
@@ -270,12 +270,12 @@
devalias ext /sd/disk@1
devalias net /wlan \ XXX should report-net in case of USB Ethernet
+fload ${BP}/cpu/arm/olpc/spcmd.fth
+
fload ${BP}/dev/olpc/kb3700/spicmd.fth
devalias keyboard /ec-spi/keyboard
-fload ${BP}/cpu/arm/olpc/spcmd.fth
-
: wlan-reset ( -- ) d# 58 gpio-clr d# 20 ms d# 58 gpio-set ;
\ Create the alias unless it already exists
Author: wmb
Date: Mon Jun 20 22:33:27 2011
New Revision: 2298
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2298
Log:
OLPC - fixed XO-1.5 build problem introduced by XO-1.75 audio test.
Modified:
cpu/arm/olpc/1.75/sound.fth
dev/hdaudio/conexant.fth
dev/hdaudio/core.fth
dev/hdaudio/olpc-ports.fth
dev/hdaudio/test.fth
Modified: cpu/arm/olpc/1.75/sound.fth
==============================================================================
--- cpu/arm/olpc/1.75/sound.fth Mon Jun 20 19:13:54 2011 (r2297)
+++ cpu/arm/olpc/1.75/sound.fth Mon Jun 20 22:33:27 2011 (r2298)
@@ -522,13 +522,19 @@
false value force-internal-mic? \ Can't be implemented on XO-1.75
2 value #channels
-fload ${BP}/dev/hdaudio/test.fth
-: input-settings ( -- )
- audio-clock-on ( ) \ If you don't do this, the L/R phase is often wrong
+
+\ Unless you do the audio-clock-on, the L/R phase is often wrong
+: input-test-settings ( -- ) audio-clock-on ;
+: output-test-settings ( -- ) ;
+
+d# -1 constant case-test-volume
+d# -13 constant fixture-test-volume
+d# -22 constant loopback-test-volume
+: configure-platform ( -- )
+ board-revision h# 1a28 >= if " configure-xo1.75" $call-analyzer exit then
;
-: output-settings ( -- ) ;
-' input-settings to input-common-settings
-' output-settings to output-common-settings
+
+fload ${BP}/dev/hdaudio/test.fth
end-package
Modified: dev/hdaudio/conexant.fth
==============================================================================
--- dev/hdaudio/conexant.fth Mon Jun 20 19:13:54 2011 (r2297)
+++ dev/hdaudio/conexant.fth Mon Jun 20 22:33:27 2011 (r2298)
@@ -136,6 +136,25 @@
\ setup-config-default
;
+\ As far as I can tell, the CX2058 does not have a way to turn off the
+\ bias for the external mic port (port b). To eliminate the bias, we
+\ would have to use port f instead, but that doesn't work with loopback
+\ because port f is DC coupled, so the DC offset on the headphone output
+\ would overwhelm the input.
+: mic-bias-off ( -- ) true to mic-bias-off? ;
+: mic-bias-on ( -- ) false to mic-bias-off? ;
+
+: input-test-settings ( -- )
+ open-in 48kHz 16bit with-adc d# 73 input-gain
+;
+: output-test-settings ( -- )
+ open-out 48kHz 16bit stereo
+;
+d# -9 constant case-test-volume
+d# -23 constant fixture-test-volume
+d# -33 constant loopback-test-volume
+: configure-platform ( -- ) ;
+
\ LICENSE_BEGIN
\ Copyright (c) 2009 Luke Gorrie <luke(a)bup.co.nz>
\
Modified: dev/hdaudio/core.fth
==============================================================================
--- dev/hdaudio/core.fth Mon Jun 20 19:13:54 2011 (r2297)
+++ dev/hdaudio/core.fth Mon Jun 20 22:33:27 2011 (r2298)
@@ -697,7 +697,6 @@
: mic+20db ( -- ) d# 20 to boost-db ;
: mic+0db ( -- ) 0 to boost-db ;
-: set-record-gain ( dB -- ) ; \ with-adc step# input-gain ;
: in-amp-caps ( -- u ) h# f000d cmd? ;
: in-gain-steps ( -- n ) in-amp-caps 8 rshift h# 7f and 1+ ;
: set-record-gain ( dB -- ) drop ( hardcoded for now ) with-adc h# 40 input-gain ;
Modified: dev/hdaudio/olpc-ports.fth
==============================================================================
--- dev/hdaudio/olpc-ports.fth Mon Jun 20 19:13:54 2011 (r2297)
+++ dev/hdaudio/olpc-ports.fth Mon Jun 20 22:33:27 2011 (r2298)
@@ -18,6 +18,10 @@
speakers-on
then
;
+\ Connection #2 is for port e which is unused on OLPC
+: select-dc-input ( -- )
+ mux 3 set-connection dc-input enable-hp-input
+;
: select-internal-mic ( -- )
mux 1 set-connection internal-mic enable-hp-input
;
@@ -26,8 +30,13 @@
;
\ Set this to use the internal mic even if an external mic is plugged in
false value force-internal-mic?
+false value mic-bias-off?
: set-recording-port ( -- )
external-mic pin-sense? force-internal-mic? 0= and if
+\ select-dc-input does not work for some reason I haven't yet discovered
+\ When you try to do a loopback test through the dc input, the received
+\ sample values are all 0
+\ mic-bias-off? if select-dc-input else select-external-mic then
select-external-mic
else
select-internal-mic
Modified: dev/hdaudio/test.fth
==============================================================================
--- dev/hdaudio/test.fth Mon Jun 20 19:13:54 2011 (r2297)
+++ dev/hdaudio/test.fth Mon Jun 20 22:33:27 2011 (r2298)
@@ -105,27 +105,14 @@
" 0 set-fg h# ffff set-bg single-drawing clear-drawing wave" evaluate
key ascii d = if debug-me then
;
-defer input-common-settings
-defer output-common-settings
-[ifdef] with-adc
-\ XXX this is hd-audio specific. Factor it out
-: (input-common-settings) ( -- )
- open-in 48kHz 16bit with-adc d# 73 input-gain
-;
-' (input-common-settings) to input-common-settings
-: (output-common-settings) ( -- )
- open-out 48kHz 16bit stereo
-;
-' (output-common-settings) to output-common-settings
-[then]
: test-with-case ( -- )
\ " setup-case" $call-analyzer
\ xxx - this needs to use the internal speakers and mic even though the loopback cable is attached
true to force-speakers? true to force-internal-mic?
mic-bias-on
- input-common-settings mono
- output-common-settings d# -1 set-volume
+ input-test-settings mono
+ output-test-settings case-test-volume set-volume
." Testing internal speakers and microphone" cr
" setup-case" test-common
false to force-speakers? false to force-internal-mic?
@@ -137,8 +124,8 @@
: test-with-fixture ( -- error? )
true to force-speakers? true to force-internal-mic?
mic-bias-on
- input-common-settings mono
- output-common-settings d# -13 set-volume \ -23 prevents obvious visible clipping
+ input-test-settings mono
+ output-test-settings fixture-test-volume set-volume \ -23 prevents obvious visible clipping
." Testing internal speakers and microphone with fixture" cr
" setup-fixture" test-common
false to force-speakers? false to force-internal-mic?
@@ -149,8 +136,8 @@
;
: test-with-loopback ( -- error? )
mic-bias-off
- input-common-settings stereo
- output-common-settings d# -22 set-volume
+ input-test-settings stereo
+ output-test-settings loopback-test-volume set-volume
." Testing headphone and microphone jacks with loopback cable" cr
" setup-loopback" test-common
plot? if
@@ -196,9 +183,6 @@
instructions-done
then
;
-: configure-platform ( -- )
- board-revision h# 1a28 >= if " configure-xo1.75" $call-analyzer exit then
-;
\ Returns failure by throwing
: automatic-test ( -- )
configure-platform
Author: wmb
Date: Sun Jun 19 03:18:02 2011
New Revision: 2296
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2296
Log:
PC keyboard driver - Explicitly choose scan set 1.
Modified:
dev/pckbd.fth
Modified: dev/pckbd.fth
==============================================================================
--- dev/pckbd.fth Sat Jun 18 02:36:44 2011 (r2295)
+++ dev/pckbd.fth Sun Jun 19 03:18:02 2011 (r2296)
@@ -270,7 +270,7 @@
d# 50 timed-read if exit then ( id1 )
h# ab <> if exit then
- \ The ENE keyboard controller return ab 41
+ \ The ENE keyboard controller returns ab 41
d# 50 timed-read if exit then ( id2 )
h# 41 <> if exit then
@@ -530,6 +530,7 @@
unlock
keyboard-present? if clear-out-buf else reset then
keyboard-present? 0= if false exit then
+ 1 set-scan-set
choose-type
['] get-scan d# 10 alarm
1 +refcnt
Author: wmb
Date: Sat Jun 18 02:22:38 2011
New Revision: 2294
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2294
Log:
OLPC trac #10895 - OFW end of SP-PS2 communications protocol - add the driver to the build, and don't turn off the SP IRQs.
Modified:
cpu/arm/mmp2/irq.fth
cpu/arm/olpc/1.75/devices.fth
Modified: cpu/arm/mmp2/irq.fth
==============================================================================
--- cpu/arm/mmp2/irq.fth Sat Jun 18 00:42:53 2011 (r2293)
+++ cpu/arm/mmp2/irq.fth Sat Jun 18 02:22:38 2011 (r2294)
@@ -33,8 +33,9 @@
: open ( -- flag )
my-space to base-adr
- block-irqs
- d# 64 0 do i disable-irq loop
+\ Leave the IRQ table alone so as not to steal interrupts from the SP
+\ block-irqs
+\ d# 64 0 do i disable-irq loop
unblock-irqs
true
;
Modified: cpu/arm/olpc/1.75/devices.fth
==============================================================================
--- cpu/arm/olpc/1.75/devices.fth Sat Jun 18 00:42:53 2011 (r2293)
+++ cpu/arm/olpc/1.75/devices.fth Sat Jun 18 02:22:38 2011 (r2294)
@@ -274,6 +274,8 @@
devalias keyboard /ec-spi/keyboard
+fload ${BP}/cpu/arm/olpc/spcmd.fth
+
: wlan-reset ( -- ) d# 58 gpio-clr d# 20 ms d# 58 gpio-set ;
\ Create the alias unless it already exists