Author: wmb
Date: Wed Oct 3 23:50:56 2012
New Revision: 3350
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/3350
Log:
OLPC XO-1.75 - support old OS releases from OFW with new device tree layout.
Added:
cpu/arm/olpc/1.75/dtcompat.fth
Modified:
cpu/arm/olpc/1.75/fw.bth
forth/lib/substrin.fth
Added: cpu/arm/olpc/1.75/dtcompat.fth
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ cpu/arm/olpc/1.75/dtcompat.fth Wed Oct 3 23:50:56 2012 (r3350)
@@ -0,0 +1,34 @@
+purpose: Hack to make old kernels boot with new device tree layout
+
+\ The problem this solves is that older OS releases for XO-1.75
+\ a) Require ATAGS info instead of flattened device tree (kernel), and
+\ b) Require MMC pathnames of the form /sd@d4280000/disk@N instead of
+\ the new form /sd/sdhci@d428nnnn/disk (initrd).
+\ In order to boot those old OS releases, when we detect an old release,
+\ we use ATAGS and rewrite the "bootpath" property in /chosen to the old
+\ form.
+
+
+\ If "bootpath" (whose underlying storage is load-path) matches newpath$,
+\ replace it with oldpath$ .
+: $replaced? ( oldpath$ newpath$ -- flag )
+ load-path cscount substring? if ( oldpath$ )
+ load-path place-cstr ( )
+ true ( flag )
+ else ( oldpath$ )
+ 2drop false ( flag )
+ then ( flag )
+;
+
+: fixup-bootpath ( -- )
+ disable-interrupts
+ /ramdisk 0= if exit then
+ " $bootpath in"n"t"t/sd@" ramdisk-adr /ramdisk $sindex nip if ( )
+ false to use-fdt?
+ " /sd@d4280000/disk@1:/" " /sd/sdhci@d4280000/disk" $replaced? ?exit
+ " /sd@d4280000/disk@2:/" " /sd/sdhci@d4280800/disk" $replaced? ?exit
+ " /sd@d4280000/disk@3:/" " /sd/sdhci@d4281000/disk" $replaced? ?exit
+ then
+;
+
+patch fixup-bootpath disable-interrupts linux-fixup
Modified: cpu/arm/olpc/1.75/fw.bth
==============================================================================
--- cpu/arm/olpc/1.75/fw.bth Wed Oct 3 23:40:57 2012 (r3349)
+++ cpu/arm/olpc/1.75/fw.bth Wed Oct 3 23:50:56 2012 (r3350)
@@ -31,5 +31,6 @@
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/1.75/dtcompat.fth
fload ${BP}/cpu/arm/olpc/save-fw.fth
Modified: forth/lib/substrin.fth
==============================================================================
--- forth/lib/substrin.fth Wed Oct 3 23:40:57 2012 (r3349)
+++ forth/lib/substrin.fth Wed Oct 3 23:50:56 2012 (r3350)
@@ -31,6 +31,20 @@
r> 1+ >r
again
;
+
+\ This version is faster (due to bscan being a code word) and arguably more convenient than sindex
+: $sindex ( small$ big$ -- rem$ )
+ 2 pick 0= if 4drop 0 then \ Null string is initial substring of anything
+ 3 pick c@ >r ( small$ big$ r: firstchar )
+ begin r@ bscan dup while ( small$ rem$ r: firstchar )
+ 4dup substring? if ( small$ rem$ r: firstchar )
+ 2swap r> 3drop exit ( -- rem$ )
+ then ( small$ rem$ r: firstchar )
+ 1 /string ( small$ rem$' r: firstchar )
+ repeat ( small$ rem$ r: firstchar )
+ 2swap r> 3drop ( rem$ )
+;
+
only forth also definitions
\ LICENSE_BEGIN
Author: wmb
Date: Tue Oct 2 03:48:06 2012
New Revision: 3348
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/3348
Log:
Q7B02 redux - reverted the 8787 WLAN version from 14.66.09.p96, which doesn't work with OFW, to 14.66.09.p80, which does work. The problem is that the data write port ready never gets set.
Modified:
cpu/arm/olpc/4.0/wlan-version.fth
Modified: cpu/arm/olpc/4.0/wlan-version.fth
==============================================================================
--- cpu/arm/olpc/4.0/wlan-version.fth Tue Oct 2 03:05:18 2012 (r3347)
+++ cpu/arm/olpc/4.0/wlan-version.fth Tue Oct 2 03:48:06 2012 (r3348)
@@ -5,7 +5,11 @@
macro: WLAN_PREFIX lbtf_sdio-
macro: WLAN_VERSION 9.0.7.p2
-macro: WLAN_8787_VERSION dd7193bc187a5182a6236cb6337699d2229c54b0
+\ dd7193bc is 14.66.09.p96 . The OFW driver doesn't work with it yet
+\ macro: WLAN_8787_VERSION dd7193bc187a5182a6236cb6337699d2229c54b0
+
+\ 7a28e074 is 14.66.09.p80
+macro: WLAN_8787_VERSION 7a28e074
\ Non-thin version
\ macro: WLAN_SUBDIR