Author: wmb
Date: Thu Jun 30 10:33:16 2011
New Revision: 2321
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2321
Log:
ARM - support direct loading of Linux ELF images that are not wrapped in zImage decompression code.
Modified:
cpu/arm/linux.fth
Modified: cpu/arm/linux.fth
==============================================================================
--- cpu/arm/linux.fth Thu Jun 30 10:24:40 2011 (r2320)
+++ cpu/arm/linux.fth Thu Jun 30 10:33:16 2011 (r2321)
@@ -185,6 +185,18 @@
: mcr ( -- ) cr exit? throw ;
+\ Hack to force the vaddr to a paddr, because the Linux kernel expects to be
+\ started at physical addresses.
+: (linux-elf-map-in) ( va size -- )
+ drop ( va )
+ h# c000.0000 u> if ( )
+ p32_vaddr h# c000.0000 - dup elf32-pheader >p32_vaddr l! ( pa )
+ to linux-base
+ true to linux-loaded?
+ then
+;
+' (linux-elf-map-in) to elf-map-in
+
\ LICENSE_BEGIN
\ Copyright (c) 2010 FirmWorks
\
Author: wmb
Date: Tue Jun 28 21:32:22 2011
New Revision: 2317
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2317
Log:
OLPC keyboard selftest - to test for the presence of /ec-spi, use locate-device instead of find-package, because the latter searches the dropin driver list to find possible demand-loadable packages. That has the bad effect of starving the EC of cycles while the SPI FLASH behind the EC is being accessed. Also, do the presence test once when the test is started and cache the result in a value, thus reducing the "dead time" between polls.
Modified:
dev/olpc/keyboard/selftest.fth
Modified: dev/olpc/keyboard/selftest.fth
==============================================================================
--- dev/olpc/keyboard/selftest.fth Tue Jun 28 18:57:21 2011 (r2316)
+++ dev/olpc/keyboard/selftest.fth Tue Jun 28 21:32:22 2011 (r2317)
@@ -664,18 +664,17 @@
then ( false | scancode true )
;
+0 value ec-spi-buttons?
+
\ Check for a change in button state if necessary.
: or-button? ( [scancode] key? -- [scancode] flag )
\ If there is already a key from get-data?, handle it before checking the game buttons
- dup if exit then ( [scancode] key? phandle )
+ dup if exit then ( false )
\ If the /ec-spi device node is present, the game buttons are directly connected
\ so we must handle them here. Otherwise the EC will handle them and fold their
\ events into the keyboard scancode stream.
- " /ec-spi" find-package if ( false phandle )
- 2drop ( )
- button-event? ( [scancode] flag )
- then ( [scancode] flag )
+ ec-spi-buttons? if drop button-event? then
;
0 value last-timestamp
@@ -729,6 +728,13 @@
: selftest ( -- error? )
open 0= if true exit then
+ " /ec-spi" locate-device if ( )
+ false ( flag )
+ else ( phandle )
+ drop true ( flag )
+ then ( flag )
+ to ec-spi-buttons? ( )
+
set-keyboard-type
make-keys
Author: wmb
Date: Tue Jun 28 18:57:21 2011
New Revision: 2316
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2316
Log:
OLPC keyboard selftest - poll the keyboard rapidly, but the ec-spi game keys only once every 20 ms. This solves the problem with EC starvation without causing loss of keyboard events. Tested on XO-1.5 and XO-1.75.
Modified:
dev/olpc/keyboard/selftest.fth
Modified: dev/olpc/keyboard/selftest.fth
==============================================================================
--- dev/olpc/keyboard/selftest.fth Tue Jun 28 00:27:51 2011 (r2315)
+++ dev/olpc/keyboard/selftest.fth Tue Jun 28 18:57:21 2011 (r2316)
@@ -617,6 +617,16 @@
then ( scancode )
;
+0 value button-poll-time
+: okay-to-poll? ( -- flag )
+ button-poll-time 0= get-msecs button-poll-time - 0>= or if
+ get-msecs d# 20 + to button-poll-time
+ true
+ else
+ false
+ then
+;
+
\ Returns the next button-related scancode byte.
: button-event? ( -- false | scancode true )
\ Handle the suffix of an e0-scancode sequence
@@ -625,14 +635,16 @@
exit ( -- scancode true )
then ( )
- \ If the pending-buttons change mask is 0, we don't have anymore
+ \ If the pending-buttons change mask is 0, we don't have any more
\ events to generate from the last time around, so reread the
\ game buttons and set pending-buttons to the ones that have
\ changed.
pending-buttons 0= if
- game-key@ ( new-buttons )
- dup last-buttons xor to pending-buttons ( new-buttons )
- to last-buttons ( )
+ okay-to-poll? if
+ game-key@ ( new-buttons )
+ dup last-buttons xor to pending-buttons ( new-buttons )
+ to last-buttons ( )
+ then
then
\ If there are bits set in pending-buttons, generate an event from
@@ -685,7 +697,6 @@
get-msecs last-timestamp - d# 10,000 >=
then
then ( exit? )
- d# 20 ms
until
begin get-data? while drop repeat
;