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
November 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
59 discussions
Start a n
N
ew thread
[commit] r2687 - cpu/x86/pc/olpc/via/build
by repository service
15 Nov '11
15 Nov '11
Author: wmb Date: Tue Nov 15 02:14:07 2011 New Revision: 2687 URL:
http://tracker.coreboot.org/trac/openfirmware/changeset/2687
Log: .gitignore Added: cpu/x86/pc/olpc/via/build/.gitignore Added: cpu/x86/pc/olpc/via/build/.gitignore ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ cpu/x86/pc/olpc/via/build/.gitignore Tue Nov 15 02:14:07 2011 (r2687) @@ -0,0 +1,5 @@ +*.public +multicast-nand/ +build +dsdt.stamp +sourceurl
1
0
0
0
[commit] r2686 - in cpu: arm/olpc/1.75 x86/pc/alex x86/pc/olpc/via
by repository service
15 Nov '11
15 Nov '11
Author: wmb Date: Tue Nov 15 02:14:02 2011 New Revision: 2686 URL:
http://tracker.coreboot.org/trac/openfirmware/changeset/2686
Log: OLPC trac 11423 - Manufacturing tests - merged common code for manufacturing tests into one file and split the differences out into platform-specific "testitems.fth" files. Also implemented an autorun facility for use in secure mode, per OLPC trac 11423. Added: cpu/arm/olpc/1.75/testitems.fth cpu/x86/pc/alex/testitems.fth cpu/x86/pc/olpc/via/testitems.fth Deleted: cpu/arm/olpc/1.75/mfgtest.fth cpu/x86/pc/alex/mfgtest.fth Modified: cpu/arm/olpc/1.75/fw.bth cpu/x86/pc/alex/fw.bth cpu/x86/pc/olpc/via/fw.bth cpu/x86/pc/olpc/via/mfgtest.fth Modified: cpu/arm/olpc/1.75/fw.bth ============================================================================== --- cpu/arm/olpc/1.75/fw.bth Tue Nov 15 02:13:49 2011 (r2685) +++ cpu/arm/olpc/1.75/fw.bth Tue Nov 15 02:14:02 2011 (r2686) @@ -139,7 +139,8 @@ \ Uninstall the diag menu from the general user interface vector \ so exiting from emacs doesn't invoke the diag menu. ' quit to user-interface -fload ${BP}/cpu/arm/olpc/1.75/mfgtest.fth +fload ${BP}/cpu/x86/pc/olpc/via/mfgtest.fth +fload ${BP}/cpu/arm/olpc/1.75/testitems.fth [ifdef] notyet fload ${BP}/cpu/x86/pc/olpc/via/bootmenu.fth @@ -481,7 +482,7 @@ : ?diags ( -- ) rocker-left game-key? if protect-fw - text-on " test-all" ['] eval guarded + text-on ['] gamekey-auto-menu guarded ." Tests complete - powering off" cr d# 5000 ms power-off then ; Added: cpu/arm/olpc/1.75/testitems.fth ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ cpu/arm/olpc/1.75/testitems.fth Tue Nov 15 02:14:02 2011 (r2686) @@ -0,0 +1,94 @@ +icon: cpu.icon rom:cpu.565 +icon: spi.icon rom:spi.565 +icon: ram.icon rom:ram.565 +icon: sdcard.icon rom:sdcard.565 +icon: usb.icon rom:usb.565 +icon: battery.icon rom:battery.565 +icon: camera.icon rom:camera.565 +icon: wifi.icon rom:wifi.565 +icon: audio.icon rom:audio.565 +icon: touchpad.icon rom:touchpad.565 +icon: display.icon rom:display.565 +icon: keyboard.icon rom:keyboard.565 +icon: timer.icon rom:timer.565 +icon: clock.icon rom:clock.565 +icon: ebook.icon rom:ebook.565 +icon: leds.icon rom:leds.565 + +d# 15 to #mfgtests +d# 5 to #mfgcols +d# 4 to #mfgrows + +: cpu-item ( -- ) " /cpu" mfg-test-dev ; +: battery-item ( -- ) " /battery" mfg-test-dev ; +: spiflash-item ( -- ) " /flash" mfg-test-dev ; +: memory-item ( -- ) " /memory" mfg-test-dev ; +: usb-item ( -- ) " /usb/hub" mfg-test-dev ; +: int-sd-item ( -- ) " int:0" mfg-test-dev ; +: ext-sd-item ( -- ) " ext:0" mfg-test-dev ; +: rtc-item ( -- ) " /rtc" mfg-test-dev ; +: display-item ( -- ) " /display" mfg-test-dev ; +: audio-item ( -- ) " /audio" mfg-test-dev ; +: camera-item ( -- ) " /camera" mfg-test-dev ; +: wlan-item ( -- ) " /wlan" mfg-test-dev ; +: timer-item ( -- ) " /timer" mfg-test-dev ; +: touchpad-item ( -- ) " mouse" mfg-test-dev ; +: keyboard-item ( -- ) " keyboard" mfg-test-dev ; +: switch-item ( -- ) " /accelerometer" mfg-test-dev " /switches" mfg-test-dev ; +: leds-item ( -- ) " /leds" mfg-test-dev ; + +: olpc-test-menu-items ( -- ) + clear-menu + +\ " CPU" +\ ['] cpu-item cpu.icon 1 0 install-icon + + " SPI Flash: Contains EC code, firmware, manufacturing data." + ['] spiflash-item spi.icon 1 0 install-icon + + " RAM chips" + ['] memory-item ram.icon 1 1 install-icon + + " Internal mass storage" + ['] int-sd-item sdcard.icon 1 2 install-icon + + " Plug-in SD card" + ['] ext-sd-item sdcard.icon 1 3 install-icon + + " Wireless LAN" + ['] wlan-item wifi.icon 1 4 install-icon + + " Display" + ['] display-item display.icon 2 0 install-icon + + " Camera" + ['] camera-item camera.icon 2 1 install-icon + + " Audio: Speaker and microphone" + ['] audio-item audio.icon 2 2 install-icon + + " Battery" + ['] battery-item battery.icon 2 3 install-icon + + " RTC (Real-Time Clock)" + ['] rtc-item clock.icon 2 4 install-icon + + " USB ports" + ['] usb-item usb.icon 3 0 install-icon + + \ These are last because they require user participation. + \ The earlier tests are all included in automatic batch-mode. + + " Keyboard" + ['] keyboard-item keyboard.icon 3 1 install-icon + + " Touchpad" + ['] touchpad-item touchpad.icon 3 2 install-icon + + " LEDs" + ['] leds-item leds.icon 3 3 install-icon + + " Switches and Accelerometer" + ['] switch-item ebook.icon 3 4 install-icon +; +' olpc-test-menu-items to test-menu-items Modified: cpu/x86/pc/alex/fw.bth ============================================================================== --- cpu/x86/pc/alex/fw.bth Tue Nov 15 02:13:49 2011 (r2685) +++ cpu/x86/pc/alex/fw.bth Tue Nov 15 02:14:02 2011 (r2686) @@ -213,7 +213,7 @@ patch noop set-menu-colors setup-graphics patch merge-rect-565 merge-rect merge-cursor \ Hack since we do all our user-level graphics in 565 patch merge-rect-565 merge-rect merge-cursor \ Hack since we do all our user-level graphics in 565 -fload ${BP}/cpu/x86/pc/alex/mfgtest.fth +fload ${BP}/cpu/x86/pc/olpc/via/mfgtest.fth fload ${BP}/dev/olpc/confirm.fth : bright! ( level -- ) drop ; : backlight-on ( -- ) ; Added: cpu/x86/pc/alex/testitems.fth ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ cpu/x86/pc/alex/testitems.fth Tue Nov 15 02:14:02 2011 (r2686) @@ -0,0 +1,128 @@ +purpose: Platform-specific layout of diagnostic GUI menu items + +d# 6 to #mfgcols +d# 4 to #mfgrows + +: dummy-test-dev ( $ -- ) + clear-n-restore-scroller + ??cr ." Testing " type ." - to be implemented" cr + mfg-color-green sq-border! + d# 2000 hold-message drop + cursor-off gui-alerts refresh + flush-keyboard +; + +: mfg-test-disk ( name$ -- ) + clear-n-restore-scroller + ??cr ." Testing " 2dup type cr + + ['] $.partitions catch if + 2drop false + else + 0 true + then + + d# 2000 ms \ More time to inspect + + mfg-test-result +; + +icon: play.icon rom:play.565 +icon: quit.icon rom:quit.565 +icon: cpu.icon rom:cpu.565 +icon: spi.icon rom:spi.565 +icon: ram.icon rom:ram.565 +icon: sdcard.icon rom:sdcard.565 +icon: usb.icon rom:usb.565 +icon: battery.icon rom:battery.565 +icon: camera.icon rom:camera.565 +icon: wifi.icon rom:wifi.565 +icon: audio.icon rom:audio.565 +icon: touchpad.icon rom:touchpad.565 +icon: display.icon rom:display.565 +icon: keyboard.icon rom:keyboard.565 +icon: timer.icon rom:timer.565 +icon: clock.icon rom:clock.565 +icon: ebook.icon rom:ebook.565 +icon: leds.icon rom:leds.565 + +: cpu-item ( -- ) " /cpu" mfg-test-dev ; +: battery-item ( -- ) " /battery" dummy-test-dev ; +: spiflash-item ( -- ) " /flash" mfg-test-dev ; +: memory-item ( -- ) " /memory" mfg-test-dev ; +: usb-item ( -- ) " /usb" mfg-test-dev ; +: int-sd-item ( -- ) " disk" mfg-test-disk ; +\ : ext-sd-item ( -- ) " ext:0" mfg-test-dev ; +: rtc-item ( -- ) " /rtc" mfg-test-dev ; +: display-item ( -- ) " screen" mfg-test-dev ; +: audio-item ( -- ) " /audio" dummy-test-dev ; +: camera-item ( -- ) " /camera" mfg-test-dev ; +: wlan-item ( -- ) " /wlan" dummy-test-dev ; +: timer-item ( -- ) " /timer" mfg-test-dev ; +: touchpad-item ( -- ) " /mouse" mfg-test-dev ; +: keyboard-item ( -- ) " /keyboard" mfg-test-dev ; +: switch-item ( -- ) " /switches" mfg-test-dev ; +: leds-item ( -- ) " /leds" mfg-test-dev ; + +: alex-test-menu-items ( -- ) + silent-probe-usb + + 0 to #mfgtests + 0 1 set-col-row + + " CPU" + ['] cpu-item cpu.icon add-icon + + " SPI Flash: Contains EC code, firmware, manufacturing data." + ['] spiflash-item spi.icon add-icon + + " RAM chips" + ['] memory-item ram.icon add-icon + + " Internal mass storage" + ['] int-sd-item sdcard.icon add-icon + +\ " Plug-in SD card" +\ ['] ext-sd-item sdcard.icon add-icon + + " Timer" + ['] timer-item timer.icon add-icon + + " RTC (Real-Time Clock)" + ['] rtc-item clock.icon add-icon + + " Keyboard" + ['] keyboard-item keyboard.icon add-icon + + " Touchpad" + ['] touchpad-item touchpad.icon add-icon + + " Display" + ['] display-item display.icon add-icon + + " Camera" + ['] camera-item camera.icon add-icon + + " Audio: Speaker and microphone" + ['] audio-item audio.icon add-icon + + " Wireless LAN" + ['] wlan-item wifi.icon add-icon + + " USB ports" + ['] usb-item usb.icon add-icon + + " Battery" + ['] battery-item battery.icon add-icon + + \ These are last because they require user participation. + \ The earlier tests are all included in automatic batch-mode. + +\ " LEDs" +\ ['] leds-item leds.icon add-icon + +\ " Switches" +\ ['] switch-item ebook.icon add-icon +; + +' alex-test-menu-items to test-menu-items Modified: cpu/x86/pc/olpc/via/fw.bth ============================================================================== --- cpu/x86/pc/olpc/via/fw.bth Tue Nov 15 02:13:49 2011 (r2685) +++ cpu/x86/pc/olpc/via/fw.bth Tue Nov 15 02:14:02 2011 (r2686) @@ -326,6 +326,7 @@ \ so exiting from emacs doesn't invoke the diag menu. ' quit to user-interface fload ${BP}/cpu/x86/pc/olpc/via/mfgtest.fth +fload ${BP}/cpu/x86/pc/olpc/via/testitems.fth fload ${BP}/cpu/x86/pc/olpc/via/bootmenu.fth : screen-#lines ( -- n ) Modified: cpu/x86/pc/olpc/via/mfgtest.fth ============================================================================== --- cpu/x86/pc/olpc/via/mfgtest.fth Tue Nov 15 02:13:49 2011 (r2685) +++ cpu/x86/pc/olpc/via/mfgtest.fth Tue Nov 15 02:14:02 2011 (r2686) @@ -4,7 +4,17 @@ h# f800 constant mfg-color-red h# 07e0 constant mfg-color-green -: flush-keyboard ( -- ) begin key? while key drop repeat ; +: blank-screen ( -- ) + h# ffff ( color ) + 0 0 ( color x y ) + screen-wh ( color x y w y ) + fill-rectangle-noff ( ) +; + +: clear-n-restore-scroller ( -- ) + blank-screen + restore-scroller +; : sq-border! ( bg -- ) current-sq sq >border ! ; @@ -24,7 +34,7 @@ begin key? if key drop refresh exit then mouse-ih if - 10 get-event if + mouse-event? if \ Ignore movement, act only on a button down event nip nip if wait-buttons-up refresh exit then then @@ -32,15 +42,8 @@ again ; -: mfg-test-dev ( $ -- ) - restore-scroller - ??cr ." Testing " 2dup type cr ( $ ) - 2dup locate-device if ( $ ) - 2drop ." Can't find device node" cr exit ( -- ) - else - drop ( $ ) - then ( $ phandle ) - " selftest" execute-device-method if ( return-code ) +: mfg-test-result ( error? -- ) +if ( return-code ) ?dup if ( return-code ) ??cr ." Selftest failed. Return code = " .d cr mfg-color-red sq-border! @@ -50,14 +53,14 @@ mfg-wait-return else ( ) green-letters - ." Okay" cr + ??cr ." Okay" cr black-letters mfg-color-green sq-border! true to pass? - d# 2000 hold-message + d# 2000 hold-message drop then else - ." Selftest failed due to abort" cr + ??cr ." Selftest failed due to abort" cr mfg-color-red sq-border! false to pass? red-screen @@ -67,30 +70,18 @@ cursor-off gui-alerts refresh flush-keyboard ; - -: draw-error-border ( -- ) - mfg-color-red d# 20 d# 20 d# 1160 d# 820 d# 20 box +: mfg-test-dev ( $ -- ) + clear-n-restore-scroller ( $ ) + ??cr ." Testing " 2dup type cr ( $ ) + 2dup locate-device if ( $ ) + ." Can't find device node " type cr exit ( -- ) + else ( $ phandle ) + drop ( $ ) + then ( $ ) + " selftest" execute-device-method ( error? ) + mfg-test-result ; -icon: play.icon rom:play.565 -icon: quit.icon rom:quit.565 -icon: cpu.icon rom:cpu.565 -icon: spi.icon rom:spi.565 -icon: ram.icon rom:ram.565 -icon: sdcard.icon rom:sdcard.565 -icon: usb.icon rom:usb.565 -icon: battery.icon rom:battery.565 -icon: camera.icon rom:camera.565 -icon: wifi.icon rom:wifi.565 -icon: audio.icon rom:audio.565 -icon: touchpad.icon rom:touchpad.565 -icon: display.icon rom:display.565 -icon: keyboard.icon rom:keyboard.565 -icon: timer.icon rom:timer.565 -icon: clock.icon rom:clock.565 -icon: ebook.icon rom:ebook.565 -icon: leds.icon rom:leds.565 - : all-tests-passed ( -- ) restore-scroller clear-screen @@ -101,8 +92,25 @@ flush-keyboard ; -d# 15 value #mfgtests -d# 5 value #mfgcols +0 value #mfgtests +0 value #mfgcols +0 value #mfgrows + +: #mfgtests++ ( -- ) #mfgtests 1+ to #mfgtests ; + +0 value cur-col +0 value cur-row +: cur-col++ ( -- ) cur-col 1+ to cur-col ; +: cur-row++ ( -- ) cur-row 1+ to cur-row ; +: set-col-row ( row col -- ) to cur-col to cur-row ; +: add-icon ( -- ) + cur-col #mfgcols = if + cur-row++ cur-row #mfgcols >= if abort" Too many icons" then + 0 to cur-col + then + cur-row cur-col install-icon + cur-col++ +; : mfg-test-autorunner ( -- ) \ Unattended autorun of all tests #mfgcols #mfgtests + #mfgcols ?do @@ -114,6 +122,9 @@ loop ; +icon: play.icon rom:play.565 +icon: quit.icon rom:quit.565 + : play-item ( -- ) \ Interactive autorun of all tests #mfgcols #mfgtests + #mfgcols ?do i set-current-sq @@ -128,81 +139,10 @@ ; : quit-item ( -- ) menu-done ; -: cpu-item ( -- ) " /cpu" mfg-test-dev ; -: battery-item ( -- ) " /battery" mfg-test-dev ; -: spiflash-item ( -- ) " /flash" mfg-test-dev ; -: memory-item ( -- ) " /memory" mfg-test-dev ; -: usb-item ( -- ) " /usb" mfg-test-dev ; -: int-sd-item ( -- ) " int:0" mfg-test-dev ; -: ext-sd-item ( -- ) " ext:0" mfg-test-dev ; -: rtc-item ( -- ) " /rtc" mfg-test-dev ; -: display-item ( -- ) " /display" mfg-test-dev ; -: audio-item ( -- ) " /audio" mfg-test-dev ; -: camera-item ( -- ) " /camera" mfg-test-dev ; -: wlan-item ( -- ) " /wlan" mfg-test-dev ; -: timer-item ( -- ) " /timer" mfg-test-dev ; -: touchpad-item ( -- ) " /8042/mouse" mfg-test-dev ; -: keyboard-item ( -- ) " /8042/keyboard" mfg-test-dev ; -: switch-item ( -- ) " /switches" mfg-test-dev ; -: leds-item ( -- ) " /leds" mfg-test-dev ; - -: olpc-menu-items ( -- ) - clear-menu - -\ " CPU" -\ ['] cpu-item cpu.icon 1 0 install-icon - - " SPI Flash: Contains EC code, firmware, manufacturing data." - ['] spiflash-item spi.icon 1 0 install-icon - - " RAM chips" - ['] memory-item ram.icon 1 1 install-icon - - " Internal mass storage" - ['] int-sd-item sdcard.icon 1 2 install-icon - - " Plug-in SD card" - ['] ext-sd-item sdcard.icon 1 3 install-icon - - " Wireless LAN" - ['] wlan-item wifi.icon 1 4 install-icon - - " Display" - ['] display-item display.icon 2 0 install-icon - - " Camera" - ['] camera-item camera.icon 2 1 install-icon - - " Audio: Speaker and microphone" - ['] audio-item audio.icon 2 2 install-icon - - " Battery" - ['] battery-item battery.icon 2 3 install-icon - - " RTC (Real-Time Clock)" - ['] rtc-item clock.icon 2 4 install-icon - - " USB ports" - ['] usb-item usb.icon 3 0 install-icon - - \ These are last because they require user participation. - \ The earlier tests are all included in automatic batch-mode. - - " Keyboard" - ['] keyboard-item keyboard.icon 3 1 install-icon - - " Touchpad" - ['] touchpad-item touchpad.icon 3 2 install-icon - - " LEDs" - ['] leds-item leds.icon 3 3 install-icon - - " Switches" - ['] switch-item ebook.icon 3 4 install-icon -; : init-menu ( -- ) - d# 4 to rows + ?open-screen ?open-mouse + #mfgrows to rows #mfgcols to cols d# 180 to sq-size d# 128 to image-size @@ -210,9 +150,12 @@ cursor-off ; +defer test-menu-items + : full-menu ( -- ) init-menu - olpc-menu-items + clear-menu + test-menu-items " Run all non-interactive tests. (Press a key between tests to stop.)" ['] play-item play.icon 0 1 selected install-icon @@ -229,12 +172,33 @@ ['] run-menu behavior >r ['] mfg-test-autorunner to run-menu \ Run menu automatically true to diag-switch? - ['] olpc-menu-items ['] nest-menu catch drop + ['] test-menu-items ['] nest-menu catch drop r> to run-menu false to diag-switch? restore-scroller ; +: autorun-from-gamekey ( -- ) + default-selection set-current-sq refresh + (cr kill-line + 0 d# 30 do + i d# 10 mod 0= if (cr i d# 10 / .d then + mouse-event? dup if nip nip nip then ( moused? ) + key? or if ( ) + drop ( ) + menu-interact ( ) + unloop exit ( -- ) + then ( ) + d# 100 ms ( ) + -1 +loop + play-item +; +: gamekey-auto-menu ( -- ) + ['] run-menu behavior >r + ['] autorun-from-gamekey to run-menu \ Run menu automatically after a timeout + (menu) + r> to run-menu +; \ LICENSE_BEGIN \ Copyright (c) 2009 Luke Gorrie Added: cpu/x86/pc/olpc/via/testitems.fth ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ cpu/x86/pc/olpc/via/testitems.fth Tue Nov 15 02:14:02 2011 (r2686) @@ -0,0 +1,96 @@ +purpose: Platform-specific layout of diagnostic GUI menu items + +d# 5 to #mfgcols +d# 4 to #mfgrows + +icon: cpu.icon rom:cpu.565 +icon: spi.icon rom:spi.565 +icon: ram.icon rom:ram.565 +icon: sdcard.icon rom:sdcard.565 +icon: usb.icon rom:usb.565 +icon: battery.icon rom:battery.565 +icon: camera.icon rom:camera.565 +icon: wifi.icon rom:wifi.565 +icon: audio.icon rom:audio.565 +icon: touchpad.icon rom:touchpad.565 +icon: display.icon rom:display.565 +icon: keyboard.icon rom:keyboard.565 +icon: timer.icon rom:timer.565 +icon: clock.icon rom:clock.565 +icon: ebook.icon rom:ebook.565 +icon: leds.icon rom:leds.565 + +: cpu-item ( -- ) " /cpu" mfg-test-dev ; +: battery-item ( -- ) " /battery" mfg-test-dev ; +: spiflash-item ( -- ) " /flash" mfg-test-dev ; +: memory-item ( -- ) " /memory" mfg-test-dev ; +: usb-item ( -- ) " /usb" mfg-test-dev ; +: int-sd-item ( -- ) " int:0" mfg-test-dev ; +: ext-sd-item ( -- ) " ext:0" mfg-test-dev ; +: rtc-item ( -- ) " /rtc" mfg-test-dev ; +: display-item ( -- ) " /display" mfg-test-dev ; +: audio-item ( -- ) " /audio" mfg-test-dev ; +: camera-item ( -- ) " /camera" mfg-test-dev ; +: wlan-item ( -- ) " /wlan" mfg-test-dev ; +: timer-item ( -- ) " /timer" mfg-test-dev ; +: touchpad-item ( -- ) " /8042/mouse" mfg-test-dev ; +: keyboard-item ( -- ) " /8042/keyboard" mfg-test-dev ; +: switch-item ( -- ) " /switches" mfg-test-dev ; +: leds-item ( -- ) " /leds" mfg-test-dev ; + +: olpc-test-menu-items ( -- ) + 0 to #mfgtests + 0 1 set-col-row + +\ " CPU" +\ ['] cpu-item cpu.icon add-icon + + " SPI Flash: Contains EC code, firmware, manufacturing data." + ['] spiflash-item spi.icon add-icon + + " RAM chips" + ['] memory-item ram.icon add-icon + + " Internal mass storage" + ['] int-sd-item sdcard.icon add-icon + + " Plug-in SD card" + ['] ext-sd-item sdcard.icon add-icon + + " Wireless LAN" + ['] wlan-item wifi.icon add-icon + + " Display" + ['] display-item display.icon add-icon + + " Camera" + ['] camera-item camera.icon add-icon + + " Audio: Speaker and microphone" + ['] audio-item audio.icon add-icon + + " Battery" + ['] battery-item battery.icon add-icon + + " RTC (Real-Time Clock)" + ['] rtc-item clock.icon add-icon + + " USB ports" + ['] usb-item usb.icon add-icon + + \ These are last because they require user participation. + \ The earlier tests are all included in automatic batch-mode. + + " Keyboard" + ['] keyboard-item keyboard.icon add-icon + + " Touchpad" + ['] touchpad-item touchpad.icon add-icon + + " LEDs" + ['] leds-item leds.icon add-icon + + " Switches" + ['] switch-item ebook.icon add-icon +; +' olpc-test-menu-items to test-menu-items
1
0
0
0
[commit] r2685 - cpu/arm
by repository service
15 Nov '11
15 Nov '11
Author: wmb Date: Tue Nov 15 02:13:49 2011 New Revision: 2685 URL:
http://tracker.coreboot.org/trac/openfirmware/changeset/2685
Log: ARM - removed duplicate definition in cpu/arm/scc.fth - no functional change. Modified: cpu/arm/scc.fth Modified: cpu/arm/scc.fth ============================================================================== --- cpu/arm/scc.fth Mon Nov 14 05:26:21 2011 (r2684) +++ cpu/arm/scc.fth Tue Nov 15 02:13:49 2011 (r2685) @@ -99,7 +99,6 @@ code drain-write-buffer ( -- ) mcr p15,0,r0,cr7,cr10,4 c; alias data-sync-barrier drain-write-buffer -code drain-write-buffer ( -- ) mcr p15,0,r0,cr7,cr10,4 c; code data-memory-barrier ( -- ) mcr p15,0,r0,cr7,cr10,5 c; code flush-i&d-tlb ( -- ) mcr p15,0,r0,cr8,cr7,0 c;
1
0
0
0
[commit] r2684 - cpu/arm/olpc/1.75
by repository service
14 Nov '11
14 Nov '11
Author: quozl Date: Mon Nov 14 05:26:21 2011 New Revision: 2684 URL:
http://tracker.coreboot.org/trac/openfirmware/changeset/2684
Log: OLPC XO-1.75 - report write protected EC and flash correctly, was "EDI byte in timeout", allow time for EC to finish reset Modified: cpu/arm/olpc/1.75/devices.fth Modified: cpu/arm/olpc/1.75/devices.fth ============================================================================== --- cpu/arm/olpc/1.75/devices.fth Mon Nov 14 04:24:06 2011 (r2683) +++ cpu/arm/olpc/1.75/devices.fth Mon Nov 14 05:26:21 2011 (r2684) @@ -177,7 +177,9 @@ : ignore-power-button ( -- ) edi-spi-start - ['] reset-8051 catch if reset-8051 then + ['] reset-8051 catch if + ['] reset-8051 catch if ." Write Protected EC" cr then + then use-ssp-spi ['] ec-spi-reprogrammed to spi-reprogrammed ; @@ -188,6 +190,7 @@ ; : )flash-vulnerable ( -- ) hdd-led-off + d# 850 ms \ allow time for 8051 to finish reset and power us down ; : fs-vulnerable( ( -- ) ols-off
1
0
0
0
[commit] r2683 - cpu/arm/olpc/1.75 cpu/x86/pc/olpc cpu/x86/pc/olpc/via dev/olpc/keyboard
by repository service
14 Nov '11
14 Nov '11
Author: quozl Date: Mon Nov 14 04:24:06 2011 New Revision: 2683 URL:
http://tracker.coreboot.org/trac/openfirmware/changeset/2683
Log: OLPC - enable the keyboard interrupt on mechanical keyboards, using the del key, see #10318. Modified: cpu/arm/olpc/1.75/fw.bth cpu/x86/pc/olpc/sound.fth cpu/x86/pc/olpc/via/fw.bth dev/olpc/keyboard/selftest.fth Modified: cpu/arm/olpc/1.75/fw.bth ============================================================================== --- cpu/arm/olpc/1.75/fw.bth Mon Nov 14 01:58:24 2011 (r2682) +++ cpu/arm/olpc/1.75/fw.bth Mon Nov 14 04:24:06 2011 (r2683) @@ -285,6 +285,9 @@ dev /ap-sp/keyboard fload ${BP}/dev/olpc/keyboard/selftest.fth \ Keyboard diagnostic device-end +stand-init: Keyboard + " /ap-sp/keyboard" " set-keyboard-type" execute-device-method drop +; dev /ap-sp/mouse fload ${BP}/dev/olpc/touchpad/syntpad.fth \ Touchpad diagnostic device-end Modified: cpu/x86/pc/olpc/sound.fth ============================================================================== --- cpu/x86/pc/olpc/sound.fth Mon Nov 14 01:58:24 2011 (r2682) +++ cpu/x86/pc/olpc/sound.fth Mon Nov 14 04:24:06 2011 (r2683) @@ -56,13 +56,13 @@ dev /keyboard 0 value waiting-up? -: olpc-check-abort ( scan-code -- abort? ) \ Square pressed? +: olpc-check-abort ( scan-code -- abort? ) \ an abort key pressed? last-scan over to last-scan ( scan-code old-scan-code ) h# e0 <> if drop false exit then ( scan-code ) check-abort? 0= if drop false exit then ( scan-code ) - dup h# 7f and h# 5d <> if drop false exit then ( scan-code ) + dup h# 7f and abort-key <> if drop false exit then ( scan-code ) h# 80 and if \ Up false to waiting-up? Modified: cpu/x86/pc/olpc/via/fw.bth ============================================================================== --- cpu/x86/pc/olpc/via/fw.bth Mon Nov 14 01:58:24 2011 (r2682) +++ cpu/x86/pc/olpc/via/fw.bth Mon Nov 14 04:24:06 2011 (r2683) @@ -386,6 +386,9 @@ dev /keyboard fload ${BP}/dev/olpc/keyboard/selftest.fth \ Keyboard diagnostic device-end +stand-init: Keyboard + " /keyboard" " set-keyboard-type" execute-device-method drop +; 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/via/copynand.fth Modified: dev/olpc/keyboard/selftest.fth ============================================================================== --- dev/olpc/keyboard/selftest.fth Mon Nov 14 01:58:24 2011 (r2682) +++ dev/olpc/keyboard/selftest.fth Mon Nov 14 04:24:06 2011 (r2683) @@ -10,6 +10,9 @@ \ This is 1 for the original rubber keyboard and 2 for the mechanical keyboard 1 value keyboard-type +\ Scan code of abort key +h# 5d value abort-key + \ There are two scancode tables: \ 1. simple scancode (down values); up value is f0 + scancode \ 2. e0 + scancode (down values); up value is e0 + f0 + scancode @@ -712,12 +715,20 @@ else " KM" find-tag if ( adr len ) -null ( adr' len' ) - " olpcm" $= if 2 else 1 then ( type ) + " olpcm" $= if + h# 53 to abort-key \ del + 2 + else + 1 + then ( type ) else ( ) 1 ( type ) then ( type ) then to keyboard-type +; + +: use-keyboard-type ( -- ) keyboard-type case 0 of ['] make-buttons ['] ibm#s0 ['] /ibm#s0 ['] all-tested?0 endof @@ -733,6 +744,7 @@ open 0= if true exit then set-keyboard-type + use-keyboard-type make-keys
1
0
0
0
[commit] r2682 - cpu/arm/olpc/1.75 cpu/x86/pc/olpc cpu/x86/pc/olpc/via dev/olpc/kb3700
by repository service
14 Nov '11
14 Nov '11
Author: quozl Date: Mon Nov 14 01:58:24 2011 New Revision: 2682 URL:
http://tracker.coreboot.org/trac/openfirmware/changeset/2682
Log: OLPC - keep storage LED lit during fs-update and flash, by turning off light sensor Modified: cpu/arm/olpc/1.75/devices.fth cpu/arm/olpc/1.75/leds.fth cpu/x86/pc/olpc/devices.fth cpu/x86/pc/olpc/via/devices.fth cpu/x86/pc/olpc/via/fsupdate.fth dev/olpc/kb3700/eccmds.fth Modified: cpu/arm/olpc/1.75/devices.fth ============================================================================== --- cpu/arm/olpc/1.75/devices.fth Fri Nov 11 09:45:01 2011 (r2681) +++ cpu/arm/olpc/1.75/devices.fth Mon Nov 14 01:58:24 2011 (r2682) @@ -182,12 +182,21 @@ ['] ec-spi-reprogrammed to spi-reprogrammed ; : flash-vulnerable( ( -- ) + ols-off ignore-power-button hdd-led-on ; : )flash-vulnerable ( -- ) hdd-led-off ; +: fs-vulnerable( ( -- ) + ols-off + hdd-led-on +; +: )fs-vulnerable ( -- ) + hdd-led-off + ols-on +; fload ${BP}/dev/olpc/spiflash/spiui.fth \ User interface for SPI FLASH programming \ fload ${BP}/dev/olpc/spiflash/recover.fth \ XO-to-XO SPI FLASH recovery Modified: cpu/arm/olpc/1.75/leds.fth ============================================================================== --- cpu/arm/olpc/1.75/leds.fth Fri Nov 11 09:45:01 2011 (r2681) +++ cpu/arm/olpc/1.75/leds.fth Mon Nov 14 01:58:24 2011 (r2682) @@ -6,11 +6,6 @@ " leds" device-name : open ( -- okay? ) true ; : close ( -- ) ; -: ols-led-on ( -- ) h# 57 ec-cmd ; -: ols-led-off ( -- ) h# 58 ec-cmd ; -: ols-assy-mode-on ( -- ) h# 59 ec-cmd ; -: ols-assy-mode-off ( -- ) h# 5a ec-cmd ; -: ols-led-ec-control ( -- ) h# 5b ec-cmd ; : selftest ( -- ) ." Flashing LEDs" cr Modified: cpu/x86/pc/olpc/devices.fth ============================================================================== --- cpu/x86/pc/olpc/devices.fth Fri Nov 11 09:45:01 2011 (r2681) +++ cpu/x86/pc/olpc/devices.fth Mon Nov 14 01:58:24 2011 (r2682) @@ -320,6 +320,8 @@ load-base constant flash-buf : flash-vulnerable( ( -- ) ignore-power-button ; : )flash-vulnerable ( -- ) ; +: fs-vulnerable( ( -- ) ; +: )fs-vulnerable ( -- ) ; fload ${BP}/dev/olpc/spiflash/spiui.fth \ User interface for SPI FLASH programming fload ${BP}/dev/olpc/spiflash/recover.fth \ XO-to-XO SPI FLASH recovery Modified: cpu/x86/pc/olpc/via/devices.fth ============================================================================== --- cpu/x86/pc/olpc/via/devices.fth Fri Nov 11 09:45:01 2011 (r2681) +++ cpu/x86/pc/olpc/via/devices.fth Mon Nov 14 01:58:24 2011 (r2682) @@ -296,6 +296,12 @@ : )flash-vulnerable ( -- ) hdd-led-off ; +: fs-vulnerable( ( -- ) + hdd-led-on +; +: )fs-vulnerable ( -- ) + hdd-led-off +; fload ${BP}/dev/olpc/spiflash/spiui.fth \ User interface for SPI FLASH programming fload ${BP}/cpu/x86/pc/olpc/via/recover.fth \ XO-to-XO SPI FLASH recovery Modified: cpu/x86/pc/olpc/via/fsupdate.fth ============================================================================== --- cpu/x86/pc/olpc/via/fsupdate.fth Fri Nov 11 09:45:01 2011 (r2681) +++ cpu/x86/pc/olpc/via/fsupdate.fth Mon Nov 14 01:58:24 2011 (r2682) @@ -67,7 +67,7 @@ also nand-commands definitions : zblocks: ( "eblock-size" "#eblocks" ... -- ) - hdd-led-toggle + fs-vulnerable( ?compare-spec-line get-hex# to /nand-block get-hex# to #image-eblocks @@ -90,7 +90,7 @@ \ Asynchronous writes " write-blocks-end" $call-nand ( error? ) " Write error" ?nand-abort - hdd-led-off + )fs-vulnerable release-inflater fexit ; Modified: dev/olpc/kb3700/eccmds.fth ============================================================================== --- dev/olpc/kb3700/eccmds.fth Fri Nov 11 09:45:01 2011 (r2681) +++ dev/olpc/kb3700/eccmds.fth Mon Nov 14 01:58:24 2011 (r2682) @@ -82,7 +82,21 @@ d# 16 cscount-max ; -: als@ ( -- w ) h# 56 ec-cmd-w@ ; +: als@ ( -- w ) h# 56 ec-cmd-w@ ; +: ols-led-on ( -- ) h# 57 ec-cmd ; +: ols-led-off ( -- ) h# 58 ec-cmd ; +: ols-assy-mode-on ( -- ) h# 59 ec-cmd ; +: ols-assy-mode-off ( -- ) h# 5a ec-cmd ; +: ols-led-ec-control ( -- ) h# 5b ec-cmd ; +: ols-off + ols-led-on + ols-led-ec-control + ols-assy-mode-on +; +: ols-on + ols-led-ec-control + ols-assy-mode-off +; : ec-min-pwr ( -- ) h# 5d ec-cmd-w@ w->n ; : ec-max-pwr ( -- ) h# 5e ec-cmd-w@ w->n ;
1
0
0
0
[commit] r2681 - cpu/x86/pc/olpc
by repository service
11 Nov '11
11 Nov '11
Author: quozl Date: Fri Nov 11 09:45:01 2011 New Revision: 2681 URL:
http://tracker.coreboot.org/trac/openfirmware/changeset/2681
Log: OLPC - fix link Modified: cpu/x86/pc/olpc/keymap.fth Modified: cpu/x86/pc/olpc/keymap.fth ============================================================================== --- cpu/x86/pc/olpc/keymap.fth Thu Nov 10 07:18:02 2011 (r2680) +++ cpu/x86/pc/olpc/keymap.fth Fri Nov 11 09:45:01 2011 (r2681) @@ -1,7 +1,7 @@ purpose: Populate keymaps from the KA manufacturing data tag \ See license at end of file -\ Per
http://wiki.laptop.org/Manufacturing_Data#Keyboard_ASCII_Map
+\ Per
http://wiki.laptop.org/go/Manufacturing_Data#Keyboard_ASCII_Map
h# 60 constant /submap
1
0
0
0
[commit] r2680 - cpu/arm/olpc/1.75
by repository service
10 Nov '11
10 Nov '11
Author: quozl Date: Thu Nov 10 07:18:02 2011 New Revision: 2680 URL:
http://tracker.coreboot.org/trac/openfirmware/changeset/2680
Log: OLPC XO-1.75 - refix #11215, regression introduced in -r2561 Modified: cpu/arm/olpc/1.75/devices.fth Modified: cpu/arm/olpc/1.75/devices.fth ============================================================================== --- cpu/arm/olpc/1.75/devices.fth Thu Nov 10 05:32:25 2011 (r2679) +++ cpu/arm/olpc/1.75/devices.fth Thu Nov 10 07:18:02 2011 (r2680) @@ -182,6 +182,7 @@ ['] ec-spi-reprogrammed to spi-reprogrammed ; : flash-vulnerable( ( -- ) + ignore-power-button hdd-led-on ; : )flash-vulnerable ( -- )
1
0
0
0
[commit] r2679 - cpu/x86/pc/olpc cpu/x86/pc/olpc/via dev
by repository service
10 Nov '11
10 Nov '11
Author: quozl Date: Thu Nov 10 05:32:25 2011 New Revision: 2679 URL:
http://tracker.coreboot.org/trac/openfirmware/changeset/2679
Log: OLPC - show RTC in banner, cache banner internal storage result, show value of RTC in test. #11424 Modified: cpu/x86/pc/olpc/banner.fth cpu/x86/pc/olpc/fw.bth cpu/x86/pc/olpc/via/banner.fth cpu/x86/pc/olpc/via/fw.bth dev/ds1385r.fth Modified: cpu/x86/pc/olpc/banner.fth ============================================================================== --- cpu/x86/pc/olpc/banner.fth Wed Nov 9 06:00:22 2011 (r2678) +++ cpu/x86/pc/olpc/banner.fth Thu Nov 10 05:32:25 2011 (r2679) @@ -27,7 +27,7 @@ : (xbanner-basics) ( -- ) ?spaces cpu-model type ." , " .memory ." , S/N " " SN" find-tag if type else ." Unknown" then cr - ?spaces .rom ." " .ec cr + ?spaces .rom ." " .ec ." " .clock ; ' (xbanner-basics) to banner-basics Modified: cpu/x86/pc/olpc/fw.bth ============================================================================== --- cpu/x86/pc/olpc/fw.bth Wed Nov 9 06:00:22 2011 (r2678) +++ cpu/x86/pc/olpc/fw.bth Thu Nov 10 05:32:25 2011 (r2679) @@ -300,6 +300,9 @@ : user-ok "ok" ; \ This is supposed to check for authorization true value user-mode? +: .clock ( -- ) + time&date .date space .time ." UTC" cr +; fload ${BP}/cpu/x86/pc/olpc/banner.fth fload ${BP}/ofw/gui/loadmenu.fth @@ -453,9 +456,6 @@ ntp-timestamp abort" Can't contact NTP server" ntp>time&date ; -: .clock ( -- ) - time&date .date space .time ." UTC" cr -; : ntp-set-clock ( -- ) ntp-time&date " set-time" clock-node @ $call-method .clock Modified: cpu/x86/pc/olpc/via/banner.fth ============================================================================== --- cpu/x86/pc/olpc/via/banner.fth Wed Nov 9 06:00:22 2011 (r2678) +++ cpu/x86/pc/olpc/via/banner.fth Thu Nov 10 05:32:25 2011 (r2679) @@ -65,7 +65,9 @@ ; : .storage ( -- ) - get-internal-disk-info ( ) + internal-disk-present? 0= if ( ) + get-internal-disk-info ( ) + then internal-disk-present? if ( ) internal-disk-size ( d.size ) d# 200,000,000. d+ ( d.size' ) \ Round up @@ -120,7 +122,7 @@ ?spaces cpu-model type ." , " .memory ." , " .storage ." , S/N " " SN" find-tag if type else ." Unknown" then cr - ?spaces .rom ." " .ec cr + ?spaces .rom ." " .ec ." " .clock check-internal-partitions ; ' (xbanner-basics) to banner-basics Modified: cpu/x86/pc/olpc/via/fw.bth ============================================================================== --- cpu/x86/pc/olpc/via/fw.bth Wed Nov 9 06:00:22 2011 (r2678) +++ cpu/x86/pc/olpc/via/fw.bth Thu Nov 10 05:32:25 2011 (r2679) @@ -311,6 +311,9 @@ : user-ok "ok" ; \ This is supposed to check for authorization true value user-mode? +: .clock ( -- ) + time&date .date space .time ." UTC" cr +; fload ${BP}/cpu/x86/pc/olpc/via/banner.fth fload ${BP}/ofw/gui/loadmenu.fth @@ -525,9 +528,6 @@ ntp-timestamp abort" Can't contact NTP server" ntp>time&date ; -: .clock ( -- ) - time&date .date space .time ." UTC" cr -; : ntp-set-clock ( -- ) ntp-time&date " set-time" clock-node @ $call-method .clock Modified: dev/ds1385r.fth ============================================================================== --- dev/ds1385r.fth Wed Nov 9 06:00:22 2011 (r2678) +++ dev/ds1385r.fth Thu Nov 10 05:32:25 2011 (r2679) @@ -157,6 +157,9 @@ open drop check-battery \ Don't display the message here because "open" will do it check-tick or + get-time .date space .time cr + get-time 2nip 2nip nip + d# 2011 < dup if ." Date in RTC is too early" cr then close ;
1
0
0
0
[commit] r2678 - cpu/arm/mmp2
by repository service
09 Nov '11
09 Nov '11
Author: wmb Date: Wed Nov 9 06:00:22 2011 New Revision: 2678 URL:
http://tracker.coreboot.org/trac/openfirmware/changeset/2678
Log: OLPC XO-1.75 - fixed high speed TWSI operation based on new information about how the registers work. Modified: cpu/arm/mmp2/twsi.fth Modified: cpu/arm/mmp2/twsi.fth ============================================================================== --- cpu/arm/mmp2/twsi.fth Tue Nov 8 20:20:58 2011 (r2677) +++ cpu/arm/mmp2/twsi.fth Wed Nov 9 06:00:22 2011 (r2678) @@ -15,11 +15,13 @@ : sr@ ( -- n ) twsi-chip h# 18 + io@ ; : sar@ ( -- n ) twsi-chip h# 20 + io@ ; : lcr@ ( -- n ) twsi-chip h# 28 + io@ ; +: wcr@ ( -- n ) twsi-chip h# 30 + io@ ; : dbr! ( n -- ) twsi-chip h# 08 + io! ; : cr! ( n -- ) twsi-chip h# 10 + io! ; : sr! ( n -- ) twsi-chip h# 18 + io! ; : sar! ( n -- ) twsi-chip h# 20 + io! ; : lcr! ( n -- ) twsi-chip h# 28 + io! ; +: wcr! ( -- n ) twsi-chip h# 30 + io! ; create channel-bases h# 011000 , h# 031000 , h# 032000 , h# 033000 , h# 033800 , h# 034000 , @@ -58,6 +60,10 @@ h# 1000 constant BBU_TWSI_TimeOut \ TWSI bus timeout loop counter value +d# 26 constant ftwsi-mhz \ +d# 1400 constant tlow-nsec \ The I2C spec calls for Tlow >= 1300 ns +ftwsi-mhz tlow-nsec d# 1000 */ constant tlow-ticks + bbu_ICR_IUE bbu_ICR_SCLE or value cr-set \ bits to maintain as set : init-twsi-channel ( channel# -- ) set-twsi-channel @@ -67,6 +73,9 @@ cr-set cr! \ Release the reset 0 sar! \ Set host slave address 0 cr! \ Disable interrupts + \ The COUNT field of TWSI_WCR establishes a minimum value for the SCL low time. + \ The minimum Tlow is the clock period * (12 + 2*COUNT) + wcr@ h# 1f invert and tlow-ticks d# 12 - 2/ or wcr! \ Setup and hold times ; : init-twsi ( -- ) 7 1 do i init-twsi-channel loop @@ -177,25 +186,25 @@ twsi-out ; -: set-bus-standard cr-set h# fffe7fff and to cr-set ; -: set-bus-fast cr-set h# fffe7fff and h# 8000 or to cr-set ; -\ The dividends below (12,600,000 and 11,600,000) are chosen to give the -\ same values that the LCR defaults to for the data rates 100,000 and 400,000 -\ The TWSI input clock is the 26 MHz VCXO, and the divided value generates -\ both the low phase and the high phase, so you would think that the dividend -\ should be 13,000,000 (half of 26M), but that doesn't give the right result. -\ Perhaps there is an additive factor in the divisor; the manual is quite vague. +: set-bus-standard cr-set h# 18000 invert and to cr-set ; +: set-bus-fast cr-set h# 18000 invert and h# 8000 or to cr-set ; + : set-bus-speed ( hz -- ) \ Useful range is 25K .. 400K - 100K and 400K are typical child-address set-twsi-target ( hz ) - dup d# 100,000 <= if ( hz ) - set-bus-standard ( hz ) - d# 12,600,000 swap / h# 1ff min h# 7e max ( divisor ) + ftwsi-mhz d# 1,000,000 2 pick */ ( hz ticks ) + swap d# 100,000 <= if ( ticks ) + \ In slow mode, Thi = Tclk * (8+slv), Tlow = Tclk * (1+slv) + 9 - 2/ 1+ ( slv ) lcr@ h# 1ff invert and or lcr! ( ) - else ( hz ) - set-bus-fast ( hz ) - d# 11,600,000 swap / h# 1ff min h# 1d max ( divisor ) - lcr@ h# 3.fe00 invert and swap 9 lshift or lcr! ( ) + set-bus-standard ( ) + else ( ticks ) + \ (The information below is poorly documented and was determined empirically) + \ In fast mode, Thi = Tclk * (10+flv), Tlo = Tclk * max(1+flv, tlow_ticks)) + dup d# 11 - 2/ 1+ tlow-ticks max ( ticks ticks-low ) + - d# 10 - ( flv ) + 9 lshift lcr@ h# 3.fe00 invert and or lcr! ( ) + set-bus-fast ( ) then ( ) ; : decode-unit ( adr len -- low high ) parse-2int ;
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