Author: wmb
Date: Fri Jun 17 09:52:21 2011
New Revision: 2292
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2292
Log:
OLPC trac #10895 - OFW end of SP-PS2 communications protocol.
Added:
cpu/arm/olpc/spcmd.fth
Added: cpu/arm/olpc/spcmd.fth
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ cpu/arm/olpc/spcmd.fth Fri Jun 17 09:52:21 2011 (r2292)
@@ -0,0 +1,171 @@
+\ See license at end of file
+purpose: Communication protocol for application processor to security processor
+
+\ Interface from pckbd.fth to i8042.fth:
+\ set-port ( port# -- ) \ Selects keyboard (port#=0) or mouse (port#=1)
+\ get-data ( -- data | -1 ) \ Returns a keyboard or mouse byte, or -1 if none after one second
+\ get-data? ( -- false | data true ) \ Non-blocking version of get-data
+\ clear-out-buf ( -- ) \ Drains pending data, waiting until 120 ms elapses with no data. Built from get-data?
+\ put-get-data ( cmd -- data | -1 ) \ Sends cmd and waits for one response byte
+\ Used only by "echo?", which is not called on OLPC.
+\ put-data ( data -- ) \ Sends a byte to the keyboard or mouse
+\ Used only by "cmd". "cmd" is used by set-scan-set, default-disable-kbd, enable-scan, set-leds, toggle-leds,
+\ kbd-reset, (obsolete) olpc-set-ec-keymap. set-scan-set is used only by commented-out code guarded by
+\ the non-defined ifdef "fix-keyboard". default-disable-kbd is called only by get-initial-state (NC on OLPC).
+\ enable-scan is NC on OLPC. set-leds is called by toggle-leds with is called when you press numlock or
+\ scrolllock or capslock, none of which the OLPC keyboard has.
+
+0 0 " d4290000" " /" begin-package \ AP-SP interface the WTM command queue
+
+headerless
+
+" ap-sp" device-name
+
+0 0 encode-bytes
+ " olpc,ap-sp" encode-string encode+
+" compatible" property
+
+my-address my-space h# 1000 encode-reg
+" reg" property
+
+1 " #address-cells" integer-property
+0 " #size-cells" integer-property
+
+: encode-unit ( phys -- adr len ) push-hex (u.) pop-base ;
+: decode-unit ( adr len -- phys ) push-hex $number if 0 then pop-base ;
+
+\ Channel#(port#) Meaning
+\ 0 Keyboard
+\ 1 Touchpad
+
+2 constant #ports
+#ports constant #queues
+
+d# 16 constant /q
+
+0 value queue#
+#queues /n* buffer: heads : head ( -- adr ) heads queue# na+ ;
+#queues /n* buffer: tails : tail ( -- adr ) tails queue# na+ ;
+
+#queues /q * buffer: qs : q ( adr -- ) qs queue# /q * + ;
+
+/q 1- value q-end
+
+: init-queues ( -- )
+ #queues 0 do
+ i to queue#
+ 0 head ! 0 tail ! /q 1- to q-end
+ loop
+;
+: inc-q-ptr ( pointer-addr -- )
+ dup @ q-end >= if 0 swap ! else /c swap +! then
+;
+
+: select-queue ( channel# -- error? )
+ to queue#
+ queue# #queues >=
+;
+
+: enque ( new-entry channel# -- )
+ select-queue if drop exit then ( new-entry )
+ tail @ head @ 2dup > if - q-end else 1- then ( new-entry tail head )
+ <> if q tail @ ca+ c! tail inc-q-ptr else drop then
+;
+
+: deque? ( channel# -- false | entry true )
+ select-queue if false exit then
+ lock[
+ head @ tail @ <> if
+ q head @ ca+ c@ head inc-q-ptr true
+ else
+ false
+ then
+ ]unlock
+;
+
+0 value reg-base
+: reg@ ( offset -- l ) reg-base + l@ ;
+: reg! ( l offset -- ) reg-base + l! ;
+
+: data? ( -- flag ) h# c8 reg@ 1 and ;
+: send-rdy ( -- ) h# ff00 h# 40 reg! ;
+: poll ( -- )
+ lock[
+ data? if
+ h# 80 reg@ wbsplit enque
+ 1 h# c8 reg!
+ send-rdy
+ then
+ ]unlock
+;
+
+0 instance value port#
+: set-port ( port# -- ) to port# ;
+: get-data? ( -- false | data true )
+ port# deque? ( false | data true )
+ poll
+;
+: get-data ( -- data | -1 ) \ Wait for data from our device
+ d# 1000 0 do
+ get-data? if unloop exit then ( data )
+ 1 ms
+ loop
+ true \ abort" Timeout waiting for data from device"
+;
+\ Wait until the device stops sending data
+: clear-out-buf ( -- ) begin d# 120 ms get-data? while drop repeat ;
+
+0 value open-count
+: open ( -- flag )
+ open-count 0= if
+ my-address my-space h# 1000 " map-in" $call-parent is reg-base
+ data? 0= if send-rdy then
+ then
+ open-count 1+ to open-count
+ true
+;
+: close ( -- )
+ open-count 1 = if
+ reg-base h# 1000 " map-out" $call-parent 0 is reg-base
+ then
+ open-count 1- 0 max to open-count
+;
+
+: put-data ( byte -- ) port# bwjoin h# 40 reg! ;
+: put-get-data ( cmd -- data | -1 ) put-data get-data ;
+
+new-device
+ " " " 0" set-args
+ fload ${BP}/dev/pckbd.fth
+finish-device
+
+new-device
+ " " " 1" set-args
+ fload ${BP}/dev/ps2mouse.fth
+finish-device
+
+end-package
+
+\ LICENSE_BEGIN
+\ Copyright (c) 2011 FirmWorks
+\
+\ Permission is hereby granted, free of charge, to any person obtaining
+\ a copy of this software and associated documentation files (the
+\ "Software"), to deal in the Software without restriction, including
+\ without limitation the rights to use, copy, modify, merge, publish,
+\ distribute, sublicense, and/or sell copies of the Software, and to
+\ permit persons to whom the Software is furnished to do so, subject to
+\ the following conditions:
+\
+\ The above copyright notice and this permission notice shall be
+\ included in all copies or substantial portions of the Software.
+\
+\ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+\ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+\ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+\ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+\ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+\ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+\ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+\
+\ LICENSE_END
Hi,
Is it possible to boot Open Firmware directly from a hard drive, and then use it to boot linux, instead of using grub ?
Thanks,
Andrew
=============================
Andrew Holt
Senior Software Engineer
Email: andrew.holt(a)electrans.com
Phone: 0151 347 2270
Mobile: 07841 340608
Skype: andrewtholt
De Omnibus Dubitandum
=============================
Author: rsmith
Date: Thu Jun 16 03:56:03 2011
New Revision: 2288
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2288
Log:
OLPC XO-1.5,1.75: Remove mppt-pct
The Intersil charger only has 0x20 graduations of resolution in
current limit so setting this in percent doesn't make as much sense as
it did when the max was 0xff. Was only used in manual testing/debug
and now all that is done with 'mppt-limit!' .
Modified:
dev/olpc/kb3700/batstat.fth
Modified: dev/olpc/kb3700/batstat.fth
==============================================================================
--- dev/olpc/kb3700/batstat.fth Wed Jun 15 23:06:00 2011 (r2287)
+++ dev/olpc/kb3700/batstat.fth Thu Jun 16 03:56:03 2011 (r2288)
@@ -128,17 +128,12 @@
;
[then]
-: (mppt-pct) 255 * 100 / mppt-limit! ;
-
-
: .mppt
mppt-limit@ ( pwr_limit )
vin@ ( pwr_limit VA2 )
." Vin: " .d ." PWM: " .
;
-: mppt-pct (mppt-pct) .mppt cr ;
-
: watch-mppt ( -- )
begin (cr .mppt kill-line d# 500 ms key? until
key drop
Author: wmb
Date: Wed Jun 15 23:06:00 2011
New Revision: 2287
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2287
Log:
Fixed yet another cross-compilation problem in nandblaster.
Modified:
cpu/arm/olpc/1.75/mcnand-version.fth
Modified: cpu/arm/olpc/1.75/mcnand-version.fth
==============================================================================
--- cpu/arm/olpc/1.75/mcnand-version.fth Wed Jun 15 23:00:08 2011 (r2286)
+++ cpu/arm/olpc/1.75/mcnand-version.fth Wed Jun 15 23:06:00 2011 (r2287)
@@ -3,6 +3,6 @@
\ With a specific ID, mcastnand.bth will download a tarball without .git stuff.
\ With "test", mcastnand.bth will clone the git head if build/multicast-nand/
\ is not already present, then you can modify the git subtree as needed.
-macro: MCNAND_VERSION bee3e761ec20c9e42778db4e72c3200ee888a419
+macro: MCNAND_VERSION c535151a3f7f396006eb0d5ebd25d135351ffc06
\ macro: MCNAND_VERSION test
\ macro: MCNAND_VERSION HEAD
Author: wmb
Date: Wed Jun 15 22:38:20 2011
New Revision: 2285
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2285
Log:
Use new git commit of nandblaster, which actually has the changes to which the last commit alludes.
Modified:
cpu/arm/olpc/1.75/mcnand-version.fth
Modified: cpu/arm/olpc/1.75/mcnand-version.fth
==============================================================================
--- cpu/arm/olpc/1.75/mcnand-version.fth Wed Jun 15 22:23:53 2011 (r2284)
+++ cpu/arm/olpc/1.75/mcnand-version.fth Wed Jun 15 22:38:20 2011 (r2285)
@@ -3,6 +3,6 @@
\ With a specific ID, mcastnand.bth will download a tarball without .git stuff.
\ With "test", mcastnand.bth will clone the git head if build/multicast-nand/
\ is not already present, then you can modify the git subtree as needed.
-macro: MCNAND_VERSION 46352660d19d20ebc69d8c0bd5e4d3bbf5185501
+macro: MCNAND_VERSION bee3e761ec20c9e42778db4e72c3200ee888a419
\ macro: MCNAND_VERSION test
\ macro: MCNAND_VERSION HEAD
Author: wmb
Date: Wed Jun 15 22:23:53 2011
New Revision: 2284
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2284
Log:
Use new git commit of nandblaster, with fewer compiler include dependencies.
Modified:
cpu/arm/olpc/1.75/mcnand-version.fth
Modified: cpu/arm/olpc/1.75/mcnand-version.fth
==============================================================================
--- cpu/arm/olpc/1.75/mcnand-version.fth Wed Jun 15 07:36:10 2011 (r2283)
+++ cpu/arm/olpc/1.75/mcnand-version.fth Wed Jun 15 22:23:53 2011 (r2284)
@@ -3,6 +3,6 @@
\ With a specific ID, mcastnand.bth will download a tarball without .git stuff.
\ With "test", mcastnand.bth will clone the git head if build/multicast-nand/
\ is not already present, then you can modify the git subtree as needed.
-macro: MCNAND_VERSION 3537d14318e0eac205dda2f8dcd524f24b9cabe3
+macro: MCNAND_VERSION 46352660d19d20ebc69d8c0bd5e4d3bbf5185501
\ macro: MCNAND_VERSION test
\ macro: MCNAND_VERSION HEAD