Author: wmb Date: Mon May 23 23:06:42 2011 New Revision: 2219 URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2219
Log: OLPC XO-1.75 - Sdkit core files.
Added: cpu/arm/mmap.fth cpu/arm/mmp2/make-sdkit.sh (contents, props changed) cpu/arm/mmp2/sdkit.fth cpu/arm/mmp2/sdkit.sh (contents, props changed)
Added: cpu/arm/mmap.fth ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ cpu/arm/mmap.fth Mon May 23 23:06:42 2011 (r2219) @@ -0,0 +1,19 @@ +-1 value mem-fd +: ?open-mem ( -- ) + mem-fd 0< if + 2 " /dev/mem" $cstr 8 syscall 2drop retval to mem-fd + then + mem-fd 0< abort" Can't open /dev/mem; try being root" +; +: mmap ( phys len -- virt ) + ?open-mem mem-fd d# 380 syscall 3drop retval + dup -1 = abort" mmap failed" +; +: munmap ( virt len -- ) mem-fd d# 384 syscall 2drop ; + +: unaligned-mmap ( phys -- virt ) + dup h# fff and ( phys phys.lowbits ) + swap h# fff invert and ( phys.lowbits phys.highbits ) + h# 1000 mmap ( phys.lowbit virt.highbits ) + + ( virt ) +;
Added: cpu/arm/mmp2/make-sdkit.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ cpu/arm/mmp2/make-sdkit.sh Mon May 23 23:06:42 2011 (r2219) @@ -0,0 +1,8 @@ +mkdir -p sdkit-arm +cp ../mmap.fth sdkit-arm +cp twsi.fth gpio.fth mfpr.fth sdkit.fth sdkit-arm +cp ../olpc/1.75/smbus.fth ../olpc/1.75/camera-test.fth ../olpc/1.75/accelerometer.fth sdkit-arm +cp ../Linux/armforth.static sdkit-arm/forth +cp ../olpc/1.75/build/prefw.dic sdkit-arm/prefw.dic +cp sdkit.sh sdkit-arm +tar cfz sdkit-arm.tgz sdkit-arm
Added: cpu/arm/mmp2/sdkit.fth ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ cpu/arm/mmp2/sdkit.fth Mon May 23 23:06:42 2011 (r2219) @@ -0,0 +1,14 @@ +fload mmap.fth +0 constant acgr-pa \ Dummy definition +fload mfpr.fth +mfpr-base h# 1000 mmap to mfpr-base +h# d4019000 h# 1000 mmap constant gpio-base +fload gpio.fth +: us ( n -- ) d# 40 * 0 do loop ; +: ms ( n -- ) 0 ?do d# 1000 us loop ; +fload smbus.fth +fload camera-test.fth +fload twsi.fth +fload accelerometer.fth +.( See http://wiki.laptop.org/go/Forth_Lesson_22) cr +hex
Added: cpu/arm/mmp2/sdkit.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ cpu/arm/mmp2/sdkit.sh Mon May 23 23:06:42 2011 (r2219) @@ -0,0 +1,2 @@ +#!/bin/sh +./forth prefw.dic sdkit.fth -