OpenBIOS
Threads by month
- ----- 2025 -----
- 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
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2000 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1999 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1998 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1997 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1996 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1995 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1994 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1993 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1992 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1991 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1990 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1989 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1988 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1987 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1986 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1985 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1984 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1983 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1982 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1981 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1980 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1979 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1978 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1977 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1976 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1975 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1974 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1973 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1972 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1971 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1970 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1969 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1968 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1967 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1966 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1965 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1964 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1963 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1962 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1961 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1960 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1959 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1958 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1957 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1956 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1955 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1954 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1953 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1952 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1951 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1950 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1949 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1948 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1947 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1946 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1945 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1944 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1943 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1942 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1941 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1940 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1939 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1938 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1937 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1936 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1935 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1934 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1933 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1932 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1931 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1930 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1929 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1928 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1927 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1926 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1925 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1924 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1923 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1922 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1921 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1920 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1919 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1918 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1917 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1916 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1915 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1914 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1913 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1912 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1911 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1910 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1909 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1908 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1907 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1906 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1905 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1904 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
July 2007
- 3 participants
- 65 discussions
Author: wmb
Date: 2007-07-26 08:42:10 +0200 (Thu, 26 Jul 2007)
New Revision: 497
Modified:
dev/mmc/sdhci/sdhci.fth
Log:
OLPC trac 2371 - SD is flaky in high-speed (50 MHz) mode on B1,
probably as a result of the FPGA-based CaFe chips on B1.
The firmware fix is to check for a B1 system and avoid switching
to 50 MHz card clock thereon.
Modified: dev/mmc/sdhci/sdhci.fth
===================================================================
--- dev/mmc/sdhci/sdhci.fth 2007-07-26 01:14:50 UTC (rev 496)
+++ dev/mmc/sdhci/sdhci.fth 2007-07-26 06:42:10 UTC (rev 497)
@@ -154,7 +154,12 @@
;
: card-clock-50 ( -- )
card-clock-off
- h# 003 h# 2c cw! \ Set divisor to 2^0, leaving internal clock on
+ h# 003 \ division = 2^0, clocks on
+
+ \ OLPC-specific hack: fast clock doesn't work on the FPGA CaFe chip
+ " board-revision" evaluate h# b20 < if drop h# 103 then
+
+ h# 2c cw! \ Set divisor to 2^0, leaving internal clock on
card-clock-on
;
1
0
Author: wmb
Date: 2007-07-26 03:14:50 +0200 (Thu, 26 Jul 2007)
New Revision: 496
Modified:
cpu/x86/pc/olpc/copynand.fth
dev/olpc/cafenand/badblock.fth
Log:
OLPC NAND driver/copy-nand - Added JFFS2 cleanmarkers to erased blocks
to speed up startup time on the first boot of the OS after copy-nand.
Modified: cpu/x86/pc/olpc/copynand.fth
===================================================================
--- cpu/x86/pc/olpc/copynand.fth 2007-07-25 01:58:15 UTC (rev 495)
+++ cpu/x86/pc/olpc/copynand.fth 2007-07-26 01:14:50 UTC (rev 496)
@@ -150,6 +150,10 @@
i ?check-crc
load-base " copy-block" nandih $call-method
loop
+
+ cr ." Filling with cleanmarkers ..."
+ " put-cleanmarkers" nandih $call-method cr
+
close-nand-ihs
;
Modified: dev/olpc/cafenand/badblock.fth
===================================================================
--- dev/olpc/cafenand/badblock.fth 2007-07-25 01:58:15 UTC (rev 495)
+++ dev/olpc/cafenand/badblock.fth 2007-07-26 01:14:50 UTC (rev 496)
@@ -341,11 +341,18 @@
headers
-: find-good-block ( -- )
- scan-page# ( page# )
- begin pages/eblock + dup block-bad? 0= until
- to scan-page#
+: (next-page#) ( -- true | page# false )
+ usable-page-limit scan-page# pages/eblock + ?do
+ i block-bad? 0= if
+ i to scan-page#
+ scan-page# false unloop exit
+ then
+ pages/eblock +loop
+ true
;
+: next-page# ( -- page# )
+ (next-page#) if ." No more good NAND blocks" cr abort then
+;
0 value test-page
@@ -358,17 +365,22 @@
\ Must erase all (wipe) first
: copy-block ( adr -- )
- find-good-block
- scan-page# pages/eblock bounds ?do ( adr )
+ next-page# pages/eblock bounds ?do ( adr )
dup i write-page ( adr )
/page + ( adr' )
loop ( adr )
drop ( )
;
+: put-cleanmarkers ( -- )
+ begin (next-page#) 0= while ( page# )
+ " "(85 19 03 20 08 00 00 00 00 00 00 00)" ( page# adr len )
+ rot /page /ecc + write-bytes ( )
+ repeat ( )
+;
+
: read-next-block ( adr -- )
- find-good-block
- scan-page# pages/eblock bounds ?do ( adr )
+ next-page# pages/eblock bounds ?do ( adr )
dup i read-page if ( adr )
." Uncorrectable error in page 0x" i .x cr
then
1
0

r495 - cpu/x86/pc cpu/x86/pc/olpc dev dev/geode/ac97 dev/geode/display dev/mmc/sdhci dev/olpc/cafecamera dev/olpc/cafenand dev/pci
by svn@openbios.org July 25, 2007
by svn@openbios.org July 25, 2007
July 25, 2007
Author: wmb
Date: 2007-07-25 03:58:15 +0200 (Wed, 25 Jul 2007)
New Revision: 495
Added:
cpu/x86/pc/olpc/crypto.fth
Modified:
cpu/x86/pc/flashpkg.fth
cpu/x86/pc/olpc/config.fth
cpu/x86/pc/olpc/devices.fth
cpu/x86/pc/olpc/fw.bth
cpu/x86/pc/olpc/pcinode.fth
dev/geode/ac97/ac97.fth
dev/geode/display/gxfb.fth
dev/geode/display/gxpci.fth
dev/i8042.fth
dev/mmc/sdhci/sdhci.fth
dev/mmc/sdhci/sdmmc.fth
dev/olpc/cafecamera/cafecamera.fth
dev/olpc/cafenand/cafenand.fth
dev/pci/isa.fth
dev/pci/isaall.fth
dev/pci/isamisc.fth
dev/pcibus.fth
Log:
OLPC trac #553 - lots of device tree tweaks, mostly stuff that the
OS doesn't care about.
Modified: cpu/x86/pc/flashpkg.fth
===================================================================
--- cpu/x86/pc/flashpkg.fth 2007-07-24 20:33:58 UTC (rev 494)
+++ cpu/x86/pc/flashpkg.fth 2007-07-25 01:58:15 UTC (rev 495)
@@ -119,6 +119,7 @@
size rot 0 d- ( d.#bytes )
;
+[ifdef] flash-is-parent
\ These allow us to sub-address the FLASH device to access the PROMICE AI port
1 " #address-cells" integer-property
@@ -126,6 +127,8 @@
: encode-unit ( phys -- adr len ) push-hex (u.) pop-base ;
: map-in ( offset size -- virt ) drop device-base + ;
: map-out ( virt size -- virt ) 2drop ;
+[then]
+
\ LICENSE_BEGIN
\ Copyright (c) 2006 FirmWorks
\
Modified: cpu/x86/pc/olpc/config.fth
===================================================================
--- cpu/x86/pc/olpc/config.fth 2007-07-24 20:33:58 UTC (rev 494)
+++ cpu/x86/pc/olpc/config.fth 2007-07-25 01:58:15 UTC (rev 495)
@@ -37,7 +37,11 @@
\ create use-watch-all
\ create use-root-isa
create no-floppy-node
+create no-com2-node
+create no-lpt-node
create use-pci-isa
+create basic-isa
+create isa-dma-only
create use-null-nvram
Added: cpu/x86/pc/olpc/crypto.fth
===================================================================
--- cpu/x86/pc/olpc/crypto.fth (rev 0)
+++ cpu/x86/pc/olpc/crypto.fth 2007-07-25 01:58:15 UTC (rev 495)
@@ -0,0 +1,127 @@
+purpose: Interface to cryptographic code for firmware image validation
+\ See license at end of file
+
+h# c0000 constant crypto-base \ The address the code is linked to run at
+h# c0000 constant hasher-base \ The address the code is linked to run at
+
+variable hashlen
+d# 128 buffer: hashbuf
+
+: hash ( data$ hashname$ -- result$ )
+ " hasher" find-drop-in 0= if 4drop true exit then ( data$ hashname$ prog$ )
+ 2dup hasher-base swap move free-mem ( data$ hashname$ )
+
+ d# 128 hashlen !
+ 2>r swap hashlen hashbuf 2swap 2r> $cstr ( &reslen resbuf datalen databuf hashname-cstr )
+
+ hasher-base dup h# 10 - sp-call abort" Hash failed" drop 4drop ( )
+ hashbuf hashlen @
+;
+
+h# f value which-hashes
+: signature-bad? ( data$ sig$ -- mismatch? )
+ " crypto" find-drop-in 0= if 4drop true exit then ( data$ sig$ prog$ )
+ 2dup crypto-base swap move free-mem ( data$ sig$ )
+
+ " pubkey" find-drop-in 0= if 4drop true exit then ( data$ sig$ key$ )
+ 2>r ( data$ sig$ r: key$ )
+ swap 2swap swap ( siglen sigadr datalen dataadr r: key$ )
+ 2r@ swap 2swap ( siglen sigadr keylen keyadr datalen dataadr r: key$ )
+
+ which-hashes
+
+ crypto-base dup h# 10 - sp-call >r 3drop 4drop r> ( result r: key$ )
+ 2r> free-mem
+
+\ XXX free-mem in suspend.fth and fw.bth after find-drop-in
+\ XXX clean out dead code in usb.fth
+;
+
+1 [if]
+
+\ Check that the version is an upgrade?
+
+: >rom-name$ ( device$ -- path$ )
+ image-name-buf place ( )
+ " :\boot\olpcfw.rom" image-name-buf $cat ( )
+ image-name$
+;
+: sig-name$ ( -- path$ )
+ image-name$ + 4 - " .rom" caps-comp 0= if
+ " sig" image-name$ + 3 - swap move
+ image-name$
+ else
+ 2drop " "
+ then
+;
+: $dev-update-flash ( device$ -- )
+ >rom-name$ $get-image if exit then ( data$ )
+
+ sig-name$ $get-image if
+ ." Missing firmware update signature file: " sig-name$ type cr
+ free-mem exit
+ then ( data$ sig$ )
+
+ 2over 2over signature-bad? if ( data$ sig$ )
+ ." Firmware update image signature mismatch: " sig-name$ type cr
+ free-mem free-mem exit
+ then ( data$ sig$ )
+
+ free-mem ( data$ )
+
+ 2dup flash-buf swap move ( data$ )
+ tuck free-mem ( data-len )
+ ['] ?image-valid catch if ( x )
+ drop ." Firmware image failed sanity checks" cr ( )
+ exit
+ then ( x )
+
+ true to file-loaded?
+ reflash
+;
+[then]
+
+: getbin " usb8388.bin" find-drop-in 0= abort" No usb8388.bin" ;
+: getsig " usb8388.sig" find-drop-in 0= abort" No usb8388.sig" ;
+: tc ( -- )
+ getbin getsig
+ signature-bad? if
+ ." Signature was bad, expected good" cr
+ then
+
+ getbin over 1 swap +!
+ getsig
+ signature-bad? 0= if
+ ." Signature was good, expected bad (corrupt image)" cr
+ then
+
+ getbin
+ getsig over 40 + 1 swap +!
+ signature-bad? 0= if
+ ." Signature was good, expected bad (corrupt signature)" cr
+ then
+;
+
+\ LICENSE_BEGIN
+\ Copyright (c) 2007 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/devices.fth
===================================================================
--- cpu/x86/pc/olpc/devices.fth 2007-07-24 20:33:58 UTC (rev 494)
+++ cpu/x86/pc/olpc/devices.fth 2007-07-25 01:58:15 UTC (rev 495)
@@ -27,9 +27,14 @@
fload ${BP}/cpu/x86/tsc.fth
stand-init:
- gx? if d# 366,666,667 else d# 433,333,333 then ( cpu-clock-hz )
+ gx? if
+ d# 366,666,667 " AMD,Geode GX"
+ else
+ d# 433,333,333 " AMD,Geode LX"
+ then ( cpu-clock-hz model$ )
- " /cpu" find-device ( cpu-clock-hz )
+ " /cpu" find-device ( cpu-clock-hz model$ )
+ " model" string-property ( cpu-clock-hz )
dup " clock-frequency" integer-property ( cpu-clock-hz )
device-end ( cpu-clock-hz )
@@ -64,12 +69,18 @@
h# 20 to vector-base0
h# 28 to vector-base1
device-end
-[then]
+warning @ warning off
+: probe-pci ( -- )
+ probe-pci
+ " /pci" " make-interrupt-map" execute-device-method drop
+;
+warning !
+
0 0 dropin-base <# u#s u#> " /" begin-package
" flash" device-name
-[ifdef] addresses-assigned dropin-size [else] h# 4.0000 [then]
+ h# 10.0000
dup value /device
constant /device-phys
my-address my-space /device-phys reg
Modified: cpu/x86/pc/olpc/fw.bth
===================================================================
--- cpu/x86/pc/olpc/fw.bth 2007-07-24 20:33:58 UTC (rev 494)
+++ cpu/x86/pc/olpc/fw.bth 2007-07-25 01:58:15 UTC (rev 495)
@@ -64,6 +64,7 @@
dev /
1 encode-int " #address-cells" property
+1 encode-int " #size-cells" property
" OLPC" encode-string " architecture" property
device-end
@@ -378,6 +379,8 @@
fload ${BP}/dev/olpc/keyboard/selftest.fth \ Keyboard diagnostic
fload ${BP}/dev/olpc/touchpad/touchpad.fth \ Touchpad diagnostic
fload ${BP}/dev/olpc/kb3700/battery.fth \ Battery status reports
+fload ${BP}/cpu/x86/pc/olpc/copynand.fth
+fload ${BP}/cpu/x86/pc/olpc/crypto.fth \ Cryptographic image validation
[then]
\ Eliminate 4 second delay in install console for the case where
@@ -546,6 +549,7 @@
?start-sound
['] false to interrupt-auto-boot?
probe-usb
+ " nand" $dev-update-flash
interpreter-init
[ifndef] lx-devel
enable-power-button
@@ -573,7 +577,9 @@
quit
;
-fload ${BP}/cpu/x86/pc/olpc/copynand.fth
+: newrom
+ " flash http:\\10.20.0.109\new.rom" eval
+;
\ This helps with TeraTerm, which sends ESC-O as the arrow key prefix
also hidden also keys-forth definitions
Modified: cpu/x86/pc/olpc/pcinode.fth
===================================================================
--- cpu/x86/pc/olpc/pcinode.fth 2007-07-24 20:33:58 UTC (rev 494)
+++ cpu/x86/pc/olpc/pcinode.fth 2007-07-25 01:58:15 UTC (rev 495)
@@ -1,7 +1,7 @@
\ See license at end of file
purpose: PCI bus package
-0 [if] addresses-assigned
+0 [if]
\ Suppress PCI address assignment; use the addresses the BIOS assigned
patch false true master-probe
patch noop assign-all-addresses prober
@@ -13,6 +13,7 @@
patch or-w! my-w! find-fcode?
patch 2drop my-w! find-fcode?
[then]
+
[ifdef] addresses-assigned
\ patch false true master-probe
: nonvirtual-probe-state? ( -- flag )
@@ -61,7 +62,7 @@
[ifdef] lx-devel
" 2,3,4,5,6,7,8,9,a,b,c,d,e,f" exit
[then]
- " c,f"
+ " 1,c,f"
;
\ " c,f" dup config-string pci-probe-list
@@ -100,6 +101,45 @@
drop h# 3c + config-b@ true
;
+0 value interrupt-parent
+
+1 " #interrupt-cells" integer-property
+0 0 encode-bytes 0000.ff00 +i 0+i 0+i 7 +i " interrupt-map-mask" property
+
+: +map ( adr len dev# int-pin# int-level -- adr' len' )
+ >r >r ( $ dev# R: level pin )
+ +i ( $' R: level pin )
+ 0+i 0+i r> +i ( $' R: level )
+ interrupt-parent +i ( $' R: level )
+ r> +i 0 +i ( $' ) \ 0 is active low, level senstive for ISA
+;
+
+external
+
+: make-interrupt-map ( -- )
+ " /isa/interrupt-controller" find-package 0= if exit then to interrupt-parent
+
+ 0 0 encode-bytes ( prop$ )
+
+ h# 10000 0 do ( prop$ )
+ i h# 3d + config-b@ ( prop$ pin# )
+ dup 0<> over h# ff <> and if ( prop$ pin# )
+ i h# 3c + config-b@ ( prop$ pin# level )
+ i -rot +map ( prop$' )
+ else ( prop$ pin# )
+ drop ( prop$ )
+ then ( prop$ )
+ h# 100 +loop ( prop$ )
+ " interrupt-map" property ( )
+;
+
+also known-int-properties definitions
+\ In some systems the number of interrupt-map ints is variable,
+\ but on OLPC, the only node with an interrupt-map is PCI.
+: interrupt-map 7 ;
+: interrupt-map-mask 4 ;
+previous definitions
+
\ Just use the global versions
warning @ warning off
: config-b@ ( config-adr -- b ) config-b@ ;
Modified: dev/geode/ac97/ac97.fth
===================================================================
--- dev/geode/ac97/ac97.fth 2007-07-24 20:33:58 UTC (rev 494)
+++ dev/geode/ac97/ac97.fth 2007-07-25 01:58:15 UTC (rev 495)
@@ -12,9 +12,9 @@
d# 16 encode-int " sample-frame-size" property
\ frame-rate encode-int " input-frame-rates" property
\ frame-rate encode-int " output-frame-rates" property
-" 16bit-LE-unsigned-linear" 2dup encode-string " input-encoding-types" property
+" 16bit-LE-signed-linear" 2dup encode-string " input-encoding-types" property
encode-string " output-encoding-types" property
-" AC97,CODEC" encode-string " compatible" property
+" AD1888" encode-string " AC97,CODEC" encode-string encode+ " compatible" property
d# 128 constant /chipbase
Modified: dev/geode/display/gxfb.fth
===================================================================
--- dev/geode/display/gxfb.fth 2007-07-24 20:33:58 UTC (rev 494)
+++ dev/geode/display/gxfb.fth 2007-07-25 01:58:15 UTC (rev 495)
@@ -541,7 +541,7 @@
h# 0f color@ h# ff color! \ Set color ff to white (same as 15)
;
-: init ( -- ) \ Initializes the controller
+: init-all ( -- ) \ Initializes the controller
smb-init
map-io-regs \ Enable IO registers
init-controller \ Setup the video controller
@@ -566,7 +566,7 @@
0 0 encode-bytes " iso6429-1983-colors" property
: display-install ( -- )
- init
+ init-all
default-font set-font
/scanline bytes/pixel / #scanlines ( width height )
over char-width / over char-height / ( width height rows cols )
Modified: dev/geode/display/gxpci.fth
===================================================================
--- dev/geode/display/gxpci.fth 2007-07-24 20:33:58 UTC (rev 494)
+++ dev/geode/display/gxpci.fth 2007-07-25 01:58:15 UTC (rev 495)
@@ -30,6 +30,13 @@
: (map-frame-buffer) ( -- adr )
h# 10 h# 80.0000 map-membar
;
+
+\ This is called during probing by make-function-node
+: init ( -- )
+ " make-compatible-property" my-parent ihandle>phandle find-method if execute then
+ " make-power-property" my-parent ihandle>phandle find-method if execute then
+;
+
\ LICENSE_BEGIN
\ Copyright (c) 2006 FirmWorks
\
Modified: dev/i8042.fth
===================================================================
--- dev/i8042.fth 2007-07-24 20:33:58 UTC (rev 494)
+++ dev/i8042.fth 2007-07-25 01:58:15 UTC (rev 495)
@@ -26,7 +26,7 @@
[then]
\ 0 means the keyboard port, 1 means the aux port
-: encode-unit ( n -- adr len ) if " aux" else " " then ;
+: encode-unit ( n -- adr len ) if " aux" else " kbd" then ;
: decode-unit ( adr len -- n ) " aux" $= 0= if 0 else 1 then ;
\ Queues for distributing bytes sent from the two devices
Modified: dev/mmc/sdhci/sdhci.fth
===================================================================
--- dev/mmc/sdhci/sdhci.fth 2007-07-24 20:33:58 UTC (rev 494)
+++ dev/mmc/sdhci/sdhci.fth 2007-07-25 01:58:15 UTC (rev 495)
@@ -15,6 +15,8 @@
0 " #address-cells" integer-property
0 " #size-cells" integer-property
+" sdhci" " compatible" string-property
+
h# 4000 constant /regs
: phys+ encode-phys encode+ ;
Modified: dev/mmc/sdhci/sdmmc.fth
===================================================================
--- dev/mmc/sdhci/sdmmc.fth 2007-07-24 20:33:58 UTC (rev 494)
+++ dev/mmc/sdhci/sdmmc.fth 2007-07-25 01:58:15 UTC (rev 495)
@@ -3,6 +3,7 @@
" disk" device-name
" sdmmc" " iconname" string-property
+" block" device-type
0 instance value label-package
Modified: dev/olpc/cafecamera/cafecamera.fth
===================================================================
--- dev/olpc/cafecamera/cafecamera.fth 2007-07-24 20:33:58 UTC (rev 494)
+++ dev/olpc/cafecamera/cafecamera.fth 2007-07-25 01:58:15 UTC (rev 495)
@@ -7,6 +7,8 @@
" camera" device-name
" olpc,camera" model
" camera" device-type
+" olpc,camera" " compatible" string-property
+" OV7670" " sensor" string-property
h# 4000 constant /regs
Modified: dev/olpc/cafenand/cafenand.fth
===================================================================
--- dev/olpc/cafenand/cafenand.fth 2007-07-24 20:33:58 UTC (rev 494)
+++ dev/olpc/cafenand/cafenand.fth 2007-07-25 01:58:15 UTC (rev 495)
@@ -3,7 +3,7 @@
" nandflash" device-name
" olpc,cafenand" model
-" disk" device-type
+" olpc,cafenand" " compatible" string-property
h# 4000 constant /regs
Modified: dev/pci/isa.fth
===================================================================
--- dev/pci/isa.fth 2007-07-24 20:33:58 UTC (rev 494)
+++ dev/pci/isa.fth 2007-07-25 01:58:15 UTC (rev 495)
@@ -6,6 +6,9 @@
" isa" device-name
" isa" device-type
+2 " #address-cells" integer-property
+1 " #size-cells" integer-property
+
my-address my-space encode-phys 0 encode-int encode+ h# 0 encode-int encode+
" reg" property
Modified: dev/pci/isaall.fth
===================================================================
--- dev/pci/isaall.fth 2007-07-24 20:33:58 UTC (rev 494)
+++ dev/pci/isaall.fth 2007-07-25 01:58:15 UTC (rev 495)
@@ -3,7 +3,7 @@
fload ${BP}/dev/pci/isacom.fth \ Serial ports
-[ifndef] no-lpt
+[ifndef] no-lpt-node
0 0 " i378" " /isa" begin-package
fload ${BP}/dev/pci/isalpt.fth \ Parallel port
end-package
Modified: dev/pci/isamisc.fth
===================================================================
--- dev/pci/isamisc.fth 2007-07-24 20:33:58 UTC (rev 494)
+++ dev/pci/isamisc.fth 2007-07-25 01:58:15 UTC (rev 495)
@@ -15,7 +15,9 @@
0 1 10 encode-reg
80 1 20 encode-reg encode+
c0 1 20 encode-reg encode+
-[ifndef] isa-dma-only
+[ifdef] isa-dma-only
+ 481 1 f encode-reg encode+ \ High page registers
+[else]
[ifdef] PREP
40a 1 2 encode-reg encode+ \ AIX wants this
[else]
@@ -91,9 +93,7 @@
" pnpPNP,0" " compatible" string-property
20 1 2 encode-reg a0 1 2 encode-reg encode+
-[ifndef] basic-isa
4d0 1 2 encode-reg encode+
-[then]
" reg" property
fload ${BP}/dev/i8259.fth
Modified: dev/pcibus.fth
===================================================================
--- dev/pcibus.fth 2007-07-24 20:33:58 UTC (rev 494)
+++ dev/pcibus.fth 2007-07-25 01:58:15 UTC (rev 495)
@@ -40,8 +40,6 @@
headers
" pci" encode-string " name" property
-7 encode-int " scsi-initiator-id" property
-
\ There are no visible PCI registers
\ my-address encode-int /pci-regs encode-int encode+ " reg" property
1
0
Author: wmb
Date: 2007-07-24 22:33:58 +0200 (Tue, 24 Jul 2007)
New Revision: 494
Modified:
cpu/x86/pc/olpc/linux.fth
Log:
OLPC trac #2335 - changed boot order to USB before SD.
Modified: cpu/x86/pc/olpc/linux.fth
===================================================================
--- cpu/x86/pc/olpc/linux.fth 2007-07-24 19:02:06 UTC (rev 493)
+++ cpu/x86/pc/olpc/linux.fth 2007-07-24 20:33:58 UTC (rev 494)
@@ -11,7 +11,7 @@
\needs ramdisk " " d# 128 config-string ramdisk
" " ' boot-file set-config-string-default \ Let the olpcboot.fth file set the cmdline
-" sd:\boot\olpc.fth disk:\boot\olpc.fth nand:\boot\olpc.fth /prober /usb/ethernet /usb/wlan" ' boot-device set-config-string-default
+" disk:\boot\olpc.fth sd:\boot\olpc.fth nand:\boot\olpc.fth /prober /usb/ethernet /usb/wlan" ' boot-device set-config-string-default
0 value ramdisk-adr
0 value /ramdisk
1
0
Author: wmb
Date: 2007-07-24 21:02:06 +0200 (Tue, 24 Jul 2007)
New Revision: 493
Added:
ofw/fs/ext2fs/partition.fth
Modified:
ofw/disklabel/loadpkg.fth
ofw/disklabel/methods.fth
Log:
Partition type decoder - handle mismatch between partition type code
and actual filesystem. Warn of the mismatch, but use the actual filesystem.
OLPC trac #635.
Modified: ofw/disklabel/loadpkg.fth
===================================================================
--- ofw/disklabel/loadpkg.fth 2007-07-24 01:21:22 UTC (rev 492)
+++ ofw/disklabel/loadpkg.fth 2007-07-24 19:02:06 UTC (rev 493)
@@ -4,11 +4,15 @@
fload ${BP}/ofw/disklabel/common.fth
fload ${BP}/ofw/fs/fatfs/partition.fth
fload ${BP}/ofw/fs/cdfs/partition.fth
+[ifdef] ufs-support
fload ${BP}/ofw/fs/ufs/partition.fth
+[then]
+fload ${BP}/ofw/fs/ext2fs/partition.fth
[ifdef] hfs-support
fload ${BP}/ofw/fs/macfs/partition.fth
[then]
fload ${BP}/ofw/disklabel/methods.fth
+
\ LICENSE_BEGIN
\ Copyright (c) 2006 FirmWorks
\
Modified: ofw/disklabel/methods.fth
===================================================================
--- ofw/disklabel/methods.fth 2007-07-24 01:21:22 UTC (rev 492)
+++ ofw/disklabel/methods.fth 2007-07-24 19:02:06 UTC (rev 493)
@@ -48,11 +48,13 @@
then
then
+[ifdef] ufs-support
\ If the partition type is UFS and a filename is specified, select
\ one of the UFS sub-partitions. Otherwise use the raw partition.
partition-type ufs-type = if
filename nip if ufs-map then
then
+[then]
;
: select-partition ( -- )
@@ -83,6 +85,7 @@
iso-9660? if exit then
+[ifdef] ufs-support
\ If this disk has a UFS partition map that is not subordinate to
\ an FDISK map and either a UFS partition letter or a filename is
\ specified, select one of the UFS sub-partitions.
@@ -90,6 +93,7 @@
ufs? if
ufs-partition 0<> filename nip 0<> or if ufs-map exit then
then
+[then]
\ Nothing we tried worked.
abort
@@ -106,15 +110,32 @@
\ ( change sector-offset and size.low,high ) ...
[then]
+ 2 read-sector
+ ext2? if
+ partition-type ext2fs-type <> if
+ ." Warning: Filesystem is ext2/3, but partition type is 0x"
+ partition-type .x ." (should be 0x83)." cr
+ then
+ " ext2-file-system" exit
+ then
+
+[ifdef] ufs-support
partition-type ufs-type = if " ufs-file-system" exit then
- partition-type ext2fs-type = if " ext2-file-system" exit then
- partition-type minix-type = if " minix-file-system" exit then
+[then]
+ partition-type minix-type = if " minix-file-system" exit then
0 read-sector \ Get the first sector of the selected partition
dropin? if " dropin-file-system" exit then
zip? if " zip-file-system" exit then
+ fat? if
+ partition-type ext2fs-type = if
+ ." Warning: Filesystem is FAT, but partition type is 0x83 (ext2/3)." cr
+ then
+ " fat-file-system" exit
+ then
- " fat-file-system"
+ ." Error: Unknown file system" cr
+ abort
;
\ If the arguments include a filename, we determine the type of filesystem
Added: ofw/fs/ext2fs/partition.fth
===================================================================
--- ofw/fs/ext2fs/partition.fth (rev 0)
+++ ofw/fs/ext2fs/partition.fth 2007-07-24 19:02:06 UTC (rev 493)
@@ -0,0 +1,33 @@
+\ See license at end of file
+purpose: Ext2/3 partition map decoding support
+
+\ Returns true if the sector buffer appears to contain an ext2/3 super block
+\ which signifies the beginning of a DOS "FAT" file system.
+: ext2? ( -- flag )
+ sector-buf h# 38 + w@ ( magic )
+ dup h# ef53 = swap h# 53ef = or ( ext2? )
+;
+
+\ LICENSE_BEGIN
+\ Copyright (c) 2007 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: wmb
Date: 2007-07-24 03:21:22 +0200 (Tue, 24 Jul 2007)
New Revision: 492
Modified:
dev/olpc/cafenand/badblock.fth
dev/olpc/cafenand/cafenand.fth
dev/olpc/cafenand/ecc.fth
Log:
OLPC CaFe NAND driver - turned on ECC correction. Trac 738
Modified: dev/olpc/cafenand/badblock.fth
===================================================================
--- dev/olpc/cafenand/badblock.fth 2007-07-23 20:24:48 UTC (rev 491)
+++ dev/olpc/cafenand/badblock.fth 2007-07-24 01:21:22 UTC (rev 492)
@@ -170,7 +170,10 @@
bbt swap /bbt /page / ( adr page# #pages )
\ Can't use read-blocks because of block-bad? dependency
bounds ?do ( adr )
- dup i read-page ( adr )
+ dup i read-page if ( adr )
+ ." BBT has uncorrectable errors" cr
+ abort
+ then ( adr )
/page + ( adr' )
loop ( adr )
drop
@@ -232,13 +235,15 @@
over block-bad? if 3drop 0 exit then
then
- dup >r ( adr page# #pages r: #pages )
- bounds ?do ( adr )
- \ XXX need some error handling
- dup i read-page ( adr )
- /page + ( adr' )
- loop ( adr )
- drop r>
+ rot >r 2dup r> -rot ( page# #pages adr page# #pages )
+ bounds ?do ( page# #pages adr )
+ dup i read-page if ( page# #pages adr )
+ 2drop i swap - ( #read )
+ unloop exit
+ then ( page# #pages adr )
+ /page + ( page# #pages adr' )
+ loop ( page# #pages adr )
+ drop nip
;
: write-blocks ( adr page# #pages -- #written )
@@ -364,7 +369,9 @@
: read-next-block ( adr -- )
find-good-block
scan-page# pages/eblock bounds ?do ( adr )
- dup i read-page ( adr )
+ dup i read-page if ( adr )
+ ." Uncorrectable error in page 0x" i .x cr
+ then
/page + ( adr' )
loop ( adr )
drop ( )
@@ -381,7 +388,7 @@
\ : verify-block ( adr -- false | page# true )
\ find-good-block
\ scan-page# pages/eblock bounds ?do ( adr )
-\ test-page i read-page ( adr )
+\ test-page i read-page drop ( adr )
\ dup test-page /page comp if ( adr )
\ drop ( )
\ i true exit ( -- page# true )
@@ -401,7 +408,7 @@
: block-erased? ( page# -- flag )
pages/eblock bounds ?do
- test-page i read-page
+ test-page i read-page drop
test-page /page erased? 0= if false unloop exit then
pages/eblock +loop
true
Modified: dev/olpc/cafenand/cafenand.fth
===================================================================
--- dev/olpc/cafenand/cafenand.fth 2007-07-23 20:24:48 UTC (rev 491)
+++ dev/olpc/cafenand/cafenand.fth 2007-07-24 01:21:22 UTC (rev 492)
@@ -22,6 +22,7 @@
: cl! ( l adr -- ) chip + rl! ;
: cl@ ( adr -- l ) chip + rl@ ;
+: cw@ ( adr -- w ) chip + rw@ ;
: map-regs ( -- )
0 0 h# 0200.0010 my-space + /regs " map-in" $call-parent to chip
@@ -199,16 +200,27 @@
0 instance value dma-buf-pa
0 instance value dma-buf-va
defer do-lmove
+h# 10 buffer: syndrome-buf
+: syndrome ( -- adr )
+ 8 0 do h# 50 i wa+ cw@ i syndrome-buf array! loop
+ syndrome-buf
+;
-\ XXX should check ECC
-: read-page ( adr page# -- )
+: read-page ( adr page# -- error? )
0 set-page ( adr )
- /page ( /oob + ) h# 18 cl! ( adr )
+ /page /ecc + h# 18 cl! ( adr )
dma-buf-pa h# 44 cl! ( adr )
0 h# 48 cl! ( adr )
/page h# a000.0000 or h# 40 cl! ( adr )
read-cmd h# 0800.0130 cmd wait-dma ( adr )
- dma-buf-va swap /page do-lmove ( )
+
+ h# 3c cl@ h# 40000 and if ( adr ) \ ECC error
+ dma-buf-va syndrome correct-ecc ( adr uncorrectable? )
+ else ( adr )
+ false ( adr error? )
+ then ( adr error? )
+
+ dma-buf-va rot /page do-lmove ( error? )
;
: dma-write-raw ( adr len page# offset -- )
@@ -231,7 +243,6 @@
write-disable ( )
;
-\ : read-page ( adr page# -- ) dma-read-page ;
: write-page ( adr page# -- ) dma-write-page ;
: write-bytes ( adr len page# offset -- ) pio-write-raw ;
Modified: dev/olpc/cafenand/ecc.fth
===================================================================
--- dev/olpc/cafenand/ecc.fth 2007-07-23 20:24:48 UTC (rev 491)
+++ dev/olpc/cafenand/ecc.fth 2007-07-24 01:21:22 UTC (rev 492)
@@ -3,8 +3,8 @@
hex
-: array! ( value index adr -- ) swap wa+ ! ;
-: array@ ( index adr -- value ) swap wa+ @ ;
+: array! ( value index adr -- ) swap wa+ w! ;
+: array@ ( index adr -- value ) swap wa+ w@ ;
\ Split or join a number, size of low half is n bits.
: #split ( x n -- x.lo x.hi )
@@ -330,10 +330,10 @@
[ifdef] notdef
\ Test vectors
-CREATE s1 001 , 6c6 , 291 , d91 , 1ef , e26 , a19 , 8c0 ,
-CREATE s2 0f8 , de1 , 5e5 , 287 , 566 , 756 , f5f , 253 ,
-CREATE s3 001 , 001 , 001 , 001 , 001 , 001 , 001 , 001 ,
-CREATE s4 41e , b7a , 37c , 885 , c32 , a87 , 218 , b08 ,
+CREATE s1 001 w, 6c6 w, 291 w, d91 w, 1ef w, e26 w, a19 w, 8c0 w,
+CREATE s2 0f8 w, de1 w, 5e5 w, 287 w, 566 w, 756 w, f5f w, 253 w,
+CREATE s3 001 w, 001 w, 001 w, 001 w, 001 w, 001 w, 001 w, 001 w,
+CREATE s4 41e w, b7a w, 37c w, 885 w, c32 w, a87 w, 218 w, b08 w,
: #aligned negate swap negate and negate ;
1
0
Author: wmb
Date: 2007-07-23 22:24:48 +0200 (Mon, 23 Jul 2007)
New Revision: 491
Added:
ofw/termemu/15x30pc.license
ofw/termemu/15x30pc.psf
Log:
Checked-in 15x30pc font and associated license text.
Added: ofw/termemu/15x30pc.license
===================================================================
--- ofw/termemu/15x30pc.license (rev 0)
+++ ofw/termemu/15x30pc.license 2007-07-23 20:24:48 UTC (rev 491)
@@ -0,0 +1,5 @@
+15x30pc.psf was created by Albert Cahalan as a modification of the DejaVu fonts.
+Such modification, and incorporation of a typeface within a larger software
+package, is permitted by the following license:
+
+http://dejavu.sourceforge.net/wiki/index.php/License
Added: ofw/termemu/15x30pc.psf
===================================================================
(Binary files differ)
Property changes on: ofw/termemu/15x30pc.psf
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
1
0
Author: wmb
Date: 2007-07-23 22:04:51 +0200 (Mon, 23 Jul 2007)
New Revision: 490
Modified:
cpu/x86/pc/biosload/build/
Log:
svn: Ignore .elf files in cpu/x86/pc/biosload/build directory
Property changes on: cpu/x86/pc/biosload/build
___________________________________________________________________
Name: svn:ignore
- build
builton.fth
ofw.c32
+ build
builton.fth
ofw.c32
*.elf
1
0
Author: wmb
Date: 2007-07-23 21:53:45 +0200 (Mon, 23 Jul 2007)
New Revision: 489
Modified:
cpu/x86/pc/olpc/build/
Log:
svn: Ignore .md5 files in build directory
Property changes on: cpu/x86/pc/olpc/build
___________________________________________________________________
Name: svn:ignore
- build
ofw.elf
builton.fth
*.rom
*.bin
*.version
forth
sourceurl
+ build
ofw.elf
builton.fth
*.rom
*.bin
*.version
forth
sourceurl
*.md5
1
0
Author: wmb
Date: 2007-07-23 21:40:40 +0200 (Mon, 23 Jul 2007)
New Revision: 488
Added:
cpu/ppc/cacheon.bth
cpu/ppc/cachinfl.bth
cpu/ppc/inflate.bth
cpu/ppc/olpc/olpc.bth
cpu/ppc/olpc/resetvec.bth
cpu/ppc/olpc/start.bth
Modified:
cpu/ppc/olpc/build/
cpu/ppc/olpc/devalias.fth
cpu/ppc/olpc/fw.bth
cpu/ppc/olpc/fwuboot.bth
cpu/ppc/olpc/pcinode.fth
cpu/ppc/ppcboot.fth
Log:
PowerPC OLPC build - Checkpoint.
Added: cpu/ppc/cacheon.bth
===================================================================
--- cpu/ppc/cacheon.bth (rev 0)
+++ cpu/ppc/cacheon.bth 2007-07-23 19:40:40 UTC (rev 488)
@@ -0,0 +1,55 @@
+purpose: Code to prepend to the inflater to run it with the cache on
+copyright: Copyright 1995 Firmworks All Rights Reserved
+
+command: &builder &this
+build-now
+
+fload ${BP}/cpu/ppc/asmtools.fth
+
+start-assembling
+
+\ This module use C calling and register usage conventions
+\ On entry,
+\ r1: C stack pointer
+\ r3: pointer to compressed image,
+\ r4: pointer to base of firmware RAM,
+\ r5: pointer to workspace area
+\ r6: size of firmware RAM
+
+label entry ( <as above> -- )
+ mfspr r0,lr \ C stack linkage and register saving
+ stw r31,-4(r1)
+ stw r0,8(r1)
+ stwu r1,h#-18(r1)
+
+ mfspr r31,hid0 \ r31: hid0
+
+ ori r0,r31,h#8800 \ Merge-in bits to invalidate and enable the Icache
+ sync isync
+ mtspr hid0,r0 \ Invalidate and enable Icache
+ isync sync
+
+ here 0 , \ Reserve space for a call instruction
+
+ sync isync
+ mtspr hid0,r31 \ Restore hid0 to its previous value
+ isync sync
+
+ addi r1,r1,h#18 \ C stack un-linkage and register restoration
+ lwz r0,8(r1)
+ mtspr lr,r0
+ lwz r31,-4(r1)
+
+ mtspr lr,r0 \ Return to caller
+ bclr 20,0
+
+here swap put-call \ Put a call to the following code in the place
+ \ that was reserved. The code to be called will
+ \ be concatenated to the end of this binary file.
+end-code
+
+end-assembling
+
+writing cacheon.img
+asm-base here over - ofd @ fputs
+ofd @ fclose
Added: cpu/ppc/cachinfl.bth
===================================================================
--- cpu/ppc/cachinfl.bth (rev 0)
+++ cpu/ppc/cachinfl.bth 2007-07-23 19:40:40 UTC (rev 488)
@@ -0,0 +1,36 @@
+purpose: Build script for the cacheon+inflater dropin
+copyright: Copyright 1997 FirmWorks All Rights Reserved
+
+command: &builder &this
+in: cacheon.img
+in: inflate.bin
+build-now
+
+\needs $add-dropin fload ${BP}/tools/mkdropin.fth
+
+\ Concatentate cacheon.img and inflate.bin and write it as a dropin file
+
+0 value bigbuf
+0 value /bigbuf
+
+: bufs+ ( adr1 len1 adr2 len2 -- adr3 len3 )
+ 2swap tuck ( adr2 len2 len1 adr1 len1 )
+ 3 pick + ( adr2 len2 len1 adr1 len3 )
+ tuck resize throw ( adr2 len2 len1 len3 adr3 )
+ tuck 2>r ( adr2 len2 len1 adr3 ) ( r: len3,adr3 )
+ + swap move ( ) ( r: len3,adr3 )
+ 2r> swap ( adr3 len3 )
+;
+
+
+" cachinfl.di" $new-file
+ " cacheon.img" $read-file ( adr1 len1 )
+ " inflate.bin" $read-file ( adr1 len1 adr2 len2 )
+
+ bufs+ ( adr3 len3 )
+
+ 2dup 0 " inflate" write-dropin ( adr3 len3 )
+
+ free-mem
+
+ofd @ fclose
Added: cpu/ppc/inflate.bth
===================================================================
--- cpu/ppc/inflate.bth (rev 0)
+++ cpu/ppc/inflate.bth 2007-07-23 19:40:40 UTC (rev 488)
@@ -0,0 +1,7 @@
+purpose: Build script for the inflater
+copyright: Copyright 1997 FirmWorks All Rights Reserved
+
+command: &builder &this
+build-now
+
+fload ${BP}/cpu/ppc/inflate.fth
Property changes on: cpu/ppc/olpc/build
___________________________________________________________________
Name: svn:ignore
- *.rom
ppcforth
+ *.rom
ppcforth
builton.fth
sourceurl
inflate.bin
Modified: cpu/ppc/olpc/devalias.fth
===================================================================
--- cpu/ppc/olpc/devalias.fth 2007-07-23 19:34:43 UTC (rev 487)
+++ cpu/ppc/olpc/devalias.fth 2007-07-23 19:40:40 UTC (rev 488)
@@ -1,20 +1,12 @@
purpose: Platform-specific device aliases
\ See license at end of file
-devalias net /pci/ethernet@e
+devalias net /pci/ethernet
+devalias disk /pci/disk
+devalias c /pci/disk
+devalias u /pci/usb/disk
+devalias com1 /serial
-.( XXX olpc/devalias.fth) cr
-devalias disk0 /pci/disk@0,0:1
-devalias disk1 /pci/scsi@c/disk@1,0:1
-devalias disk2 /pci/scsi@c/disk@2,0:1
-devalias cdrom /pci/scsi@c/disk@5,0
-
-devalias c /pci/scsi@c/disk@0,0
-
-devalias disk /pci/scsi@c/disk@0,0:1
-
-devalias com1 /serial@f1012000
-
\ LICENSE_BEGIN
\ Copyright (c) 2007 FirmWorks
\
Modified: cpu/ppc/olpc/fw.bth
===================================================================
--- cpu/ppc/olpc/fw.bth 2007-07-23 19:34:43 UTC (rev 487)
+++ cpu/ppc/olpc/fw.bth 2007-07-23 19:40:40 UTC (rev 488)
@@ -6,7 +6,6 @@
build-now
\ Configuration defines
-create bailout-early
true to stand-init-debug?
true constant real-mode?
@@ -100,7 +99,7 @@
h# 0200.0000 value fw-virt-size
headers
-0 value memsize
+h# 1000.0000 value memsize
fload ${BP}/cpu/ppc/loadvmem.fth \ /mmu node
stand-init: MMU
@@ -185,20 +184,15 @@
\ fload ${BP}/arch/prep/eagle.fth \ Eagle configuration registers
fload ${BP}/cpu/ppc/ppcboot.fth \ Forth startup code
-[ifdef] bailout-early
-: startup quit ;
+\ ---
-install-rom-cold
-
-.( --- Saving fw.dic ---) cr p" fw.dic" save-forth
-bye
-[then]
-
fload ${BP}/cpu/ppc/olpc/rootnode.fth \ Methods for root node
fload ${BP}/cpu/ppc/olpc/pcinode.fth \ System-specific words for PCI
-" " dup config-string pci-probe-list
+\ Don't probe 0; it is the host bridge thing and bad things
+\ happen if you change its BARs.
+" 7,8" dup config-string pci-probe-list
6 buffer: 'system-mac-address
: get-mac-address ( -- )
@@ -240,7 +234,7 @@
" /nvram" open-dev to nvram-node
init-config-vars
;
-[endif]
+[then]
\ fload ${BP}/dev/isa/irq.fth
@@ -254,26 +248,29 @@
fload ${BP}/cpu/ppc/olpc/devalias.fth \ Device aliases
-0 0 " fff00000" " /" begin-package
+0 0 " 0ff00000" " /" begin-package
" flash" device-name
- h# 8.0000 constant /device
+ h# 10.0000 dup constant /device
+ constant /device-phys
my-address my-space /device reg
fload ${BP}/cpu/x86/pc/flashpkg.fth
end-package
-devalias rom /flash@fff00000
+devalias rom /flash@0ff00000
+[ifdef] notyet
fload ${BP}/cpu/ppc/olpc/flash.fth \ Low-level FLASH access
+[then]
-fload ${BP}/pkg/flash/saveflsh.fth \ FLASH to disk and back
-
\ ' false to interrupt-auto-boot? \ Don't do countdown
patch noop fw-title rom-cold \ Superseded by banner
+: startup quit ;
+
install-rom-cold
-.( --- Saving subset.dic ---) cr p" subset.dic" save-forth
+.( --- Saving fw.dic ---) cr p" fw.dic" save-forth
\ LICENSE_BEGIN
\ Copyright (c) 2007 FirmWorks
Modified: cpu/ppc/olpc/fwuboot.bth
===================================================================
--- cpu/ppc/olpc/fwuboot.bth 2007-07-23 19:34:43 UTC (rev 487)
+++ cpu/ppc/olpc/fwuboot.bth 2007-07-23 19:40:40 UTC (rev 488)
@@ -2,7 +2,7 @@
\ See license at end of file
command: &builder &this
-in: ${BP}/cpu/ppc/olpc/build/fw.dic
+in: ${BP}/cpu/ppc/olpc/build/olpc.img
build-now
create uboot-header
@@ -10,8 +10,8 @@
0 be-l, \ Header CRC, set later
0 be-l, \ Timestamp
0 be-l, \ Data size
- h# 0f000000 be-l, \ Load address
- h# 0f000000 be-l, \ Entry address
+ h# 0ff00000 be-l, \ Load address
+ h# 0ff00100 be-l, \ Entry address
0 be-l, \ Data CRC, set later
5 c, \ OS type - Linux
7 c, \ CPU type - PowerPC
@@ -26,7 +26,7 @@
fload ${BP}/forth/lib/crc32.fth
-reading fw.dic
+reading olpc.img
ifd @ fsize constant /image
/image buffer: filebuf
filebuf /image ifd @ fgets /image <> abort" Can't read image"
Added: cpu/ppc/olpc/olpc.bth
===================================================================
--- cpu/ppc/olpc/olpc.bth (rev 0)
+++ cpu/ppc/olpc/olpc.bth 2007-07-23 19:40:40 UTC (rev 488)
@@ -0,0 +1,65 @@
+purpose: Top-level build script for DDI DragonFly ROM
+copyright: Copyright 1997 FirmWorks All Rights Reserved
+
+command: &builder &this
+in: ${BP}/cpu/ppc/olpc/build/builton.fth
+in: ${BP}/cpu/ppc/olpc/build/resetvec.di
+in: ${BP}/cpu/ppc/olpc/build/cachinfl.di
+in: ${BP}/cpu/ppc/olpc/build/start.di
+in: ${BP}/cpu/ppc/olpc/build/fw.dic
+in: ${BP}/dev/mmc/sdhci/build/sdhci.fc
+in: ${BP}/dev/mmc/sdhci/build/sdmmc.fc
+in: ${BP}/dev/usb2/hcd/ohci/build/ohci.fc
+in: ${BP}/dev/usb2/hcd/ehci/build/ehci.fc
+in: ${BP}/dev/usb2/device/hub/build/hub.fc
+in: ${BP}/dev/usb2/device/net/build/usbnet.fc
+in: ${BP}/dev/usb2/device/serial/build/usbserial.fc
+in: ${BP}/dev/usb2/device/storage/build/usbstorage.fc
+in: ${BP}/dev/usb2/device/keyboard/build/usbkbd.fc
+in: ${BP}/dev/usb2/device/wlan/build/usb8388.fc
+in: ${BP}/dev/olpc/cafenand/build/cafenand.fc
+in: ${BP}/dev/olpc/cafecamera/build/cafecamera.fc
+in: ${BP}/dev/pci/build/pcibridg.fc
+\ in: ${BP}/dev/ide/build/idehier.fc
+\ in: usb8388.bin
+build-now
+
+\ Always re-create the builton.fth file when we make a new rom.img
+fload ${BP}/cpu/x86/pc/builton.bth
+\ fload ${BP}/cpu/x86/pc/olpc/sourceurl.fth
+
+writing olpc.img
+ " resetvec.di" $add-file
+ " start.di" $add-file
+ " cachinfl.di" $add-file
+
+\ " fw.dic" " firmware" $add-deflated-dropin
+ " fw.dic" " firmware" $add-dropin
+
+ " builton.fth" " probe-" $add-dropin
+\ " help.img" " help" $add-deflated-dropin
+
+ " ${BP}/dev/pci/build/pcibridg.fc" " class060400" $add-deflated-dropin
+\ " ${BP}/dev/ide/build/idehier.fc" " pci-ide" $add-deflated-dropin
+
+ " ${BP}/dev/usb2/hcd/ohci/build/ohci.fc" " class0c0310" $add-dropin
+ " ${BP}/dev/usb2/hcd/ehci/build/ehci.fc" " class0c0320" $add-dropin
+ " ${BP}/dev/usb2/device/hub/build/hub.fc" " usb,class9" $add-dropin
+ " ${BP}/dev/usb2/device/net/build/usbnet.fc" " usbnet" $add-dropin
+ " ${BP}/dev/usb2/device/keyboard/build/usbkbd.fc" " usb,class3" $add-dropin
+ " ${BP}/dev/usb2/device/serial/build/usbserial.fc" " usbserial" $add-dropin
+ " ${BP}/dev/usb2/device/storage/build/usbstorage.fc" " usbstorage" $add-dropin
+\ " ${BP}/dev/usb2/device/wlan/build/usb8388.fc" " usb1286,2001" $add-deflated-dropin
+\ " usb8388.bin" " usb8388.bin" $add-deflated-dropin
+
+ \ XXX the PCI device IDs should be different for the different CaFe functions
+ " ${BP}/dev/olpc/cafenand/build/cafenand.fc" " class050101" $add-dropin
+ " ${BP}/dev/olpc/cafecamera/build/cafecamera.fc" " pci11ab,4102" $add-dropin
+
+ " ${BP}/dev/mmc/sdhci/build/sdhci.fc" " pci11ab,4101" $add-dropin
+ " ${BP}/dev/mmc/sdhci/build/sdmmc.fc" " sdmmc" $add-dropin
+ " ${BP}/dev/geode/nandflash/build/nandflash.fc" " nand5536" $add-dropin
+
+ " ${BP}/ofw/inet/telnetd.fth" " telnetd" $add-deflated-dropin
+
+ofd @ fclose
Modified: cpu/ppc/olpc/pcinode.fth
===================================================================
--- cpu/ppc/olpc/pcinode.fth 2007-07-23 19:34:43 UTC (rev 487)
+++ cpu/ppc/olpc/pcinode.fth 2007-07-23 19:40:40 UTC (rev 488)
@@ -32,7 +32,6 @@
\ Could do interrupt routing here
;
-[ifdef] notyet
headerless
\ Determine the parent interrupt information (the "interrupt line" in PCI
@@ -43,6 +42,8 @@
\ This table describes the wiring of PCI interrupt pins at the PCI slots
\ to PIRQ inputs on the 82378zb chip. The wiring varies from slot to slot.
+[ifdef] notyet
+
create slot-map
\ Pin A Pin B Pin C Pin D Dev#
@@ -61,9 +62,11 @@
c - 4 * + slot-map + c@ ( pirq#|ff )
dup h# ff = if drop true else false then
;
+[then]
headers
+[ifdef] notyet
: assign-int-line ( phys.hi.func int-pin -- false | int-line true )
dup 0= if 2drop false exit then ( phys.hi.func int-pin# )
1- swap d# 11 rshift h# 1f and ( int-pin0 dev# )
@@ -75,11 +78,16 @@
true
;
+[else]
+.( XXX implement assign-int-line) cr
+: assign-int-line ( phys.hi.func int-pin -- false | int-line true )
+ 2drop false exit
+;
+[then]
-h# 700 encode-int \ Mask of implemented slots
+h# 180 encode-int \ Mask of implemented slots
" PCI 1" encode-string encode+
-" PCI 2" encode-string encode+
-" PCI 3" encode-string encode+ " slot-names" property
+" PCI 2" encode-string encode+ " slot-names" property
[then]
device-end
Added: cpu/ppc/olpc/resetvec.bth
===================================================================
--- cpu/ppc/olpc/resetvec.bth (rev 0)
+++ cpu/ppc/olpc/resetvec.bth 2007-07-23 19:40:40 UTC (rev 488)
@@ -0,0 +1,7 @@
+purpose: Build script for the reset vector startup code
+copyright: Copyright 1997 FirmWorks All Rights Reserved
+
+command: &builder &this
+build-now
+
+fload ${BP}/cpu/ppc/resetvec.fth
Added: cpu/ppc/olpc/start.bth
===================================================================
--- cpu/ppc/olpc/start.bth (rev 0)
+++ cpu/ppc/olpc/start.bth 2007-07-23 19:40:40 UTC (rev 488)
@@ -0,0 +1,76 @@
+purpose: Load file for start.di dropin
+copyright: Copyright 1997 FirmWorks. All rights resrved.
+
+command: &builder &this
+build-now
+
+h# 0ff0.0000 constant /ram
+h# 20.0000 constant /fw-ram
+
+true value stand-init-debug?
+\ false value stand-init-debug?
+
+\needs start-assembling fload ${BP}/cpu/ppc/asmtools.fth
+
+hex
+
+start-assembling
+
+label my-entry
+ 0 , \ To be patched later
+end-code
+
+fload ${BP}/cpu/ppc/olpc/reports.fth
+\ fload ${BP}/cpu/ppc/olpc/initcom1.fth
+
+\ fload ${BP}/cpu/ppc/olpc/mem.fth
+\ fload ${BP}/cpu/ppc/scrub.fth
+
+label start-memory ( -- )
+ mfspr r31,lr
+
+\ init-com1 bl *
+
+\ eagle-mem bl * \ Configure memory
+\ eagle-mem-size bl * \ r7 = actual RAMtop
+ /ram set r7,*
+ mr r30,r7
+
+[ifdef] notdef
+ /fw-ram set r4,* \ Firmware memory size
+ subf r3,r4,r30 \ Firmware memory base address
+ scrub-memory bl *
+
+ set r4,h#4000 \ size of low memory int vectors
+ set r3,0
+ scrub-memory bl *
+[then]
+
+ stw r30,0(r0) \ Actual memory size in low-memory structure
+
+ addi r3,r0,0 \ We don't know the memory speed
+ stw r3,4(r0) \ Memory speed in low-memory structure
+
+ set r3,d#800000000
+ stw r3,8(r0) \ CPU speed in low-memory structure
+
+ set r3,d#200000000
+ stw r3,12(r0) \ Bus speed in low-memory structure
+
+ addi r3,r0,0 \ Null board type
+ stw r3,16(r0) \ Board type in low-memory structure
+
+ /fw-ram set r4,* \ FW memory size, passed to reset code in r4
+ subf r3,r4,r30 \ FW memory base addr., passed to reset code in r3
+
+ mtspr lr,r31
+ bclr 20,0
+end-code
+
+start-memory my-entry put-branch
+
+end-assembling
+
+writing start.di
+asm-base here over - 0 " start" write-dropin
+ofd @ fclose
Modified: cpu/ppc/ppcboot.fth
===================================================================
--- cpu/ppc/ppcboot.fth 2007-07-23 19:34:43 UTC (rev 487)
+++ cpu/ppc/ppcboot.fth 2007-07-23 19:40:40 UTC (rev 488)
@@ -187,7 +187,7 @@
end-code
[then]
-create uboot-entry
+\ create uboot-entry
label rom-cold-code ( r3:fw-RAM-base r4:fw-RAM-size -- )
[ifdef] uboot-entry
1
0