mail.coreboot.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
List overview
Download
openfirmware
September 2011
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
openfirmware@openfirmware.info
1 participants
60 discussions
Start a n
N
ew thread
[commit] r2515 - cpu/arm/olpc/1.75
by repository service
16 Sep '11
16 Sep '11
Author: wmb Date: Fri Sep 16 02:43:49 2011 New Revision: 2515 URL:
http://tracker.coreboot.org/trac/openfirmware/changeset/2515
Log: OLPC XO-1.75 - Cleaned up some old cruft in the build script for nandblaster. Modified: cpu/arm/olpc/1.75/mcastnand.bth Modified: cpu/arm/olpc/1.75/mcastnand.bth ============================================================================== --- cpu/arm/olpc/1.75/mcastnand.bth Fri Sep 16 02:43:04 2011 (r2514) +++ cpu/arm/olpc/1.75/mcastnand.bth Fri Sep 16 02:43:49 2011 (r2515) @@ -5,25 +5,18 @@ fload ${BP}/cpu/arm/olpc/1.75/mcnand-version.fth -1 [if] - " ${MCNAND_VERSION}" expand$ " test" $= [if] - " multicast-nand/Makefile" $file-exists? 0= [if] - " git clone -q
git+ssh://dev.laptop.org/git/users/wmb/multicast-nand
" expand$ $sh - [then] - [else] - " rm -rf multicast-nand" $sh - " wget -q -O multicast-nand.tar.gz
http://dev.laptop.org/git/users/wmb/multicast-nand/snapshot/multicast-nand-…
" expand$ $sh - " tar xfz multicast-nand.tar.gz" $sh - " mv multicast-nand-${MCNAND_VERSION} multicast-nand" expand$ $sh - " rm multicast-nand.tar.gz" $sh +" ${MCNAND_VERSION}" expand$ " test" $= [if] + " multicast-nand/Makefile" $file-exists? 0= [if] + " git clone -q
git+ssh://dev.laptop.org/git/users/wmb/multicast-nand
" expand$ $sh [then] - - " (cd multicast-nand; make BPDIR=../../../../../.. OFW_CPU=arm nandblaster15_rx.bin nandblaster_tx.bin; cp nandblaster15_rx.bin nandblaster_tx.bin ..)" expand$ $sh -[else] - " (cd /home/wmb/Git/multicast-nand; make BPDIR=/home/wmb/ofw.test OFW_CPU=x86 nandblaster15_rx.bin nandblaster_tx.bin;)" $sh - " cp /home/wmb/Git/multicast-nand/*blaster*.bin ." expand$ $sh +[else] + " rm -rf multicast-nand" $sh + " wget -q -O -
http://dev.laptop.org/git/users/wmb/multicast-nand/snapshot/multicast-nand-…
| tar xfz -" expand$ $sh + " mv multicast-nand-${MCNAND_VERSION} multicast-nand" expand$ $sh [then] +" (cd multicast-nand; make BPDIR=../../../../../.. OFW_CPU=arm nandblaster15_rx.bin nandblaster_tx.bin; cp nandblaster15_rx.bin nandblaster_tx.bin ..)" expand$ $sh + \ This forces the creation of a .log file, so we don't re-fetch writing mcastnand.version " ${MCNAND_VERSION}"n" expand$ ofd @ fputs
1
0
0
0
[commit] r2514 - dev/olpc/kb3700
by repository service
16 Sep '11
16 Sep '11
Author: wmb Date: Fri Sep 16 02:43:04 2011 New Revision: 2514 URL:
http://tracker.coreboot.org/trac/openfirmware/changeset/2514
Log: OLPC XO-1.75 - Better management of ACK line to EC when not ready to receive events. Modified: dev/olpc/kb3700/eccmds.fth dev/olpc/kb3700/spicmd.fth Modified: dev/olpc/kb3700/eccmds.fth ============================================================================== --- dev/olpc/kb3700/eccmds.fth Fri Sep 16 02:41:48 2011 (r2513) +++ dev/olpc/kb3700/eccmds.fth Fri Sep 16 02:43:04 2011 (r2514) @@ -9,8 +9,14 @@ : do-ec-cmd-buf ( [ args ] #args #results cmd-code -- buf-adr ) " ec-command-buf" $call-ec ; +: open-ec ( -- ) + ec-ih 0= if " /ec-spi" open-dev to ec-ih then +; +: close-ec ( -- ) + ec-ih if ec-ih close-dev 0 to ec-ih then +; stand-init: EC - " /ec-spi" open-dev to ec-ih + open-ec ; : too-many-retries ( -- ) true abort" Too many EC command retries" ; Modified: dev/olpc/kb3700/spicmd.fth ============================================================================== --- dev/olpc/kb3700/spicmd.fth Fri Sep 16 02:41:48 2011 (r2513) +++ dev/olpc/kb3700/spicmd.fth Fri Sep 16 02:43:04 2011 (r2514) @@ -331,6 +331,7 @@ true ; : close ( -- ) + set-ack open-count 1 = if ssp-base h# 1000 " map-out" $call-parent 0 is ssp-base then @@ -388,9 +389,10 @@ dup get-msecs - 0< ( limit ) until ( limit ) drop + clr-cmd true abort" EC command result timeout" ; - + : ec-command-buf ( [ args ] #args #results cmd-code -- result-buf-adr ) 0 set-cmdbuf ( )
1
0
0
0
[commit] r2513 - dev/video/common
by repository service
16 Sep '11
16 Sep '11
Author: wmb Date: Fri Sep 16 02:41:48 2011 New Revision: 2513 URL:
http://tracker.coreboot.org/trac/openfirmware/changeset/2513
Log: ARM - ARM version of argb>565-pixel was badly broken. Modified: dev/video/common/rectangle16.fth Modified: dev/video/common/rectangle16.fth ============================================================================== --- dev/video/common/rectangle16.fth Fri Sep 16 02:40:48 2011 (r2512) +++ dev/video/common/rectangle16.fth Fri Sep 16 02:41:48 2011 (r2513) @@ -52,14 +52,14 @@ 0= until c; code argb>565-pixel ( argb -- 565 ) - mov r0,tos,lsr #3 \ Blue - and r0,tos,#0x1f + and r0,tos,#0xf8 \ Blue + mov r0,r0,lsr #3 and r1,tos,#0xfc00 \ Green - orr r0,r1,r1,lsr #5 + orr r0,r0,r1,lsr #5 and r1,tos,#0xf80000 \ Red - orr r0,r1,r1,lsr #8 + orr r0,r0,r1,lsr #8 mov tos,r0 c;
1
0
0
0
[commit] r2512 - cpu/arm/olpc/1.75 dev/hdaudio
by repository service
16 Sep '11
16 Sep '11
Author: wmb Date: Fri Sep 16 02:40:48 2011 New Revision: 2512 URL:
http://tracker.coreboot.org/trac/openfirmware/changeset/2512
Log: OLPC XO-1.75 - checkpoint of revised audio code. May still have rough edges. Modified: cpu/arm/olpc/1.75/alc5631.fth cpu/arm/olpc/1.75/sound.fth dev/hdaudio/noiseburst.fth dev/hdaudio/test.fth Modified: cpu/arm/olpc/1.75/alc5631.fth ============================================================================== --- cpu/arm/olpc/1.75/alc5631.fth Fri Sep 16 01:34:00 2011 (r2511) +++ cpu/arm/olpc/1.75/alc5631.fth Fri Sep 16 02:40:48 2011 (r2512) @@ -5,38 +5,53 @@ : 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 +\ h# a080 h# 06 codec! \ AXO1/AXO2 channel volume select OUTMIXER,0DB by default + h# b0b0 h# 14 codec! \ Record Mixer source from Mic1/Mic2 by default +\ h# 5500 h# 22 codec! \ Mic1/Mic2 boost 20DB by default (done in set-default-gains) + h# dfc0 h# 1a codec! \ DACL -> OUTMIXL - c0 is "don't change it" per datasheet 0.91 + h# dfc0 h# 1c codec! \ DACR -> OUTMIXR - c0 is "don't change it" per datasheet 0.91 + h# d8d8 h# 28 codec! \ DACLR -> SPKMIXLR - 808 is "don't change it" per datasheet 0.91 + h# 6c00 h# 2a codec! \ unmute SPKVOLL -> SPOLMIX, SPKVOLR -> SPORMIX, mute L>R, R>L, and L/R>MONO + h# 0f18 h# 4a codec! \ (undocumented bit 11) enables HP zero-cross detection + + h# 0000 h# 2c codec! \ SPOxMIX -> SPKRMUX, HPOVOL -> HPMUX +; : codec-on ( -- ) 0 0 codec! \ Reset - b# 1010.0000.0001.1101 h# 3c codec! \ All on except AX and MONO - d# 110 ms - b# 1110.0000.0001.1101 h# 3c codec! \ Fast VREF control - d# 100 ms + b# 1010.0000.0000.0000 h# 3c codec! \ All on except AX and MONO + d# 80 ms + b# 1110.0000.0000.0000 h# 3c codec! \ Fast VREF control + + set-routing + + h# 8001 h# 34 codec! \ Slave mode, 16 bits, left justified, exchange L and R on playback + + \ The speaker gain ratio must be <= the ratio of SPKVDD to AVDD. + \ In our system, SPKVDD is 5V and AVDD is 3.3V, so we need a gain ratio <= 1.51 . + \ The value 3 gives a ratio of 1.44, and value 4 gives a ratio of 1.56 . We use 3. + h# 3e00 h# 40 codec! \ Speaker Amp Ratio GAIN is 1.44x, no HPFs - h# 8001 h# 34 codec! \ Slave mode, 16 bits, left justified + h# 0000 h# 42 codec! \ Use MCLK, not PLL +\ b# 1110.1100.1001.0000 h# 52 codec! \ Protection on +\ h# 4000 h# 56 codec! \ HP depop by register control 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 - -\ h# 8c00 h# 40 codec! \ Speaker Amp Auto Ratio GAIN, use HPFs - h# 4e00 h# 40 codec! \ Speaker Amp Ratio GAIN is 1.44x, no HPFs - h# 0000 h# 42 codec! \ Use MCLK, not PLL -\ b# 1110.1100.1001.0000 h# 52 codec! \ Protection on - h# 8000 h# 56 codec! \ HP depop by register control -; -: codec-off ( -- ) - 0 h# 3a codec! \ All off - 0 h# 3b codec! \ All off - 0 h# 3c codec! \ All off - 0 h# 3e codec! \ All off ; : mic-bias-off ( -- ) h# 000c h# 3b codec-clr ; : mic-bias-on ( -- ) h# 000c h# 3b codec-set ; @@ -46,60 +61,204 @@ : mic2-high-bias ( -- ) h# 08 h# 22 codec-clr mic-bias-on ; \ 0.90*AVDD, e.g. 3V with AVDD=3.3V : mic2-low-bias ( -- ) h# 08 h# 22 codec-set mic-bias-on ; \ 0.75*AVDD, e.g. 2.5V with AVDD=3.3V +: depop! ( value -- ) h# 54 codec! ; +: pwr3a! ( value -- ) h# 3a codec! ; +: pwr3b! ( value -- ) h# 3b codec! ; +: pwr3c! ( value -- ) h# 3c codec! ; +: pwr3e! ( value -- ) h# 3e codec! ; +: depop( ( current -- ) + h# 0000 h# 5c codec! \ Disable ZCD + h# 0710 h# 4a codec! \ Bit 11=0 disables HP zero-cross detection. 71 is reserved bits. + d# 10 ms + ( current ) h# 56 codec-i! \ Index 56 - depop current control +; +: )depop ( -- ) + h# 04c0 h# 5c codec! \ Power on ZCD, enable ZCD for SPOL/R + h# 0f10 h# 4a codec! \ Bit 11 enables HP zero-cross detection. 71 is reserved bits +; + +0 value headphones-on? +0 value speakers-on? + +: mute-speakers ( -- ) h# 8080 2 codec-set ; +: unmute-speakers ( -- ) h# 8080 2 codec-clr ; + \ The range is from -46.5 db to +12 dB -: gain>lr-12 ( db -- true | regval false ) +: gain>lr-12 ( db -- regval on? ) d# 12 min ( db' ) 2* 3 / ( steps ) \ Converts -46.5 .. 12 db to -31 .. 8 steps dup d# -31 < if ( steps ) - drop true + drop h# 2727 ( regval ) + false ( regval on? ) else ( steps ) 8 swap - ( -steps ) 0 max ( clipped-steps ) dup 8 lshift or ( regval ) - false + true ( regval on? ) then ; +: set-speaker-volume ( n -- ) + gain>lr-12 to speakers-on? h# bfbf 2 codec-field +; + +: mute-headphones ( -- ) h# 8080 4 codec-set ; +: unmute-headphones ( -- ) h# 8080 4 codec-clr ; + \ The range is from -46.5 db to 0 dB -: gain>lr ( db -- true | regval false ) +: gain>lr ( db -- regval on? ) 0 min ( db' ) 2* 3 / ( steps ) \ Converts -46.5 .. 12 db to -31 .. 8 steps dup d# -31 < if ( steps ) - drop true + drop h# 1f1f ( regval ) + false ( regval on? ) else ( steps ) 0 swap - ( -steps ) 0 max ( clipped-steps ) dup 8 lshift or ( regval ) - false + true ( regval on? ) then ; - -\ This sets up a simple routing from the DAC to the headphone and speaker outputs -: output-config ( -- ) - h# df00 h# 1a codec! \ DACL -> OUTMIXL - h# df00 h# 1c codec! \ DACR -> OUTMIXR - h# 4040 h# 04 codec-set \ OUTMIXLR -> HPOVOLLR - h# d0d0 h# 28 codec! \ DACLR -> SPKMIXLR - h# 4040 h# 02 codec-set \ SPKMIXLR -> SPKVOLLR - h# 9000 h# 2a codec! \ SPKVOLL -> SPOLMIX, SPKVOLR -> SPORMIX - h# 0000 h# 2c codec! \ SPOxMIX -> SPKRMUX, HPOVOL -> HPMUX +: set-headphone-volume ( n -- ) + gain>lr to headphones-on? h# 9f9f 4 codec-field ; -: mute-speakers ( -- ) h# 8080 2 codec-set ; -: set-speaker-volume ( n -- ) \ DONE - gain>lr-12 if h# 8080 then h# bfbf 2 codec-field +: codec-off ( -- ) + mute-speakers + mute-headphones + 0 h# 3a codec! \ All off + 0 h# 3b codec! \ All off + 0 h# 3c codec! \ All off + 0 h# 3e codec! \ All off ; -: mute-headphones ( -- ) h# 8080 4 codec-set ; -: set-headphone-volume ( n -- ) \ DONE - gain>lr if h# 8080 then h# 9f9f 4 codec-field + +: hp-powerup-depop ( -- ) + \ powerup depop + h# 303e depop( \ App note says 303f, engineer says to use 303e + h# e01c pwr3c! \ 1c powers on charge pump, HP Amp L/R + h# 8080 depop! \ Power on HP Soft Generator, (datasheet says 80 bit is "reserved-0", engineer says datasheet is wrong) + d# 100 ms + h# e01e pwr3c! \ Now put HP output in normal, not depop, mode + )depop + + \ unmute depop + h# 302f depop( \ This is the only case where 10 ms delay is actually needed + h# c003 depop! \ Power on HP Soft Generator, HP Softgen Trigger, ena HPOL/R depop + unmute-headphones + d# 160 ms + )depop +; +: hp-powerdown-depop ( -- ) + \ mute depop + h# 302f depop( + h# c003 depop! \ Power on HP Soft Generator, HP Softgen Trigger, ena HPOL/R depop + mute-headphones + d# 150 ms + )depop + + \ powerdown depop + h# 303f depop( + h# c030 depop! \ ..30 enables HPOL/R startup, disables HPOL/R depop + d# 75 ms + h# 8030 depop! \ !4000 powers down HP softgen trigger + h# e01c pwr3c! \ !2 puts HP output in depop mode + h# 80b0 depop! + d# 80 ms + h# 8000 depop! \ !30 disables HPOL/R startup + h# e000 pwr3c! \ !1c powers off charge pump, HP Amp L/R + )depop +; + +: open-common ( -- ) + h# 8080 h# 3a codec-set \ Power on I2S, DAC ref (which is also used for ADC according to the engineer) +; +: close-common ( -- ) + h# 8080 h# 3a codec-clr \ Power off I2S, DAC ref +\ h# 0000 pwr3b! \ Power off PLL +; +: open-out-specific ( -- ) + 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 + + speakers-on? if unmute-speakers then + headphones-on? if hp-powerup-depop then +; + +: open-out ( -- ) + open-common + open-out-specific +; + +: close-out-specific ( -- ) + speakers-on? if mute-speakers then + headphones-on? if hp-powerdown-depop then + + h# f000 h# 3b codec-clr \ Power off OUTMIXL/R, SPKMIXL/R + h# 0300 h# 3a codec-clr \ Power off DACs + h# cc00 h# 3e codec-clr \ Power off SPKL/RVOL, HPOVOLL/R + h# 1060 h# 3a codec-clr \ Power off ClassD amp, DAC to mixer +; +: close-out ( -- ) + close-out-specific + close-common +; + +: adc-source ( value -- ) h# c000 h# 4a codec-field ; +: adc-stereo ( -- ) 0 adc-source ; \ L->L, R->R +: adc-mono-left ( -- ) h# 4000 adc-source ; \ L->L+R +: adc-mono-right ( -- ) h# 8000 adc-source ; \ R->L+R +: adc-stereo-reversed ( -- ) h# c000 adc-source ; \ L->R, R->L (channels swapped) + +: open-in-specific ( -- ) + h# 000c h# 3b codec-set \ Power on MIC1/2 bias + 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 +; +: open-in ( -- ) +\ h# 46f0 h# 44 codec! \ pll: 256000 -> 2048000 ??? why is this different from playback? - 8khz record? + open-common + open-in-specific +; + +: close-in-specific ( -- ) + h# 0c00 h# 3a codec-clr \ Power off ADCL/R + h# 0030 h# 3b codec-clr \ Power off MIC1/2 boost gain + h# 0c0c h# 3b codec-clr \ Power off RECMIXLR, MIC1/2 bias +; +: close-in ( -- ) + close-in-specific + close-common +; + +: open-out-in ( -- ) + open-common + open-out-specific + open-in-specific +; + +: close-out-in ( -- ) + close-in-specific + close-out-specific + close-common ; false value force-speakers? : set-volume ( n -- ) + mute-speakers mute-headphones \ Start with both muted, will be unmuted later headphones-inserted? ( force-speakers? 0= and ) if - set-headphone-volume mute-speakers + d# 30 - set-headphone-volume + true false else - set-speaker-volume mute-headphones + set-speaker-volume + false true then + to speakers-on? to headphones-on? ; d# 0 constant default-adc-gain \ 0 dB - range is -96.625 to +28.5 d# 0 constant default-dac-gain \ 0 dB - range is -96.625 to +28.5 @@ -108,9 +267,9 @@ d# -10 constant default-headphone-volume \ -10 dB - range is -46.5 to 0 : speakers-on ( -- ) default-speaker-volume set-speaker-volume ; -: speakers-off ( -- ) d# -100 set-speaker-volume ; +: speakers-off ( -- ) d# -100 set-speaker-volume ; : headphones-on ( -- ) default-headphone-volume set-headphone-volume ; -: headphones-off ( -- ) d# -100 set-headphone-volume ; +: headphones-off ( -- ) d# -100 set-headphone-volume ; : adc-mute-all ( -- ) h# f0f0 h# 14 codec! ; : adc-mute-mic ( -- ) h# 4040 h# 14 codec-set ; @@ -126,28 +285,40 @@ : outmix-mute-recmix ( -- ) h# 8000 dup h# 1a codec-set h# 1c codec-set ; : outmix-unmute-recmix ( -- ) h# 8000 dup h# 1a codec-clr h# 1c codec-clr ; -: gain>lr-3/8 ( -- lrgain boost ) - d# 28 min - dup 0>= if ( n ) +: attenuation-3/8 ( db -- lrgain boost ) + dup d# -96 <= if ( db ) + drop ( ) + h# ffff h# 8080 ( lrgain boost-muted ) + else ( db ) + negate 8 3 */ ( steps ) + dup bwjoin ( lrgain ) + 0 ( lrgain boost ) + then ( lrgain boost ) +; +: gain>lr-3/8 ( db -- lrgain boost ) + d# 28 min ( db ) + dup 0>= if ( db ) 8 3 */ ( boost ) \ Convert to .375 dB increments 0 swap ( lrgain boost ) - else ( n ) - dup d# -96 <= if ( n ) - drop ( ) - h# ffff h# 8080 ( lrgain boost ) - else ( n ) - negate 8 3 */ ( steps ) - dup bwjoin ( lrgain ) - 0 ( lrgain boost ) - then ( lrgain boost ) - then ( lrgain boost ) + else ( db ) + attenuation-3/8 ( lrgain boost ) + then ( lrgain boost ) ; -: set-dac-gain ( n -- ) +: set-dac-gain ( db -- ) dup d# -96 < if outmix-mute-dac else outmix-unmute-dac then gain>lr-3/8 h# 0c codec! h# 10 codec! ; -: set-adc-gain ( n -- ) - gain>lr-3/8 h# 12 codec! h# 16 codec! +: gain>lr-3/2+3/8 ( db -- lrgain boost ) + d# 28 min ( db ) + dup 0>= if ( db ) + 2 3 */ ( boost ) \ Convert to 1.5 dB increments + 0 swap ( lrgain boost ) + else ( db ) + attenuation-3/8 ( lrgain boost ) + then ( lrgain boost ) +; +: set-adc-gain ( db -- ) + gain>lr-3/2+3/8 h# 12 codec! h# 16 codec! ; : mic1-balanced ( -- ) h# 8000 h# 8000 h# 0e codec-field ; : mic1-single-ended ( -- ) 0 h# 8000 h# 0e codec-field ; @@ -178,7 +349,6 @@ : mic+0db ( -- ) 0 set-mic-gain ; : mic+20db ( -- ) d# 20 set-mic-gain ; : set-default-gains ( -- ) - output-config headphones-inserted? ( force-speakers? 0= and ) if headphones-on speakers-off Modified: cpu/arm/olpc/1.75/sound.fth ============================================================================== --- cpu/arm/olpc/1.75/sound.fth Fri Sep 16 01:34:00 2011 (r2511) +++ cpu/arm/olpc/1.75/sound.fth Fri Sep 16 02:40:48 2011 (r2512) @@ -112,8 +112,7 @@ 0 d# 18 lshift or \ External clock - slave configuration (Rx is master) 0 d# 17 lshift or \ Sample on rising edge of clock -\ Empirically, this needs to be backwards from what we think it should be - 0 d# 16 lshift or \ Active high frame sync (should be active low, but that gives backwards results) + 1 d# 16 lshift or \ Active low frame sync (I2S standard) d# 31 d# 4 lshift or \ Frame sync period 1 d# 2 lshift or \ Flush the FIFO @@ -259,11 +258,6 @@ : dma-alloc ( len -- adr ) " dma-alloc" $call-parent ; : dma-free ( adr len -- ) " dma-free" $call-parent ; -: open-in ( -- ) ; -: close-in ( -- ) ; -: open-out ( -- ) ; -: close-out ( -- ) ; - : wait-out ( -- ) buf-timeout 0 do 1 ms h# a0 adma@ 1 and ?leave @@ -292,6 +286,7 @@ stop-out-ring uninstall-playback-alarm false to playing? + close-out ; : out-ready? ( -- flag ) @@ -387,7 +382,7 @@ disable-sspa-rx ( actual ) reset-rx ( actual ) ; -: read ( adr len -- actual ) open-in audio-in ; +: read ( adr len -- actual ) open-in audio-in close-in ; 0 value mono? 0 value in-adr0 @@ -398,13 +393,15 @@ loop ; : out-in ( out-adr out-len in-adr in-len -- ) + open-out-in + to in-len0 to in-adr0 ( out-adr out-len ) to out-len to out-adr ( ) in-adr0 to in-adr ( ) in-len0 mono? if 2* then to in-len - audio-clock-on ( ) \ This will mess up any frequency settings + ( audio-clock-on ) ( ) \ This will mess up any frequency settings setup-sspa-tx ( ) setup-sspa-rx ( ) @@ -421,8 +418,7 @@ master-rx ( ) \ Now the clock is on slave-tx ( ) - adc-on ( ) - dac-on ( ) + adc+dac-on ( ) true to playing? @@ -439,6 +435,8 @@ dac-off adc-off ( ) mono? if collapse-in then ( ) + + close-out-in ; 0 [if] \ Interactive test words for out-in @@ -527,7 +525,7 @@ 2 value #channels \ Unless you do the audio-clock-on, the L/R phase is often wrong -: input-test-settings ( -- ) audio-clock-on ; +: input-test-settings ( -- ) ( audio-clock-on ) ; : output-test-settings ( -- ) ; d# -1 constant case-test-volume Modified: dev/hdaudio/noiseburst.fth ============================================================================== --- dev/hdaudio/noiseburst.fth Fri Sep 16 01:34:00 2011 (r2511) +++ dev/hdaudio/noiseburst.fth Fri Sep 16 02:40:48 2011 (r2512) @@ -562,8 +562,40 @@ defer analyze-right defer fix-dc +[ifdef] notdef +fload ${BP}/forth/lib/isin.fth +fload ${BP}/forth/lib/tones.fth + +\ This version puts the tone first into the left channel for +\ half the time, then into the right channel for the remainder +: make-2tones ( adr len freq sample-rate -- ) + 2dup set-freq ( adr len freq sample-rate ) + + 3 pick make-cycle drop ( adr len freq sample-rate ) + + swap 2* swap set-freq ( adr len ) + over wa1+ make-cycle drop ( adr len ) + + + \ Copy the wave template into the remainder of the buffer + over /cycle + over /cycle - bounds ?do ( adr len ) + over i /cycle move ( adr len ) + /cycle +loop ( adr len ) + 2drop +; +1 value debug-analyzer? +[then] + : prepare-signal ( -- out-adr, len in-adr,len ) +[ifdef] debug-analyzer? + debug-analyzer? if + pb /pb d# 1000 d# 48000 make-2tones + else + pb /pb bounds do random-long i l! /l +loop + then +[else] pb /pb bounds do random-long i l! /l +loop +[then] pb /pb -stereo-wmean pb wa1+ /pb -stereo-wmean pb /pb lose-6db Modified: dev/hdaudio/test.fth ============================================================================== --- dev/hdaudio/test.fth Fri Sep 16 01:34:00 2011 (r2511) +++ dev/hdaudio/test.fth Fri Sep 16 02:40:48 2011 (r2512) @@ -102,7 +102,7 @@ false value plot? \ Set to true to plot the impulse response, for debugging : plot-impulse ( adr -- ) d# 600 ( adr #samples ) - " 0 set-fg h# ffff set-bg single-drawing clear-drawing wave" evaluate + " 0 set-fg h# ffffffff set-bg single-drawing clear-drawing wave" evaluate key ascii d = if debug-me then ;
1
0
0
0
[commit] r2511 - cpu/arm/mmp2
by repository service
16 Sep '11
16 Sep '11
Author: quozl Date: Fri Sep 16 01:34:00 2011 New Revision: 2511 URL:
http://tracker.coreboot.org/trac/openfirmware/changeset/2511
Log: OLPC XO-1.75 - add thermal sensor watch mode Modified: cpu/arm/mmp2/thermal.fth Modified: cpu/arm/mmp2/thermal.fth ============================================================================== --- cpu/arm/mmp2/thermal.fth Thu Sep 15 08:08:18 2011 (r2510) +++ cpu/arm/mmp2/thermal.fth Fri Sep 16 01:34:00 2011 (r2511) @@ -26,10 +26,22 @@ : wd-thresh@ ( -- n ) wd-thresh io@ ; : wd-thresh! ( n -- ) wd-thresh io! ; +: .c ( n -- ) (.) type ." C " ; + : .thermal - ." degrees=" cpu-temperature .d - ." raw=" thermal-base io@ h# 3ff and . - ." threshold=" wd-thresh@ h# 3ff and . + push-decimal + time&date >unix-seconds . + ." limit: " wd-thresh@ h# 3ff and . + ." sensor: " thermal-base io@ h# 3ff and . + ." cpu: " cpu-temperature .c + ." battery: " bat-temp .c + pop-base +; + +: watch-thermal + begin + .thermal cr d# 1000 ms key? + until key drop cr ; : test-thermal
1
0
0
0
[commit] r2510 - cpu/arm/olpc/1.75 dev/olpc/spiflash
by repository service
15 Sep '11
15 Sep '11
Author: quozl Date: Thu Sep 15 08:08:18 2011 New Revision: 2510 URL:
http://tracker.coreboot.org/trac/openfirmware/changeset/2510
Log: OLPC XO-1.75 - enforce SPI FLASH write protect during security startup, #11228 Modified: cpu/arm/olpc/1.75/fw.bth dev/olpc/spiflash/flashif.fth dev/olpc/spiflash/spiflash.fth Modified: cpu/arm/olpc/1.75/fw.bth ============================================================================== --- cpu/arm/olpc/1.75/fw.bth Thu Sep 15 07:39:43 2011 (r2509) +++ cpu/arm/olpc/1.75/fw.bth Thu Sep 15 08:08:18 2011 (r2510) @@ -82,9 +82,16 @@ false to stand-init-debug? \ true to stand-init-debug? +: sec-trg ( -- ) d# 73 gpio-set ; \ rising edge latches SPI_WP# low +: sec-trg? ( -- bit ) d# 73 gpio-pin@ ; + +alias ec-indexed-io-off sec-trg +alias ec-indexed-io-off? sec-trg? +alias ec-ixio-reboot ec-power-cycle \ clears latch, brings SPI_WP# high + false value secure? -: protect-fw ( -- ) ; +: protect-fw ( -- ) secure? if flash-protect sec-trg then ; hex : i-key-wait ( ms -- pressed? ) @@ -280,9 +287,6 @@ defer rm-go-hook \ Not used, but makes security happy : tsc@ ( -- d.ticks ) timer0@ u>d ; d# 6500 constant ms-factor -0 value ec-indexed-io-off? \ !!! -: ec-indexed-io-off ( -- ) ; \ !!! -: ec-ixio-reboot ( -- ) ; \ !!! \ idt1338 rtc and ram address map \ 00 -> 0f rtc Modified: dev/olpc/spiflash/flashif.fth ============================================================================== --- dev/olpc/spiflash/flashif.fth Thu Sep 15 07:39:43 2011 (r2509) +++ dev/olpc/spiflash/flashif.fth Thu Sep 15 08:08:18 2011 (r2510) @@ -9,6 +9,7 @@ defer flash-read ( adr len offset -- ) defer flash-verify ( adr len offset -- mismatch? ) defer flash-erase-block ( offset -- ) +defer flash-protect ( -- ) h# 10.0000 value /flash h# 10000 value /flash-block Modified: dev/olpc/spiflash/spiflash.fth ============================================================================== --- dev/olpc/spiflash/spiflash.fth Thu Sep 15 07:39:43 2011 (r2509) +++ dev/olpc/spiflash/spiflash.fth Thu Sep 15 08:08:18 2011 (r2510) @@ -91,6 +91,38 @@ 1 spi-cmd ( b ) spi-out stop-writing ; +\ Protect the device from further writes, by setting the Status +\ Register Protect (SRP) bit, and the Block Protect (BP2 BP1 BP0) +\ bits. + +\ Caller must then lower /WP pin, which prevents further write access +\ to the status register until the /WP pin is raised. + +: spi-protect ( -- ) h# 9c spi-write-status ; + +\ Turn off the protection bits. + +\ Is only permitted by the device if the /WP pin is high, otherwise it +\ is ignored and the status register protection bits are unchanged. + +: spi-unprotect ( -- ) h# 0 spi-write-status ; + +\ Check if the device is protected from further writes, by testing for +\ a set SRP, and if so trying to clear it, and checking if it remained +\ clear. + +: spi-protected? ( -- flag ) + spi-read-status h# 80 and if + spi-read-status ( status ) + spi-unprotect ( status ) + spi-read-status h# 80 and if ( status ) + drop true exit ( status ) + then ( status ) + spi-write-status + then + false +; + \ Erase a 64k block : erase-spi-block ( offset -- ) h# d8 setup-spi-write stop-writing ; @@ -282,7 +314,7 @@ ( default ) true abort" Unsupported SPI FLASH ID" endcase to write-spi-flash - 0 spi-write-status \ Turn off write protect bits + spi-unprotect ; \ Display a message telling what kind of part was found @@ -299,14 +331,17 @@ then ; - : spi-flash-open ( -- ) \ One retry spi-start ['] spi-identify catch if spi-start spi-identify then ; -: spi-flash-write-enable ( -- ) flash-open .spi-id cr ; + +: spi-flash-write-enable ( -- ) + flash-open .spi-id cr + spi-protected? abort" Write Protected SPI FLASH" +; : use-spi-flash-read ( -- ) ['] read-spi-flash to flash-read ; @@ -319,6 +354,7 @@ ['] write-spi-flash to flash-write ['] verify-spi-flash to flash-verify ['] erase-spi-block to flash-erase-block + ['] spi-protect to flash-protect use-spi-flash-read \ Might be overridden h# 10.0000 to /flash /spi-eblock to /flash-block
1
0
0
0
[commit] r2509 - cpu/arm/mmp2
by repository service
15 Sep '11
15 Sep '11
Author: quozl Date: Thu Sep 15 07:39:43 2011 New Revision: 2509 URL:
http://tracker.coreboot.org/trac/openfirmware/changeset/2509
Log: OLPC XO-1.75 - avoid turning off thermal sensor watchdog reset during watchdog configuration, add thermal sensor watchdog test script Modified: cpu/arm/mmp2/thermal.fth cpu/arm/mmp2/watchdog.fth Modified: cpu/arm/mmp2/thermal.fth ============================================================================== --- cpu/arm/mmp2/thermal.fth Wed Sep 14 00:43:10 2011 (r2508) +++ cpu/arm/mmp2/thermal.fth Thu Sep 15 07:39:43 2011 (r2509) @@ -7,7 +7,7 @@ 3 h# 015090 io! \ Enable clocks to thermal sensor h# 10000 thermal-base io! \ Enable sensing ; - + : cpu-temperature ( -- celcius ) 0 ( acc ) d# 100 0 do ( acc ) \ Accumulate 100 samples @@ -21,6 +21,35 @@ d# 52940 - d# 196 / ( celcius ) ; + +thermal-base h# 4 + value wd-thresh +: wd-thresh@ ( -- n ) wd-thresh io@ ; +: wd-thresh! ( n -- ) wd-thresh io! ; + +: .thermal + ." degrees=" cpu-temperature .d + ." raw=" thermal-base io@ h# 3ff and . + ." threshold=" wd-thresh@ h# 3ff and . +; + +: test-thermal + .thermal cr + + \ save the threshold set by cforth + thermal-base 4 + io@ >r + + \ temporarily set the threshold close to current value + thermal-base io@ h# 3ff and 8 + wd-thresh! + + begin + (cr .thermal kill-line d# 500 ms key? + until key drop cr + + \ restore the threshold + r> wd-thresh! + .thermal cr +; + stand-init: Thermal sensor init-thermal-sensor ; Modified: cpu/arm/mmp2/watchdog.fth ============================================================================== --- cpu/arm/mmp2/watchdog.fth Wed Sep 14 00:43:10 2011 (r2508) +++ cpu/arm/mmp2/watchdog.fth Thu Sep 15 07:39:43 2011 (r2509) @@ -1,10 +1,10 @@ \ See license at end of file purpose: System reset using the watchdog timer +main-pmu-pa h# 200 + constant wdtpcr : enable-wdt-clock main-pmu-pa h# 1020 + dup io@ h# 10 or swap io! \ enable wdt 2 clock PMUM_PRR_PJ - 7 main-pmu-pa h# 200 + io! - 3 main-pmu-pa h# 200 + io! + wdtpcr io@ dup h# 7 or wdtpcr io! h# 3 or wdtpcr io! ; h# 080000 value wdt-pa @@ -17,7 +17,7 @@ : wdt-reset ( -- ) enable-wdt-clock 2 h# 68 wdt! \ set match register - 3 h# 64 wdt! \ match enable: just interrupt, no reset yet + 3 h# 64 wdt! \ match enable: enable counting, enable reset 1 h# 98 wdt! \ Reset counter begin again ; @@ -26,7 +26,7 @@ : test-wdt ( -- ) enable-wdt-clock h# 100 h# 68 wdt! \ set match register - 1 h# 64 wdt! \ match enable: just interrupt, no reset yet + 1 h# 64 wdt! \ match enable: enable counting, no reset yet h# 6c wdt@ . d# 100 ms h# 6c wdt@ . ; [then]
1
0
0
0
[commit] r2508 - cpu/x86/pc/olpc/via
by repository service
14 Sep '11
14 Sep '11
Author: quozl Date: Wed Sep 14 00:43:10 2011 New Revision: 2508 URL:
http://tracker.coreboot.org/trac/openfirmware/changeset/2508
Log: OLPC XO-1.75 - fix stack imbalance in fs-verify Modified: cpu/x86/pc/olpc/via/fsverify.fth Modified: cpu/x86/pc/olpc/via/fsverify.fth ============================================================================== --- cpu/x86/pc/olpc/via/fsverify.fth Wed Sep 14 00:38:52 2011 (r2507) +++ cpu/x86/pc/olpc/via/fsverify.fth Wed Sep 14 00:43:10 2011 (r2508) @@ -69,7 +69,7 @@ t-hms( also fs-verify-commands - ['] include-file catch dup if + ['] include-file catch ?dup if ( x error ) nip .error then previous
1
0
0
0
[commit] r2507 - cpu/x86/pc/olpc/via
by repository service
14 Sep '11
14 Sep '11
Author: quozl Date: Wed Sep 14 00:38:52 2011 New Revision: 2507 URL:
http://tracker.coreboot.org/trac/openfirmware/changeset/2507
Log: OLPC XO-1.75 - use correct timing commencement word, because secure fs-update, and normal fs-verify, displayed incorrect elapsed time because different timers are used for different resolutions on XO-1.75 Modified: cpu/x86/pc/olpc/via/fsupdate.fth cpu/x86/pc/olpc/via/fsverify.fth Modified: cpu/x86/pc/olpc/via/fsupdate.fth ============================================================================== --- cpu/x86/pc/olpc/via/fsupdate.fth Tue Sep 13 05:31:18 2011 (r2506) +++ cpu/x86/pc/olpc/via/fsupdate.fth Wed Sep 14 00:38:52 2011 (r2507) @@ -252,7 +252,7 @@ open-nand ( adr len ) \ clear-context nand-commands - t( + t-hms( also nand-commands ( adr len ) true to secure-fsupdate? ( adr len ) Modified: cpu/x86/pc/olpc/via/fsverify.fth ============================================================================== --- cpu/x86/pc/olpc/via/fsverify.fth Tue Sep 13 05:31:18 2011 (r2506) +++ cpu/x86/pc/olpc/via/fsverify.fth Wed Sep 14 00:38:52 2011 (r2507) @@ -67,7 +67,7 @@ over file ! linefeed line-delimiter c! ( fd fd' ) file ! ( fd ) - t( + t-hms( also fs-verify-commands ['] include-file catch dup if nip .error
1
0
0
0
[commit] r2506 - cpu/x86/pc/olpc
by repository service
13 Sep '11
13 Sep '11
Author: quozl Date: Tue Sep 13 05:31:18 2011 New Revision: 2506 URL:
http://tracker.coreboot.org/trac/openfirmware/changeset/2506
Log: OLPC XO - fix stack imbalance when bad firmware image file detected, image length left behind. Modified: cpu/x86/pc/olpc/security.fth Modified: cpu/x86/pc/olpc/security.fth ============================================================================== --- cpu/x86/pc/olpc/security.fth Mon Sep 12 04:06:15 2011 (r2505) +++ cpu/x86/pc/olpc/security.fth Tue Sep 13 05:31:18 2011 (r2506) @@ -968,7 +968,8 @@ tuck flash-buf swap move ( len ) - ['] ?image-valid catch ?dup if ( ) + ['] ?image-valid catch ?dup if ( x error# ) + nip visible red-letters ." Bad firmware image file - " .error
1
0
0
0
← Newer
1
2
3
4
5
6
Older →
Jump to page:
1
2
3
4
5
6
Results per page:
10
25
50
100
200