openfirmware
Threads by month
- ----- 2026 -----
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 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
July 2012
- 1 participants
- 78 discussions
Author: wmb
Date: Thu Jul 12 22:24:46 2012
New Revision: 3055
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/3055
Log:
OLPC ARM - Initial revisions of CL4 support.
Added:
cpu/arm/olpc/cl4/
cpu/arm/olpc/cl4/cforth-version.fth
cpu/arm/olpc/cl4/cforth.bth
cpu/arm/olpc/cl4/config.fth
cpu/arm/olpc/cl4/crypto-version.fth
cpu/arm/olpc/cl4/ec-version.fth
cpu/arm/olpc/cl4/ec.bth
cpu/arm/olpc/cl4/fw-version.fth
cpu/arm/olpc/cl4/fw.bth
cpu/arm/olpc/cl4/gpiopins.fth
cpu/arm/olpc/cl4/leds.fth
cpu/arm/olpc/cl4/mcastnand.bth
cpu/arm/olpc/cl4/mcnand-version.fth
cpu/arm/olpc/cl4/olpc.bth
cpu/arm/olpc/cl4/prefw.bth
cpu/arm/olpc/cl4/resetvec.bth
cpu/arm/olpc/cl4/sd8686.bth
cpu/arm/olpc/cl4/switches.fth
cpu/arm/olpc/cl4/testinstructions.fth
cpu/arm/olpc/cl4/verify.bth
cpu/arm/olpc/cl4/wlan-version.fth
Added: cpu/arm/olpc/cl4/cforth-version.fth
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ cpu/arm/olpc/cl4/cforth-version.fth Thu Jul 12 22:24:46 2012 (r3055)
@@ -0,0 +1,17 @@
+\ This file controls which CForth source version to include in the OFW build
+\ and the method for fetching it
+
+\ If CFORTH_VERSION is "modify", the repository will be cloned with git+ssh: so can push changes.
+\ You need ssh access to the server.
+\ macro: CFORTH_VERSION modify
+
+\ If CFORTH_VERSION is "clone", the repository will be cloned with git:. You won't be able to
+\ push changes, but you will get the full metadata so you can use commands like git grep.
+\ You don't need ssh access to the server.
+\ macro: CFORTH_VERSION clone
+
+\ Otherwise, the source code will be will be downloaded as a tarball via gitweb.
+\ macro: CFORTH_VERSION 59859f04454bc2574ab68cf0fd76ebdbc5f26fb6
+macro: CFORTH_VERSION HEAD
+
+macro: CFORTH_BUILD_DIR cforth/build/arm-xo-cl4
Added: cpu/arm/olpc/cl4/cforth.bth
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ cpu/arm/olpc/cl4/cforth.bth Thu Jul 12 22:24:46 2012 (r3055)
@@ -0,0 +1,7 @@
+purpose: Fetch and compile CForth for the Security Processor
+
+command: &builder &this
+build-now
+
+fload ${BP}/cpu/arm/olpc/cl4/cforth-version.fth
+fload ${BP}/cpu/arm/olpc/build-cforth.fth
Added: cpu/arm/olpc/cl4/config.fth
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ cpu/arm/olpc/cl4/config.fth Thu Jul 12 22:24:46 2012 (r3055)
@@ -0,0 +1,30 @@
+create debug-startup
+create olpc
+create olpc-cl4
+create trust-ec-keyboard
+create use-null-nvram
+create use-elf
+create has-sp-kbd
+create has-dcon
+
+fload ${BP}/cpu/arm/mmp2/hwaddrs.fth
+fload ${BP}/cpu/arm/olpc/addrs.fth
+
+h# 1f.0000 constant mfg-data-offset \ Offset to manufacturing data area in SPI FLASH
+h# 10.0000 constant mfg-data-end-offset \ Offset to end of manufacturing data area in SPI FLASH
+h# 1e.ffd8 constant crc-offset
+
+h# 20.0000 constant /rom \ Total size of SPI FLASH
+
+: signature$ " CL4" ;
+: model$ " olpc,XO-CL4" ;
+: compatible$ " olpc,xo-cl4" ;
+
+d# 10001 constant machine-type \ Backwards compatibility with non-device-tree kernel
+
+char 5 constant expected-ec-version
+h# 10000 value /ec-flash
+
+h# 20000 constant l2-#sets
+
+fload ${BP}/cpu/arm/olpc/cl4/gpiopins.fth
Added: cpu/arm/olpc/cl4/crypto-version.fth
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ cpu/arm/olpc/cl4/crypto-version.fth Thu Jul 12 22:24:46 2012 (r3055)
@@ -0,0 +1,6 @@
+\ The public keys
+macro: KEYS mpkeys
+\ macro: KEYS testkeys
+
+\ The bios_verify image
+macro: CRYPTO_VERSION 0.5-ARM
Added: cpu/arm/olpc/cl4/ec-version.fth
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ cpu/arm/olpc/cl4/ec-version.fth Thu Jul 12 22:24:46 2012 (r3055)
@@ -0,0 +1,9 @@
+\ The EC microcode
+macro: EC_PLATFORM cl4
+macro: EC_VERSION 6_0_0_00
+
+\ 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
Added: cpu/arm/olpc/cl4/ec.bth
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ cpu/arm/olpc/cl4/ec.bth Thu Jul 12 22:24:46 2012 (r3055)
@@ -0,0 +1,7 @@
+purpose: Fetch the EC (Embedded Controller, i.e. KB3700) microcode
+
+command: &builder &this
+build-now
+
+fload ${BP}/cpu/arm/olpc/cl4/ec-version.fth
+fload ${BP}/cpu/arm/olpc/fetch-ec.fth
Added: cpu/arm/olpc/cl4/fw-version.fth
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ cpu/arm/olpc/cl4/fw-version.fth Thu Jul 12 22:24:46 2012 (r3055)
@@ -0,0 +1,4 @@
+\ The overall firmware revision
+macro: FW_PREFIX Q5
+macro: FW_MAJOR A
+macro: FW_MINOR 00ma
Added: cpu/arm/olpc/cl4/fw.bth
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ cpu/arm/olpc/cl4/fw.bth Thu Jul 12 22:24:46 2012 (r3055)
@@ -0,0 +1,41 @@
+purpose: Build OFW Forth dictionary for OLPC CL4
+\ See license at end of file
+
+dictionary: ${BP}/cpu/arm/olpc/cl4/build/prefw.dic
+command: &armforth &dictionary &this
+build-now
+
+" fw.tag" r/w create-file drop tag-file !
+
+fload ${BP}/cpu/arm/olpc/build-fw.fth
+
+dev /sd
+ new-device
+ 4 encode-int "reg" property
+ fload ${BP}/dev/mmc/sdhci/sdmmc.fth
+ fload ${BP}/dev/mmc/sdhci/selftest.fth
+ " internal" " slot-name" string-property
+ finish-device
+device-end
+
+devalias int /sd/disk@3
+devalias ext /sd/disk@2
+devalias int-sd /sd/disk@5
+devalias emmc /sd/disk@5
+
+stand-init:
+ boot-dev-sel-gpio# gpio-pin@ 0= if
+ " int" " /sd/disk@5" $devalias
+ then
+;
+
+fload ${BP}/cpu/arm/olpc/1.75/lcdcfg.fth
+fload ${BP}/cpu/arm/olpc/1.75/usb.fth
+fload ${BP}/cpu/arm/olpc/nn-touchscreen.fth
+fload ${BP}/cpu/arm/olpc/cl4/switches.fth
+fload ${BP}/cpu/arm/olpc/cl4/leds.fth
+fload ${BP}/cpu/arm/olpc/cl4/testinstructions.fth
+fload ${BP}/cpu/arm/olpc/gpio-gamekeys.fth
+fload ${BP}/cpu/arm/olpc/test-tweaks.fth
+
+fload ${BP}/cpu/arm/olpc/save-fw.fth
Added: cpu/arm/olpc/cl4/gpiopins.fth
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ cpu/arm/olpc/cl4/gpiopins.fth Thu Jul 12 22:24:46 2012 (r3055)
@@ -0,0 +1,69 @@
+\ GPIO pin assignments - XO-CL4
+
+d# 165 constant cam-scl-gpio#
+d# 166 constant cam-sda-gpio#
+
+d# 102 constant cam-rst-gpio#
+d# 150 constant cam-pwr-gpio#
+
+d# 46 constant spi-flash-cs-gpio#
+
+d# 155 constant ec-spi-cmd-gpio#
+d# 113 constant ec-spi-ack-gpio#
+
+d# 167 constant dcon-scl-gpio#
+d# 168 constant dcon-sda-gpio#
+
+d# 126 constant dcon-irq-gpio#
+d# 142 constant dcon-load-gpio#
+
+d# 34 constant en-wlan-pwr-gpio#
+d# 35 constant wlan-pd-gpio#
+d# 36 constant wlan-reset-gpio#
+
+d# 148 constant usb-hub-reset-gpio#
+
+d# 97 constant en-emmc-pwr-gpio#
+d# 144 constant emmc-rst-gpio#
+
+d# 73 constant sec-trg-gpio#
+
+d# 53 constant rtc-scl-gpio#
+d# 54 constant rtc-sda-gpio#
+
+d# 104 constant ec-edi-cs-gpio#
+d# 105 constant ec-edi-mosi-gpio#
+d# 106 constant ec-edi-clk-gpio#
+
+d# 2 constant boot-dev-sel-gpio#
+
+d# 143 constant mic-ac/dc-gpio#
+d# 8 constant audio-reset-gpio#
+d# 13 constant hp-plug-gpio#
+
+d# 10 constant led-storage-gpio#
+d# 123 constant vid2-gpio#
+
+d# 160 constant soc-tpd-clk-gpio#
+d# 107 constant soc-tpd-dat-gpio#
+
+d# 71 constant soc-kbd-clk-gpio#
+d# 72 constant soc-kbd-dat-gpio#
+
+d# 129 constant lid-switch-gpio#
+d# 130 constant ebook-mode-gpio#
+
+d# 97 constant en-emmc-pwr-gpio#
+
+d# 4 constant hdmi-scl-gpio#
+d# 5 constant hdmi-sda-gpio#
+d# 14 constant hdmi-hp-det-gpio#
+
+d# 12 constant touch-hd-gpio#
+d# 139 constant touch-tck-gpio#
+d# 98 constant touch-rst-gpio#
+
+d# 3 constant soc-sel-gpio#
+
+d# 15 constant rotate-gpio#
+d# 17 constant check-gpio#
Added: cpu/arm/olpc/cl4/leds.fth
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ cpu/arm/olpc/cl4/leds.fth Thu Jul 12 22:24:46 2012 (r3055)
@@ -0,0 +1,53 @@
+\ See license at end of file
+purpose: Driver/selftest for OLPC XO-1.75 LEDs
+
+0 0 " 0" " /" begin-package
+0 0 reg \ So test-all will run the test
+" leds" device-name
+: open ( -- okay? ) true ;
+: close ( -- ) ;
+
+: hdd-led-off ( -- ) led-storage-gpio# gpio-clr ;
+: hdd-led-on ( -- ) led-storage-gpio# gpio-set ;
+: hdd-led-toggle ( -- ) led-storage-gpio# gpio-pin@ if hdd-led-off else hdd-led-on then ;
+
+: selftest ( -- )
+ ." Flashing LEDs" cr
+
+ d# 10 0 do ols-led-on d# 200 ms ols-led-off d# 200 ms loop
+ ols-led-ec-control
+ ols-assy-mode-on
+
+ " /wlan:quiet" test-dev " /wlan:quiet" test-dev \ Twice for longer flashing
+
+ d# 20 0 do hdd-led-on d# 100 ms hdd-led-off d# 100 ms loop
+ ols-assy-mode-off
+
+ confirm-selftest?
+;
+
+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
Added: cpu/arm/olpc/cl4/mcastnand.bth
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ cpu/arm/olpc/cl4/mcastnand.bth Thu Jul 12 22:24:46 2012 (r3055)
@@ -0,0 +1,7 @@
+purpose: Fetch and compile the multicast NAND reflash program
+
+command: &builder &this
+build-now
+
+fload ${BP}/cpu/arm/olpc/cl4/mcnand-version.fth
+fload ${BP}/cpu/arm/olpc/build-mcnand.fth
Added: cpu/arm/olpc/cl4/mcnand-version.fth
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ cpu/arm/olpc/cl4/mcnand-version.fth Thu Jul 12 22:24:46 2012 (r3055)
@@ -0,0 +1,8 @@
+\ The multicast NAND updater code version
+\ Use a specific git commit ID for a formal release or "test" for development.
+\ 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 e9c0662
+\ macro: MCNAND_VERSION test
+\ macro: MCNAND_VERSION HEAD
Added: cpu/arm/olpc/cl4/olpc.bth
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ cpu/arm/olpc/cl4/olpc.bth Thu Jul 12 22:24:46 2012 (r3055)
@@ -0,0 +1,220 @@
+purpose: Construct the Open Firmware module collection
+
+command: &builder &this
+\ in: ${BP}/cpu/arm/olpc/cl4/build/ec.img
+in: ${BP}/cpu/arm/olpc/cl4/build/fw.img
+in: ${BP}/cpu/arm/olpc/cl4/build/resetvec.img
+in: ${BP}/cpu/arm/olpc/cl4/build/mcastnand.bin
+in: sd8686.bin
+in: verify.img
+in: ${BP}/dev/usb2/device/hub/build/hub.fc
+in: ${BP}/dev/usb2/device/generic/build/generic.fc
+in: ${BP}/dev/usb2/device/net/build/usbnet.fc
+in: ${BP}/dev/usb2/device/keyboard/build/usbkbd.fc
+in: ${BP}/dev/usb2/device/mouse/build/usbmouse.fc
+in: ${BP}/dev/usb2/device/serial/build/usbserial.fc
+in: ${BP}/dev/usb2/device/storage/build/usbstorage.fc
+in: testicons.bin
+in: ${BP}/clients/emacs/arm/emacs
+in: cforth.img
+build-now
+
+fload ${BP}/cpu/arm/olpc/cl4/fw-version.fth
+
+" macro: FW_VERSION ${FW_PREFIX}${FW_MAJOR}${FW_MINOR}" expand$ eval
+
+fload ${BP}/cpu/arm/olpc/cl4/config.fth
+
+\ Always re-create the builton.fth file when we make a new rom.img
+fload ${BP}/cpu/x86/pc/builton.bth
+fload ${BP}/cpu/arm/olpc/sourceurl.fth
+
+fload ${BP}/forth/lib/crc32.fth
+
+hex
+
+: pad-file ( location -- )
+ ofd @ fsize
+ 2dup u< abort" The ROM image is too large"
+ ?do h# ff ofd @ fputc loop
+;
+
+fload ${BP}/cpu/arm/marvell/tim.fth
+
+\ Marvel Trusted Image Module image creation script for
+\ XO-CL4 platform.
+
+tim: 00030400 0 OLPC PXA212x
+flash: SPI'10
+timh: TIMH 0 d101f000
+\ Main Processor code loaded into DRAM
+image: OBMI 800 d101c000 ${BP}/cpu/arm/olpc/dummy.img
+\ Secure Processor code loaded into SRAM
+image: WTMI 1000 d1018000 shim.img
+image: CFTH 2000 d1000000 cforth.img
+reserved:
+ term:
+end-reserved
+end-tim
+
+h# 20.0000 to reserved-start
+h# 20.0000 to reserved-end
+
+.( --- Saving as )
+" ${FW_VERSION}.rom" expand$ 2dup lower ( adr len )
+2dup type cr ( adr len )
+$new-file
+ tim$ ofd @ fputs
+
+ dropin-offset pad-file
+
+\ Loads the set of drivers that is common to different output formats
+
+ " ${BP}/cpu/arm/build/inflate.bin" " inflate" $add-dropin
+ " fw.img" " firmware" $add-deflated-dropin
+\ " fw.img" " firmware" $add-dropin
+ " resetvec.img" " reset" $add-dropin
+
+\ " ${BP}/dev/usb2/hcd/ehci/build/ehci.fc" " class0c0320" $add-deflated-dropin
+ " ${BP}/dev/usb2/device/hub/build/hub.fc" " usb,class9" $add-deflated-dropin
+ " ${BP}/dev/usb2/device/generic/build/generic.fc" " usbdevice" $add-deflated-dropin
+ " ${BP}/dev/usb2/device/net/build/usbnet.fc" " usbnet" $add-deflated-dropin
+ " ${BP}/dev/usb2/device/keyboard/build/usbkbd.fc" " usb,class3,1,1" $add-deflated-dropin
+ " ${BP}/dev/usb2/device/mouse/build/usbmouse.fc" " usb,class3,1,2" $add-deflated-dropin
+ " ${BP}/dev/usb2/device/serial/build/usbserial.fc" " usbserial" $add-deflated-dropin
+ " ${BP}/dev/usb2/device/storage/build/usbstorage.fc" " usbstorage" $add-deflated-dropin
+
+ " sd8686_helper.bin" " helper_sd.bin" $add-deflated-dropin
+ " sd8686.bin" " sd8686.bin" $add-deflated-dropin
+
+ " builton.fth" " probe-" $add-dropin
+
+0 [if]
+ " ${BP}/clients/emacs/x86/emacs" " emacs" $add-deflated-dropin
+ " ${BP}/clients/emacs/x86/emacs.rc" " emacs.rc" $add-deflated-dropin
+ " ${BP}/clients/emacs/emacs.hlp" " emacs.hlp" $add-deflated-dropin
+[then]
+
+ " ${BP}/ofw/inet/telnetd.fth" " telnetd" $add-deflated-dropin
+
+\ " ${BP}/cpu/x86/pc/olpc/images/warnings.565" " warnings.565" $add-deflated-dropin
+ " ${BP}/cpu/x86/pc/olpc/images/lightdot.565" " lightdot.565" $add-deflated-dropin
+ " ${BP}/cpu/x86/pc/olpc/images/yellowdot.565" " yellowdot.565" $add-deflated-dropin
+ " ${BP}/cpu/x86/pc/olpc/images/darkdot.565" " darkdot.565" $add-deflated-dropin
+ " ${BP}/cpu/x86/pc/olpc/images/lock.565" " lock.565" $add-deflated-dropin
+ " ${BP}/cpu/x86/pc/olpc/images/unlock.565" " unlock.565" $add-deflated-dropin
+ " ${BP}/cpu/x86/pc/olpc/images/plus.565" " plus.565" $add-deflated-dropin
+ " ${BP}/cpu/x86/pc/olpc/images/minus.565" " minus.565" $add-deflated-dropin
+ " ${BP}/cpu/x86/pc/olpc/images/x.565" " x.565" $add-deflated-dropin
+ " ${BP}/cpu/x86/pc/olpc/images/sad.565" " sad.565" $add-deflated-dropin
+ " ${BP}/cpu/x86/pc/olpc/images/bigdot.565" " bigdot.565" $add-deflated-dropin
+
+ " ${BP}/cpu/x86/pc/olpc/images/check.565" " check.565" $add-deflated-dropin
+ " ${BP}/cpu/x86/pc/olpc/images/xogray.565" " xogray.565" $add-deflated-dropin
+ " ${BP}/cpu/x86/pc/olpc/images/ethernet.565" " ethernet.565" $add-deflated-dropin
+ " ${BP}/cpu/x86/pc/olpc/images/usbkey.565" " disk.565" $add-deflated-dropin
+ " ${BP}/cpu/x86/pc/olpc/images/wireless.565" " wlan.565" $add-deflated-dropin
+ " ${BP}/cpu/x86/pc/olpc/images/laptop.565" " int.565" $add-deflated-dropin
+ " ${BP}/cpu/x86/pc/olpc/images/sd.565" " ext.565" $add-deflated-dropin
+
+ " verify.img" " verify" $add-deflated-dropin
+ " os.public" " ospubkey" $add-dropin \ Incompressible
+ " fw.public" " fwpubkey" $add-dropin \ Incompressible
+ " fs.public" " fspubkey" $add-dropin \ Incompressible
+ " lease.public" " leasepubkey" $add-dropin \ Incompressible
+ " developer.public" " develpubkey" $add-dropin \ Incompressible
+
+ " sourceurl" " sourceurl" $add-dropin
+
+ " ${BP}/cpu/x86/pc/olpc/images/Edge1-8k-EQ-Comp-Amp-Short.wav" " splash" $add-deflated-dropin
+
+ \ icons for mfg test gui
+ " testicons/play.565" " play.565" $add-deflated-dropin
+ " testicons/quit.565" " quit.565" $add-deflated-dropin
+ " testicons/cpu.565" " cpu.565" $add-deflated-dropin
+ " testicons/spi.565" " spi.565" $add-deflated-dropin
+ " testicons/ram.565" " ram.565" $add-deflated-dropin
+ " testicons/sdcard.565" " sdcard.565" $add-deflated-dropin
+ " testicons/keyboard.565" " keyboard.565" $add-deflated-dropin
+ " testicons/display.565" " display.565" $add-deflated-dropin
+ " testicons/touchpad.565" " touchpad.565" $add-deflated-dropin
+ " testicons/audio.565" " audio.565" $add-deflated-dropin
+ " testicons/usb.565" " usb.565" $add-deflated-dropin
+ " testicons/battery.565" " battery.565" $add-deflated-dropin
+ " testicons/camera.565" " camera.565" $add-deflated-dropin
+ " testicons/wifi.565" " wifi.565" $add-deflated-dropin
+ " testicons/clock.565" " clock.565" $add-deflated-dropin
+ " testicons/timer.565" " timer.565" $add-deflated-dropin
+ " ${BP}/cpu/x86/pc/olpc/images/bigx.di" $add-file
+ " ${BP}/cpu/x86/pc/olpc/images/bigcheck.di" $add-file
+ " ${BP}/cpu/x86/pc/olpc/images/leds.di" $add-file
+ " ${BP}/cpu/x86/pc/olpc/images/ebook.di" $add-file
+
+ " nandblaster15_rx.bin" " nb15_rx" $add-deflated-dropin
+ " nandblaster_tx.bin" " nb_tx" $add-deflated-dropin
+
+\ " ec.img" " ecimage.bin" $add-deflated-dropin
+ " ${BP}/clients/emacs/x86/emacs.rc" " emacs.rc" $add-deflated-dropin
+ " ${BP}/clients/emacs/emacs.hlp" " emacs.hlp" $add-deflated-dropin
+ " ${BP}/clients/emacs/arm/emacs" " emacs" $add-deflated-dropin
+
+.( Dropin top is ) ofd @ fsize .x cr
+
+/rom pad-file
+
+\ Insert the revision signature
+/rom h# 40 - ofd @ fseek
+h# 10 buffer: signature
+signature h# 10 blank
+signature$ signature swap move
+" ${FW_VERSION}" expand$ signature 6 + swap move
+" ${FW_PREFIX}${FW_MAJOR}" expand$ signature d# 13 + swap move
+signature h# 10 ofd @ fputs
+
+/l buffer: crcbuf
+/rom buffer: filebuf
+
+\ Read the entire image, compute the CRC, and store it h# 28 from the end
+0 ofd @ fseek
+filebuf /rom ofd @ fgets /rom <> abort" Can't read back image"
+0 crctab filebuf /rom ($crc) crcbuf !
+
+crc-offset ofd @ fseek
+crcbuf /l ofd @ fputs
+
+ofd @ fclose
+
+\ Creating olpc.version serves two purposes:
+\ a) It reports the firmware revision for use by external scripts
+\ b) It provides an olpc.* artifact for the builder dependency management.
+
+writing olpc.version
+" ${FW_VERSION}" expand$ 2dup lower ofd @ fputs
+ofd @ fclose
+
+
+
+\ LICENSE_BEGIN
+\ Copyright (c) 2010 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
+
Added: cpu/arm/olpc/cl4/prefw.bth
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ cpu/arm/olpc/cl4/prefw.bth Thu Jul 12 22:24:46 2012 (r3055)
@@ -0,0 +1,13 @@
+purpose: Build OFW Forth dictionary for OLPC XO-1.75
+\ See license at end of file
+
+dictionary: ${BP}/cpu/arm/build/basefw.dic
+command: &armforth &dictionary &this
+build-now
+
+\ This line must be in this file instead of in prefw.fth so the definitions
+\ in config.fth will be tagged.
+" prefw.tag" r/w create-file drop tag-file !
+
+fload ${BP}/cpu/arm/olpc/cl4/config.fth
+fload ${BP}/cpu/arm/olpc/prefw.fth
Added: cpu/arm/olpc/cl4/resetvec.bth
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ cpu/arm/olpc/cl4/resetvec.bth Thu Jul 12 22:24:46 2012 (r3055)
@@ -0,0 +1,7 @@
+purpose: Build script for low-level startup code
+
+command: &builder &this
+build-now
+
+fload ${BP}/cpu/arm/olpc/cl4/config.fth
+fload ${BP}/cpu/arm/olpc/resetvec.fth
Added: cpu/arm/olpc/cl4/sd8686.bth
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ cpu/arm/olpc/cl4/sd8686.bth Thu Jul 12 22:24:46 2012 (r3055)
@@ -0,0 +1,8 @@
+purpose: Fetch the firmware for the Marvell 8686 wireless LAN module
+
+command: &builder &this
+build-now
+
+fload ${BP}/cpu/arm/olpc/cl4/wlan-version.fth
+
+fload ${BP}/cpu/arm/olpc/build-wlan.fth
Added: cpu/arm/olpc/cl4/switches.fth
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ cpu/arm/olpc/cl4/switches.fth Thu Jul 12 22:24:46 2012 (r3055)
@@ -0,0 +1,64 @@
+\ See license at end of file
+purpose: Driver/selftest for OLPC lid and ebook switches
+
+0 0 " 0" " /" begin-package
+" switches" device-name
+0 0 reg \ So test-all will run the test
+: open ( -- okay? ) true ;
+: close ( -- ) ;
+: lid? ( -- flag ) d# 129 gpio-pin@ 0= ;
+: ebook? ( -- flag ) d# 130 gpio-pin@ 0= ;
+
+: ?key-abort ( -- ) key? if key esc = abort" Aborted" then ;
+: wait-not-lid ( -- )
+ ." Deactivate lid switch" cr
+ begin ?key-abort lid? 0= until
+;
+: wait-lid ( -- )
+ ." Activate lid switch" cr
+ begin ?key-abort lid? until
+;
+: wait-not-ebook ( -- )
+ ." Deactivate ebook switch" cr
+ begin ?key-abort ebook? 0= until
+;
+: wait-ebook ( -- )
+ ." Activate ebook switch" cr
+ begin ?key-abort ebook? until
+;
+
+: all-switch-states ( -- )
+ lid? if wait-not-lid else wait-lid then
+ ebook? if wait-not-ebook else wait-ebook then
+;
+
+: selftest ( -- error? )
+ ['] all-switch-states catch
+;
+
+fload ${BP}/dev/olpc/lid.fth
+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
Added: cpu/arm/olpc/cl4/testinstructions.fth
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ cpu/arm/olpc/cl4/testinstructions.fth Thu Jul 12 22:24:46 2012 (r3055)
@@ -0,0 +1,553 @@
+\ See license at end of file
+purpose: Drawings of OLPC XO-1.75 board and components for test instructions
+
+support-package: test-instructions
+
+decimal
+
+\ Common items
+
+\ FIXME: these might be shared between XO-1.5 and XO-1.75
+
+: headphones-logo
+ 24 5 rmove -6 0 -10 6 -10 13 rcurve
+ 10 -13 rmove 6 0 10 6 10 13 rcurve
+ -16 4 rmove -2 0 -3 -1 -3 -2 rcurve 0 -3 1 -3 3 -3 rcurve 0 5 rline
+ 12 -5 rmove 2 0 3 0 3 2 rcurve 0 3 -1 3 -3 3 rcurve 0 -5 rline
+;
+
+: led-symbol ( x y -- )
+ moveto 5 5 rline 5 -5 rline -5 -5 rline -5 5 rline
+;
+: usb-logo
+ 14 11 rmove
+ 1 1 1 3 0 4 rcurve
+ -1 1 -2 1 -3 0 rcurve
+ -1 -1 -1 -3 0 -4 rcurve
+ 1 -1 2 -1 3 0 rcurve
+
+ 10 -4 rmove
+ 1 -1 1 -2 0 -2 rcurve
+ 0 -1 -1 -1 -1 0 rcurve
+ 0 0 0 1 0 2 rcurve
+ 0 0 1 0 1 0 rcurve
+
+ -12 6 rmove 18 0 rline
+ 5 0 rmove -5 -2 rline 0 4 rline 5 -2 rline
+ -7 6 rmove 2 0 rline 0 3 rline -2 0 rline 0 -3 rline
+ -11 -6 rmove
+ 1 -2 2 -5 3 -6 rcurve
+ 1 -2 2 -1 3 -1 rcurve
+
+ -2 7 rmove
+ 2 2 2 5 4 7 rcurve
+ 1 1 3 0 5 0 rcurve
+;
+: mic-logo
+ -4 0 -6 -3 -6 -5 rcurve
+ 6 5 rmove 3 0 6 -3 6 -5 rcurve
+ -4 -8 rmove
+ 0 8 rline 0 1 -1 2 -2 2 rcurve -1 0 -2 -1 -2 -2 rcurve
+ 0 -8 rline 0 -1 1 -2 2 -2 rcurve 1 0 2 1 2 2 rcurve
+ -2 13 rmove 0 3 rline 3 0 rmove -7 0 rline
+;
+
+\ Board bottom items
+
+: rantenna ( -- )
+ -5 -5 rmove 10 10 rbox 5 5 rmove rpoint 5 rcircle
+;
+: wlan-card
+ 122 6 75 74 boxat
+ 10 9 rmove rantenna
+ 55 0 rmove rantenna
+;
+
+: board-outline
+ ( lower left corner ) 2 370 moveto
+ ( left side cutout ) 0 -117 rline 9 0 rline
+ 0 -17 rline -5 0 rline
+ ( upper left corner ) 0 -199 rline
+ ( wireless cutout ) 54 0 rline 0 -37 rline 54 0 rline
+ 0 96 rline 91 0 rline 0 -96 rline
+ 319 0 rline 0 37 rline
+ ( upper right corner ) 56 0 rline
+ ( right side cutout ) 0 127 rline -11 0 rline 0 43 rline
+ 7 0 rline 0 35 rline -7 0 rline
+ 0 17 rline 11 0 rline
+ ( lower right corner ) 0 111 rline
+ ( lower cutout ) -85 0 rline 0 -4 rline -49 0 rline
+ 0 -13 rline -23 0 rline 0 -17 rline
+ -27 0 rline 0 -105 rline -213 0 rline
+ 0 102 rline -28 0 rline 0 16 rline
+ -23 0 rline 0 17 rline -37 0 rline
+ 0 4 rline
+ ( lower left corner ) -93 0 rline
+;
+
+: mic-conn
+ 535 52 45 28 boxat
+ 24 20 rmove mic-logo
+ 580 58 8 16 boxat
+;
+: headphone-conn
+ 535 90 45 28 boxat
+ headphones-logo
+ 580 96 8 16 boxat
+;
+: ac-conn 553 306 36 27 boxat ;
+: ext-sd-slot 2 280 81 90 boxat ;
+: kbd-conn 165 300 12 23 boxat ;
+
+: ext-sd-card
+ 9 293 moveto
+ 9 379 lineto 76 379 lineto 76 304 lineto 65 293 lineto 9 293 lineto
+;
+
+: usb0-conn
+ 537 126 45 27 boxat
+ usb-logo
+;
+: usb1-conn
+ 0 54 45 27 boxat
+ usb-logo
+;
+: usb2-conn
+ 0 99 45 45 boxat
+ 0 9 rmove usb-logo
+;
+: battery-conn
+ 435 321 25 20 boxat
+ 435 299 10 12 boxat
+;
+
+: led0 103 356 led-symbol ;
+: led1 119 356 led-symbol ;
+: led2 454 356 led-symbol ;
+: led3 474 356 led-symbol ;
+: cmos-battery-conn
+ 259 47 12 18 boxat
+ 261 43 8 4 boxat
+ 261 65 8 4 boxat
+;
+
+\ FIXME: find out where this is to go for A2
+: cmos-battery
+ 262 60 22 circleat
+ \ Wires
+ 243 71 moveto
+ 238 75 228 81 229 86 curveto
+ 229 90 242 99 249 100 curveto
+ 255 100 262 89 269 89 curveto
+ 275 89 280 100 286 100 curveto
+ 292 100 297 93 303 90 curveto
+ 247 76 moveto
+ 241 81 231 89 229 93 curveto
+ 226 96 230 99 234 99 curveto
+ 237 99 244 90 250 91 curveto
+ 255 91 261 101 268 101 curveto
+ 274 100 280 90 286 90 curveto
+ 292 90 298 96 304 99 curveto
+;
+
+: rspkr-conn
+ 20 153 18 16 boxat
+ 16 157 4 8 boxat
+ 38 157 4 8 boxat
+;
+: lspkr-conn
+ 544 170 18 16 boxat
+ 540 174 4 8 boxat
+ 562 174 4 8 boxat
+;
+
+: wlan-conn 109 75 101 28 boxat ;
+
+: serial-conn
+ 71 46 18 27 boxat
+ 75 42 8 4 boxat
+ 75 73 8 4 boxat
+
+ 519 154 22 12 boxat
+
+;
+
+: int-sd-slot 115 143 32 37 boxat ;
+
+: int-sd-card
+ 101 146 moveto 43 0 rline 0 27 rline -13 0 rline -5 4 rline
+ -5 0 rline 0 -4 rline -4 0 rline -2 4 rline -15 0 rline 0 -31 rline
+;
+
+: basic-layout ( -- )
+ clear-drawing
+ d# 10 d# 20 offsetat
+ double-drawing
+;
+: draw-board ( -- )
+ basic-layout
+ board-outline
+ mic-conn
+ headphone-conn
+ ac-conn
+ ext-sd-slot
+ kbd-conn
+ usb0-conn
+ usb1-conn
+ usb2-conn
+ battery-conn
+ led0 led1 led2 led3
+ cmos-battery-conn
+ cmos-battery
+ rspkr-conn
+ lspkr-conn
+ wlan-conn
+ serial-conn
+ int-sd-slot
+
+ wlan-card
+ int-sd-card
+ ext-sd-card
+;
+
+\ Board top items
+\ FIXME: still has XO-1.5 image, yet to update for XO-1.75
+
+: button-symbol ( x y -- )
+ 2dup 18 18 boxat
+ swap 9 + swap 9 + 6 circleat
+;
+
+: top-outline
+ 584 370 moveto
+ 0 -117 rline -9 0 rline 0 -17 rline 5 0 rline 0 -199 rline -54 0 rline
+ 0 -37 rline -54 0 rline 0 96 rline -91 0 rline 0 -96 rline -319 0 rline
+ 0 37 rline -56 0 rline 0 127 rline 11 0 rline 0 43 rline -7 0 rline
+ 0 35 rline 7 0 rline 0 17 rline -11 0 rline 0 111 rline 85 0 rline
+ 0 -4 rline 49 0 rline 0 -13 rline 23 0 rline 0 -17 rline 27 0 rline
+ 0 -105 rline 213 0 rline 0 102 rline 28 0 rline 0 16 rline 23 0 rline
+ 0 17 rline 37 0 rline 0 4 rline 93 0 rline
+;
+
+: headphones-top
+ 2 95 7 18 boxat
+ 9 91 45 28 boxat
+ headphones-logo
+;
+: mic-top
+ 9 54 45 28 boxat
+ 24 20 rmove mic-logo
+ 2 59 7 18 boxat
+;
+: acin 0 307 36 27 boxat ;
+: int-mic-conn
+ 70 146 18 18 boxat
+ 28 15 rmove mic-logo
+;
+: usb0
+ 7 128 45 27 boxat
+ usb-logo
+;
+: usb1
+ 543 55 45 27 boxat
+ usb-logo
+;
+: usb2
+ 543 100 45 45 boxat
+ 0 9 rmove usb-logo
+;
+: display-conn 252 1 89 18 boxat ;
+: camera-conn 540 154 36 18 boxat ;
+: backlight-conn 63 46 27 17 boxat ;
+: above-int-mic-conn
+ 79 87 18 27 boxat
+ 81 82 9 5 boxat
+ 81 114 9 5 boxat
+;
+: pwr-but 543 338 button-symbol ;
+: rotate-but 30 338 button-symbol ;
+: up-but 37 237 button-symbol ;
+: down-but 37 278 button-symbol ;
+: left-but 14 258 button-symbol ;
+: right-but 57 258 button-symbol ;
+: o-but 543 239 button-symbol ;
+: x-but
+ 543 279 18 18 boxat
+ 548 283 moveto 557 292 lineto 548 292 moveto 557 283 lineto
+;
+: square-but
+ 521 260 18 18 boxat
+ 525 264 moveto 534 264 lineto 534 273 lineto 525 273 lineto 525 264 lineto
+;
+: check-but
+ 564 259 18 18 boxat
+ 570 269 moveto 573 273 lineto 578 263 lineto
+;
+: led0-top 518 348 led-symbol ;
+: led1-top 491 348 led-symbol ;
+: led2-top 72 348 led-symbol ;
+: led3-top 99 348 led-symbol ;
+: mic-led 31 45 led-symbol ;
+: camera-led 569 45 led-symbol ;
+: wlan-conn-top 374 76 104 27 boxat ;
+: wlan-card-top 389 7 75 75 boxat ;
+: ext-sd-slot-top 497 360 81 9 boxat ;
+: ext-sd-card-top
+ 504 369 moveto 0 -75 rline 11 -11 rline 56 0 rline 0 86 rline -67 0 rline
+;
+: draw-top ( -- )
+ basic-layout
+
+ top-outline
+ headphones-top
+ mic-top
+ acin
+ int-mic-conn
+ usb0 usb1 usb2
+ display-conn
+ camera-conn
+ backlight-conn
+ above-int-mic-conn
+ pwr-but
+ rotate-but
+ up-but
+ down-but
+ left-but
+ right-but
+ o-but
+ x-but
+ square-but
+ check-but
+ led0-top
+ led1-top
+ led2-top
+ led3-top
+ mic-led
+ camera-led
+ wlan-conn-top
+ wlan-card-top
+ ext-sd-slot-top
+;
+
+: usb-key ( -- )
+ 95 155 moveto 130 165 lineto 130 155 lineto 95 145 lineto 95 155 lineto
+ 130 155 moveto 150 140 lineto 150 150 lineto 130 165 lineto
+ 150 140 moveto 115 130 lineto 95 145 lineto
+ 146 153 moveto 155 155 lineto 155 135 lineto 110 122 lineto 110 133 lineto
+ 110 122 moveto 110 122 171 67 197 54 curveto 229 38 295 42 155 135 curveto
+ 155 156 moveto 218 111 229 100 241 81 curveto 248 65 239 51 239 51 curveto
+;
+
+: scanner ( -- )
+ 195 98 moveto
+ 195 111 174 121 149 121 curveto
+ 123 121 103 111 102 98 curveto
+ 103 85 123 75 149 75 curveto
+ 174 75 195 85 195 98 curveto
+
+ 111 84 moveto
+ 193 36 228 48 239 61 curveto
+ 261 90 171 122 171 118 curveto
+
+ 235 85 moveto
+ 281 177 310 177 267 201 curveto
+ 251 209 227 200 235 189 curveto
+ 243 177 249 179 248 172 curveto
+ 239 121 196 109 200 109 curveto
+;
+
+: usb-ethernet
+ 130 212 moveto
+ 141 218 145 220 145 205 curveto 145 190 145 190 125 180 curveto
+ 105 170 105 171 105 185 curveto 105 190 105 185 105 190 curveto
+
+ 105 190 moveto
+ 106 190 105 192 105 185 curveto 105 170 105 170 135 155 curveto 165 140 165 140 185 150 curveto
+ 205 160 205 160 205 175 curveto 205 190 205 190 175 205 curveto 145 220 146 221 130 212 curveto
+
+ 125 190 moveto 135 195 lineto 115 205 lineto 95 195 lineto 115 185 lineto 120 188 lineto
+ 105 215 moveto 115 220 lineto 115 205 lineto 95 195 lineto 95 206 lineto
+ 115 220 moveto 135 210 lineto 135 195 lineto 115 205 lineto 115 220 lineto
+ 102 202 moveto 105 201 109 202 110 205 curveto 111 208 111 211 109 213 curveto
+ 109 213 moveto 78 232 38 242 38 242 curveto
+ 103 202 moveto 76 219 38 230 38 230 curveto
+ 130 188 moveto 121 193 lineto 115 190 lineto 125 185 lineto 130 188 lineto
+ 130 188 moveto 130 189 130 193 130 193 curveto
+ 115 185 moveto 120 188 lineto
+ 135 195 moveto 126 191 lineto
+
+ 321 96 moveto 321 106 lineto 322 106 308 124 287 118 curveto
+ 306 108 moveto 313 105 321 96 321 96 curveto 303 89 lineto 303 89 296 92 289 98 curveto 275 112 291 117 306 108 curveto
+ 327 90 moveto 327 96 lineto 321 101 lineto
+ 307 90 moveto 315 85 lineto 327 90 lineto 319 95 lineto
+ 283 111 moveto 284 114 287 112 288 113 curveto 289 114 289 116 288 117 curveto
+ 284 111 moveto 284 110 lineto
+
+ 287 111 moveto 250 134 198 157 198 157 curveto
+ 288 117 moveto 238 147 203 161 203 161 curveto
+;
+
+
+0 value blink-time
+-1 value blink-state
+0 value blink-color
+h# ff0000 constant red-888
+h# 00ff00 constant green-888
+h# 0000ff constant blue-888
+h# 000000 constant black-888
+h# ffffff constant white-888
+h# ff00ff constant magenta-888
+magenta-888 to blink-color
+
+: set-default-color ( -- ) black-888 set-fg ;
+
+defer selected-object ' noop to selected-object
+
+: idle ( -- )
+ blink-state -1 = if exit then
+ 1 ms
+ get-msecs blink-time - 0>= if
+ blink-state 1 xor dup to blink-state ( state )
+ if blink-color set-fg else white-888 set-fg then
+ selected-object
+ get-msecs d# 400 + to blink-time
+ then
+;
+
+: highlight ( xt color -- )
+ to blink-color
+ to selected-object
+ get-msecs to blink-time
+ 0 to blink-state
+ idle
+;
+: message-off ( -- ) d# 2 d# 27 at-xy kill-line ;
+: message ( adr len -- ) cursor-off message-off red-letters type cancel ;
+
+: performed ( -- )
+ -1 to blink-state
+ message-off
+ set-default-color
+ selected-object
+ cr
+;
+
+: connect-scanner ( -- )
+ basic-layout
+ " Connect USB barcode scanner to continue.." message
+ ['] scanner green-888 highlight
+;
+
+: connect-usb-key ( -- )
+ basic-layout
+ " Connect USB stick to continue.." message
+ ['] usb-key green-888 highlight
+;
+
+: connect-usb-ethernet ( -- )
+ basic-layout
+ " Connect USB Ethernet to continue.." message
+ ['] usb-ethernet green-888 highlight
+;
+
+: connect-headphones ( -- )
+ draw-top
+ " Connect headphones to continue.." message
+ ['] headphones-top h# 00e000 highlight \ Green like headphone jack
+;
+: disconnect-headphones ( -- )
+ draw-top
+ " Disconnect headphones to continue.." message
+ ['] headphones-top red-888 highlight
+;
+: connect-microphone ( -- )
+ draw-top
+ " Connect microphone to continue.." message
+ ['] mic-top h# ff80c0 highlight \ Close enough to the pink of the mic jack
+;
+: disconnect-microphone ( -- )
+ draw-top
+ " Disconnect microphone to continue.." message
+ ['] mic-top red-888 highlight
+;
+: mic+phones-top ( -- ) mic-top headphones-top ;
+: connect-loopback ( -- )
+ draw-top
+ " Connect loopback cable to continue.." message
+ ['] mic+phones-top green-888 highlight
+;
+: disconnect-loopback ( -- )
+ draw-top
+ " Disconnect loopback cable to continue.." message
+ ['] mic+phones-top red-888 highlight
+;
+
+: connect-int-sd ( -- )
+ draw-board
+ " Connect internal SD card to continue.." message
+ ['] int-sd-card green-888 highlight
+;
+: connect-ext-sd ( -- )
+ draw-top
+ " Connect external SD card to continue.." message
+ ['] ext-sd-card-top green-888 highlight
+;
+
+: disconnect-int-sd ( -- )
+ draw-board
+ " Disconnect internal SD card to continue.." message
+ ['] int-sd-card red-888 highlight
+;
+: disconnect-ext-sd ( -- )
+ draw-top
+ " Disconnect external SD card to continue.." message
+ ['] ext-sd-card-top red-888 highlight
+;
+
+: open ( -- ok ) true ;
+: close ( -- ) ;
+
+end-support-package
+0 value instructions-ih
+
+: ($instructions) ( name$ -- )
+ instructions-ih 0= if
+ " " " test-instructions" $open-package to instructions-ih
+ then
+ instructions-ih $call-method
+;
+' ($instructions) to $instructions
+
+: (instructions-idle) ( -- ) " idle" $instructions ;
+' (instructions-idle) to instructions-idle
+
+: (instructions-done) ( -- ) " performed" $instructions ;
+' (instructions-done) to instructions-done
+
+: diag-mode ( -- ) true to diag-switch? ;
+
+hex
+
+\ LICENSE_BEGIN
+\ Copyright (c) 2010 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
Added: cpu/arm/olpc/cl4/verify.bth
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ cpu/arm/olpc/cl4/verify.bth Thu Jul 12 22:24:46 2012 (r3055)
@@ -0,0 +1,7 @@
+purpose: Fetch the Crypto code and keys
+
+command: &builder &this
+build-now
+
+fload ${BP}/cpu/arm/olpc/cl4/crypto-version.fth
+fload ${BP}/cpu/arm/olpc/build-crypto.fth
Added: cpu/arm/olpc/cl4/wlan-version.fth
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ cpu/arm/olpc/cl4/wlan-version.fth Thu Jul 12 22:24:46 2012 (r3055)
@@ -0,0 +1,16 @@
+\ The wireless LAN module firmware
+
+\ Thin firmware version
+macro: WLAN_SUBDIR thinfirm/
+macro: WLAN_PREFIX lbtf_sdio-
+macro: WLAN_VERSION 9.0.7.p2
+
+\ Non-thin version
+\ macro: WLAN_SUBDIR
+\ macro: WLAN_PREFIX sd8686-
+\ macro: WLAN_VERSION 9.70.20.p0
+
+\ Alternate command for getting WLAN firmware, for testing new versions.
+\ Temporarily uncomment the line and modify the path as necessary
+\ macro: GET_WLAN cp "/c/Documents and Settings/Mitch Bradley/My Documents/OLPC/DiskImages/sd8686-9.70.7.p0.bin" sd8686.bin; cp "/c/Documents and Settings/Mitch Bradley/My Documents/OLPC/DiskImages/sd8686_helper.bin" sd8686_helper.bin
+\ macro: GET_WLAN wget http://dev.laptop.org/pub/firmware/libertas/thinfirm/lbtf_sdio-9.0.7.p2.bin -O sd8686.bin
1
0
Author: wmb
Date: Thu Jul 12 22:21:13 2012
New Revision: 3054
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/3054
Log:
OLPC ARM - Moved GPIO pin definitions out of */config.fth into separate */gpiopins.fth files.
Added:
cpu/arm/olpc/1.75/gpiopins.fth
cpu/arm/olpc/3.0/gpiopins.fth
Modified:
cpu/arm/olpc/1.75/config.fth
cpu/arm/olpc/3.0/config.fth
Modified: cpu/arm/olpc/1.75/config.fth
==============================================================================
--- cpu/arm/olpc/1.75/config.fth Thu Jul 12 18:48:31 2012 (r3053)
+++ cpu/arm/olpc/1.75/config.fth Thu Jul 12 22:21:13 2012 (r3054)
@@ -31,62 +31,4 @@
h# 10000 constant l2-#sets
-d# 108 constant cam-scl-gpio#
-d# 109 constant cam-sda-gpio#
-
-d# 102 constant cam-rst-gpio#
-d# 150 constant cam-pwr-gpio#
-
-d# 46 constant spi-flash-cs-gpio#
-
-d# 155 constant ec-spi-cmd-gpio#
-d# 125 constant ec-spi-ack-gpio#
-
-d# 161 constant dcon-scl-gpio#
-d# 110 constant dcon-sda-gpio#
-
-d# 124 constant dcon-irq-gpio#
-d# 142 constant dcon-load-gpio#
-
-d# 34 constant en-wlan-pwr-gpio#
-d# 57 constant wlan-pd-gpio#
-d# 58 constant wlan-reset-gpio#
-
-d# 146 constant usb-hub-reset-gpio#
-
-d# 149 constant emmc-rst-gpio#
-
-d# 73 constant sec-trg-gpio#
-
-d# 53 constant rtc-scl-gpio#
-d# 54 constant rtc-sda-gpio#
-
-d# 104 constant ec-edi-cs-gpio#
-d# 105 constant ec-edi-mosi-gpio#
-d# 106 constant ec-edi-clk-gpio#
-
-\ d# 56 constant boot-dev-sel-gpio# \ revision-dependent, determined at run time
-
-d# 129 constant lid-switch-gpio#
-d# 128 constant ebook-mode-gpio#
-
-d# 143 constant mic-ac/dc-gpio#
-d# 8 constant audio-reset-gpio#
-d# 97 constant hp-plug-gpio#
-
-d# 10 constant led-storage-gpio#
-d# 11 constant vid2-gpio#
-
-d# 160 constant soc-tpd-clk-gpio#
-d# 107 constant soc-tpd-dat-gpio#
-
-d# 71 constant soc-kbd-clk-gpio#
-d# 72 constant soc-kbd-dat-gpio#
-d# 148 constant soc-en-kbd-pwr-gpio#
-
-d# 144 constant cam-pwrdn-gpio#
-
-d# 4 constant compass-scl-gpio#
-d# 5 constant compass-sda-gpio#
-
-d# 15 constant rotate-gpio#
+fload ${BP}/cpu/arm/olpc/1.75/gpiopins.fth
Added: cpu/arm/olpc/1.75/gpiopins.fth
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ cpu/arm/olpc/1.75/gpiopins.fth Thu Jul 12 22:21:13 2012 (r3054)
@@ -0,0 +1,62 @@
+\ GPIO pin assignments - XO-1.75
+
+d# 108 constant cam-scl-gpio#
+d# 109 constant cam-sda-gpio#
+
+d# 102 constant cam-rst-gpio#
+d# 150 constant cam-pwr-gpio#
+
+d# 46 constant spi-flash-cs-gpio#
+
+d# 155 constant ec-spi-cmd-gpio#
+d# 125 constant ec-spi-ack-gpio#
+
+d# 161 constant dcon-scl-gpio#
+d# 110 constant dcon-sda-gpio#
+
+d# 124 constant dcon-irq-gpio#
+d# 142 constant dcon-load-gpio#
+
+d# 34 constant en-wlan-pwr-gpio#
+d# 57 constant wlan-pd-gpio#
+d# 58 constant wlan-reset-gpio#
+
+d# 146 constant usb-hub-reset-gpio#
+
+d# 149 constant emmc-rst-gpio#
+
+d# 73 constant sec-trg-gpio#
+
+d# 53 constant rtc-scl-gpio#
+d# 54 constant rtc-sda-gpio#
+
+d# 104 constant ec-edi-cs-gpio#
+d# 105 constant ec-edi-mosi-gpio#
+d# 106 constant ec-edi-clk-gpio#
+
+\ d# 56 constant boot-dev-sel-gpio# \ revision-dependent, determined at run time
+
+d# 129 constant lid-switch-gpio#
+d# 128 constant ebook-mode-gpio#
+
+d# 143 constant mic-ac/dc-gpio#
+d# 8 constant audio-reset-gpio#
+d# 97 constant hp-plug-gpio#
+
+d# 10 constant led-storage-gpio#
+d# 11 constant vid2-gpio#
+
+d# 160 constant soc-tpd-clk-gpio#
+d# 107 constant soc-tpd-dat-gpio#
+
+d# 71 constant soc-kbd-clk-gpio#
+d# 72 constant soc-kbd-dat-gpio#
+d# 148 constant soc-en-kbd-pwr-gpio#
+
+d# 144 constant cam-pwrdn-gpio#
+
+d# 4 constant compass-scl-gpio#
+d# 5 constant compass-sda-gpio#
+
+d# 15 constant rotate-gpio#
+d# 17 constant check-gpio#
Modified: cpu/arm/olpc/3.0/config.fth
==============================================================================
--- cpu/arm/olpc/3.0/config.fth Thu Jul 12 18:48:31 2012 (r3053)
+++ cpu/arm/olpc/3.0/config.fth Thu Jul 12 22:21:13 2012 (r3054)
@@ -30,40 +30,4 @@
h# 10000 constant l2-#sets
-d# 56 constant boot-dev-sel-gpio#
-
-d# 4 constant cam-scl-gpio#
-d# 5 constant cam-sda-gpio#
-
-d# 10 constant cam-rst-gpio#
-d# 150 constant cam-pwr-gpio#
-d# 9 constant cam-pwrdn-gpio#
-
-d# 46 constant spi-flash-cs-gpio#
-
-d# 155 constant ec-spi-cmd-gpio#
-d# 125 constant ec-spi-ack-gpio#
-
-\ CL3 has no DCON
-
-d# 34 constant en-wlan-pwr-gpio#
-d# 57 constant wlan-pd-gpio#
-d# 58 constant wlan-reset-gpio#
-
-d# 146 constant usb-hub-reset-gpio#
-
-d# 149 constant emmc-rst-gpio#
-
-d# 142 constant sec-trg-gpio#
-
-d# 53 constant rtc-scl-gpio#
-d# 54 constant rtc-sda-gpio#
-
-d# 104 constant ec-edi-cs-gpio#
-d# 105 constant ec-edi-mosi-gpio#
-d# 106 constant ec-edi-clk-gpio#
-
-d# 143 constant mic-ac/dc-gpio#
-d# 8 constant audio-reset-gpio#
-d# 97 constant hp-plug-gpio#
-d# 11 constant vid2-gpio#
+fload ${BP}/cpu/arm/olpc/3.0/gpiopins.fth
Added: cpu/arm/olpc/3.0/gpiopins.fth
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ cpu/arm/olpc/3.0/gpiopins.fth Thu Jul 12 22:21:13 2012 (r3054)
@@ -0,0 +1,39 @@
+\ GPIO pin assigments - XO-3.0
+
+d# 4 constant cam-scl-gpio#
+d# 5 constant cam-sda-gpio#
+
+d# 10 constant cam-rst-gpio#
+d# 150 constant cam-pwr-gpio#
+d# 9 constant cam-pwrdn-gpio#
+
+d# 46 constant spi-flash-cs-gpio#
+
+d# 155 constant ec-spi-cmd-gpio#
+d# 125 constant ec-spi-ack-gpio#
+
+\ CL3 has no DCON
+
+d# 34 constant en-wlan-pwr-gpio#
+d# 57 constant wlan-pd-gpio#
+d# 58 constant wlan-reset-gpio#
+
+d# 146 constant usb-hub-reset-gpio#
+
+d# 149 constant emmc-rst-gpio#
+
+d# 142 constant sec-trg-gpio#
+
+d# 53 constant rtc-scl-gpio#
+d# 54 constant rtc-sda-gpio#
+
+d# 104 constant ec-edi-cs-gpio#
+d# 105 constant ec-edi-mosi-gpio#
+d# 106 constant ec-edi-clk-gpio#
+
+d# 56 constant boot-dev-sel-gpio#
+
+d# 143 constant mic-ac/dc-gpio#
+d# 8 constant audio-reset-gpio#
+d# 97 constant hp-plug-gpio#
+d# 11 constant vid2-gpio#
1
0
Author: wmb
Date: Thu Jul 12 18:48:31 2012
New Revision: 3053
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/3053
Log:
OLPC XO-1.75 - Added keyject.bth template.
Added:
cpu/arm/olpc/1.75/keyject.bth
Added: cpu/arm/olpc/1.75/keyject.bth
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ cpu/arm/olpc/1.75/keyject.bth Thu Jul 12 18:48:31 2012 (r3053)
@@ -0,0 +1,224 @@
+purpose: Construct the Open Firmware module collection
+
+command: &builder &this
+in: ${BP}/cpu/arm/olpc/1.75/build/ec.img
+in: ${BP}/cpu/arm/olpc/1.75/build/fw.img
+in: ${BP}/cpu/arm/olpc/1.75/build/resetvec.img
+in: ${BP}/cpu/arm/olpc/1.75/build/mcastnand.bin
+in: sd8686.bin
+in: verify.img
+in: ${BP}/dev/usb2/device/hub/build/hub.fc
+in: ${BP}/dev/usb2/device/generic/build/generic.fc
+in: ${BP}/dev/usb2/device/net/build/usbnet.fc
+in: ${BP}/dev/usb2/device/keyboard/build/usbkbd.fc
+in: ${BP}/dev/usb2/device/mouse/build/usbmouse.fc
+in: ${BP}/dev/usb2/device/serial/build/usbserial.fc
+in: ${BP}/dev/usb2/device/storage/build/usbstorage.fc
+in: testicons.bin
+in: ${BP}/clients/emacs/arm/emacs
+in: cforth.img
+build-now
+
+fload ${BP}/cpu/arm/olpc/1.75/fw-version.fth
+macro: FW_MINOR 20z
+
+" macro: FW_VERSION ${FW_PREFIX}${FW_MAJOR}${FW_MINOR}" expand$ eval
+
+fload ${BP}/cpu/arm/olpc/1.75/config.fth
+
+\ Always re-create the builton.fth file when we make a new rom.img
+fload ${BP}/cpu/x86/pc/builton.bth
+fload ${BP}/cpu/arm/olpc/sourceurl.fth
+
+fload ${BP}/forth/lib/crc32.fth
+
+hex
+
+: pad-file ( location -- )
+ ofd @ fsize
+ 2dup u< abort" The ROM image is too large"
+ ?do h# ff ofd @ fputc loop
+;
+
+fload ${BP}/cpu/arm/marvell/tim.fth
+
+\ Marvel Trusted Image Module image creation script for
+\ XO-1.75 platform.
+
+tim: 00030102 0 Sky! PXA688
+flash: SPI'10
+timh: TIMH 0 d101f000
+\ Main Processor code loaded into DRAM
+image: OBMI 800 d101c000 ${BP}/cpu/arm/olpc/dummy.img
+\ Secure Processor code loaded into SRAM
+image: WTMI 1000 d1018000 shim.img
+image: CFTH 2000 d1000000 cforth.img
+reserved:
+ term:
+end-reserved
+end-tim
+
+h# e.0000 to reserved-start
+h# f.0000 to reserved-end
+
+.( --- Saving as )
+" ${FW_VERSION}.rom" expand$ 2dup lower ( adr len )
+2dup type cr ( adr len )
+$new-file
+ tim$ ofd @ fputs
+
+ dropin-offset pad-file
+
+\ Loads the set of drivers that is common to different output formats
+
+ " ${BP}/cpu/arm/build/inflate.bin" " inflate" $add-dropin
+ " fw.img" " firmware" $add-deflated-dropin
+\ " fw.img" " firmware" $add-dropin
+ " resetvec.img" " reset" $add-dropin
+
+ " sd8686_helper.bin" " helper_sd.bin" $add-deflated-dropin
+ " sd8686.bin" " sd8686.bin" $add-deflated-dropin
+
+ " verify.img" " verify" $add-deflated-dropin
+
+ " sourceurl" " sourceurl" $add-dropin
+
+ " ${BP}/cpu/x86/pc/olpc/images/Edge1-8k-EQ-Comp-Amp-Short.wav" " splash" $add-deflated-dropin
+
+ " ec.img" " ecimage.bin" $add-deflated-dropin
+ " ${BP}/clients/emacs/x86/emacs.rc" " emacs.rc" $add-deflated-dropin
+ " ${BP}/clients/emacs/emacs.hlp" " emacs.hlp" $add-deflated-dropin
+ " ${BP}/clients/emacs/arm/emacs" " emacs" $add-deflated-dropin
+
+ " nandblaster15_rx.bin" " nb15_rx" $add-deflated-dropin
+ " nandblaster_tx.bin" " nb_tx" $add-deflated-dropin
+
+ \ icons for mfg test gui
+ " testicons/play.565" " play.565" $add-deflated-dropin
+ " testicons/quit.565" " quit.565" $add-deflated-dropin
+ " testicons/cpu.565" " cpu.565" $add-deflated-dropin
+ " testicons/spi.565" " spi.565" $add-deflated-dropin
+ " testicons/ram.565" " ram.565" $add-deflated-dropin
+ " testicons/sdcard.565" " sdcard.565" $add-deflated-dropin
+ " testicons/keyboard.565" " keyboard.565" $add-deflated-dropin
+ " testicons/display.565" " display.565" $add-deflated-dropin
+ " testicons/touchpad.565" " touchpad.565" $add-deflated-dropin
+ " testicons/audio.565" " audio.565" $add-deflated-dropin
+ " testicons/usb.565" " usb.565" $add-deflated-dropin
+ " testicons/battery.565" " battery.565" $add-deflated-dropin
+ " testicons/camera.565" " camera.565" $add-deflated-dropin
+ " testicons/wifi.565" " wifi.565" $add-deflated-dropin
+ " testicons/clock.565" " clock.565" $add-deflated-dropin
+ " testicons/timer.565" " timer.565" $add-deflated-dropin
+
+ " os.public" " ospubkey" $add-dropin \ Incompressible
+ " fw.public" " fwpubkey" $add-dropin \ Incompressible
+ " fs.public" " fspubkey" $add-dropin \ Incompressible
+ " lease.public" " leasepubkey" $add-dropin \ Incompressible
+ " developer.public" " develpubkey" $add-dropin \ Incompressible
+
+ " builton.fth" " probe-" $add-dropin
+
+\ " ${BP}/dev/usb2/hcd/ehci/build/ehci.fc" " class0c0320" $add-deflated-dropin
+ " ${BP}/dev/usb2/device/hub/build/hub.fc" " usb,class9" $add-deflated-dropin
+ " ${BP}/dev/usb2/device/generic/build/generic.fc" " usbdevice" $add-deflated-dropin
+ " ${BP}/dev/usb2/device/net/build/usbnet.fc" " usbnet" $add-deflated-dropin
+ " ${BP}/dev/usb2/device/keyboard/build/usbkbd.fc" " usb,class3,1,1" $add-deflated-dropin
+ " ${BP}/dev/usb2/device/mouse/build/usbmouse.fc" " usb,class3,1,2" $add-deflated-dropin
+ " ${BP}/dev/usb2/device/serial/build/usbserial.fc" " usbserial" $add-deflated-dropin
+ " ${BP}/dev/usb2/device/storage/build/usbstorage.fc" " usbstorage" $add-deflated-dropin
+
+ " ${BP}/ofw/inet/telnetd.fth" " telnetd" $add-deflated-dropin
+
+ " ${BP}/cpu/x86/pc/olpc/images/bigx.di" $add-file
+ " ${BP}/cpu/x86/pc/olpc/images/bigcheck.di" $add-file
+ " ${BP}/cpu/x86/pc/olpc/images/leds.di" $add-file
+ " ${BP}/cpu/x86/pc/olpc/images/ebook.di" $add-file
+
+\ " ${BP}/cpu/x86/pc/olpc/images/warnings.565" " warnings.565" $add-deflated-dropin
+ " ${BP}/cpu/x86/pc/olpc/images/lightdot.565" " lightdot.565" $add-deflated-dropin
+ " ${BP}/cpu/x86/pc/olpc/images/yellowdot.565" " yellowdot.565" $add-deflated-dropin
+ " ${BP}/cpu/x86/pc/olpc/images/darkdot.565" " darkdot.565" $add-deflated-dropin
+ " ${BP}/cpu/x86/pc/olpc/images/lock.565" " lock.565" $add-deflated-dropin
+ " ${BP}/cpu/x86/pc/olpc/images/unlock.565" " unlock.565" $add-deflated-dropin
+ " ${BP}/cpu/x86/pc/olpc/images/plus.565" " plus.565" $add-deflated-dropin
+ " ${BP}/cpu/x86/pc/olpc/images/minus.565" " minus.565" $add-deflated-dropin
+ " ${BP}/cpu/x86/pc/olpc/images/x.565" " x.565" $add-deflated-dropin
+ " ${BP}/cpu/x86/pc/olpc/images/sad.565" " sad.565" $add-deflated-dropin
+ " ${BP}/cpu/x86/pc/olpc/images/bigdot.565" " bigdot.565" $add-deflated-dropin
+
+ " ${BP}/cpu/x86/pc/olpc/images/check.565" " check.565" $add-deflated-dropin
+ " ${BP}/cpu/x86/pc/olpc/images/xogray.565" " xogray.565" $add-deflated-dropin
+ " ${BP}/cpu/x86/pc/olpc/images/ethernet.565" " ethernet.565" $add-deflated-dropin
+ " ${BP}/cpu/x86/pc/olpc/images/usbkey.565" " disk.565" $add-deflated-dropin
+ " ${BP}/cpu/x86/pc/olpc/images/wireless.565" " wlan.565" $add-deflated-dropin
+ " ${BP}/cpu/x86/pc/olpc/images/laptop.565" " int.565" $add-deflated-dropin
+ " ${BP}/cpu/x86/pc/olpc/images/sd.565" " ext.565" $add-deflated-dropin
+
+ " ${BP}/cpu/x86/pc/olpc/keyject.fth" " probe+" $add-deflated-dropin
+ " ${BP}/cpu/x86/pc/olpc/o1.public" " o1" $add-dropin \ Incompressible
+ " ${BP}/cpu/x86/pc/olpc/s1.public" " s1" $add-dropin
+ " ${BP}/cpu/x86/pc/olpc/d1.public" " d1" $add-dropin
+ " ${BP}/cpu/x86/pc/olpc/w1.public" " w1" $add-dropin
+ " ${BP}/cpu/x86/pc/olpc/a1.public" " a1" $add-dropin
+
+.( Dropin top is ) ofd @ fsize .x cr
+
+/rom pad-file
+
+\ Insert the revision signature
+/rom h# 40 - ofd @ fseek
+h# 10 buffer: signature
+signature h# 10 blank
+signature$ signature swap move
+" ${FW_VERSION}" expand$ signature 6 + swap move
+" ${FW_PREFIX}${FW_MAJOR}" expand$ signature d# 13 + swap move
+signature h# 10 ofd @ fputs
+
+/l buffer: crcbuf
+/rom buffer: filebuf
+
+\ Read the entire image, compute the CRC, and store it h# 28 from the end
+0 ofd @ fseek
+filebuf /rom ofd @ fgets /rom <> abort" Can't read back image"
+0 crctab filebuf /rom ($crc) crcbuf !
+
+crc-offset ofd @ fseek
+crcbuf /l ofd @ fputs
+
+ofd @ fclose
+
+\ Creating olpc.version serves two purposes:
+\ a) It reports the firmware revision for use by external scripts
+\ b) It provides an olpc.* artifact for the builder dependency management.
+
+writing keyject.version
+" ${FW_VERSION}" expand$ 2dup lower ofd @ fputs
+ofd @ fclose
+
+
+
+\ LICENSE_BEGIN
+\ Copyright (c) 2010 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
+
1
0
Author: quozl
Date: Thu Jul 12 09:24:50 2012
New Revision: 3052
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/3052
Log:
OLPC XO-1.5 XO-1.75 - an fs-load command, the reverse of fs-save, very slow, but useful for testing.
Added:
cpu/x86/pc/olpc/via/fsload.fth
Modified:
cpu/arm/olpc/build-fw.fth
cpu/x86/pc/olpc/via/fw.bth
Modified: cpu/arm/olpc/build-fw.fth
==============================================================================
--- cpu/arm/olpc/build-fw.fth Thu Jul 12 08:29:04 2012 (r3051)
+++ cpu/arm/olpc/build-fw.fth Thu Jul 12 09:24:50 2012 (r3052)
@@ -660,6 +660,7 @@
fload ${BP}/cpu/x86/pc/olpc/via/fsupdate.fth
fload ${BP}/cpu/x86/pc/olpc/via/fsverify.fth
fload ${BP}/cpu/x86/pc/olpc/via/fssave.fth
+fload ${BP}/cpu/x86/pc/olpc/via/fsload.fth
devalias fsdisk int:0
\ create pong-use-touchscreen
Added: cpu/x86/pc/olpc/via/fsload.fth
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ cpu/x86/pc/olpc/via/fsload.fth Thu Jul 12 09:24:50 2012 (r3052)
@@ -0,0 +1,51 @@
+\ Read blocks from a file and write to internal storage
+[ifndef] fs-load
+vocabulary fs-load-commands
+also fs-load-commands definitions
+
+0 value data-buffer
+
+h# ff a5 00 rgb>565 constant loaded-color \ orange
+
+: (fs-load-chunk) ( #bytes -- )
+ data-buffer over filefd fgets ( #bytes #read )
+ over <> " Read failure" ?nand-abort ( #bytes #read )
+ data-buffer swap " write" $call-nand ( #bytes )
+ drop ( )
+;
+
+: (fs-load) ( -- )
+ load-base to data-buffer
+ " size" $call-nand /nand-block um/mod ( #left-over-bytes #blocks )
+ dup show-init
+ 0 do
+ /nand-block (fs-load-chunk) ( #left-over-bytes )
+ i dup show-eblock# loaded-color show-state ( #left-over-bytes )
+ loop ( #left-over-bytes )
+ ?dup if ( #left-over-bytes )
+ (fs-load-chunk) ( )
+ then ( )
+;
+
+previous definitions
+
+: $fs-load ( file$ -- )
+ open-nand ( file$ )
+ r/o open-file ( fd error? )
+ " Can't open file" ?nand-abort ( fd )
+ to filefd ( )
+ t-hms(
+ [ also fs-load-commands ]
+ ['] (fs-load) catch ( 0 | x error# )
+ [ previous ]
+ show-done
+ close-nand-ihs
+ )t-hms
+ throw ( )
+;
+
+: fs-load ( "fs.img" -- ) \ read blocks from a file
+ safe-parse-word $fs-load
+;
+
+[then]
Modified: cpu/x86/pc/olpc/via/fw.bth
==============================================================================
--- cpu/x86/pc/olpc/via/fw.bth Thu Jul 12 08:29:04 2012 (r3051)
+++ cpu/x86/pc/olpc/via/fw.bth Thu Jul 12 09:24:50 2012 (r3052)
@@ -523,6 +523,7 @@
fload ${BP}/cpu/x86/pc/olpc/via/fsupdate.fth
fload ${BP}/cpu/x86/pc/olpc/via/fsverify.fth
fload ${BP}/cpu/x86/pc/olpc/via/fssave.fth
+fload ${BP}/cpu/x86/pc/olpc/via/fsload.fth
devalias fsdisk int:0
fload ${BP}/ofw/inet/sntp.fth
1
0
Author: quozl
Date: Thu Jul 12 08:29:04 2012
New Revision: 3051
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/3051
Log:
OLPC XO-1.75 - move the ramdisk below load-base, as linux will not boot with it in the second half of 1GB units, add room below load-base, which can be thought of as a border between where stuff is initially loaded into, vs where stuff is moved to, #12008
Modified:
cpu/arm/linux.fth
cpu/arm/olpc/addrs.fth
Modified: cpu/arm/linux.fth
==============================================================================
--- cpu/arm/linux.fth Wed Jul 11 04:00:56 2012 (r3050)
+++ cpu/arm/linux.fth Thu Jul 12 08:29:04 2012 (r3051)
@@ -107,7 +107,7 @@
arm-linux-machine-type to r1
[ifdef] flatten-device-tree
use-fdt? if
- ramdisk-adr ?dup 0= if mapped-limit then /fdt-max - to linux-params
+ ramdisk-adr ?dup 0= if load-base then /fdt-max - to linux-params
linux-params /fdt-max flatten-device-tree
else
args-buf cscount linux-params set-parameters
@@ -125,7 +125,7 @@
: linux-place-ramdisk ( adr len -- )
to /ramdisk ( adr )
- mapped-limit /ramdisk - ( adr new-ramdisk-adr )
+ load-base /ramdisk - ( adr new-ramdisk-adr )
tuck /ramdisk move ( new-ramdisk-adr )
\ dup to linux-memtop
to ramdisk-adr
Modified: cpu/arm/olpc/addrs.fth
==============================================================================
--- cpu/arm/olpc/addrs.fth Wed Jul 11 04:00:56 2012 (r3050)
+++ cpu/arm/olpc/addrs.fth Thu Jul 12 08:29:04 2012 (r3051)
@@ -31,7 +31,7 @@
\ fw-mem-pa page-table-offset + constant page-table-pa
\ h# 0110.0000 constant def-load-base
-h# 0800.0000 constant def-load-base
+h# 0c00.0000 constant def-load-base
\ The heap starts at RAMtop, which on this system is "fw-mem-pa /fw-mem +"
1
0
Author: wmb
Date: Wed Jul 11 04:00:56 2012
New Revision: 3050
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/3050
Log:
OFW core - another fix to the "relative phandles" suite, this one affecting the rarely used function "delete-package".
Modified:
ofw/core/ofwcore.fth
Modified: ofw/core/ofwcore.fth
==============================================================================
--- ofw/core/ofwcore.fth Wed Jul 11 03:50:11 2012 (r3049)
+++ ofw/core/ofwcore.fth Wed Jul 11 04:00:56 2012 (r3050)
@@ -745,7 +745,7 @@
(push-package) definitions
;
: pop-package ( -- ) (pop-package) definitions ;
-: push-device ( acf -- ) to current-device ;
+: push-device ( phandle -- ) to current-device ;
: pop-device ( -- )
parent-device ( parent-phandle )
@@ -1292,13 +1292,14 @@
root-device? abort" Attempted to find the predecessor of the root package"
pop-device ( R: phandle )
'child begin ( link R: phandle )
- dup link@ ( link phandle' R: phandle )
- dup r@ <> ( link phandle' flag R: phandle )
+ dup link@ ( link voc' R: phandle )
+ dup r@ phandle>voc <> ( link voc' flag R: phandle )
while ( link phandle' R: phandle )
- push-device drop 'peer ( link R: phandle)
+ voc>phandle push-device ( link R: phandle)
+ drop 'peer ( link' R: phandle)
repeat ( link phandle' R: phandle )
r> 2drop ( link )
- pop-package
+ pop-package ( link )
;
: delete-package ( phandle -- )
dup next-package swap previous-link link!
@@ -1948,12 +1949,12 @@
;
: ls ( -- )
device-context? if
- 'child token@ ( first-node )
- begin non-null? while ( node )
+ 'child token@ ( first-node-voc )
+ begin non-null? while ( node-voc )
voc>phandle push-device ( )
.nodeid ( )
- 'peer token@ ( node' )
- pop-device
+ 'peer token@ ( node-voc' )
+ pop-device ( )
repeat ( )
else
.not-devtree
@@ -1961,12 +1962,12 @@
;
: delete-my-children ( -- )
device-context? if
- 'child token@ ( first-node )
- begin non-null? while ( node )
- dup push-device ( node )
- 'peer token@ ( node peer )
- pop-device ( node peer )
- swap delete-package ( peer )
+ 'child token@ ( first-node-voc )
+ begin non-null? while ( node-voc )
+ voc>phandle dup push-device ( node-phandle )
+ 'peer token@ ( node-phandle peer-voc )
+ pop-device ( node-phandle peer-voc )
+ swap delete-package ( peer-voc )
repeat ( )
then
;
@@ -2162,6 +2163,7 @@
(push-package) get-property (pop-package)
;
+\ XXX - I think this could be implemented by (push-package) (property) (pop-package)
: set-package-property ( value$ name$ phandle -- )
current token@ >r context token@ >r (select-package) ( value$ name$ )
(property)
1
0
[commit] r3049 - cpu/arm/mmp2 cpu/arm/olpc cpu/arm/olpc/1.75 cpu/arm/olpc/3.0 cpu/x86/pc/olpc dev/olpc/dcon dev/olpc/kb3700 dev/olpc/mmp2camera dev/olpc/spiflash
by repository service July 10, 2012
by repository service July 10, 2012
July 10, 2012
Author: wmb
Date: Wed Jul 11 03:50:11 2012
New Revision: 3049
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/3049
Log:
OLPC - omnibus change to greatly reduce the number of platform-specific ifdefs. The GPIOs are now named in <platform>/config.fth and referenced by name in common code. The drivers that differ between platforms are loaded in <platform>/fw.bth instead of in build-fw.fth . Hopefully this will make the code easier to maintain.
Added:
cpu/arm/olpc/1.75/config-a1.fth
cpu/arm/olpc/1.75/gamekey-a1.fth
cpu/arm/olpc/gpio-gamekeys.fth
cpu/arm/olpc/keypad-gamekeys.fth
cpu/arm/olpc/save-fw.fth
cpu/arm/olpc/test-tweaks.fth
cpu/arm/olpc/usb.fth
Modified:
cpu/arm/mmp2/dramrecal.fth
cpu/arm/mmp2/sspspi.fth
cpu/arm/olpc/1.75/compass.fth
cpu/arm/olpc/1.75/config.fth
cpu/arm/olpc/1.75/fw.bth
cpu/arm/olpc/1.75/lcdcfg.fth
cpu/arm/olpc/1.75/leds.fth
cpu/arm/olpc/1.75/olpc.bth
cpu/arm/olpc/1.75/usb.fth
cpu/arm/olpc/3.0/config.fth
cpu/arm/olpc/3.0/fw.bth
cpu/arm/olpc/3.0/lcdcfg.fth
cpu/arm/olpc/3.0/leds.fth
cpu/arm/olpc/3.0/olpc.bth
cpu/arm/olpc/3.0/switches.fth
cpu/arm/olpc/3.0/usb.fth
cpu/arm/olpc/addrs.fth
cpu/arm/olpc/boardrev.fth
cpu/arm/olpc/build-fw.fth
cpu/arm/olpc/emmc.fth
cpu/arm/olpc/lcd.fth
cpu/arm/olpc/prefw.fth
cpu/arm/olpc/probemem.fth
cpu/arm/olpc/rtc.fth
cpu/arm/olpc/sdhci.fth
cpu/arm/olpc/sound.fth
cpu/x86/pc/olpc/sound.fth
dev/olpc/dcon/mmp2dcon.fth
dev/olpc/kb3700/spicmd.fth
dev/olpc/mmp2camera/platform.fth
dev/olpc/spiflash/spiui.fth
Modified: cpu/arm/mmp2/dramrecal.fth
==============================================================================
--- cpu/arm/mmp2/dramrecal.fth Tue Jul 10 21:23:04 2012 (r3048)
+++ cpu/arm/mmp2/dramrecal.fth Wed Jul 11 03:50:11 2012 (r3049)
@@ -647,8 +647,10 @@
\ How to wakeup from SP:
: setup-key-wakeup ( -- )
d# 24 d# 15 do h# b0 i af! loop \ Wake SoC on game keys
- h# 220 d# 71 af! \ Wake SoC on KBD CLK falling edge
- h# 221 d# 160 af! \ Wake SoC on TPD CLK falling edge
+[ifdef] soc-kbd-clk-gpio#
+ h# 220 soc-kbd-clk-gpio# af! \ Wake SoC on KBD CLK falling edge
+ h# 221 soc-tpd-clk-gpio# af! \ Wake SoC on TPD CLK falling edge
+[then]
h# 4 h# 4c +mpmu io-set \ Pin edge (GPIO per datasheet) wakes SoC
['] disable-int40 d# 40 interrupt-handler!
d# 40 enable-interrupt \ SP to PJ4 communications interrupt
@@ -749,11 +751,16 @@
\ end mmp2_pm_enter_lowpower_mode(state)
;
-: keyboard-power-on ( -- ) d# 148 gpio-clr ;
-: keyboard-power-off ( -- ) d# 148 gpio-set ;
-: wlan-power-on ( -- ) d# 34 gpio-set ;
-: wlan-power-off ( -- ) d# 34 gpio-clr h# 040 d# 34 af! h# 040 d# 57 af! h# 040 d# 58 af! ;
-: wlan-stay-on ( -- ) h# 140 d# 34 af! h# 140 d# 57 af! h# 140 d# 58 af! ;
+[ifdef] soc-en-kbd-pwr-gpio#
+: keyboard-power-on ( -- ) soc-en-kbd-pwr-gpio# gpio-clr ;
+: keyboard-power-off ( -- ) soc-en-kbd-pwr-gpio# gpio-set ;
+[else]
+: keyboard-power-on ( -- ) ;
+: keyboard-power-off ( -- ) ;
+[then]
+: wlan-power-on ( -- ) en-wlan-pwr-gpio# gpio-set ;
+: wlan-power-off ( -- ) en-wlan-pwr-gpio# gpio-clr h# 040 en-wlan-pwr-gpio# af! h# 040 wlan-pd-gpio# af! h# 040 wlan-reset-gpio# af! ;
+: wlan-stay-on ( -- ) h# 140 en-wlan-pwr-gpio# af! h# 140 wlan-pd-gpio# af! h# 140 wlan-reset-gpio# af! ;
0 value sleep-mask
: screen-sleep
Modified: cpu/arm/mmp2/sspspi.fth
==============================================================================
--- cpu/arm/mmp2/sspspi.fth Tue Jul 10 21:23:04 2012 (r3048)
+++ cpu/arm/mmp2/sspspi.fth Wed Jul 11 03:50:11 2012 (r3049)
@@ -20,12 +20,12 @@
h# 07 ssp-sscr0 io!
0 ssp-sscr1 io!
h# 87 ssp-sscr0 io!
- d# 46 gpio-set
- d# 46 gpio-dir-out
- h# c0 d# 46 af!
+ spi-flash-cs-gpio# gpio-set
+ spi-flash-cs-gpio# gpio-dir-out
+ h# c0 spi-flash-cs-gpio# af!
;
-: ssp-spi-cs-on ( -- ) d# 46 gpio-clr ;
-: ssp-spi-cs-off ( -- ) d# 46 gpio-set ;
+: ssp-spi-cs-on ( -- ) spi-flash-cs-gpio# gpio-clr ;
+: ssp-spi-cs-off ( -- ) spi-flash-cs-gpio# gpio-set ;
code ssp-spi-out-in ( bo -- bi )
set r0,`ssp-base +io #`
Modified: cpu/arm/olpc/1.75/compass.fth
==============================================================================
--- cpu/arm/olpc/1.75/compass.fth Tue Jul 10 21:23:04 2012 (r3048)
+++ cpu/arm/olpc/1.75/compass.fth Wed Jul 11 03:50:11 2012 (r3049)
@@ -2,8 +2,8 @@
" compass" name
: set-compass-slave ( -- )
- 4 to smb-clock-gpio#
- 5 to smb-data-gpio#
+ compass-scl-gpio# to smb-clock-gpio#
+ compass-sda-gpio# to smb-data-gpio#
h# 3c to smb-slave
smb-data-gpio# gpio-dir-out
;
Added: cpu/arm/olpc/1.75/config-a1.fth
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ cpu/arm/olpc/1.75/config-a1.fth Wed Jul 11 03:50:11 2012 (r3049)
@@ -0,0 +1,88 @@
+create cl2-a1
+create debug-startup
+create olpc
+create olpc-cl2
+create trust-ec-keyboard
+create use-null-nvram
+create use-elf
+create has-sp-kbd
+create has-dcon
+
+fload ${BP}/cpu/arm/mmp2/hwaddrs.fth
+fload ${BP}/cpu/arm/olpc/addrs.fth
+
+[ifdef] use-flash-nvram
+h# d.0000 constant nvram-offset
+[then]
+
+h# e.0000 constant mfg-data-offset \ Offset to manufacturing data area in SPI FLASH
+h# f.0000 constant mfg-data-end-offset \ Offset to end of manufacturing data area in SPI FLASH
+h# f.ffd8 constant crc-offset
+
+h# 10.0000 constant /rom \ Total size of SPI FLASH
+
+: signature$ " CL2" ;
+: model$ " olpc,XO-1.75" ;
+: compatible$ " olpc,xo-1.75" ;
+
+: touchscreen-driver$ " ${BP}/cpu/arm/olpc/rm3150-touchscreen.fth" ;
+d# 9999 constant machine-type \ Backwards compatibility with non-device-tree kernel
+
+char 3 constant expected-ec-version
+h# 10000 value /ec-flash
+
+h# 10000 constant l2-#sets
+
+d# 108 constant cam-scl-gpio#
+d# 109 constant cam-sda-gpio#
+
+d# 102 constant cam-rst-gpio#
+d# 145 constant cam-pwr-gpio#
+
+d# 46 constant spi-flash-cs-gpio#
+
+d# 155 constant ec-spi-cmd-gpio#
+d# 125 constant ec-spi-ack-gpio#
+
+d# 162 constant dcon-scl-gpio#
+d# 163 constant dcon-sda-gpio#
+
+d# 124 constant dcon-irq-gpio#
+d# 151 constant dcon-load-gpio#
+
+d# 34 constant en-wlan-pwr-gpio#
+d# 57 constant wlan-pd-gpio#
+d# 58 constant wlan-reset-gpio#
+
+d# 146 constant usb-hub-reset-gpio#
+
+d# 149 constant emmc-rst-gpio#
+
+d# 73 constant sec-trg-gpio#
+
+d# 97 constant rtc-scl-gpio#
+d# 98 constant rtc-sda-gpio#
+
+d# 129 constant lid-switch-gpio#
+d# 128 constant ebook-mode-gpio#
+
+d# 143 constant mic-ac/dc-gpio#
+d# 8 constant audio-reset-gpio#
+d# 97 constant hp-plug-gpio#
+
+d# 10 constant led-storage-gpio#
+d# 11 constant vid2-gpio#
+
+d# 160 constant soc-tpd-clk-gpio#
+d# 107 constant soc-tpd-dat-gpio#
+
+d# 71 constant soc-kbd-clk-gpio#
+d# 72 constant soc-kbd-dat-gpio#
+d# 148 constant soc-en-kbd-pwr-gpio#
+
+d# 144 constant cam-pwrdn-gpio#
+
+d# 4 constant compass-scl-gpio#
+d# 5 constant compass-sda-gpio#
+
+d# 20 constant rotate-gpio#
Modified: cpu/arm/olpc/1.75/config.fth
==============================================================================
--- cpu/arm/olpc/1.75/config.fth Tue Jul 10 21:23:04 2012 (r3048)
+++ cpu/arm/olpc/1.75/config.fth Wed Jul 11 03:50:11 2012 (r3049)
@@ -1,12 +1,92 @@
-\ create cl2-a1
create debug-startup
create olpc
create olpc-cl2
create trust-ec-keyboard
create use-null-nvram
create use-elf
+create has-sp-kbd
+create has-dcon
fload ${BP}/cpu/arm/mmp2/hwaddrs.fth
fload ${BP}/cpu/arm/olpc/addrs.fth
-create machine-signature ," CL2"
+[ifdef] use-flash-nvram
+h# d.0000 constant nvram-offset
+[then]
+
+h# e.0000 constant mfg-data-offset \ Offset to manufacturing data area in SPI FLASH
+h# f.0000 constant mfg-data-end-offset \ Offset to end of manufacturing data area in SPI FLASH
+h# f.ffd8 constant crc-offset
+
+h# 10.0000 constant /rom \ Total size of SPI FLASH
+
+: signature$ " CL2" ;
+: model$ " olpc,XO-1.75" ;
+: compatible$ " olpc,xo-1.75" ;
+
+d# 9999 constant machine-type \ Backwards compatibility with non-device-tree kernel
+
+char 4 constant expected-ec-version
+h# 8000 value /ec-flash
+
+h# 10000 constant l2-#sets
+
+d# 108 constant cam-scl-gpio#
+d# 109 constant cam-sda-gpio#
+
+d# 102 constant cam-rst-gpio#
+d# 150 constant cam-pwr-gpio#
+
+d# 46 constant spi-flash-cs-gpio#
+
+d# 155 constant ec-spi-cmd-gpio#
+d# 125 constant ec-spi-ack-gpio#
+
+d# 161 constant dcon-scl-gpio#
+d# 110 constant dcon-sda-gpio#
+
+d# 124 constant dcon-irq-gpio#
+d# 142 constant dcon-load-gpio#
+
+d# 34 constant en-wlan-pwr-gpio#
+d# 57 constant wlan-pd-gpio#
+d# 58 constant wlan-reset-gpio#
+
+d# 146 constant usb-hub-reset-gpio#
+
+d# 149 constant emmc-rst-gpio#
+
+d# 73 constant sec-trg-gpio#
+
+d# 53 constant rtc-scl-gpio#
+d# 54 constant rtc-sda-gpio#
+
+d# 104 constant ec-edi-cs-gpio#
+d# 105 constant ec-edi-mosi-gpio#
+d# 106 constant ec-edi-clk-gpio#
+
+\ d# 56 constant boot-dev-sel-gpio# \ revision-dependent, determined at run time
+
+d# 129 constant lid-switch-gpio#
+d# 128 constant ebook-mode-gpio#
+
+d# 143 constant mic-ac/dc-gpio#
+d# 8 constant audio-reset-gpio#
+d# 97 constant hp-plug-gpio#
+
+d# 10 constant led-storage-gpio#
+d# 11 constant vid2-gpio#
+
+d# 160 constant soc-tpd-clk-gpio#
+d# 107 constant soc-tpd-dat-gpio#
+
+d# 71 constant soc-kbd-clk-gpio#
+d# 72 constant soc-kbd-dat-gpio#
+d# 148 constant soc-en-kbd-pwr-gpio#
+
+d# 144 constant cam-pwrdn-gpio#
+
+d# 4 constant compass-scl-gpio#
+d# 5 constant compass-sda-gpio#
+
+d# 15 constant rotate-gpio#
Modified: cpu/arm/olpc/1.75/fw.bth
==============================================================================
--- cpu/arm/olpc/1.75/fw.bth Tue Jul 10 21:23:04 2012 (r3048)
+++ cpu/arm/olpc/1.75/fw.bth Wed Jul 11 03:50:11 2012 (r3049)
@@ -8,3 +8,39 @@
" fw.tag" r/w create-file drop tag-file !
fload ${BP}/cpu/arm/olpc/build-fw.fth
+
+\ The internal SD card shares the host controller circuitry with
+\ the internal eMMC, so you can only use one at a time. A GPIO
+\ chooses which one to use. The intended usage is to "repair"
+\ boards with a broken eMMC chip by inserting a microSD and grounding
+\ the GPIO.
+
+: clx-touch? ( -- ) board-revision h# 3a18 >= ;
+: boot-dev-sel-gpio# ( -- n ) clx-touch? if 2 else d# 56 then ;
+
+fload ${BP}/cpu/arm/olpc/emmc.fth
+
+\ Device node for internal microSD
+dev /sd
+ new-device
+ 1 encode-int " reg" property
+ fload ${BP}/dev/mmc/sdhci/sdmmc.fth
+ fload ${BP}/dev/mmc/sdhci/selftest.fth
+ " external" " slot-name" string-property
+ finish-device
+device-end
+
+devalias int /sd/disk@3
+devalias ext /sd/disk@1
+
+fload ${BP}/cpu/arm/olpc/1.75/lcdcfg.fth
+fload ${BP}/cpu/arm/olpc/1.75/usb.fth
+fload ${BP}/cpu/arm/olpc/rm3150-touchscreen.fth
+fload ${BP}/cpu/arm/olpc/1.75/compass.fth
+fload ${BP}/cpu/arm/olpc/1.75/switches.fth
+fload ${BP}/cpu/arm/olpc/1.75/leds.fth
+fload ${BP}/cpu/arm/olpc/1.75/testinstructions.fth
+fload ${BP}/cpu/arm/olpc/gpio-gamekeys.fth
+fload ${BP}/cpu/arm/olpc/test-tweaks.fth
+
+fload ${BP}/cpu/arm/olpc/save-fw.fth
Added: cpu/arm/olpc/1.75/gamekey-a1.fth
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ cpu/arm/olpc/1.75/gamekey-a1.fth Wed Jul 11 03:50:11 2012 (r3049)
@@ -0,0 +1,9 @@
+: (game-key@) ( -- n )
+ 0 ( n )
+ d# 16 gpio-pin@ 0= if h# 80 or then \ O
+ d# 17 gpio-pin@ 0= if h# 02 or then \ Check
+ d# 18 gpio-pin@ 0= if h# 100 or then \ X
+ d# 19 gpio-pin@ 0= if h# 01 or then \ Square
+ rotate-gpio# gpio-pin@ 0= if h# 40 or then \ Rotate
+;
+' (game-key@) to game-key@
Modified: cpu/arm/olpc/1.75/lcdcfg.fth
==============================================================================
--- cpu/arm/olpc/1.75/lcdcfg.fth Tue Jul 10 21:23:04 2012 (r3048)
+++ cpu/arm/olpc/1.75/lcdcfg.fth Wed Jul 11 03:50:11 2012 (r3049)
@@ -1,33 +1,7 @@
-h# 40001102 value clkdiv \ Display Clock 1 / 2 -> 56.93 MHz
-h# 00000700 value pmua-disp-clk-sel \ PLL1 / 7 -> 113.86 MHz
+dev /display
-d# 8 value hsync \ Sync width
-d# 1200 value hdisp \ Display width
-d# 1256 value htotal \ Display + FP + Sync + BP
-d# 24 value hbp \ Back porch
-
-d# 3 value vsync \ Sync width
-d# 900 value vdisp \ Display width
-d# 912 value vtotal \ Display + FP + Sync + BP
-d# 5 value vbp \ Back porch
-
-: hfp ( -- n ) htotal hdisp - hsync - hbp - ; \ 24
-: vfp ( -- n ) vtotal vdisp - vsync - vbp - ; \ 4
-
-0 [if]
-3 constant #lanes
-3 constant bytes/pixel
-d# 24 constant bpp
-[else]
-2 constant #lanes
-2 constant bytes/pixel
-d# 16 constant bpp
+[ifdef] has-dcon
+ fload ${BP}/dev/olpc/dcon/mmp2dcon.fth \ DCON control
[then]
-: >bytes ( pixels -- chunks ) bytes/pixel * ;
-: >chunks ( pixels -- chunks ) >bytes #lanes / ;
-
-alias width hdisp
-alias height vdisp
-alias depth bpp
-width >bytes constant /scanline
+device-end
Modified: cpu/arm/olpc/1.75/leds.fth
==============================================================================
--- cpu/arm/olpc/1.75/leds.fth Tue Jul 10 21:23:04 2012 (r3048)
+++ cpu/arm/olpc/1.75/leds.fth Wed Jul 11 03:50:11 2012 (r3049)
@@ -7,8 +7,12 @@
: open ( -- okay? ) true ;
: close ( -- ) ;
+: hdd-led-off ( -- ) led-storage-gpio# gpio-clr ;
+: hdd-led-on ( -- ) led-storage-gpio# gpio-set ;
+: hdd-led-toggle ( -- ) led-storage-gpio# gpio-pin@ if hdd-led-off else hdd-led-on then ;
+
: selftest ( -- )
- ." Flashing LEDs" cr
+ ." Flashing LEDs" cr
d# 10 0 do ols-led-on d# 200 ms ols-led-off d# 200 ms loop
ols-led-ec-control
Modified: cpu/arm/olpc/1.75/olpc.bth
==============================================================================
--- cpu/arm/olpc/1.75/olpc.bth Tue Jul 10 21:23:04 2012 (r3048)
+++ cpu/arm/olpc/1.75/olpc.bth Wed Jul 11 03:50:11 2012 (r3049)
@@ -162,7 +162,7 @@
/rom h# 40 - ofd @ fseek
h# 10 buffer: signature
signature h# 10 blank
-machine-signature count signature swap move
+signature$ signature swap move
" ${FW_VERSION}" expand$ signature 6 + swap move
" ${FW_PREFIX}${FW_MAJOR}" expand$ signature d# 13 + swap move
signature h# 10 ofd @ fputs
Modified: cpu/arm/olpc/1.75/usb.fth
==============================================================================
--- cpu/arm/olpc/1.75/usb.fth Tue Jul 10 21:23:04 2012 (r3048)
+++ cpu/arm/olpc/1.75/usb.fth Wed Jul 11 03:50:11 2012 (r3049)
@@ -1,192 +1,18 @@
purpose: Platform-specific USB elaborations
\ See license at end of file
-0 0 " d4208000" " /" begin-package \ USB Host Controller
- h# 200 constant /regs
- my-address my-space /regs reg
- : my-map-in ( len -- adr )
- my-space swap " map-in" $call-parent h# 100 + ( adr )
- ;
- : my-map-out ( adr len -- ) swap h# 100 - swap " map-out" $call-parent ;
- " /pmua" encode-phandle 5 encode-int encode+ " clocks" property
- d# 44 " interrupts" integer-property
-
- false constant has-dbgp-regs?
- false constant needs-dummy-qh?
- : grab-controller ( config-adr -- error? ) drop false ;
- fload ${BP}/dev/usb2/hcd/ehci/loadpkg.fth
-\ false to delay? \ No need for a polling delay on this platform
- : otg-set-host-mode 3 h# a8 ehci-reg! ; \ Force host mode
- ' otg-set-host-mode to set-host-mode
-
+dev /usb@d4208000
\ Port 1 on the hub is connected to unused pins on the WLAN connector,
\ so testing it is confusing
\ Port 2 is right upper
\ Port 3 is left
\ Port 4 is right lower
" 3,4,2" " usb-hub-test-list" string-property
- : sleep ( -- ) true to first-open? ;
- : wake ( -- ) ;
-end-package
-
-\ Turn on USB power after a delay, to ensure that USB devices are reset correctly on boot
-: usb-power-on ( -- ) ; \ The EC controls the USB power
-: reset-usb-hub ( -- ) d# 146 gpio-clr d# 10 ms d# 146 gpio-set ;
-
-: init-usb ( -- )
- h# 9 h# 5c pmua! \ Enable clock to USB block
- reset-usb-hub
- init-usb-phy
-;
+device-end
-stand-init: Init USB Phy
-\ usb-power-on \ The EC now controls the USB power
- init-usb
+: (reset-usb-hub) ( -- )
+ usb-hub-reset-gpio# gpio-clr d# 10 ms usb-hub-reset-gpio# gpio-set
;
-
-d# 350 config-int usb-delay \ Milliseconds to wait before probing hub ports
+' (reset-usb-hub) to reset-usb-hub
devalias u /usb/disk
-
-\ Like $show-devs, but ignores pagination keystrokes
-: $nopage-show-devs ( nodename$ -- )
- ['] exit? behavior >r ['] false to exit?
- $show-devs
- r> to exit?
-;
-
-\ Restrict selftest to external USB ports 1,2,3
-\ dev / 3 " usb-test-ports" integer-property dend
-
-: (probe-usb2) ( -- )
- " device_type" get-property if exit then
-[ifdef] use-usb-debug-port
- \ I haven't figured out how to turn on the EHCI cleanly
- \ when the Debug Port is running
- dbgp-off
-[then]
- get-encoded-string " ehci" $= if
- pwd$ open-dev ?dup if close-dev then
- then
-;
-: (show-usb2) ( -- )
- " device_type" get-property if exit then
- get-encoded-string " ehci" $= if
- pwd$ $nopage-show-devs
- then
-;
-
-true value first-usb-probe?
-: (silent-probe-usb) ( -- ) " /" ['] (probe-usb2) scan-subtree ;
-: silent-probe-usb ( -- )
- (silent-probe-usb)
- report-disk report-net report-keyboard
-;
-: probe-usb ( -- )
- first-usb-probe? if
- false to first-usb-probe?
- \ Initial probe to awaken the hub
- (silent-probe-usb)
- \ A little delay to let slow devices like USB scanner wake up
- d# 150 ms
- then
- silent-probe-usb
-
- ." USB devices:" cr
- " /" ['] (show-usb2) scan-subtree
-
-;
-alias p2 probe-usb
-
-0 value usb-keyboard-ih
-
-: attach-usb-keyboard ( -- )
- " usb-keyboard" expand-alias if ( devspec$ )
- drop " /usb" comp 0= if ( )
- " usb-keyboard" open-dev to usb-keyboard-ih
- usb-keyboard-ih add-input
- exit
- then
- else ( devspec$ )
- 2drop
- then
-;
-
-: detach-usb-keyboard ( -- )
- usb-keyboard-ih if
- usb-keyboard-ih remove-input
- usb-keyboard-ih close-dev
- 0 to usb-keyboard-ih
- then
-;
-
-: ?usb-keyboard ( -- )
- attach-usb-keyboard
-;
-
-: usb-quiet ( -- )
- detach-usb-keyboard
- " /usb" " reset-usb" execute-device-method drop
-;
-
-: suspend-usb ( -- )
- detach-usb-keyboard
- " /usb" " sleep" execute-device-method drop
-;
-: has-children? ( devspec$ -- flag )
- locate-device if false else child 0<> then
-;
-: any-usb-devices? ( -- flag ) " /usb/hub" has-children? ;
-: resume-usb ( -- )
- init-usb
- " /usb" " wake" execute-device-method drop
- any-usb-devices? if
- d# 2000 ms \ USB misses devices if you probe too soon
- then
- silent-probe-usb
- attach-usb-keyboard
-;
-
-\ Unlink every node whose phys.hi component matches port
-: port-match? ( port -- flag )
- get-unit if drop false exit then
- get-encoded-int =
-;
-: rm-usb-children ( port -- )
- device-context? 0= if drop exit then
- also ( port )
- 'child ( port prev )
- first-child begin while ( port prev )
- over port-match? if ( port prev )
- 'peer link@ over link! ( port prev ) \ Disconnect
- else ( port prev )
- drop 'peer ( port prev' )
- then ( port prev )
- next-child repeat ( port prev )
- 2drop ( )
- previous definitions
-;
-
-\ LICENSE_BEGIN
-\ Copyright (c) 2010 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
Modified: cpu/arm/olpc/3.0/config.fth
==============================================================================
--- cpu/arm/olpc/3.0/config.fth Tue Jul 10 21:23:04 2012 (r3048)
+++ cpu/arm/olpc/3.0/config.fth Wed Jul 11 03:50:11 2012 (r3049)
@@ -1,11 +1,69 @@
create debug-startup
create olpc
-create trust-ec-keyboard
+create olpc-cl3
create use-null-nvram
create use-elf
-create olpc-cl3
+create use-screen-kbd
+create use-small-font
fload ${BP}/cpu/arm/mmp2/hwaddrs.fth
fload ${BP}/cpu/arm/olpc/addrs.fth
-create machine-signature ," CL3"
+[ifdef] use-flash-nvram
+h# d.0000 constant nvram-offset
+[then]
+
+h# e.0000 constant mfg-data-offset \ Offset to manufacturing data area in SPI FLASH
+h# f.0000 constant mfg-data-end-offset \ Offset to end of manufacturing data area in SPI FLASH
+h# f.ffd8 constant crc-offset
+
+h# 10.0000 constant /rom \ Total size of SPI FLASH
+
+: signature$ " CL3" ;
+: model$ " olpcXO-3.0" ;
+: compatible$ " olpcxo-3.0" ;
+
+d# 10000 constant machine-type \ Backwards compatibility with non-device-tree kernel
+
+char 4 constant expected-ec-version
+h# 8000 value /ec-flash
+
+h# 10000 constant l2-#sets
+
+d# 56 constant boot-dev-sel-gpio#
+
+d# 4 constant cam-scl-gpio#
+d# 5 constant cam-sda-gpio#
+
+d# 10 constant cam-rst-gpio#
+d# 150 constant cam-pwr-gpio#
+d# 9 constant cam-pwrdn-gpio#
+
+d# 46 constant spi-flash-cs-gpio#
+
+d# 155 constant ec-spi-cmd-gpio#
+d# 125 constant ec-spi-ack-gpio#
+
+\ CL3 has no DCON
+
+d# 34 constant en-wlan-pwr-gpio#
+d# 57 constant wlan-pd-gpio#
+d# 58 constant wlan-reset-gpio#
+
+d# 146 constant usb-hub-reset-gpio#
+
+d# 149 constant emmc-rst-gpio#
+
+d# 142 constant sec-trg-gpio#
+
+d# 53 constant rtc-scl-gpio#
+d# 54 constant rtc-sda-gpio#
+
+d# 104 constant ec-edi-cs-gpio#
+d# 105 constant ec-edi-mosi-gpio#
+d# 106 constant ec-edi-clk-gpio#
+
+d# 143 constant mic-ac/dc-gpio#
+d# 8 constant audio-reset-gpio#
+d# 97 constant hp-plug-gpio#
+d# 11 constant vid2-gpio#
Modified: cpu/arm/olpc/3.0/fw.bth
==============================================================================
--- cpu/arm/olpc/3.0/fw.bth Tue Jul 10 21:23:04 2012 (r3048)
+++ cpu/arm/olpc/3.0/fw.bth Wed Jul 11 03:50:11 2012 (r3049)
@@ -8,3 +8,16 @@
" fw.tag" r/w create-file drop tag-file !
fload ${BP}/cpu/arm/olpc/build-fw.fth
+
+fload ${BP}/cpu/arm/olpc/emmc.fth
+devalias int /sd/disk@3
+
+fload ${BP}/cpu/arm/olpc/3.0/lcdcfg.fth
+fload ${BP}/cpu/arm/olpc/3.0/usb.fth
+fload ${BP}/cpu/arm/olpc/exc7200-touchscreen.fth
+fload ${BP}/cpu/arm/olpc/3.0/switches.fth
+fload ${BP}/cpu/arm/olpc/3.0/leds.fth
+fload ${BP}/cpu/arm/olpc/3.0/testinstructions.fth
+fload ${BP}/cpu/arm/olpc/test-tweaks.fth
+
+fload ${BP}/cpu/arm/olpc/save-fw.fth
Modified: cpu/arm/olpc/3.0/lcdcfg.fth
==============================================================================
--- cpu/arm/olpc/3.0/lcdcfg.fth Tue Jul 10 21:23:04 2012 (r3048)
+++ cpu/arm/olpc/3.0/lcdcfg.fth Wed Jul 11 03:50:11 2012 (r3049)
@@ -1,40 +1,20 @@
-h# 40001102 value clkdiv \ Display Clock 1 / 2 -> 56.93 MHz
-h# 00000700 value pmua-disp-clk-sel \ PLL1 / 7 -> 113.86 MHz
+dev /display
+
+d# 1024 to hdisp \ Display width
+d# 1344 to htotal \ Display + FP + Sync + BP
+
+d# 768 to vdisp \ Display width
+d# 806 to vtotal \ Display + FP + Sync + BP
+
+: pwm-bright! ( level -- ) d# 15 min h# 11 * h# 1a404 io! ;
+' pwm-bright! to bright!
+
+: pwm-backlight-on ( -- ) d# 15 bright! ;
+' pwm-backlight-on to backlight-on
+
+: pwm-backlight-off ( -- ) 0 bright! ;
+' pwm-backlight-off to backlight-off
-d# 8 value hsync \ Sync width
-d# 1024 value hdisp \ Display width
-d# 1344 value htotal \ Display + FP + Sync + BP
-d# 24 value hbp \ Back porch
-
-d# 3 value vsync \ Sync width
-d# 768 value vdisp \ Display width
-d# 806 value vtotal \ Display + FP + Sync + BP
-d# 5 value vbp \ Back porch
-
-: hfp ( -- n ) htotal hdisp - hsync - hbp - ; \ 24
-: vfp ( -- n ) vtotal vdisp - vsync - vbp - ; \ 4
-
-0 [if]
-3 constant #lanes
-3 constant bytes/pixel
-d# 24 constant bpp
-[else]
-2 constant #lanes
-2 constant bytes/pixel
-d# 16 constant bpp
-[then]
-
-: >bytes ( pixels -- chunks ) bytes/pixel * ;
-: >chunks ( pixels -- chunks ) >bytes #lanes / ;
-
-alias width hdisp
-alias height vdisp
-alias depth bpp
-width >bytes constant /scanline
-
-: bright! ( level -- ) d# 15 min h# 11 * h# 1a404 io! ;
-: backlight-on ( -- ) d# 15 bright! ;
-: backlight-off ( -- ) 0 bright! ;
: setup-pwm2 ( -- )
7 h# 1503c io! 3 h# 1503c io! \ Turn on the PWM1 clock and release reset - PWM2 depends on it
7 h# 15040 io! 3 h# 15040 io! \ Turn on the PWM2 clock and release reset
@@ -62,7 +42,9 @@
setup-pwm2
backlight-on
;
-: init-xo-display ( -- ) ; \ CForth has already turned it on
+\ ' lcd-power-on to init-panel \ Unnecessary as CForth has already done it
: set-source ( flag -- ) drop ; \ No DCON
true constant vga? \ No DCON, hence never frozen
+
+device-end
Modified: cpu/arm/olpc/3.0/leds.fth
==============================================================================
--- cpu/arm/olpc/3.0/leds.fth Tue Jul 10 21:23:04 2012 (r3048)
+++ cpu/arm/olpc/3.0/leds.fth Wed Jul 11 03:50:11 2012 (r3049)
@@ -1,5 +1,5 @@
\ See license at end of file
-purpose: Driver/selftest for OLPC XO-1.75 LEDs
+purpose: Driver/selftest for OLPC XO-3.0 LEDs
0 0 " 0" " /" begin-package
0 0 reg \ So test-all will run the test
@@ -8,16 +8,10 @@
: close ( -- ) ;
: selftest ( -- )
- ." Flashing LEDs" cr
-
-\ d# 10 0 do ols-led-on d# 200 ms ols-led-off d# 200 ms loop
-\ ols-led-ec-control
-\ ols-assy-mode-on
+ ." Flashing LEDs" cr
" /wlan:quiet" test-dev " /wlan:quiet" test-dev \ Twice for longer flashing
-\ ols-assy-mode-off
-
confirm-selftest?
;
Modified: cpu/arm/olpc/3.0/olpc.bth
==============================================================================
--- cpu/arm/olpc/3.0/olpc.bth Tue Jul 10 21:23:04 2012 (r3048)
+++ cpu/arm/olpc/3.0/olpc.bth Wed Jul 11 03:50:11 2012 (r3049)
@@ -165,7 +165,7 @@
/rom h# 40 - ofd @ fseek
h# 10 buffer: signature
signature h# 10 blank
-machine-signature count signature swap move
+signature$ signature swap move
" ${FW_VERSION}" expand$ signature 6 + swap move
" ${FW_PREFIX}${FW_MAJOR}" expand$ signature d# 13 + swap move
signature h# 10 ofd @ fputs
Modified: cpu/arm/olpc/3.0/switches.fth
==============================================================================
--- cpu/arm/olpc/3.0/switches.fth Tue Jul 10 21:23:04 2012 (r3048)
+++ cpu/arm/olpc/3.0/switches.fth Wed Jul 11 03:50:11 2012 (r3049)
@@ -1,6 +1,8 @@
\ See license at end of file
purpose: Driver/selftest for OLPC lid and ebook switches
+\ The XO-3.0 has no switches, but we need the device node
+\ because the suspend/resume test gets added to that node later.
0 0 " 0" " /" begin-package
" switches" device-name
0 0 reg \ So test-all will run the test
Modified: cpu/arm/olpc/3.0/usb.fth
==============================================================================
--- cpu/arm/olpc/3.0/usb.fth Tue Jul 10 21:23:04 2012 (r3048)
+++ cpu/arm/olpc/3.0/usb.fth Wed Jul 11 03:50:11 2012 (r3049)
@@ -1,32 +1,14 @@
purpose: Platform-specific USB elaborations
\ See license at end of file
-0 0 " d4208000" " /" begin-package \ USB OTG Host Controller
- h# 200 constant /regs
- my-address my-space /regs reg
- : my-map-in ( len -- adr )
- my-space swap " map-in" $call-parent h# 100 + ( adr )
- ;
- : my-map-out ( adr len -- ) swap h# 100 - swap " map-out" $call-parent ;
- " /pmua" encode-phandle 5 encode-int encode+ " clocks" property
- d# 44 " interrupts" integer-property
-
- false constant has-dbgp-regs?
- false constant needs-dummy-qh?
- : grab-controller ( config-adr -- error? ) drop false ;
- fload ${BP}/dev/usb2/hcd/ehci/loadpkg.fth
-\ false to delay? \ No need for a polling delay on this platform
- : otg-set-host-mode 3 h# a8 ehci-reg! ; \ Force host mode
- ' otg-set-host-mode to set-host-mode
-
+dev /usb@d4208000
\ The Marvell EHCI can handle low and full speed devices directly,
\ without needing a UHCI or OHCI companion controller
' make-port-node to handle-ls-device
' make-port-node to handle-fs-device
+device-end
- : sleep ( -- ) true to first-open? ;
- : wake ( -- ) ;
-end-package
+fload ${BP}/cpu/arm/mmp2/ulpiphy.fth
0 0 " f0003000" " /" begin-package \ USB Host Controller 1 - ULPI
h# 200 constant /regs
@@ -52,182 +34,21 @@
\ usb-power-on is unnecessary on initial boot, as CForth turns on the
\ USB power during its GPIO setup.
-: usb-power-on ( -- )
+: (usb-power-on) ( -- )
d# 126 gpio-clr \ OTG 5V on
d# 127 gpio-clr \ ULPI 5V on
;
-: reset-usb-hub ( -- )
+' (usb-power-on) to usb-power-on
+
+: (reset-usb-hub) ( -- )
d# 146 gpio-clr d# 10 ms d# 146 gpio-set \ Resets ULPI hub
ulpi-clock-on
ulpi-clock-select
ulpi-on
;
-
-: init-usb ( -- )
- h# 9 h# 5c pmua! \ Enable clock to USB block
- reset-usb-hub
- init-usb-phy
-;
-
-stand-init: Init USB Phy
-\ usb-power-on \ The USB power is turned on early, when CForth sets up GPIOs
- init-usb
-;
-
-d# 350 config-int usb-delay \ Milliseconds to wait before probing hub ports
+' (reset-usb-hub) to reset-usb-hub
devalias otg /usb@d4208000 \ USB OTG (micro) connector
devalias usba /usb@f0003000 \ USB-A connector
devalias o /usb@d4208000/disk \ Disk on USB OTG (micro) connector
devalias u /usb@f0003000/disk \ Disk on USB-A connector
-
-\ Like $show-devs, but ignores pagination keystrokes
-: $nopage-show-devs ( nodename$ -- )
- ['] exit? behavior >r ['] false to exit?
- $show-devs
- r> to exit?
-;
-
-\ Restrict selftest to external USB ports 1,2,3
-\ dev / 3 " usb-test-ports" integer-property dend
-
-: (probe-usb2) ( -- )
- " device_type" get-property if exit then
-[ifdef] use-usb-debug-port
- \ I haven't figured out how to turn on the EHCI cleanly
- \ when the Debug Port is running
- dbgp-off
-[then]
- get-encoded-string " ehci" $= if
- pwd$ open-dev ?dup if close-dev then
- then
-;
-: (show-usb2) ( -- )
- " device_type" get-property if exit then
- get-encoded-string " ehci" $= if
- pwd$ $nopage-show-devs
- then
-;
-
-true value first-usb-probe?
-: (silent-probe-usb) ( -- ) " /" ['] (probe-usb2) scan-subtree ;
-: silent-probe-usb ( -- )
- (silent-probe-usb)
- report-disk report-net report-keyboard
-;
-: probe-usb ( -- )
- first-usb-probe? if
- false to first-usb-probe?
- \ Initial probe to awaken the hub
- (silent-probe-usb)
- \ A little delay to let slow devices like USB scanner wake up
- d# 150 ms
- then
- silent-probe-usb
-
- ." USB devices:" cr
- " /" ['] (show-usb2) scan-subtree
-
-;
-alias p2 probe-usb
-
-0 value usb-keyboard-ih
-0 value otg-keyboard-ih
-
-: attach-usb-keyboard ( -- )
- " usb-keyboard" expand-alias if ( devspec$ )
- drop " /usb" comp 0= if ( )
- " usb-keyboard" open-dev to usb-keyboard-ih
- usb-keyboard-ih add-input
- then
- else ( devspec$ )
- 2drop
- then
-
- " otg/keyboard" expand-alias if ( devspec$ )
- open-dev to otg-keyboard-ih
- otg-keyboard-ih add-input
- else
- 2drop
- then
-;
-
-: detach-usb-keyboard ( -- )
- usb-keyboard-ih if
- usb-keyboard-ih remove-input
- usb-keyboard-ih close-dev
- 0 to usb-keyboard-ih
- then
-;
-
-: ?usb-keyboard ( -- )
- attach-usb-keyboard
-;
-
-: usb-quiet ( -- )
- detach-usb-keyboard
- " /usb@f0003000" " reset-usb" execute-device-method drop
- " /usb@d4208000" " reset-usb" execute-device-method drop
-;
-
-: suspend-usb ( -- )
- detach-usb-keyboard
- " /usb" " sleep" execute-device-method drop
-;
-: has-children? ( devspec$ -- flag )
- locate-device if false else child 0<> then
-;
-: any-usb-devices? ( -- flag ) " /usb/hub" has-children? ;
-: resume-usb ( -- )
- init-usb
- " /usb" " wake" execute-device-method drop
- any-usb-devices? if
- d# 2000 ms \ USB misses devices if you probe too soon
- then
- silent-probe-usb
- attach-usb-keyboard
-;
-
-\ Unlink every node whose phys.hi component matches port
-: port-match? ( port -- flag )
- get-unit if drop false exit then
- get-encoded-int =
-;
-: rm-usb-children ( port -- )
- device-context? 0= if drop exit then
- also ( port )
- 'child ( port prev )
- first-child begin while ( port prev )
- over port-match? if ( port prev )
- 'peer link@ over link! ( port prev ) \ Disconnect
- else ( port prev )
- drop 'peer ( port prev' )
- then ( port prev )
- next-child repeat ( port prev )
- 2drop ( )
- previous definitions
-;
-
-\ LICENSE_BEGIN
-\ Copyright (c) 2010 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
Modified: cpu/arm/olpc/addrs.fth
==============================================================================
--- cpu/arm/olpc/addrs.fth Tue Jul 10 21:23:04 2012 (r3048)
+++ cpu/arm/olpc/addrs.fth Wed Jul 11 03:50:11 2012 (r3049)
@@ -44,16 +44,6 @@
h# 20000 constant dropin-offset \ Offset to dropin driver area in SPI FLASH
-[ifdef] use-flash-nvram
-h# d.0000 constant nvram-offset
-[then]
-
-h# e.0000 constant mfg-data-offset \ Offset to manufacturing data area in SPI FLASH
-h# f.0000 constant mfg-data-end-offset \ Offset to end of manufacturing data area in SPI FLASH
-h# f.ffd8 constant crc-offset
-
-h# 10.0000 constant /rom \ Total size of SPI FLASH
-
\ SRAM usage
sram-pa constant sram-va
Modified: cpu/arm/olpc/boardrev.fth
==============================================================================
--- cpu/arm/olpc/boardrev.fth Tue Jul 10 21:23:04 2012 (r3048)
+++ cpu/arm/olpc/boardrev.fth Wed Jul 11 03:50:11 2012 (r3049)
@@ -4,7 +4,7 @@
0 value board-revision
\ Constructs a string like "B4" or "preB4" or "postB4"
-: model-name$ ( -- model$ )
+: model-version$ ( -- model$ )
board-revision h# 10 /mod ( minor major )
swap dup 8 = if ( major minor )
drop " " ( major prefix$ )
Modified: cpu/arm/olpc/build-fw.fth
==============================================================================
--- cpu/arm/olpc/build-fw.fth Tue Jul 10 21:23:04 2012 (r3048)
+++ cpu/arm/olpc/build-fw.fth Wed Jul 11 03:50:11 2012 (r3049)
@@ -7,6 +7,25 @@
\ ' $report-name is include-hook
\ ' noop is include-hook
+: init-stuff
+ acgr-clocks-on
+ init-timers
+ init-twsi
+;
+warning @ warning off
+: stand-init-io
+ stand-init-io
+ init-stuff
+;
+warning !
+
+dev /
+ model$ model
+ " OLPC" encode-string " architecture" property
+\ The clock frequency of the root bus may be irrelevant, since the bus is internal to the SOC
+\ d# 1,000,000,000 " clock-frequency" integer-property
+device-end
+
fload ${BP}/cpu/arm/olpc/fbnums.fth
fload ${BP}/cpu/arm/olpc/fbmsg.fth
@@ -80,27 +99,6 @@
decode-int nip nip d# 1000000 /
;
-
-fload ${BP}/cpu/arm/mmp2/pmua.fth
-fload ${BP}/cpu/arm/mmp2/apbc.fth
-fload ${BP}/cpu/arm/mmp2/irq.fth
-fload ${BP}/cpu/arm/mmp2/timer.fth
-fload ${BP}/cpu/arm/mmp2/twsi.fth
-fload ${BP}/cpu/arm/mmp2/mfpr.fth
-fload ${BP}/cpu/arm/mmp2/gpio.fth
-
-: init-stuff
- acgr-clocks-on
- init-timers
- init-twsi
-;
-warning @ warning off
-: stand-init-io
- stand-init-io
- init-stuff
-;
-warning !
-
fload ${BP}/cpu/arm/mmp2/watchdog.fth \ reset-all using watchdog timer
0 0 " d4018000" " /" begin-package \ UART3
@@ -182,34 +180,11 @@
false constant tethered? \ We only support reprogramming our own FLASH
-[ifdef] olpc-cl3
-: hdd-led-off ( -- ) ;
-: hdd-led-on ( -- ) ;
-: hdd-led-toggle ( -- ) ;
-[else]
-: hdd-led-off ( -- ) d# 10 gpio-clr ;
-: hdd-led-on ( -- ) d# 10 gpio-set ;
-: hdd-led-toggle ( -- ) d# 10 gpio-pin@ if hdd-led-off else hdd-led-on then ;
-[then]
-
fload ${BP}/cpu/arm/olpc/bbedi.fth
fload ${BP}/cpu/arm/olpc/edi.fth
load-base constant flash-buf
-
-[ifdef] cl2-a1
-h# 10000 value /ec-flash
-char 3 value expected-ec-version
-[else]
-h# 8000 value /ec-flash
-: clx-touch? ( -- ) board-revision h# 3a18 >= ;
-\+ olpc-cl2 char 4 value expected-ec-version
-\+ olpc-cl3 char 5 value expected-ec-version
-[then]
-
-[ifndef] cl2-a1
-[then]
fload ${BP}/cpu/arm/olpc/ecflash.fth
: ec-spi-reprogrammed ( -- )
@@ -250,122 +225,23 @@
d# 26 " interrupts" integer-property
end-package
-0 0 " d420b000" " /" begin-package
- " display" name
- my-address my-space h# 1000 reg
-
- " /pmua" encode-phandle 1 encode-int encode+ " clocks" property
- d# 41 " interrupts" integer-property
-
-[ifdef] olpc-cl3
- fload ${BP}/cpu/arm/olpc/3.0/lcdcfg.fth
-[else]
- fload ${BP}/cpu/arm/olpc/1.75/lcdcfg.fth
-[then]
-
- fload ${BP}/cpu/arm/olpc/lcd.fth
-[ifndef] olpc-cl3
- fload ${BP}/dev/olpc/dcon/mmp2dcon.fth \ DCON control
-[then]
- defer convert-color ' noop to convert-color
- defer pixel*
- defer pixel+
- defer pixel!
-
- : color! ( r g b index -- ) 4drop ;
- : color@ ( index -- r g b ) drop 0 0 0 ;
-
- fload ${BP}/dev/video/common/rectangle16.fth \ Rectangular graphics
-
- depth d# 24 = [if]
- code 3a+ ( adr n -- n' )
- pop r0,sp
- inc tos,#3
- add tos,tos,r0
- c;
- code rgb888! ( n adr -- )
- pop r0,sp
- strb r0,[tos]
- mov r0,r0,lsr #8
- strb r0,[tos,#1]
- mov r0,r0,lsr #8
- strb r0,[tos,#2]
- pop tos,sp
- c;
- ' 3* to pixel*
- ' 3a+ to pixel+
- ' rgb888! to pixel!
- ' noop to convert-color
- [else]
- ' /w* to pixel*
- ' wa+ to pixel+
- ' w! to pixel!
- ' argb>565-pixel to convert-color
- [then]
-
- : display-on
- init-xo-display \ Turns on DCON etc
- frame-buffer-adr hdisp vdisp * >bytes h# ffffffff lfill
- init-lcd
- ;
- : map-frame-buffer ( -- )
- \ We use fb-mem-va directly instead of calling map-in on the physical address
- \ because the physical address changes with the total memory size. The early
- \ assembly language startup code establishes the mapping.
- fb-mem-va to frame-buffer-adr
- ;
- " display" device-type
- " ISO8859-1" encode-string " character-set" property
- 0 0 encode-bytes " iso6429-1983-colors" property
-
- \ Used as temporary storage for images by $get-image
- : graphmem ( -- adr ) dimensions * pixel* fb-mem-va + ;
-
- : display-install ( -- )
- map-frame-buffer
- display-on
- default-font set-font
- width height ( width height )
- over char-width / over char-height / ( width height rows cols )
- /scanline depth fb-install ( )
- ;
-
- : display-remove ( -- ) ;
- : display-selftest ( -- failed? ) false ;
-
- ' display-install is-install
- ' display-remove is-remove
- ' display-selftest is-selftest
-end-package
-
-devalias screen /display
-
-[ifdef] olpc-cl3
-create cp881-16 " ${BP}/ofw/termemu/cp881-16.obf" $file,
-' cp881-16 to romfont
-[else]
-devalias keyboard /keyboard
-
-create 15x30pc " ${BP}/ofw/termemu/15x30pc.psf" $file,
-' 15x30pc to romfont
-[then]
-
+fload ${BP}/cpu/arm/olpc/lcd.fth
fload ${BP}/cpu/arm/olpc/sdhci.fth
-[ifndef] cl2-a1
-: boot-dev-gpio# ( -- n ) clx-touch? if 2 else d# 56 then ;
-fload ${BP}/cpu/arm/olpc/emmc.fth
-[then]
-
-devalias int /sd/disk@3
-devalias ext /sd/disk@1
-devalias net /wlan \ XXX should report-net in case of USB Ethernet
+devalias net /wlan
fload ${BP}/dev/olpc/kb3700/spicmd.fth \ EC SPI Command Protocol
-\- olpc-cl3 fload ${BP}/cpu/arm/olpc/spcmd.fth \ Security Processor communication protocol
+[ifdef] has-sp-kbd
+fload ${BP}/cpu/arm/olpc/spcmd.fth \ Security Processor communication protocol
+devalias keyboard /ap-sp/keyboard
+devalias mouse /ap-sp/mouse
+[then]
-: wlan-reset ( -- ) d# 58 gpio-clr d# 20 ms d# 58 gpio-set ;
+: wlan-reset ( -- ) wlan-reset-gpio# gpio-clr d# 20 ms wlan-reset-gpio# gpio-set ;
+
+fload ${BP}/ofw/core/fdt.fth
+fload ${BP}/cpu/arm/linux.fth
\ Create the alias unless it already exists
: $?devalias ( alias$ value$ -- )
@@ -411,14 +287,7 @@
;
fload ${BP}/cpu/arm/marvell/utmiphy.fth
-
-fload ${BP}/ofw/core/fdt.fth
-fload ${BP}/cpu/arm/linux.fth
-
-\+ olpc-cl2 fload ${BP}/cpu/arm/olpc/1.75/usb.fth
-\+ olpc-cl3 fload ${BP}/cpu/arm/mmp2/ulpiphy.fth
-\+ olpc-cl3 fload ${BP}/cpu/arm/olpc/3.0/usb.fth
-\+ olpc-cl4 fload ${BP}/cpu/arm/olpc/cl4/usb.fth
+fload ${BP}/cpu/arm/olpc/usb.fth
fload ${BP}/dev/olpc/mmp2camera/loadpkg.fth
@@ -437,12 +306,10 @@
: stand-init
stand-init
root-device
- model-name$ 2dup model ( name$ )
+ model-version$ 2dup model ( name$ )
" OLPC " encode-bytes 2swap encode-string encode+ " banner-name" property
board-revision " board-revision-int" integer-property
-\+ olpc-cl2 " olpc,xo-1.75" " compatible" string-property
-\+ olpc-cl3 " olpc,xo-3.0" " compatible" string-property
-\+ olpc-cl4 " olpc,xo-cl4" " compatible" string-property
+ compatible$ " compatible" string-property
\ The "1-" removes the null byte
" SN" find-tag if 1- else " Unknown" then " serial-number" string-property
@@ -493,8 +360,7 @@
: olpc-mapped-limit ( -- adr ) dma-mem-va >physical ;
' olpc-mapped-limit to mapped-limit
-\+ olpc-cl2 d# 9999 to arm-linux-machine-type \ XO-1.75
-\+ olpc-cl3 d# 10000 to arm-linux-machine-type \ XO-3
+machine-type to arm-linux-machine-type
\ Add a tag describing the linear frame buffer
: mmp-fb-tag, ( -- )
@@ -542,8 +408,8 @@
false to stand-init-debug?
\ true to stand-init-debug?
-: sec-trg ( -- ) d# 73 gpio-set ; \ rising edge latches SPI_WP# low
-: sec-trg? ( -- bit ) d# 73 gpio-pin@ ;
+: sec-trg ( -- ) sec-trg-gpio# gpio-set ; \ rising edge latches SPI_WP# low
+: sec-trg? ( -- bit ) sec-trg-gpio# gpio-pin@ ;
alias ec-indexed-io-off sec-trg
alias ec-indexed-io-off? sec-trg?
@@ -567,11 +433,7 @@
false
;
-[ifdef] olpc-cl3
-false value rotate-button?
-[else]
-: rotate-button? ( -- flag ) d# 15 gpio-pin@ 0= ;
-[then]
+defer rotate-button? ' false to rotate-button?
warning @ warning off
: init
@@ -632,9 +494,6 @@
fload ${BP}/cpu/arm/mmp2/clocks.fth
fload ${BP}/cpu/arm/olpc/banner.fth
-\- olpc-cl3 devalias keyboard /ap-sp/keyboard
-\- olpc-cl3 devalias mouse /ap-sp/mouse
-
: console-start ( -- )
install-mux-io
cursor-off
@@ -687,54 +546,12 @@
code halt ( -- ) wfi c;
-\+ olpc-cl2 fload ${BP}/cpu/arm/olpc/1.75/switches.fth \ Lid and ebook switches
-\+ olpc-cl3 fload ${BP}/cpu/arm/olpc/3.0/switches.fth \ Switches
-\+ olpc-cl4 fload ${BP}/cpu/arm/olpc/cl4/switches.fth \ Lid and ebook switches
-
fload ${BP}/cpu/arm/mmp2/rtc.fth \ Internal RTC, used for wakeups
-\+ olpc-cl2 fload ${BP}/cpu/arm/olpc/1.75/leds.fth \ LEDs
-\+ olpc-cl3 fload ${BP}/cpu/arm/olpc/3.0/leds.fth \ LEDs
-\+ olpc-cl4 fload ${BP}/cpu/arm/olpc/cl4/leds.fth \ LEDs
-
fload ${BP}/cpu/x86/pc/olpc/via/factory.fth \ Manufacturing tools
fload ${BP}/cpu/arm/olpc/accelerometer.fth
-[ifndef] olpc-cl3
-fload ${BP}/cpu/arm/olpc/1.75/compass.fth
-[then]
-
-\ Suppress long memory test at final test stage
-dev /memory
-0 value old-diag-switch?
-: not-final-test? ( -- flag )
- final-test? if false exit then
- smt-test? if false exit then
- old-diag-switch?
-;
-warning @ warning off
-: selftest ( -- error? )
- diag-switch? to old-diag-switch?
- not-final-test? to diag-switch?
- selftest
- old-diag-switch? to diag-switch?
-;
-warning !
-device-end
-
-\ Add suspend resume test except in final
-dev /switches
-warning @ warning off
-: selftest ( -- error? )
- final-test? 0= if
- s3-selftest if true exit then
- then
- selftest
-;
-warning !
-device-end
-
\ When reprogramming this machine's SPI FLASH, rebooting the EC is unnecessary
: no-kbc-reboot ['] noop to spi-reprogrammed ;
: kbc-on ;
@@ -749,76 +566,9 @@
: close ;
end-package
-\ it seems to be difficult to get SoC wakeups from the keypad controller,
-\ so we set them up as gpio, instead.
-[ifdef] use_mmp2_keypad_control
-fload ${BP}/cpu/arm/mmp2/keypad.fth
-[ifdef] notdef \ CForth turns on the keypad; resetting it makes it not work
-stand-init: keypad
- keypad-on
- 8 keypad-direct-mode
-;
-[then]
-: keypad-bit ( n keypad out-mask key-mask -- n' keypad )
- third invert and if ( n keypad out-mask )
- rot or swap ( n' keypad )
- else ( n keypad out-mask )
- drop ( n keypad )
- then ( n' keypad )
-;
-[then]
-
fload ${BP}/cpu/x86/pc/olpc/gamekeynames.fth
-[ifdef] cl2-a1
-: game-key@ ( -- n )
- 0 ( n )
- d# 16 gpio-pin@ 0= if h# 80 or then \ O
- d# 17 gpio-pin@ 0= if h# 02 or then \ Check
- d# 18 gpio-pin@ 0= if h# 100 or then \ X
- d# 19 gpio-pin@ 0= if h# 01 or then \ Square
- d# 20 gpio-pin@ 0= if h# 40 or then \ Rotate
-;
-[then]
-
-[ifdef] olpc-cl3
-: game-key@ ( -- n )
- 0
-;
-[then]
-
-[ifndef] game-key@
- [ifdef] use_mmp2_keypad_control
-: game-key@ ( -- n )
- 0 ( n )
- d# 15 gpio-pin@ 0= if button-rotate or then ( n )
- scan-keypad ( n keypad )
- button-o h# 01 keypad-bit ( n' keypad )
- button-check h# 02 keypad-bit ( n' keypad )
- button-x h# 04 keypad-bit ( n' keypad )
- button-square h# 08 keypad-bit ( n' keypad )
- rocker-up h# 10 keypad-bit ( n' keypad )
- rocker-right h# 20 keypad-bit ( n' keypad )
- rocker-down h# 40 keypad-bit ( n' keypad )
- rocker-left h# 80 keypad-bit ( n' keypad )
- drop ( n )
-;
- [else]
-: game-key@ ( -- n )
- 0 ( n )
- d# 15 gpio-pin@ 0= if button-rotate or then
- d# 16 gpio-pin@ 0= if button-o or then
- d# 17 gpio-pin@ 0= if button-check or then
- d# 18 gpio-pin@ 0= if button-x or then
- d# 19 gpio-pin@ 0= if button-square or then
- d# 20 gpio-pin@ 0= if rocker-up or then
- d# 21 gpio-pin@ 0= if rocker-right or then
- d# 22 gpio-pin@ 0= if rocker-down or then
- d# 23 gpio-pin@ 0= if rocker-left or then
-;
- [then]
-
-[then]
+defer game-key@ ' 0 to game-key@ \ Implementation will be loaded later
fload ${BP}/cpu/x86/pc/olpc/gamekeys.fth
@@ -826,7 +576,7 @@
fload ${BP}/cpu/x86/pc/olpc/disptest.fth
-[ifndef] olpc-cl3
+[ifdef] has-sp-kbd
dev /ap-sp/keyboard
fload ${BP}/dev/olpc/keyboard/selftest.fth \ Keyboard diagnostic
device-end
@@ -841,10 +591,9 @@
fload ${BP}/cpu/x86/pc/olpc/gridmap.fth \ Gridded display tools
fload ${BP}/cpu/x86/pc/olpc/via/copynand.fth
-\+ olpc-cl2 fload ${BP}/cpu/arm/olpc/rm3150-touchscreen.fth \ Touchscreen driver and diagnostic
-\+ olpc-cl3 fload ${BP}/cpu/arm/olpc/exc7200-touchscreen.fth \ Touchscreen driver and diagnostic
-\+ olpc-cl3 fload ${BP}/dev/softkeyboard.fth \ On-screen keyboard
-\+ olpc-cl4 fload ${BP}/cpu/arm/olpc/nn-touchscreen.fth \ Touchscreen driver and diagnostic
+\- use-screen-kbd devalias keyboard /keyboard
+\+ use-screen-kbd fload ${BP}/dev/softkeyboard.fth \ On-screen keyboard
+
fload ${BP}/cpu/arm/olpc/roller.fth \ Accelerometer test
\ fload ${BP}/cpu/arm/olpc/pinch.fth \ Touchscreen gestures
@@ -999,7 +748,7 @@
game-key-mask = if protect-fw try-fs-update then
;
-[ifdef] olpc-cl3
+[ifdef] use-screen-kbd
0 value screen-kbd-ih
: open-screen-keyboard ( -- )
" /touchscreen/keyboard" open-dev to screen-kbd-ih
@@ -1045,9 +794,6 @@
[then]
fload ${BP}/cpu/arm/olpc/testitems.fth
-\+ olpc-cl2 fload ${BP}/cpu/arm/olpc/1.75/testinstructions.fth
-\+ olpc-cl3 fload ${BP}/cpu/arm/olpc/3.0/testinstructions.fth
-\+ olpc-cl4 fload ${BP}/cpu/arm/olpc/cl4/testinstructions.fth
: startup ( -- )
standalone? 0= if exit then
@@ -1080,7 +826,7 @@
update-ec-flash
then
then
-\+ olpc-cl3 open-hotspot
+\+ use-screen-kbd open-hotspot
install-alarm
?sound
@@ -1088,7 +834,7 @@
?games
['] false to interrupt-auto-boot?
-\+ olpc-cl3 ?text-on
+\+ use-screen-kbd ?text-on
[ifdef] probe-usb
factory-test? if d# 1000 ms then \ Extra USB probe delay in the factory
probe-usb
@@ -1099,7 +845,7 @@
interpreter-init
-\+ olpc-cl3 ?text-on
+\+ use-screen-kbd ?text-on
?diags
?fs-update
@@ -1107,16 +853,16 @@
unblock-exceptions
['] (interrupt-auto-boot?) to interrupt-auto-boot?
-\+ olpc-cl3 ?text-on
+\+ use-screen-kbd ?text-on
?usb-keyboard
auto-banner? if banner then
-\+ olpc-cl3 ?text-on
+\+ use-screen-kbd ?text-on
auto-boot
-\+ olpc-cl3 close-hotspot
+\+ use-screen-kbd close-hotspot
-\+ olpc-cl3 open-screen-keyboard banner
+\+ use-screen-kbd open-screen-keyboard banner
frozen? text-on? 0= and ( no-banner? )
unfreeze visible cursor-on ( no-banner? )
@@ -1149,19 +895,6 @@
" devalias fsdisk //null" evaluate
;
-tag-file @ fclose tag-file off
-my-self [if]
- ." WARNING: my-self is not 0" cr
- bye
-[then]
-
-.( --- Saving fw.dic ...)
-" fw.dic" $save-forth cr
-
-fload ${BP}/cpu/arm/mmp2/rawboot.fth
-
-.( --- Saving fw.img --- ) cr " fw.img" $save-rom
-
\ LICENSE_BEGIN
\ Copyright (c) 2010 FirmWorks
\
Modified: cpu/arm/olpc/emmc.fth
==============================================================================
--- cpu/arm/olpc/emmc.fth Tue Jul 10 21:23:04 2012 (r3048)
+++ cpu/arm/olpc/emmc.fth Wed Jul 11 03:50:11 2012 (r3049)
@@ -39,15 +39,13 @@
h# 18c2 d# 167 af! \ eMMC_D3
h# 18c2 d# 168 af! \ eMMC_D1
- d# 149 gpio-set \ Release eMMC_RST#
+ emmc-rst-gpio# gpio-set \ Release eMMC_RST#
- d# 34 gpio-set \ This is for the case where the eMMC power is rewired to the WLAN
+ en-wlan-pwr-gpio# gpio-set \ This is for the case where the eMMC power is rewired to the WLAN
;
-\ Says COMM - is RST#
-\ Says RESET - is CMD
stand-init:
- boot-dev-gpio# gpio-pin@ if
+ boot-dev-sel-gpio# gpio-pin@ if
select-emmc
else
select-internal-sd
Added: cpu/arm/olpc/gpio-gamekeys.fth
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ cpu/arm/olpc/gpio-gamekeys.fth Wed Jul 11 03:50:11 2012 (r3049)
@@ -0,0 +1,16 @@
+: gpio-game-key@ ( -- n )
+ 0 ( n )
+ rotate-gpio# gpio-pin@ 0= if button-rotate or then
+ d# 16 gpio-pin@ 0= if button-o or then
+ d# 17 gpio-pin@ 0= if button-check or then
+ d# 18 gpio-pin@ 0= if button-x or then
+ d# 19 gpio-pin@ 0= if button-square or then
+ d# 20 gpio-pin@ 0= if rocker-up or then
+ d# 21 gpio-pin@ 0= if rocker-right or then
+ d# 22 gpio-pin@ 0= if rocker-down or then
+ d# 23 gpio-pin@ 0= if rocker-left or then
+;
+' gpio-game-key@ to game-key@
+
+: gpio-rotate-button? ( -- flag ) rotate-gpio# gpio-pin@ 0= ;
+' gpio-rotate-button? to rotate-button?
Added: cpu/arm/olpc/keypad-gamekeys.fth
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ cpu/arm/olpc/keypad-gamekeys.fth Wed Jul 11 03:50:11 2012 (r3049)
@@ -0,0 +1,39 @@
+\ This file is preserved only for historical interest.
+\ It's difficult to get SoC wakeups from the keypad controller,
+\ so we configure the game key inputs as GPIOs instead.
+
+fload ${BP}/cpu/arm/mmp2/keypad.fth
+
+[ifdef] notdef \ CForth turns on the keypad; resetting it makes it not work
+stand-init: keypad
+ keypad-on
+ 8 keypad-direct-mode
+;
+[then]
+
+: keypad-bit ( n keypad out-mask key-mask -- n' keypad )
+ third invert and if ( n keypad out-mask )
+ rot or swap ( n' keypad )
+ else ( n keypad out-mask )
+ drop ( n keypad )
+ then ( n' keypad )
+;
+
+: gpio-rotate-button? ( -- flag ) rotate-gpio# gpio-pin@ 0= ;
+' gpio-rotate-button? to rotate-button?
+
+: keypad-game-key@ ( -- n )
+ 0 ( n )
+ gpio-rotate-button? if button-rotate or then ( n )
+ scan-keypad ( n keypad )
+ button-o h# 01 keypad-bit ( n' keypad )
+ button-check h# 02 keypad-bit ( n' keypad )
+ button-x h# 04 keypad-bit ( n' keypad )
+ button-square h# 08 keypad-bit ( n' keypad )
+ rocker-up h# 10 keypad-bit ( n' keypad )
+ rocker-right h# 20 keypad-bit ( n' keypad )
+ rocker-down h# 40 keypad-bit ( n' keypad )
+ rocker-left h# 80 keypad-bit ( n' keypad )
+ drop ( n )
+;
+' keypad-game-key@ to game-key@
Modified: cpu/arm/olpc/lcd.fth
==============================================================================
--- cpu/arm/olpc/lcd.fth Tue Jul 10 21:23:04 2012 (r3048)
+++ cpu/arm/olpc/lcd.fth Wed Jul 11 03:50:11 2012 (r3049)
@@ -1,3 +1,48 @@
+purpose: Display driver for OLPC ARM/MMP platforms
+\ See license at end of file
+
+0 0 " d420b000" " /" begin-package
+ " display" name
+ my-address my-space h# 1000 reg
+
+ " /pmua" encode-phandle 1 encode-int encode+ " clocks" property
+ d# 41 " interrupts" integer-property
+
+h# 40001102 value clkdiv \ Display Clock 1 / 2 -> 56.93 MHz
+h# 00000700 value pmua-disp-clk-sel \ PLL1 / 7 -> 113.86 MHz
+
+d# 8 value hsync \ Sync width
+d# 1200 value hdisp \ Display width
+d# 1256 value htotal \ Display + FP + Sync + BP
+d# 24 value hbp \ Back porch
+
+d# 3 value vsync \ Sync width
+d# 900 value vdisp \ Display width
+d# 912 value vtotal \ Display + FP + Sync + BP
+d# 5 value vbp \ Back porch
+
+: hfp ( -- n ) htotal hdisp - hsync - hbp - ; \ 24
+: vfp ( -- n ) vtotal vdisp - vsync - vbp - ; \ 4
+
+2 value #lanes
+2 value bytes/pixel
+d# 16 value bpp
+
+0 [if] \ 24bpp parameters
+3 to #lanes
+3 to bytes/pixel
+d# 24 to bpp
+[then]
+
+: >bytes ( pixels -- chunks ) bytes/pixel * ;
+: >chunks ( pixels -- chunks ) >bytes #lanes / ;
+
+alias width hdisp
+alias height vdisp
+alias depth bpp
+width >bytes constant /scanline
+
+\ \+ olpc-cl3 fload ${BP}/cpu/arm/olpc/3.0/lcdcfg.fth
: lcd@ ( offset -- l ) lcd-pa + io@ ;
: lcd! ( l offset -- ) lcd-pa + io! ;
@@ -227,3 +272,113 @@
saved-mode h# 190 lcd!
cursor /cursor 0 cursor-sram-write
;
+
+ defer convert-color ' noop to convert-color
+ defer pixel*
+ defer pixel+
+ defer pixel!
+
+ : color! ( r g b index -- ) 4drop ;
+ : color@ ( index -- r g b ) drop 0 0 0 ;
+
+ fload ${BP}/dev/video/common/rectangle16.fth \ Rectangular graphics
+
+ depth d# 24 = [if]
+ code 3a+ ( adr n -- n' )
+ pop r0,sp
+ inc tos,#3
+ add tos,tos,r0
+ c;
+ code rgb888! ( n adr -- )
+ pop r0,sp
+ strb r0,[tos]
+ mov r0,r0,lsr #8
+ strb r0,[tos,#1]
+ mov r0,r0,lsr #8
+ strb r0,[tos,#2]
+ pop tos,sp
+ c;
+ ' 3* to pixel*
+ ' 3a+ to pixel+
+ ' rgb888! to pixel!
+ ' noop to convert-color
+ [else]
+ ' /w* to pixel*
+ ' wa+ to pixel+
+ ' w! to pixel!
+ ' argb>565-pixel to convert-color
+ [then]
+
+ defer init-panel ' noop to init-panel
+ defer bright! ' drop to bright!
+ defer backlight-off ' noop to backlight-off
+ defer backlight-on ' noop to backlight-on
+
+ : display-on
+ init-panel \ Turns on DCON etc
+ frame-buffer-adr hdisp vdisp * >bytes h# ffffffff lfill
+ init-lcd
+ ;
+ : map-frame-buffer ( -- )
+ \ We use fb-mem-va directly instead of calling map-in on the physical address
+ \ because the physical address changes with the total memory size. The early
+ \ assembly language startup code establishes the mapping.
+ fb-mem-va to frame-buffer-adr
+ ;
+ " display" device-type
+ " ISO8859-1" encode-string " character-set" property
+ 0 0 encode-bytes " iso6429-1983-colors" property
+
+ \ Used as temporary storage for images by $get-image
+ : graphmem ( -- adr ) dimensions * pixel* fb-mem-va + ;
+
+ : display-install ( -- )
+ map-frame-buffer
+ display-on
+ default-font set-font
+ width height ( width height )
+ over char-width / over char-height / ( width height rows cols )
+ /scanline depth fb-install ( )
+ ;
+
+ : display-remove ( -- ) ;
+ : display-selftest ( -- failed? ) false ;
+
+ ' display-install is-install
+ ' display-remove is-remove
+ ' display-selftest is-selftest
+end-package
+
+devalias screen /display
+
+[ifdef] use-small-font
+create cp881-16 " ${BP}/ofw/termemu/cp881-16.obf" $file,
+' cp881-16 to romfont
+[else]
+create 15x30pc " ${BP}/ofw/termemu/15x30pc.psf" $file,
+' 15x30pc to romfont
+[then]
+
+\ LICENSE_BEGIN
+\ Copyright (c) 2010 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
Modified: cpu/arm/olpc/prefw.fth
==============================================================================
--- cpu/arm/olpc/prefw.fth Tue Jul 10 21:23:04 2012 (r3048)
+++ cpu/arm/olpc/prefw.fth Wed Jul 11 03:50:11 2012 (r3049)
@@ -42,13 +42,6 @@
fload ${BP}/ofw/core/allocph1.fth \ S Physical memory allocator
fload ${BP}/ofw/core/availpm.fth \ Available memory list
-dev /
- " olpc,XO-1.75" model
- " OLPC" encode-string " architecture" property
-\ The clock frequency of the root bus may be irrelevant, since the bus is internal to the SOC
-\ d# 1,000,000,000 " clock-frequency" integer-property
-device-end
-
: (cpu-arch ( -- adr len )
" architecture" root-phandle get-package-property drop
get-encoded-string
@@ -229,6 +222,15 @@
fload ${BP}/ofw/gui/loadmenu.fth
\ fload ${BP}/ofw/gui/insticon.fth
+\ Marvell MMP low-level stuff
+fload ${BP}/cpu/arm/mmp2/pmua.fth
+fload ${BP}/cpu/arm/mmp2/apbc.fth
+fload ${BP}/cpu/arm/mmp2/irq.fth
+fload ${BP}/cpu/arm/mmp2/timer.fth
+fload ${BP}/cpu/arm/mmp2/twsi.fth
+fload ${BP}/cpu/arm/mmp2/mfpr.fth
+fload ${BP}/cpu/arm/mmp2/gpio.fth
+
\ Uninstall the diag menu from the general user interface vector
\ so exiting from emacs doesn't invoke the diag menu.
' quit to user-interface
Modified: cpu/arm/olpc/probemem.fth
==============================================================================
--- cpu/arm/olpc/probemem.fth Tue Jul 10 21:23:04 2012 (r3048)
+++ cpu/arm/olpc/probemem.fth Wed Jul 11 03:50:11 2012 (r3049)
@@ -56,7 +56,7 @@
h# 2000.0000 +loop \ h# 2000.0000 depends on L1 #ways
h# 20 +loop \ h# 20 is L1 line size
- h# 10000 0 do \ Loop over sets - h# 10000 is L2 #sets
+ l2-#sets 0 do \ Loop over sets
0 0 do \ Loop over ways
i j + 2+ clean&flush-d$-entry-way \ Operate on L2 cache (2+)
h# 2000.0000 +loop \ h# 2000.0000 depends on L2 #ways
Modified: cpu/arm/olpc/rtc.fth
==============================================================================
--- cpu/arm/olpc/rtc.fth Tue Jul 10 21:23:04 2012 (r3048)
+++ cpu/arm/olpc/rtc.fth Wed Jul 11 03:50:11 2012 (r3049)
@@ -15,8 +15,8 @@
[ifdef] cl2-a1
: set-address ( -- )
- d# 97 to smb-clock-gpio#
- d# 98 to smb-data-gpio#
+ rtc-scl-gpio# to smb-clock-gpio#
+ rtc-sda-gpio# to smb-data-gpio#
h# d0 to smb-slave
;
: rtc@ ( reg# -- byte ) set-address smb-byte@ ;
Added: cpu/arm/olpc/save-fw.fth
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ cpu/arm/olpc/save-fw.fth Wed Jul 11 03:50:11 2012 (r3049)
@@ -0,0 +1,12 @@
+tag-file @ fclose tag-file off
+my-self [if]
+ ." WARNING: my-self is not 0" cr
+ bye
+[then]
+
+.( --- Saving fw.dic ...)
+" fw.dic" $save-forth cr
+
+fload ${BP}/cpu/arm/mmp2/rawboot.fth
+
+.( --- Saving fw.img --- ) cr " fw.img" $save-rom
Modified: cpu/arm/olpc/sdhci.fth
==============================================================================
--- cpu/arm/olpc/sdhci.fth Tue Jul 10 21:23:04 2012 (r3048)
+++ cpu/arm/olpc/sdhci.fth Wed Jul 11 03:50:11 2012 (r3049)
@@ -17,26 +17,16 @@
\ Slot:power_GPIO - 1:35, 2:34, 3:33
: gpio-power-on ( -- )
sdhci-card-power-on
-\ The CL3 version below actually works for CL2 >= B1
-\+ olpc-cl2 d# 36 slot - gpio-set
-\+ olpc-cl3 slot 2 = if d# 34 gpio-set then
+ slot 2 = if en-wlan-pwr-gpio# gpio-set then
;
' gpio-power-on to card-power-on
: gpio-power-off ( -- )
-\+ olpc-cl2 d# 36 slot - gpio-clr
-\+ olpc-cl3 slot 2 = if d# 34 gpio-clr then
+ slot 2 = if en-wlan-pwr-gpio# gpio-clr then
sdhci-card-power-off
;
' gpio-power-off to card-power-off
-\+ olpc-cl2 new-device
-\+ olpc-cl2 1 encode-int " reg" property
-\+ olpc-cl2 fload ${BP}/dev/mmc/sdhci/sdmmc.fth
-\+ olpc-cl2 fload ${BP}/dev/mmc/sdhci/selftest.fth
-\+ olpc-cl2 " external" " slot-name" string-property
-\+ olpc-cl2 finish-device
-
new-device
2 encode-int " reg" property
fload ${BP}/dev/mmc/sdhci/mv8686/loadpkg.fth
Modified: cpu/arm/olpc/sound.fth
==============================================================================
--- cpu/arm/olpc/sound.fth Tue Jul 10 21:23:04 2012 (r3048)
+++ cpu/arm/olpc/sound.fth Wed Jul 11 03:50:11 2012 (r3049)
@@ -227,8 +227,8 @@
[then]
\ Reset is unconnected on current boards
-\ : audio-reset ( -- ) 8 gpio-clr ;
-\ : audio-unreset ( -- ) 8 gpio-set ;
+\ : audio-reset ( -- ) audio-reset-gpio# gpio-clr ;
+\ : audio-unreset ( -- ) audio-reset-gpio# gpio-set ;
: codec@ ( reg# -- w ) choose-smbus 1 2 twsi-get swap bwjoin ;
: codec! ( w reg# -- ) choose-smbus >r wbsplit r> 3 twsi-out ;
: codec-i@ ( index# -- w ) h# 6a codec! h# 6c codec@ ;
@@ -440,7 +440,7 @@
;
: watch-dc ( bias? -- )
to mic-bias?
- d# 143 gpio-set \ DC input mode
+ mic-ac/dc-gpio# gpio-set \ DC input mode
h# 0400 h# 40 codec-clr
open-in
stereo 0 set-adc-gain 0 set-mic-gain
Added: cpu/arm/olpc/test-tweaks.fth
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ cpu/arm/olpc/test-tweaks.fth Wed Jul 11 03:50:11 2012 (r3049)
@@ -0,0 +1,29 @@
+\ Suppress long memory test at final test stage
+dev /memory
+0 value old-diag-switch?
+: not-final-test? ( -- flag )
+ final-test? if false exit then
+ smt-test? if false exit then
+ old-diag-switch?
+;
+warning @ warning off
+: selftest ( -- error? )
+ diag-switch? to old-diag-switch?
+ not-final-test? to diag-switch?
+ selftest
+ old-diag-switch? to diag-switch?
+;
+warning !
+device-end
+
+\ Add suspend resume test except in final
+dev /switches
+warning @ warning off
+: selftest ( -- error? )
+ final-test? 0= if
+ s3-selftest if true exit then
+ then
+ selftest
+;
+warning !
+device-end
Added: cpu/arm/olpc/usb.fth
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ cpu/arm/olpc/usb.fth Wed Jul 11 03:50:11 2012 (r3049)
@@ -0,0 +1,191 @@
+\ See license at end of file
+purpose: USB features common to most OLPC ARM platforms
+
+0 0 " d4208000" " /" begin-package \ USB Host Controller
+ h# 200 constant /regs
+ my-address my-space /regs reg
+ : my-map-in ( len -- adr )
+ my-space swap " map-in" $call-parent h# 100 + ( adr )
+ ;
+ : my-map-out ( adr len -- ) swap h# 100 - swap " map-out" $call-parent ;
+ " /pmua" encode-phandle 5 encode-int encode+ " clocks" property
+ d# 44 " interrupts" integer-property
+
+ false constant has-dbgp-regs?
+ false constant needs-dummy-qh?
+ : grab-controller ( config-adr -- error? ) drop false ;
+ fload ${BP}/dev/usb2/hcd/ehci/loadpkg.fth
+\ false to delay? \ No need for a polling delay on this platform
+ : otg-set-host-mode 3 h# a8 ehci-reg! ; \ Force host mode
+ ' otg-set-host-mode to set-host-mode
+
+ : sleep ( -- ) true to first-open? ;
+ : wake ( -- ) ;
+end-package
+
+defer usb-power-on ' noop to usb-power-on
+defer reset-usb-hub ' noop to reset-usb-hub
+
+: init-usb ( -- )
+ h# 9 h# 5c pmua! \ Enable clock to USB block
+ reset-usb-hub
+ init-usb-phy
+;
+
+stand-init: Init USB Phy
+\ usb-power-on \ The EC now controls the USB power
+ init-usb
+;
+
+d# 350 config-int usb-delay \ Milliseconds to wait before probing hub ports
+
+\ Like $show-devs, but ignores pagination keystrokes
+: $nopage-show-devs ( nodename$ -- )
+ ['] exit? behavior >r ['] false to exit?
+ $show-devs
+ r> to exit?
+;
+
+\ Restrict selftest to external USB ports 1,2,3
+\ dev / 3 " usb-test-ports" integer-property dend
+
+: (probe-usb2) ( -- )
+ " device_type" get-property if exit then
+[ifdef] use-usb-debug-port
+ \ I haven't figured out how to turn on the EHCI cleanly
+ \ when the Debug Port is running
+ dbgp-off
+[then]
+ get-encoded-string " ehci" $= if
+ pwd$ open-dev ?dup if close-dev then
+ then
+;
+: (show-usb2) ( -- )
+ " device_type" get-property if exit then
+ get-encoded-string " ehci" $= if
+ pwd$ $nopage-show-devs
+ then
+;
+
+true value first-usb-probe?
+: (silent-probe-usb) ( -- ) " /" ['] (probe-usb2) scan-subtree ;
+: silent-probe-usb ( -- )
+ (silent-probe-usb)
+ report-disk report-net report-keyboard
+;
+: probe-usb ( -- )
+ first-usb-probe? if
+ false to first-usb-probe?
+ \ Initial probe to awaken the hub
+ (silent-probe-usb)
+ \ A little delay to let slow devices like USB scanner wake up
+ d# 150 ms
+ then
+ silent-probe-usb
+
+ ." USB devices:" cr
+ " /" ['] (show-usb2) scan-subtree
+
+;
+alias p2 probe-usb
+
+0 value usb-keyboard-ih
+0 value otg-keyboard-ih
+
+: attach-usb-keyboard ( -- )
+ " usb-keyboard" expand-alias if ( devspec$ )
+ drop " /usb" comp 0= if ( )
+ " usb-keyboard" open-dev to usb-keyboard-ih
+ usb-keyboard-ih add-input
+ then
+ else ( devspec$ )
+ 2drop
+ then
+
+ " otg/keyboard" expand-alias if ( devspec$ )
+ open-dev to otg-keyboard-ih
+ otg-keyboard-ih add-input
+ else
+ 2drop
+ then
+;
+
+: detach-usb-keyboard ( -- )
+ usb-keyboard-ih if
+ usb-keyboard-ih remove-input
+ usb-keyboard-ih close-dev
+ 0 to usb-keyboard-ih
+ then
+;
+
+: ?usb-keyboard ( -- )
+ attach-usb-keyboard
+;
+
+: usb-quiet ( -- )
+ detach-usb-keyboard
+ " /usb@f0003000" " reset-usb" execute-device-method drop
+ " /usb@d4208000" " reset-usb" execute-device-method drop
+;
+
+: suspend-usb ( -- )
+ detach-usb-keyboard
+ " /usb" " sleep" execute-device-method drop
+;
+: has-children? ( devspec$ -- flag )
+ locate-device if false else child 0<> then
+;
+: any-usb-devices? ( -- flag ) " /usb/hub" has-children? ;
+: resume-usb ( -- )
+ init-usb
+ " /usb" " wake" execute-device-method drop
+ any-usb-devices? if
+ d# 2000 ms \ USB misses devices if you probe too soon
+ then
+ silent-probe-usb
+ attach-usb-keyboard
+;
+
+\ Unlink every node whose phys.hi component matches port
+: port-match? ( port -- flag )
+ get-unit if drop false exit then
+ get-encoded-int =
+;
+: rm-usb-children ( port -- )
+ device-context? 0= if drop exit then
+ also ( port )
+ 'child ( port prev )
+ first-child begin while ( port prev )
+ over port-match? if ( port prev )
+ 'peer link@ over link! ( port prev ) \ Disconnect
+ else ( port prev )
+ drop 'peer ( port prev' )
+ then ( port prev )
+ next-child repeat ( port prev )
+ 2drop ( )
+ previous definitions
+;
+
+\ LICENSE_BEGIN
+\ Copyright (c) 2010 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
Modified: cpu/x86/pc/olpc/sound.fth
==============================================================================
--- cpu/x86/pc/olpc/sound.fth Tue Jul 10 21:23:04 2012 (r3048)
+++ cpu/x86/pc/olpc/sound.fth Wed Jul 11 03:50:11 2012 (r3049)
@@ -54,7 +54,7 @@
close-audio
;
-[ifndef] olpc-cl3
+[ifndef] use-screen-kbd
dev /keyboard
0 value waiting-up?
: olpc-check-abort ( scan-code -- abort? ) \ an abort key pressed?
Modified: dev/olpc/dcon/mmp2dcon.fth
==============================================================================
--- dev/olpc/dcon/mmp2dcon.fth Tue Jul 10 21:23:04 2012 (r3048)
+++ dev/olpc/dcon/mmp2dcon.fth Wed Jul 11 03:50:11 2012 (r3049)
@@ -51,13 +51,9 @@
\ h# 8000 constant DM_SELFTEST
: set-dcon-slave ( -- )
-[ifdef] cl2-a1
- d# 162 to smb-clock-gpio#
- d# 163 to smb-data-gpio#
-[else]
- d# 161 to smb-clock-gpio#
- d# 110 to smb-data-gpio#
-[then]
+ dcon-scl-gpio# to smb-clock-gpio#
+ dcon-sda-gpio# to smb-data-gpio#
+
h# 1a to smb-slave
;
@@ -66,17 +62,13 @@
: dcon@ ( reg# -- word ) set-dcon-slave smb-word@ ;
: dcon! ( word reg# -- ) set-dcon-slave smb-word! ;
-[ifdef] cl2-a1
-: dcon-load ( -- ) d# 151 gpio-set ;
-: dcon-unload ( -- ) d# 151 gpio-clr ;
-[else]
-: dcon-load ( -- ) d# 142 gpio-set ;
-: dcon-unload ( -- ) d# 142 gpio-clr ;
-[then]
+: dcon-load ( -- ) dcon-load-gpio# gpio-set ;
+: dcon-unload ( -- ) dcon-load-gpio# gpio-clr ;
+
\ : dcon-blnk? ( -- flag ) ; \ Not hooked up
-: dcon-stat@ ( -- n ) h# 019100 io@ 4 rshift 3 and ;
-: setup-dcon-irq ( -- ) d# 124 dup gpio-set-fer gpio-clr-edge ;
-: dcon-irq? ( -- flag ) d# 124 gpio-edge@ ;
+: dcon-stat@ ( -- n ) h# 019100 io@ 4 rshift 3 and ; \ GPIO 100..101
+: setup-dcon-irq ( -- ) dcon-irq-gpio# dup gpio-set-fer gpio-clr-edge ;
+: dcon-irq? ( -- flag ) dcon-irq-gpio# gpio-edge@ ;
\ DCONSTAT values: 0 SCANINT 1 SCANINT_DCON 2 DISPLAYLOAD 3 MISSED
@@ -151,13 +143,16 @@
: vsync! ( sync -- ) 7 dcon! ; \ def: h# 403 d# 4,3
: timeout! ( to -- ) 8 dcon! ; \ def: h# ffff
: scanint! ( si -- ) 9 dcon! ; \ def: h# 0000
-: bright! ( level -- ) d# 10 dcon! ; \ def: h# xxxF
+: dcon-bright! ( level -- ) d# 10 dcon! ; \ def: h# xxxF
+' dcon-bright! to bright!
: bright@ ( -- level ) d# 10 dcon@ ;
: brighter ( -- ) bright@ 1+ h# f min bright! ;
: dimmer ( -- ) bright@ 1- 0 max bright! ;
-: backlight-off ( -- ) mode@ 8 invert and mode! ;
-: backlight-on ( -- ) mode@ 8 or mode! ;
+: dcon-backlight-off ( -- ) mode@ 8 invert and mode! ;
+' dcon-backlight-off to backlight-off
+: dcon-backlight-on ( -- ) mode@ 8 or mode! ;
+' dcon-backlight-on to backlight-on
\ Color swizzle, AA, no passthrough, backlight
: set-color ( color? -- )
@@ -219,13 +214,15 @@
: maybe-set-cmos ( -- ) ;
-: init-xo-display ( -- )
+: init-dcon ( -- )
smb-init
\ Unnecessary because CForth has already done it
\ dcon-load dcon-enable ( maybe-set-cmos )
\ dcon-enable leaves mode set to 69 - 40:antialias, 20:swizzle, 8:backlight on, 1:passthru off
;
+' init-dcon to init-panel
+
: dcon-power-on ( -- ) 1 h# 26 ec-cmd-b! ;
: dcon-power-off ( -- ) 0 h# 26 ec-cmd-b! ;
0 value saved-dcon-mode
Modified: dev/olpc/kb3700/spicmd.fth
==============================================================================
--- dev/olpc/kb3700/spicmd.fth Tue Jul 10 21:23:04 2012 (r3048)
+++ dev/olpc/kb3700/spicmd.fth Wed Jul 11 03:50:11 2012 (r3049)
@@ -42,9 +42,6 @@
: encode-unit ( phys -- adr len ) push-hex (u.) pop-base ;
: decode-unit ( adr len -- phys ) push-hex $number if 0 then pop-base ;
-d# 155 constant cmd-gpio#
-d# 125 constant ack-gpio#
-
\ Channel#(port#) Meaning
\ 0 Invalid
\ 1 Switch to Command Mode
@@ -161,13 +158,13 @@
false value debug?
\ Set the direction on the ACK and CMD GPIOs
: init-gpios ( -- )
- cmd-gpio# gpio-dir-out
- ack-gpio# gpio-dir-out
+ ec-spi-cmd-gpio# gpio-dir-out
+ ec-spi-ack-gpio# gpio-dir-out
;
-: clr-cmd ( -- ) cmd-gpio# gpio-clr ;
-: set-cmd ( -- ) cmd-gpio# gpio-set ;
-: clr-ack ( -- ) ack-gpio# gpio-clr ;
-: set-ack ( -- ) ack-gpio# gpio-set ;
+: clr-cmd ( -- ) ec-spi-cmd-gpio# gpio-clr ;
+: set-cmd ( -- ) ec-spi-cmd-gpio# gpio-set ;
+: clr-ack ( -- ) ec-spi-ack-gpio# gpio-clr ;
+: set-ack ( -- ) ec-spi-ack-gpio# gpio-set ;
: fast-ack ( -- ) set-ack clr-ack debug? if ." ACK " cr then ;
: slow-ack ( -- ) d# 10 ms set-ack d# 10 ms clr-ack ;
defer pulse-ack ' fast-ack to pulse-ack
Modified: dev/olpc/mmp2camera/platform.fth
==============================================================================
--- dev/olpc/mmp2camera/platform.fth Tue Jul 10 21:23:04 2012 (r3048)
+++ dev/olpc/mmp2camera/platform.fth Wed Jul 11 03:50:11 2012 (r3049)
@@ -7,10 +7,8 @@
0 value camera-smb-slave
: camera-smb-setup ( -- )
1 to smb-dly-us
-\+ olpc-cl2 d# 108 to smb-clock-gpio#
-\+ olpc-cl2 d# 109 to smb-data-gpio#
-\+ olpc-cl3 d# 4 to smb-clock-gpio#
-\+ olpc-cl3 d# 5 to smb-data-gpio#
+ cam-scl-gpio# to smb-clock-gpio#
+ cam-sda-gpio# to smb-data-gpio#
camera-smb-slave to smb-slave
;
: camera-smb-on ( -- ) camera-smb-setup smb-on ;
@@ -18,20 +16,17 @@
: ov! ( data reg -- ) camera-smb-setup smb-byte! ;
: reset-sensor ( -- )
-\+ olpc-cl3 d# 10 gpio-clr 1 ms d# 10 gpio-set
-\+ olpc-cl2 d# 102 gpio-clr 1 ms d# 102 gpio-set
+ cam-rst-gpio# gpio-clr 1 ms cam-rst-gpio# gpio-set
;
-[ifdef] cl2-a1
-: sensor-power-on ( -- ) d# 145 gpio-set ;
-: sensor-power-off ( -- ) d# 145 gpio-clr ;
-[else]
: sensor-power-on ( -- )
- d# 150 gpio-set
-\+ olpc-cl2 d# 144 gpio-clr
-\+ olpc-cl3 d# 9 gpio-clr
+ cam-pwr-gpio# gpio-set
+ cam-pwrdn-gpio# gpio-clr
+;
+: sensor-power-off ( -- )
+ ( cam-pwrdn-gpio# gpio-set ) \ Leave low for Linux
+ cam-pwr-gpio# gpio-clr
;
-: sensor-power-off ( -- ) ( d# 144 gpio-set ) d# 150 gpio-clr ; \ Leave low for Linux
[then]
\ CAM_HSYNC is on GPIO67, CAM_VSYNC is on GPIO68
Modified: dev/olpc/spiflash/spiui.fth
==============================================================================
--- dev/olpc/spiflash/spiui.fth Tue Jul 10 21:23:04 2012 (r3048)
+++ dev/olpc/spiflash/spiui.fth Wed Jul 11 03:50:11 2012 (r3049)
@@ -74,7 +74,7 @@
." Got firmware version: "
flash-buf h# f.ffc0 + dup h# 10 type cr ( adr )
- machine-signature count comp abort" Wrong machine signature"
+ signature$ comp abort" Wrong machine signature"
?crc
@@ -290,7 +290,7 @@
: check-firmware-image ( adr len -- adr len )
dup /flash <> abort" Wrong image length" ( adr len )
2dup + h# 40 - ( adr len signature-adr )
- machine-signature count comp abort" Wrong machine signature"
+ signature$ comp abort" Wrong machine signature"
( adr len signature-adr )
." Firmware: " h# 10 type ( adr len )
\ XXX add some more sanity checks
1
0
Author: wmb
Date: Tue Jul 10 21:23:04 2012
New Revision: 3048
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/3048
Log:
OLPC XO-3.0 - Added some descriptive properties to USB device node.
Modified:
cpu/arm/olpc/3.0/usb.fth
Modified: cpu/arm/olpc/3.0/usb.fth
==============================================================================
--- cpu/arm/olpc/3.0/usb.fth Tue Jul 10 21:20:48 2012 (r3047)
+++ cpu/arm/olpc/3.0/usb.fth Tue Jul 10 21:23:04 2012 (r3048)
@@ -8,6 +8,9 @@
my-space swap " map-in" $call-parent h# 100 + ( adr )
;
: my-map-out ( adr len -- ) swap h# 100 - swap " map-out" $call-parent ;
+ " /pmua" encode-phandle 5 encode-int encode+ " clocks" property
+ d# 44 " interrupts" integer-property
+
false constant has-dbgp-regs?
false constant needs-dummy-qh?
: grab-controller ( config-adr -- error? ) drop false ;
1
0
Author: wmb
Date: Tue Jul 10 21:20:48 2012
New Revision: 3047
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/3047
Log:
OLPC XO-1.75 - removed duplicate inclusion of telnetd dropin.
Modified:
cpu/arm/olpc/1.75/olpc.bth
Modified: cpu/arm/olpc/1.75/olpc.bth
==============================================================================
--- cpu/arm/olpc/1.75/olpc.bth Tue Jul 10 21:16:44 2012 (r3046)
+++ cpu/arm/olpc/1.75/olpc.bth Tue Jul 10 21:20:48 2012 (r3047)
@@ -129,8 +129,6 @@
" ${BP}/ofw/inet/telnetd.fth" " telnetd" $add-deflated-dropin
- " ${BP}/ofw/inet/telnetd.fth" " telnetd" $add-deflated-dropin
-
" ${BP}/cpu/x86/pc/olpc/images/bigx.di" $add-file
" ${BP}/cpu/x86/pc/olpc/images/bigcheck.di" $add-file
" ${BP}/cpu/x86/pc/olpc/images/leds.di" $add-file
1
0
Author: wmb
Date: Tue Jul 10 21:16:44 2012
New Revision: 3046
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/3046
Log:
ARM MMP2 - added io!@ routine for accessing slow IO registers that need to be read back after writing.
Modified:
cpu/arm/mmp2/mfpr.fth
cpu/arm/mmp2/socregs.fth
Modified: cpu/arm/mmp2/mfpr.fth
==============================================================================
--- cpu/arm/mmp2/mfpr.fth Tue Jul 10 10:50:12 2012 (r3045)
+++ cpu/arm/mmp2/mfpr.fth Tue Jul 10 21:16:44 2012 (r3046)
@@ -46,9 +46,11 @@
: no-update, ( -- ) 8 w, ; \ 8 is a reserved bit; the code skips these
: af@ ( gpio# -- function# ) gpio>mfpr io@ ;
-: af! ( function# gpio# -- ) gpio>mfpr io! ;
+: af! ( function# gpio# -- ) gpio>mfpr io!@ ;
: +edge-clr ( n -- n' ) h# 40 or ;
+: +very-slow ( n -- n' ) h# 0000 or ;
+: +slow ( n -- n' ) h# 0800 or ;
: +medium ( n -- n' ) h# 1000 or ;
: +fast ( n -- n' ) h# 1800 or ;
: +twsi ( n -- n' ) h# 400 or ;
Modified: cpu/arm/mmp2/socregs.fth
==============================================================================
--- cpu/arm/mmp2/socregs.fth Tue Jul 10 10:50:12 2012 (r3045)
+++ cpu/arm/mmp2/socregs.fth Tue Jul 10 21:16:44 2012 (r3046)
@@ -4,6 +4,7 @@
: +io ( offset -- va ) io-va + ;
: io! ( value offset -- ) +io l! ;
: io@ ( offset -- value ) +io l@ ;
+: io!@ ( value offset -- ) tuck io! io@ drop ; \ For slow registers like MFPRs
: +apbc ( offset -- io-offset ) h# 01.5000 + ; \ APB Clock Unit
: +pmua ( offset -- io-offset ) h# 28.2800 + ; \ CPU Power Management Unit
1
0