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] r2535 - cpu/arm/mmp2
by repository service
24 Sep '11
24 Sep '11
Author: wmb Date: Sat Sep 24 02:38:55 2011 New Revision: 2535 URL:
http://tracker.coreboot.org/trac/openfirmware/changeset/2535
Log: OLPC XO-1.75 - Suspend/resume code - delay before unblocking RAM accesses, and record resume progress in a breadcrumb register you can view from CForth. Modified: cpu/arm/mmp2/dramrecal.fth Modified: cpu/arm/mmp2/dramrecal.fth ============================================================================== --- cpu/arm/mmp2/dramrecal.fth Sat Sep 24 02:36:27 2011 (r2534) +++ cpu/arm/mmp2/dramrecal.fth Sat Sep 24 02:38:55 2011 (r2535) @@ -46,7 +46,7 @@ \ ZQ calibration long takes 512 memory clock cycles after a reset \ At 400 MHz, that's a little more than 2 us. We spin here to \ ensure that the recal is complete before we touch the DRAM again. - mov r1, #0x100000 \ 512K spins, takes about 2.6 us + mov r1, #0x20 \ 32 spins, takes about 4 uS (from SRAM) begin decs r1, #1 0= until @@ -61,7 +61,7 @@ label ddr-self-refresh ( r0:memctrl-va -- ) dsb mcr p15,0,r0,cr8,cr5,0 \ Invalidate TLB - mcr p15,0,r0,cr7,cr10,4 \ Write data synchronization barrier +\ mcr p15,0,r0,cr7,cr10,4 \ Write data synchronization barrier mov r1, #0x1 \ Block all data requests str r1, [r0, #0x7e0] \ SDRAM_CTRL14 @@ -85,8 +85,7 @@ bic r1,r1,#0x07700000 \ PHY_ADCM_ZPDRV: 0 PHY_ADCM_ZNDRV: 0 (Disable drivers 6:0) str r1, [r0, #0x1e0] \ PHY_CTRL8 -\ mov r1, #0x00070000 \ PHY_SYNC_EN -\ str r1, [r0, #0x110] \ MMAP_CS1 + mov r1, #0x80000 str r1, [r0, #0x110] \ MMAP1 - breadcrumb dsb \ Data Synchronization Barrier wfi \ Wait for interrupt @@ -130,9 +129,19 @@ \ orr r1, r1, #0x80 \ Exit Self Refresh value \ str r1, [r0, #0x120] \ USER_INITIATED_COMMAND0 + mov r1, #0x100 \ 256 spins, takes about 32 uS (from SRAM) + begin + decs r1,#1 + 0= until + mov r1, #0x0 \ Unblock data requests str r1, [r0, #0x7e0] \ SDRAM_CTRL14 + dsb + mcr p15,0,r0,cr8,cr5,0 \ Invalidate TLB + + mov r1, #0x80000 str r1, [r0, #0x110] \ MMAP1 - breadcrumb + mov pc, lr end-code here ddr-self-refresh - constant /ddr-self-refresh @@ -167,11 +176,14 @@ \ Call this from OFW to enter self-refresh code do-self-refresh ( -- ) set r0,`memctrl-va #` \ Memory controller virtual address + set r1,`'ddr-self-refresh #` \ Address of ddr-self-refresh routine in SRAM mov r7,sp set sp,`'ddr-self-refresh-sp #` mov lr,pc mov pc,r1 + + mov r1,#0x90000 str r1,[r0,#0x110] \ MMAP1 - breadcrumb mov sp,r7 c; @@ -446,7 +458,7 @@ : .fiq ( -- ) h# 304 icu@ if ." FIQ is masked off" cr then - h# 300 icu@ dup h# 40 and if ." FIQ selected INT" h# 3f and .d cr else drop then + h# 300 icu@ dup h# 40 and if ." FIQ selected INT: " h# 3f and .d cr else drop then h# 310 icu@ h# 314 icu@ 2dup d0= if ( d ) 2drop ( ) else ( d ) @@ -601,6 +613,8 @@ h# 2900cc io@ 1 invert and h# 2900cc io! \ Unmask the communications interrupt ; +: breadcrumb ( n -- ) h# d000.0110 l! ; + 0 value save-apcr 0 value save-idlecfg @@ -773,25 +787,40 @@ disable-clks + hdd-led-off + \ begin mmp2_cpu_do_idle() block-irqs ( ) \ Block IRQs - will be cleared by PMU do-self-refresh ( ) + hdd-led-on + h# a0000 breadcrumb + restore-run-state \ end mmp2_cpu_do_idle() + h# b0000 breadcrumb + enable-clks + h# c0000 breadcrumb + power-islands-on \ mmp2_cpu_enable_l2(0); \ idle_cfg &= (~PMUA_MOH_SRAM_PWRDWN); stdin-idle-on + + h# d0000 breadcrumb screen-on timers-on + h# e0000 breadcrumb enable-interrupts + h# f0000 breadcrumb + hdd-led-off ; +: strp ( -- ) ec-rst-pwr str ec-max-pwr .d ." mW " ; \ LICENSE_BEGIN \ Copyright (c) 2011 FirmWorks
1
0
0
0
[commit] r2534 - cpu/arm dev/olpc/kb3700
by repository service
24 Sep '11
24 Sep '11
Author: wmb Date: Sat Sep 24 02:36:27 2011 New Revision: 2534 URL:
http://tracker.coreboot.org/trac/openfirmware/changeset/2534
Log: OLPC XO-1.75 - Added EC commands ec-rst-pwr, ec-min-pwr, ec-max-pwr , used for power measurement during suspend. Modified: cpu/arm/extra.fth dev/olpc/kb3700/eccmds.fth Modified: cpu/arm/extra.fth ============================================================================== --- cpu/arm/extra.fth Fri Sep 23 23:53:29 2011 (r2533) +++ cpu/arm/extra.fth Sat Sep 24 02:36:27 2011 (r2534) @@ -91,6 +91,7 @@ code n->a ( n -- a ) c; code l->w ( l -- w ) mov tos,tos,lsl #16 mov tos,tos,lsr #16 c; code n->w ( n -- w ) mov tos,tos,lsl #16 mov tos,tos,lsr #16 c; +code w->n ( n -- w ) mov tos,tos,lsl #16 mov tos,tos,asr #16 c; \ Sign extend code l>r ( l -- ) psh tos,rp pop tos,sp c; code lr> ( -- l ) psh tos,sp pop tos,rp c; Modified: dev/olpc/kb3700/eccmds.fth ============================================================================== --- dev/olpc/kb3700/eccmds.fth Fri Sep 23 23:53:29 2011 (r2533) +++ dev/olpc/kb3700/eccmds.fth Sat Sep 24 02:36:27 2011 (r2534) @@ -84,6 +84,11 @@ : als@ ( -- w ) h# 56 ec-cmd-w@ ; +: ec-min-pwr ( -- ) h# 5d ec-cmd-w@ w->n ; +: ec-max-pwr ( -- ) h# 5e ec-cmd-w@ w->n ; +: ec-rst-pwr ( -- ) h# 5f ec-cmd ; + + [ifdef] notdef \ These commands are awaiting documentation on their interfaces #define CMD_READ_EXT_SCI_MASK 0x37 #define CMD_WRITE_EXT_SCI_MASK 0x38
1
0
0
0
[commit] r2533 - ofw/wifi
by repository service
23 Sep '11
23 Sep '11
Author: wmb Date: Fri Sep 23 23:53:29 2011 New Revision: 2533 URL:
http://tracker.coreboot.org/trac/openfirmware/changeset/2533
Log: Wifi - fixed silly bug in $wep - now 13-byte keys work. Modified: ofw/wifi/wifi-cfg.fth Modified: ofw/wifi/wifi-cfg.fth ============================================================================== --- ofw/wifi/wifi-cfg.fth Fri Sep 23 07:16:50 2011 (r2532) +++ ofw/wifi/wifi-cfg.fth Fri Sep 23 23:53:29 2011 (r2533) @@ -81,7 +81,7 @@ \ expressed either in straight ASCII or in hexadecimal. In hex, the \ length is either 10 or 26 bytes, which converts to 5 or 13 ASCII bytes. : $wep ( wep$ -- ) - dup d# 10 = over d# 26 = if ( wep$ ) + dup d# 10 = over d# 26 = or if ( wep$ ) decode-hex ( wep$' ) else ( wep$ ) dup 5 <> over d# 13 <> and abort" WEP key must be 5 or 13 ASCII characters or 10 or 26 hex digits"
1
0
0
0
[commit] r2532 - cpu/arm/olpc/1.75
by repository service
23 Sep '11
23 Sep '11
Author: quozl Date: Fri Sep 23 07:16:50 2011 New Revision: 2532 URL:
http://tracker.coreboot.org/trac/openfirmware/changeset/2532
Log: Q4B10 Modified: cpu/arm/olpc/1.75/fw-version.fth Modified: cpu/arm/olpc/1.75/fw-version.fth ============================================================================== --- cpu/arm/olpc/1.75/fw-version.fth Fri Sep 23 07:03:22 2011 (r2531) +++ cpu/arm/olpc/1.75/fw-version.fth Fri Sep 23 07:16:50 2011 (r2532) @@ -1,3 +1,3 @@ \ The overall firmware revision macro: FW_MAJOR B -macro: FW_MINOR 09jg +macro: FW_MINOR 10
1
0
0
0
[commit] r2531 - cpu/arm/olpc/1.75
by repository service
23 Sep '11
23 Sep '11
Author: wmb Date: Fri Sep 23 07:03:22 2011 New Revision: 2531 URL:
http://tracker.coreboot.org/trac/openfirmware/changeset/2531
Log: OLPC XO-1.75 - EC version 4.2.04 Modified: cpu/arm/olpc/1.75/ec-version.fth Modified: cpu/arm/olpc/1.75/ec-version.fth ============================================================================== --- cpu/arm/olpc/1.75/ec-version.fth Fri Sep 23 07:02:24 2011 (r2530) +++ cpu/arm/olpc/1.75/ec-version.fth Fri Sep 23 07:03:22 2011 (r2531) @@ -1,7 +1,8 @@ \ The EC microcode -macro: EC_VERSION 4_0_2_03 +macro: EC_VERSION 4_0_2_04 \ Alternate command for getting EC microcode, for testing new versions. \ Temporarily uncomment the line and modify the path as necessary \ macro: GET_EC cp ~rsmith/olpc/ec/ec-code15/image/ecimage.bin ec.img \ macro: GET_EC wget -q
http://dev.laptop.org/pub/ec/ec_test.img
-O ec.img +\ macro: GET_EC cp no_event.bin ec.img
1
0
0
0
[commit] r2530 - cpu/arm/olpc/1.75
by repository service
23 Sep '11
23 Sep '11
Author: wmb Date: Fri Sep 23 07:02:24 2011 New Revision: 2530 URL:
http://tracker.coreboot.org/trac/openfirmware/changeset/2530
Log: OLPC XO-1.75 - different IP address for convenience function "newrom". Modified: cpu/arm/olpc/1.75/fw.bth Modified: cpu/arm/olpc/1.75/fw.bth ============================================================================== --- cpu/arm/olpc/1.75/fw.bth Fri Sep 23 07:01:37 2011 (r2529) +++ cpu/arm/olpc/1.75/fw.bth Fri Sep 23 07:02:24 2011 (r2530) @@ -529,10 +529,10 @@ ; : newrom - " flash! http:\\10.20.0.14\new.rom" eval + " flash! http:\\192.168.200.200\new.rom" eval ; : newec - " flash-ec http:\\10.20.0.14\ecimage.bin" eval + " flash-ec http:\\192.168.200.200\ecimage.bin" eval ; : qz " qz" $essid " http:\\qz\" included \ qa test bed scripting, james cameron
1
0
0
0
[commit] r2529 - cpu/x86/pc/olpc
by repository service
23 Sep '11
23 Sep '11
Author: wmb Date: Fri Sep 23 07:01:37 2011 New Revision: 2529 URL:
http://tracker.coreboot.org/trac/openfirmware/changeset/2529
Log: OLPC security - added require-signatures? value for unsigned booting. Modified: cpu/x86/pc/olpc/security.fth Modified: cpu/x86/pc/olpc/security.fth ============================================================================== --- cpu/x86/pc/olpc/security.fth Fri Sep 23 07:00:36 2011 (r2528) +++ cpu/x86/pc/olpc/security.fth Fri Sep 23 07:01:37 2011 (r2529) @@ -603,8 +603,11 @@ 2drop false ( good? ) ; +true value require-signatures? + \ Find a sig0N: line and check its sha256/rsa signature : sha-valid? ( data$ sig$ -- okay? ) + require-signatures? 0= if 4drop true exit then ( data$ sig$ ) next-sig-in-list$ if 2drop false exit then ( data$ rem$ sig$ ) 2nip " sha256" signature-good? ; @@ -612,6 +615,7 @@ \ Find two sig0N: lines, the first with sha256 and the second with rmd160, \ and check their signatures : fw-valid? ( data$ sig$ -- okay? ) + require-signatures? 0= if 4drop true exit then ( data$ sig$ ) 2swap 2>r ( sig$ r: data$ ) next-sig-in-list$ if 2r> 2drop false exit then ( rem$ sig$ ) 2r@ 2swap sha-valid? 0= if ( rem$ r: data$ ) @@ -737,17 +741,22 @@ \ like "runos.zip" (the normal OS, used when an valid lease is \ present) or "actos.zip" (the activation version of the OS). +: use-run ( -- ) " run" cn-buf place ; +: use-act ( -- ) " act" cn-buf place ; : ?leased ( -- ) - " ak" find-tag if - 2drop " run" - else - rtc-rollback? if - " act" + require-signatures? if + " ak" find-tag if + 2drop use-run else - lease-valid? if " run" else " act" then + rtc-rollback? if + use-act + else + lease-valid? if use-run else use-act then + then then + else + use-run then - cn-buf place ; : set-alternate ( -- ) @@ -1208,11 +1217,13 @@ filesystem-present? if ( list$ ) show-dot ( list$ ) - has-developer-key? if ( list$ ) - 2drop ( ) - true to security-off? - show-unlock - true exit + require-signatures? if ( list$ ) + has-developer-key? if ( list$ ) + 2drop ( ) + true to security-off? + show-unlock + true exit + then ( list$ ) then ( list$ ) load-from-device if ( list$ )
1
0
0
0
[commit] r2528 - ofw/wifi
by repository service
23 Sep '11
23 Sep '11
Author: wmb Date: Fri Sep 23 07:00:36 2011 New Revision: 2528 URL:
http://tracker.coreboot.org/trac/openfirmware/changeset/2528
Log: Wifi - improved user interface for WPA authentication. Modified: ofw/wifi/eapol.fth ofw/wifi/wifi-cfg.fth Modified: ofw/wifi/eapol.fth ============================================================================== --- ofw/wifi/eapol.fth Fri Sep 23 06:59:53 2011 (r2527) +++ ofw/wifi/eapol.fth Fri Sep 23 07:00:36 2011 (r2528) @@ -699,8 +699,24 @@ ; : pmk-ok? ( -- flag ) - wifi-pmk$ nip d# 32 = - atype at-preshared = and + atype at-preshared <> if false exit then + + \ If necessary, compute the PMK (pairwise master key) from the PSK (pre-shared key) + \ The PSK is the user-visible password, whereas the PMK is a hash of the PSK and + \ the SSID which is used in the key exchange. + wifi-pmk$ nip case ( length ) + 0 of ( ) + wifi-psk$ wifi-ssid$ pad d# 32 pbkdf2-sha1 ( ) + pad d# 32 $pmk ( ) + true ( okay? ) + endof + + d# 32 of + true ( okay? ) + endof + + ( default ) false swap + endcase ( okay? ) ; : key-ok? ( -- ok? ) Modified: ofw/wifi/wifi-cfg.fth ============================================================================== --- ofw/wifi/wifi-cfg.fth Fri Sep 23 06:59:53 2011 (r2527) +++ ofw/wifi/wifi-cfg.fth Fri Sep 23 07:00:36 2011 (r2528) @@ -12,6 +12,7 @@ /n field >wc-wep3 \ pstr (binary, len=5 or 13) /n field >wc-wep4 \ pstr (binary, len=5 or 13) /n field >wc-pmk \ pstr (binary, len=32) + /n field >wc-psk \ pstr (ASCII, arbitrary length) constant /wifi-cfg /wifi-cfg buffer: ram-wifi-cfg @@ -35,12 +36,22 @@ : pstr@ ( src -- adr len ) @ ?dup if count else " " then ; : wifi-ssid$ ( -- $ ) wifi-cfg >wc-ssid pstr@ ; : wifi-pmk$ ( -- $ ) wifi-cfg >wc-pmk pstr@ ; +: wifi-psk$ ( -- $ ) wifi-cfg >wc-psk pstr@ ; : wifi-wep1$ ( -- $ ) wifi-cfg >wc-wep1 pstr@ ; : wifi-wep2$ ( -- $ ) wifi-cfg >wc-wep2 pstr@ ; : wifi-wep3$ ( -- $ ) wifi-cfg >wc-wep3 pstr@ ; : wifi-wep4$ ( -- $ ) wifi-cfg >wc-wep4 pstr@ ; : wifi-wep-idx ( -- n ) wifi-cfg >wc-wep-idx @ 1- 0 max 4 min ; +\ The PMK is used internally, rarely entered directly +\ Computing it from the user-visible PSK is relatively expensive, so +\ we store the value for later reuse. The supplicant package calls $pmk +\ to store the computed value in the wifi-cfg data structure. +: $pmk ( pmk$ -- ) + dup d# 32 <> abort" PMK must be 32 bytes" + wifi-cfg >wc-pmk pstr! ( ) +; + defer default-ssids ( -- $ ) ' null$ to default-ssids 0 value ssid-reset? @@ -53,19 +64,6 @@ ['] null$ to default-ssids ; -: $wep ( wep$ -- ) - dup 5 <> over d# 13 <> and abort" WEP key must be 5 or 13 bytes" - wifi-cfg >wc-wep-idx dup @ ( wep$ adr idx ) - dup 4 >= abort" Too many WEP keys" ( wep$ adr idx ) - 2dup 1+ swap ! ( wep$ adr idx ) - 2* na+ na1+ pstr! ( ) -; - -: $pmk ( pmk$ -- ) - dup d# 32 <> abort" PMK must be 32 bytes" - wifi-cfg >wc-pmk pstr! ( ) -; - \ Stores the result at here : decode-hex ( hex$ -- bin$ ) here >r @@ -79,12 +77,30 @@ r> here over - ( bin-adr bin-len ) ; +\ WEP keys are fundamentally either 5 or 13 bytes long, but they can be +\ expressed either in straight ASCII or in hexadecimal. In hex, the +\ length is either 10 or 26 bytes, which converts to 5 or 13 ASCII bytes. +: $wep ( wep$ -- ) + dup d# 10 = over d# 26 = if ( wep$ ) + decode-hex ( wep$' ) + else ( wep$ ) + dup 5 <> over d# 13 <> and abort" WEP key must be 5 or 13 ASCII characters or 10 or 26 hex digits" + then ( wep$ ) + + wifi-cfg >wc-wep-idx dup @ ( wep$ adr idx ) + dup 4 >= abort" Too many WEP keys" ( wep$ adr idx ) + 2dup 1+ swap ! ( wep$ adr idx ) + 2* na+ na1+ pstr! ( ) +; + +: $wpa ( psk$ -- ) wifi-cfg >wc-psk pstr! ; + : essid ( "ssid" -- ) 0 parse $essid ; alias wifi essid alias ssid essid -: wep ( "wep" -- ) parse-word decode-hex $wep ; -: pmk ( "pmk" -- ) parse-word decode-hex $pmk ; +: wep ( "wep" -- ) parse-word $wep ; +: wpa ( "psk" -- ) parse-word $wpa ; \ ===================================================================== \ Scan wireless networks
1
0
0
0
[commit] r2527 - cpu/arm/mmp2 dev/olpc/dcon
by repository service
23 Sep '11
23 Sep '11
Author: wmb Date: Fri Sep 23 06:59:53 2011 New Revision: 2527 URL:
http://tracker.coreboot.org/trac/openfirmware/changeset/2527
Log: OLPC XO-1.75 - Stabilizing suspend/resume. Modified: cpu/arm/mmp2/dramrecal.fth cpu/arm/mmp2/rtc.fth dev/olpc/dcon/mmp2dcon.fth Modified: cpu/arm/mmp2/dramrecal.fth ============================================================================== --- cpu/arm/mmp2/dramrecal.fth Fri Sep 23 00:42:26 2011 (r2526) +++ cpu/arm/mmp2/dramrecal.fth Fri Sep 23 06:59:53 2011 (r2527) @@ -59,6 +59,10 @@ here ddr-recal - constant /ddr-recal label ddr-self-refresh ( r0:memctrl-va -- ) + dsb + mcr p15,0,r0,cr8,cr5,0 \ Invalidate TLB + mcr p15,0,r0,cr7,cr10,4 \ Write data synchronization barrier + mov r1, #0x1 \ Block all data requests str r1, [r0, #0x7e0] \ SDRAM_CTRL14 @@ -73,14 +77,17 @@ \ str r1, [r0, #0x770] \ SDRAM_CTRL7_SDRAM_ODT_CTRL2 \ Store registers in SRAM so CForth can see them, for debugging -\ set r2, #0xd102.0400 -\ stmia r2, {r0-r15} + set r2, #0xd102.0400 + stmia r2, {r0-r15} \ Linux sets the register to 0x860 ldr r1, [r0, #0x1e0] \ PHY_CTRL8 bic r1,r1,#0x07700000 \ PHY_ADCM_ZPDRV: 0 PHY_ADCM_ZNDRV: 0 (Disable drivers 6:0) str r1, [r0, #0x1e0] \ PHY_CTRL8 +\ mov r1, #0x00070000 \ PHY_SYNC_EN +\ str r1, [r0, #0x110] \ MMAP_CS1 + dsb \ Data Synchronization Barrier wfi \ Wait for interrupt @@ -295,13 +302,305 @@ \ WAKEUP6: SDH1_CD, SDH3_CD, MSP_INS \ WAKEUP7: PMIC INT 5 value sleep-depth -: setup-wakeup-sources ( -- mask ) - h# 0002.0094 h# 4c mpmu! \ RTC_ALARM, WAKEUP7, WAKEUP4, WAKEUP2 -\ h# 0002.0094 h# 104c mpmu! \ RTC_ALARM, WAKEUP7, WAKEUP4, WAKEUP2 ??? +: setup-wakeup-sources ( -- mask ) +\ h# 0002.0094 h# 4c mpmu! \ RTC_ALARM, WAKEUP7, WAKEUP4, WAKEUP2 +\ h# 0002.0094 h# 104c mpmu! \ RTC_ALARM, WAKEUP7, WAKEUP4, WAKEUP2 h# ff08.7fff ( mask ) \ Enable all wakeup ports ; : block-irqs ( -- ) 1 h# 110 +icu io! ; +\ XXX we might need to set GPIOs 71 and 160 (ps2 clocks), and perhaps the dat lines too, +\ for non-sleep-mode control - or maybe for sleep mode control as inputs. +\ We also may need to enable falling edge detects. +: disable-int40 ( -- ) d# 40 disable-interrupt ; + +: gpio-wakeup? ( gpio# -- flag ) + h# 019800 over 5 rshift la+ l@ ( gpio# mask ) + swap h# 1f and ( mask bit# ) + 1 swap lshift and 0<> ( flag ) +; + +: icu@ ( offset -- value ) h# 28.2000 + io@ ; +: .masked ( irq# -- ) + dup /l* h# 10c + icu@ ( irq# masked ) + 1 and if ( irq# ) + ." IRQ" .d ." is masked off" cr + else ( irq# ) + drop ( ) + then ( ) +; +: .selected ( irq# -- ) + dup /l* h# 100 + icu@ ( irq# n ) + dup h# 40 and if ( irq# n ) + ." IRQ" swap .d ( n ) + ." selected INT" h# 3f and .d cr ( ) + else ( irq# n ) + 2drop ( ) + then ( ) +; +: (.pending) ( d -- ) + ." pending INTs: " ( d ) + d# 64 0 do ( d ) + over 1 and if i .d then ( d ) + d2/ ( d' ) + loop ( d ) + 2drop ( ) +; +: .pending ( irq# -- ) + dup 2* /l* h# 130 + dup icu@ swap la1+ icu@ ( irq# d ) + 2dup d0= if ( irq# d ) + 3drop ( ) + else ( irq# d ) + ." IRQ " rot .d (.pending) cr ( ) + then ( ) +; + +: bit? ( n bit# -- n flag ) 1 swap lshift over and 0<> ; +: .ifbit ( n bit# msg$ -- n ) + 2>r bit? if ( n r: msg$ ) + 2r> type space ( n ) + else ( n r: msg$ ) + 2r> 2drop ( n ) + then ( n ) +; +: .enabled-ints ( -- ) + d# 64 0 do ( ) + i /l* icu@ dup h# 70 and if ( n ) + ." INT" i .d ." -> IRQ" ( n ) + 4 " 0" .ifbit ( n ) + 5 " 1" .ifbit ( n ) + 6 " 2" .ifbit ( n ) + ." Pri " h# f and .d cr ( ) + else ( n ) + drop ( ) + then ( ) + loop ( ) +; +: .int4 ( -- ) + ." INT4 - mask " h# 168 icu@ .x + ." status " h# 150 icu@ dup .x + 0 " USB " .ifbit + 1 " PMIC" .ifbit + drop cr +; +: .int5 ( -- ) + ." INT5 - mask " h# 16c icu@ .x + ." status " h# 154 icu@ dup .x + 0 " RTC " .ifbit + 1 " RTC_Alarm" .ifbit + drop cr +; +: .int9 ( -- ) + ." INT9 - mask " h# 17c icu@ .x + ." status " h# 180 icu@ dup .x + 0 " Keypad " .ifbit + 1 " Rotary " .ifbit + 2 " Trackball" .ifbit + drop cr +; +: .int17 ( -- ) + ." INT17 - mask " h# 170 icu@ .x + ." status " h# 158 icu@ dup .x ( n ) + 7 2 do ( n ) + dup 1 and if ( n ) + ." TWSI" i .d ( n ) + then ( n ) + u2/ ( n' ) + loop ( n ) + drop cr ( ) +; +: .int35 ( -- ) + ." INT5 - mask " h# 174 icu@ .x + ." status " h# 15c icu@ dup .x + d# 0 " PJ_PerfMon" .ifbit + d# 1 " L2_PA_ECC" .ifbit + d# 2 " L2_ECC" .ifbit + d# 3 " L2_UECC" .ifbit + d# 4 " DDR" .ifbit + d# 5 " Fabric0" .ifbit + d# 6 " Fabric1" .ifbit + d# 7 " Fabric2" .ifbit + d# 9 " Thermal" .ifbit + d# 10 " MainPMU" .ifbit + d# 11 " WDT2" .ifbit + d# 12 " CoreSight" .ifbit + d# 13 " PJ_Commtx" .ifbit + d# 14 " PJ_Commrx" .ifbit + drop + cr +; +: .int51 ( -- ) + ." INT51 - mask " h# 178 icu@ .x + ." status " h# 160 icu@ dup .x + 0 " HSI_CAWAKE1 " .ifbit + 1 " MIPI_HSI1" .ifbit + drop cr +; +: .int55 ( -- ) + ." INT55 - mask " h# 184 icu@ .x + ." status " h# 188 icu@ dup .x + 0 " HSI_CAWAKE0 " .ifbit + 1 " MIPI_HSI0" .ifbit + drop cr +; + +: .fiq ( -- ) + h# 304 icu@ if ." FIQ is masked off" cr then + h# 300 icu@ dup h# 40 and if ." FIQ selected INT" h# 3f and .d cr else drop then + h# 310 icu@ h# 314 icu@ 2dup d0= if ( d ) + 2drop ( ) + else ( d ) + ." FIQ " (.pending) cr ( ) + then ( ) +; + +: .icu ( -- ) + .enabled-ints + 3 0 do i .masked i .selected i .pending loop + \ XXX should handle DMA interrupts too + .fiq + .int4 .int5 .int9 .int17 .int35 .int51 .int55 +; +string-array wakeup-bit-names + ," WU0 " + ," WU1 " + ," WU2 " + ," WU3 " + ," WU4 " + ," WU5 " + ," WU6 " + ," WU7 " + ," TIMER_1_1 " + ," TIMER_1_2 " + ," TIMER_1_3 " + ," MSP_INS " + ," AUDIO " + ," WDT1 " + ," TIMER_2_1 " + ," TIMER_2_2 " + ," TIMER_2_3 " + ," RTC_ALARM " + ," WDT2 " + ," ROTARY " + ," TRACKBALL " + ," KEYPRESS " + ," SDH3_CARD " + ," SDH1_CARD " + ," FULL_IDLE " + ," ASYNC_INT " + ," SSP1_SRDY " + ," CAWAKE " + ," resv28 " + ," SSP3_SRDY " + ," ALL_WU " + ," resv31 " +end-string-array + +string-array wakeup-mask-names + ," WU0 " + ," WU1 " + ," WU2 " + ," WU3 " + ," WU4 " + ," WU5 " + ," WU6 " + ," WU7 " + ," TIMER_1_1 " + ," TIMER_1_2 " + ," TIMER_1_3 " + ," " + ," " + ," " + ," TIMER_2_1 " + ," TIMER_2_2 " + ," TIMER_2_3 " + ," RTC_ALARM " + ," WDT2 " + ," ROTARY " + ," TRACKBALL " + ," KEYPRESS " + ," SDH3_CARD " + ," SDH1_CARD " + ," FULL_IDLE " + ," ASYNC_INT " + ," WDT1 " + ," SSP3_SRDY " + ," SSP1_SRDY " + ," CAWAKE " + ," MSP_INS " + ," resv31 " +end-string-array + +: .active-wakeups ( -- ) + ." Wakeups: " + h# 1048 mpmu@ ( n ) + d# 31 0 do ( n ) + dup 1 and if i wakeup-bit-names count type then ( n ) + u2/ ( n' ) + loop ( n ) + drop cr ( ) +; +: .wakeup-mask ( -- ) + ." Enabled wakeups: " + h# 4c mpmu@ h# 104c or ( n ) + d# 31 0 do ( n ) + dup 1 and if i wakeup-mask-names count type then ( n ) + u2/ ( n' ) + loop ( n ) + drop cr ( ) +; +: .edges ( -- ) + ." Wakeup edges: " ( ) + d# 6 0 do ( ) + h# 19800 i la+ io@ ( n ) + d# 32 0 do ( n ) + dup 1 and if ( n ) + j d# 32 * i + .d ( n ) + then ( n ) + u2/ ( n' ) + loop ( n ) + drop ( ) + loop ( ) + cr ( ) +; +: .edge-enables ( -- ) + ." Enabled edges: " + d# 160 0 do + i af@ dup h# 70 and h# 40 <> if ( n ) + dup h# 10 and if ." R" then ( n ) + dup h# 20 and if ." F" then ( n ) + dup h# 40 and if ." C" then ( n ) + i .d ( n ) + then ( n ) + drop ( ) + loop +; +: .wakeup ( -- ) .active-wakeups .wakeup-mask .edges .edge-enables ; + +: .irqstat ( -- ) h# 148 h# 130 do i icu@ . 4 +loop ; +\ !!! The problem right now is that I have woken from keyboard, but the interrupt is still asserted +\ So perhaps the interrupt handler didn't fire +: rotate-wakeup? ( -- flag ) d# 15 gpio-wakeup? ; +: kbd-wakeup? ( -- flag ) d# 71 gpio-wakeup? ; +: tpd-wakeup? ( -- flag ) d# 160 gpio-wakeup? ; +\ We need to do this in the SP interrupt handler +: clear-wakeup ( gpio# -- ) + dup af@ ( gpio# value ) + 2dup h# 40 or swap af! ( gpio# value ) + swap af! +; +\ How to wakeup from SP: +: setup-key-wakeup ( -- ) + d# 24 d# 16 do h# b1 i af! loop \ Wake SP on game keys + h# b0 d# 15 af! \ Wake SP on rotate key + h# 220 d# 71 af! \ Wake SP on KBD CLK falling edge + h# 221 d# 160 af! \ Wake SP on TPD CLK falling edge + h# 4c mpmu@ h# 20.0000 or h# 4c mpmu! \ Keypress wakes SP + ['] disable-int40 d# 40 interrupt-handler! + d# 40 enable-interrupt \ SP to PJ4 communications interrupt + h# 2900cc io@ 1 invert and h# 2900cc io! \ Unmask the communications interrupt +; + 0 value save-apcr 0 value save-idlecfg @@ -404,6 +703,8 @@ " dcon-suspend" $call-screen then " suspend" $call-screen + " set-ack" $call-ec + \ 0 h# 54 pmua! \ Kill the SDIO 0 clocks - insignificant savings \ 0 h# 58 pmua! \ Kill the SDIO 1 clocks - insignificant savings sleep-mask 2 and 0= if keyboard-power-off then \ Should save about 17 mW @@ -412,6 +713,7 @@ : screen-on ( -- ) sleep-mask 4 and 0= if wlan-power-on then sleep-mask 2 and 0= if keyboard-power-on then + " clr-ack" $call-ec " resume" $call-screen sleep-mask 1 and if \ DCON power up dcon-unfreeze Modified: cpu/arm/mmp2/rtc.fth ============================================================================== --- cpu/arm/mmp2/rtc.fth Fri Sep 23 00:42:26 2011 (r2526) +++ cpu/arm/mmp2/rtc.fth Fri Sep 23 06:59:53 2011 (r2527) @@ -15,10 +15,13 @@ ; : soc-rtc@ ( offset -- value ) h# 01.0000 + io@ ; : soc-rtc! ( value offset -- value ) h# 01.0000 + io! ; +: cancel-alarm ( -- ) + 0 8 soc-rtc! + int5-mask@ 1 or int5-mask! \ Mask alarm +; : take-alarm ( -- ) ." Alarm fired" cr - 0 8 soc-rtc! - int5-mask@ 1 or int5-mask! \ Mask alarm + cancel-alarm ; : alarm-in-3 ( -- ) enable-rtc \ Turn on clocks @@ -30,3 +33,79 @@ ['] take-alarm 5 interrupt-handler! 5 enable-interrupt ; +: alarm-in-1 ( -- ) + enable-rtc \ Turn on clocks + + int5-mask@ 1 invert and int5-mask! \ Unmask alarm + enable-rtc-wakeup + 0 soc-rtc@ d# 1 + 4 soc-rtc! \ Set alarm for 3 seconds from now + 7 8 soc-rtc! \ Ack old interrupts and enable new ones + ['] cancel-alarm 5 interrupt-handler! + 5 enable-interrupt +; +: wake1 ( -- ) + enable-rtc \ Turn on clocks + + int5-mask@ 1 invert and int5-mask! \ Unmask alarm + enable-rtc-wakeup + 0 soc-rtc@ d# 1 + 4 soc-rtc! \ Set alarm for 3 seconds from now + 7 8 soc-rtc! \ Ack old interrupts and enable new ones + ['] cancel-alarm 5 interrupt-handler! + 5 enable-interrupt +; +: alarm1 ( -- ) + enable-rtc \ Turn on clocks + + int5-mask@ 1 invert and int5-mask! \ Unmask alarm + enable-rtc-wakeup + 0 soc-rtc@ d# 1 + 4 soc-rtc! \ Set alarm for 3 seconds from now + 7 8 soc-rtc! \ Ack old interrupts and enable new ones + ['] take-alarm 5 interrupt-handler! + 5 enable-interrupt +; +: test1 + 0 + begin + alarm1 + str + (cr dup . 1+ + d# 500 ms + key? until +; +: test2 + 0 + begin + wake1 + str + (cr dup . 1+ + d# 500 ms + key? until +; +: test3 + 0 + begin + wake1 + str + cr dup . 1+ + d# 500 ms + key? until +; +: test4 + begin + 0 d# 13 at-xy + 5 0 do + wake1 str + cr i . + d# 500 ms + key? if unloop exit then + loop + again +; + +\ test3 +\ wake1 str cr + +\ patch noop cr take-alarm test1 +\ patch (cr cr take-alarm test1 + +\ : cx cr d# 400 ms ; patch cx cr take-alarm test1 Modified: dev/olpc/dcon/mmp2dcon.fth ============================================================================== --- dev/olpc/dcon/mmp2dcon.fth Fri Sep 23 00:42:26 2011 (r2526) +++ dev/olpc/dcon/mmp2dcon.fth Fri Sep 23 06:59:53 2011 (r2527) @@ -176,8 +176,8 @@ h# dc02 = ; -: dcon-setup ( -- ) - 0 dcon@ drop 0 dcon@ drop +: dcon-setup ( -- error? ) + dcon2? 0= if ." Can't init DCON" true exit then [ifdef] notdef d# 1200 2 dcon! \ HResolution @@ -196,9 +196,10 @@ h# 0101 h# 42 dcon! h# 12 mode! + false ; : dcon-enable ( -- ) - dcon-setup + dcon-setup if exit then true set-color h# f bright! ; @@ -234,8 +235,12 @@ dcon-power-off ; : dcon-resume ( -- ) - dcon-power-on d# 50 ms - dcon-setup + ['] dcon-power-on catch if + ." dcon-power-on failed" cr + exit + then + d# 80 ms + dcon-setup if exit then saved-dcon-mode mode! saved-brightness bright! ;
1
0
0
0
[commit] r2526 - ofw/inet
by repository service
22 Sep '11
22 Sep '11
Author: wmb Date: Fri Sep 23 00:42:26 2011 New Revision: 2526 URL:
http://tracker.coreboot.org/trac/openfirmware/changeset/2526
Log: pingd no longer needs an argument; it implicitly uses "net//obp-tftp:last". If you need to change the target device, change the "net" devalias. Modified: ofw/inet/ping.fth Modified: ofw/inet/ping.fth ============================================================================== --- ofw/inet/ping.fth Fri Sep 23 00:38:28 2011 (r2525) +++ ofw/inet/ping.fth Fri Sep 23 00:42:26 2011 (r2526) @@ -17,14 +17,12 @@ 0 value ping-ih : open-net ( pathname$ -- ) - dup 0= if 2drop " net" then ( pathname$' ) - open-dev to ping-ih + " net//obp-tftp:last" open-dev to ping-ih ping-ih 0= abort" Can't open network device" ; : close-net ( -- ) ping-ih close-dev ; : $call-net ( ? name$ -- ? ) ping-ih $call-method ; -true value first? 0 value /packet d# 1600 constant /packet-max /packet-max buffer: packet @@ -169,13 +167,10 @@ key drop ; -: $pingd ( pathname$ -- ) - true to first? +: pingd ( -- ) open-net handle-requests close-net ; -: pingd ( "device" -- ) parse-word $pingd ; - d# 64 value ping-size d# 512 value /ping-max d# 10 value ping-seconds @@ -251,7 +246,7 @@ ; : $ping ( ip$ -- ) - " net//obp-tftp:last" open-net " $set-host" $call-net + open-net " $set-host" $call-net /ping-max " allocate-ip" $call-net to ping-packet try-pings ping-packet /ping-max " free-ip" $call-net
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