[openfirmware] r951 - cpu/x86/pc/olpc ofw/inet

svn at openfirmware.info svn at openfirmware.info
Tue Sep 30 22:35:12 CEST 2008


Author: wmb
Date: 2008-09-30 22:35:12 +0200 (Tue, 30 Sep 2008)
New Revision: 951

Added:
   cpu/x86/pc/olpc/mcastnand.bth
Modified:
   ofw/inet/ip.fth
   ofw/inet/netload.fth
Log:
OLPC - beginning of support for multicast NAND reflashing.


Added: cpu/x86/pc/olpc/mcastnand.bth
===================================================================
--- cpu/x86/pc/olpc/mcastnand.bth	                        (rev 0)
+++ cpu/x86/pc/olpc/mcastnand.bth	2008-09-30 20:35:12 UTC (rev 951)
@@ -0,0 +1,23 @@
+purpose: Fetch and compile the multicast NAND reflash program
+
+command: &builder &this
+build-now
+
+\ fload ${BP}/cpu/x86/pc/olpc/versions.fth
+
+" rm -rf multicast-nand" $sh
+
+" wget -q -O multicast-nand.tar.gz http://dev.laptop.org/git?p=users/wmb/multicast-nand\;a=snapshot" $sh
+" tar xfz multicast-nand.tar.gz" $sh
+" mv users/wmb/multicast-nand ." $sh
+" rm -rf users/wmb" $sh
+" rm multicast-nand.tar.gz" $sh
+
+\ " git clone --depth 1 -q git://dev.laptop.org/users/wmb/multicast-nand" expand$ $sh
+
+" (cd multicast-nand; make BPDIR=../../../../../.. rx_ofw; strip -o ../mcastnand.bin rx_ofw)" expand$ $sh
+
+\ This forces the creation of a .log file, so we don't re-fetch
+writing mcastnand.version
+\ " ${WLAN_VERSION}"n" expand$  ofd @ fputs
+ofd @ fclose

Modified: ofw/inet/ip.fth
===================================================================
--- ofw/inet/ip.fth	2008-09-30 20:27:58 UTC (rev 950)
+++ ofw/inet/ip.fth	2008-09-30 20:35:12 UTC (rev 951)
@@ -61,6 +61,7 @@
 
 : ip=  ( ip-addr1  ip-addr2 -- flag  )   /i comp  0=  ;
 
+: multicast?  ( adr-buf -- flag )  c@  h# f0 and  h# e0 =  ;
 : unknown-ip-addr?   ( adr-buf -- flag )  unknown-ip-addr  ip=  ;
 : known?  ( adr-buf -- flag )  unknown-ip-addr? 0=  ;
 

Modified: ofw/inet/netload.fth
===================================================================
--- ofw/inet/netload.fth	2008-09-30 20:27:58 UTC (rev 950)
+++ ofw/inet/netload.fth	2008-09-30 20:35:12 UTC (rev 951)
@@ -400,9 +400,37 @@
    2drop false
 ;
 
+: setup-multicast  ( -- )
+   server-ip-addr my-ip-addr copy-ip-addr
+   " set-multicast" my-parent ihandle>phandle find-method  if   ( acf )
+      " "(01 00 5e)" his-en-addr swap move                      ( acf )
+      my-ip-addr 1+  his-en-addr 3 +  3 move                    ( acf )
+      his-en-addr 3 + c@ h# 7f and his-en-addr 3 + c!           ( )
+      his-en-addr /e  rot my-parent call-package                ( )
+      exit
+   then
+   " enable-promiscuous" my-parent ihandle>phandle find-method  if   ( acf )
+      my-parent call-package
+      exit
+   then
+   " promiscuous-mode" my-parent ihandle>phandle find-method  if   ( acf )
+      my-parent call-package
+      exit
+   then
+   " promiscuous" my-parent ihandle>phandle find-method  if   ( acf )
+      my-parent call-package
+      exit
+   then
+   \ Try setting the unicast address to the multicast address?
+   ." Can't enable multicast reception in network driver" cr
+;
+
 defer configured  ' noop to configured
 : configure  ( -- )
    use-last?  if  configured exit  then
+
+   server-ip-addr multicast?  if  setup-multicast exit  then
+
    use-bootp?  if
       nvram-ip?  0=  if  process-bootp  then
    else




More information about the openfirmware mailing list