changeset 164:f7999c3a5f21

Merge from eCos master repository on 2001-06-25-18:05:25-BST
author jlarmour
date Mon, 25 Jun 2001 18:24:34 +0000
parents 0d2b193a635f
children d63db767121d
files host/tools/configtool/standalone/wxwin/makefile.g95 host/tools/configtool/standalone/wxwin/setup/innobott.txt packages/ChangeLog packages/devs/eth/ns/dp83902a/current/ChangeLog packages/devs/eth/ns/dp83902a/current/cdl/ns_dp83902a_eth_drivers.cdl packages/devs/eth/ns/dp83902a/current/include/dp83902a.h packages/devs/eth/ns/dp83902a/current/src/if_dp83902a.c packages/ecos.db packages/hal/mips/rm7000/var/current/ChangeLog packages/hal/mips/rm7000/var/current/include/var_cache.h packages/hal/mips/rm7000/var/current/include/variant.inc packages/hal/mips/rm7000/var/current/src/var_mk_defs.c
diffstat 12 files changed, 1669 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
new file mode 100644
--- /dev/null
+++ b/host/tools/configtool/standalone/wxwin/makefile.g95
@@ -0,0 +1,403 @@
+#
+# File:		Makefile for Configtool
+# Author:	Julian Smart
+# Created:	2000.08.25
+# Updated:	
+# Copyright:	(c) Red Hat, Inc.
+#
+# To make absolutely everything:
+#
+# % mkdir /tmp/ecos-build
+# % cd /tmp/ecos-build
+# % make -f $(ECOSDIR)/host/tools/configtool/standalone/wxwin/Makefile WXDIR=$(WXDIR) ECOSDIR=$(ECOSDIR) LEVEL=debug full
+#
+# To make just Configtool:
+#
+# % make ... LEVEL=debug ct
+#
+# To make wxWindows & eCos libraries:
+#
+# % make ... LEVEL=debug wx ecc
+#
+# The result will be subdirectories under your /tmp/ecos-build (or other specified
+# directory) containing:
+#
+# ct-build-debug/
+# ecc-build-debug/
+# wxwin-build-debug/
+#
+# To make a release version, specify LEVEL=release instead of LEVEL=debug.
+#
+
+# If this is set to gcc, we get some link errors relating to
+# streams and such
+CC = c++
+#CC = gcc
+
+PROGRAM = configtool
+LEVEL = debug
+WXDEBUGFLAGS=--with-debug_flag --with-debug_info --enable-debug --enable-debug_cntxt
+ECCDEBUGFLAGS=--enable-debug 
+CPPDEBUGOPTIONS=-D__WXDEBUG__ -ggdb
+LINKDEBUGOPTIONS=
+STRIPCOMMAND=echo 
+USEEXPERIMENTALCODE=1
+# You should specify this on the command line
+WXDIR=You_should_override_the_WXDIR_variable
+
+# Current (build) directory
+CURRDIR = $(shell pwd)
+BUILDDIR=$(CURRDIR)
+
+# Where the CDL, infra etc. libraries have been built
+ECOSBUILDDIR=$(BUILDDIR)/ecc-build-$(LEVEL)
+WXBUILDDIR=$(BUILDDIR)/wxwin-build-$(LEVEL)
+CTBUILDDIR=$(BUILDDIR)/ct-build-$(LEVEL)
+
+# You have to specify this when invoking make.
+ECOSDIR=You_should_override_the_ECOSDIR_variable
+CTDIR=$(ECOSDIR)/host/tools/configtool/standalone/wxwin
+WXCONFIG=$(WXBUILDDIR)/wx-config
+# Where the binary will be installed locally
+LOCALBINDIR=/home/ecos/misctools/H-i686-pc-linux-gnu/bin
+# A suitable home for archives of the tool
+LOCALARCHIVEDIR=/netopt/ecc-share/releng/eCosTools/eCosConfigurationTool
+
+ifneq "$(LEVEL)" "debug"
+  CPPDEBUGOPTIONS=-O2
+  LINKDEBUGOPTIONS=--strip-debug
+  STRIPCOMMAND=strip
+endif
+
+CPPFLAGS=-I$(WXDIR)/include $(CPPDEBUGOPTIONS) -DSTRICT -DWINVER=0x0400 -D__WIN95__ -D__GNUWIN32__ -D__WIN32__ -D_X86_=1 -DWIN32 -D_WIN32
+LDFLAGS=-L$(WXDIR)/lib -lstdc++ -lgcc \
+	-lwinspool -lwinmm -lshell32 \
+	-lcomctl32 -lctl3d32 -lodbc32 -ladvapi32 \
+	-lodbc32 -lwsock32 -lopengl32 -lglu32
+
+OBJECTS = \
+ $(CTBUILDDIR)/aboutdlg.o \
+ $(CTBUILDDIR)/admindlg.o \
+ $(CTBUILDDIR)/appsettings.o \
+ $(CTBUILDDIR)/build.o \
+ $(CTBUILDDIR)/buildoptionsdlg.o \
+ $(CTBUILDDIR)/choosereposdlg.o \
+ $(CTBUILDDIR)/Collections.o \
+ $(CTBUILDDIR)/configitem.o \
+ $(CTBUILDDIR)/configpropdlg.o \
+ $(CTBUILDDIR)/configtool.o \
+ $(CTBUILDDIR)/configtooldoc.o \
+ $(CTBUILDDIR)/configtoolview.o \
+ $(CTBUILDDIR)/configtree.o \
+ $(CTBUILDDIR)/conflictsdlg.o \
+ $(CTBUILDDIR)/conflictwin.o \
+ $(CTBUILDDIR)/docsystem.o \
+ $(CTBUILDDIR)/ecscrolwin.o \
+ $(CTBUILDDIR)/eCosSerial.o \
+ $(CTBUILDDIR)/eCosSocket.o \
+ $(CTBUILDDIR)/eCosStd.o \
+ $(CTBUILDDIR)/eCosTest.o \
+ $(CTBUILDDIR)/eCosTestDownloadFilter.o \
+ $(CTBUILDDIR)/eCosTestPlatform.o \
+ $(CTBUILDDIR)/eCosTestSerialFilter.o \
+ $(CTBUILDDIR)/eCosTestUtils.o \
+ $(CTBUILDDIR)/eCosThreadUtils.o \
+ $(CTBUILDDIR)/eCosTrace.o \
+ $(CTBUILDDIR)/ecutils.o \
+ $(CTBUILDDIR)/filename.o \
+ $(CTBUILDDIR)/finddlg.o \
+ $(CTBUILDDIR)/flags.o \
+ $(CTBUILDDIR)/folderdlg.o \
+ $(CTBUILDDIR)/htmlparser.o \
+ $(CTBUILDDIR)/licensedlg.o \
+ $(CTBUILDDIR)/mainwin.o \
+ $(CTBUILDDIR)/mltwin.o \
+ $(CTBUILDDIR)/msgdlgex.o \
+ $(CTBUILDDIR)/outputwin.o \
+ $(CTBUILDDIR)/packagesdlg.o \
+ $(CTBUILDDIR)/platformeditordlg.o \
+ $(CTBUILDDIR)/platformsdlg.o \
+ $(CTBUILDDIR)/propertywin.o \
+ $(CTBUILDDIR)/Properties.o \
+ $(CTBUILDDIR)/reposdlg.o \
+ $(CTBUILDDIR)/ResetAttributes.o \
+ $(CTBUILDDIR)/runtestsdlg.o \
+ $(CTBUILDDIR)/sectiondlg.o \
+ $(CTBUILDDIR)/settingsdlg.o \
+ $(CTBUILDDIR)/shortdescrwin.o \
+ $(CTBUILDDIR)/solutionswin.o \
+ $(CTBUILDDIR)/splittree.o \
+ $(CTBUILDDIR)/Subprocess.o \
+ $(CTBUILDDIR)/templatesdlg.o \
+ $(CTBUILDDIR)/TestResource.o
+
+
+# C++ compiler
+CC          = c++
+
+INCLUDEPREFIX=--prefix=$(WXBUILDDIR)
+LIBPREFIX=--prefix=$(WXBUILDDIR)
+EXTRACPPFLAGS=\
+  -I$(WXDIR)/include\
+  -I$(ECOSDIR)/host/libcdl\
+  -I$(ECOSDIR)/host/infra\
+  -I$(ECOSDIR)/host/tools/configtool/common/common\
+  -I$(ECOSDIR)/host/tools/Utils/common\
+  -I$(ECOSDIR)/host/tools/ecostest/common\
+  -I$(ECOSBUILDDIR)/libcdl\
+  -I$(ECOSBUILDDIR)/infra\
+  -DecUSE_EXPERIMENTAL_CODE=$(USEEXPERIMENTALCODE)
+
+EXTRALDFLAGS=-L$(ECOSBUILDDIR)/infra -L$(ECOSBUILDDIR)/libcdl -lcdl -lcyginfra -ltcl
+
+.SUFFIXES:	.o .cpp .cxx
+
+.cpp.o :
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+.cxx.o :
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+all:    mkbuilddir $(CTBUILDDIR)/$(PROGRAM)
+
+ct:	mkbuilddir $(CTBUILDDIR)/$(PROGRAM)
+
+mkbuilddir:
+	mkdir -p $(CTBUILDDIR)
+
+$(CTBUILDDIR)/$(PROGRAM):	$(OBJECTS)
+	$(CC) $(LINKDEBUGOPTIONS) -o $(CTBUILDDIR)/$(PROGRAM) $(OBJECTS) $(EXTRALDFLAGS) $(LDFLAGS)
+	$(STRIPCOMMAND) $(CTBUILDDIR)/$(PROGRAM)
+
+full: wx ecc all
+
+wx:
+	@mkdir -p $(WXBUILDDIR) ; \
+	cd $(WXBUILDDIR) ; \
+        if test ! -f Makefile ; then rm -f *.o *.d ; \
+        rm -f *.cache ; \
+        $(WXDIR)/configure --disable-shared --enable-gui --with-gtk --enable-log $(WXDEBUGFLAGS) --with-threads --without-sockets -without-odbc -without-libjpeg ; \
+        fi; \
+        make
+
+ecc:
+	@mkdir -p $(ECOSBUILDDIR) ; \
+        cd $(ECOSBUILDDIR) ; \
+        if test ! -f Makefile ; then $(ECOSDIR)/host/configure --prefix=$(ECOSBUILDDIR) $(ECCDEBUGFLAGS) \
+         --with-tcl=/usr --with-tcl-version=80 ; \
+        fi ; \
+        make
+
+# Some GTK+ installations are a bit broken and we need to define __WXGTK127__ even if
+# we don't really have GTK++ 1.2.7. This manifests itself in a compile error in dcclient.cpp.
+
+wxgtkfix:
+	@rm -f $(WXBUILDDIR)/setup.h; rm -f $(WXBUILDIR)/lib/wx/include/wx/gtk*/setup/h; \
+	sed -e "s;/\* #undef __WXGTK127__ \*/;#define __WXGTK127__ 1;g;" < $(WXBUILDDIR)/include/wx/gtk/setup.h > /tmp/setup.h ; \
+	mv /tmp/setup.h $(WXBUILDDIR)/include/wx/gtk/setup.h
+
+clean: 
+	rm -f $(CTBUILDDIR)/$(PROGRAM) $(CTBUILDDIR)/*.o
+
+cleanct: clean
+
+cleanecc:
+	rm -f -r $(ECOSBUILDDIR)
+
+cleanwx:
+	rm -f -r $(WXBUILDDIR)
+
+cleanall:	clean cleanecc cleanwx
+
+# Making a binary, RH Linux tarball release using the setup script.
+# It will put the result in /tmp/ctdeliver.
+releasect:
+	echo "#include <stdio.h>" > /tmp/ctver.c
+	echo "#include \"symbols.h\"" >> /tmp/ctver.c
+	echo "int main() { printf(\"%.1f\", ecCONFIGURATION_TOOL_VERSION); }" >> /tmp/ctver.c
+	cc /tmp/ctver.c -I$(CTDIR) -o /tmp/ctver
+	chmod a+x $(CTDIR)/setup/maketarball.sh
+	$(CTDIR)/setup/maketarball.sh $(ECOSDIR)/.. $(CTBUILDDIR) /tmp/ctdeliver `/tmp/ctver`
+	rm -f /tmp/ctver /tmp/ctver.c
+
+# Installs the binary and associated files in the correct place for local running
+installbinary: releasect
+	cp /tmp/ctdeliver/configtool/configtool $(LOCALBINDIR)/configtool-`date -I`
+	mv /tmp/ctdeliver/configtool/README.txt /tmp/ctdeliver/configtool/README-configtool.txt
+	rm -f $(LOCALBINDIR)/configtool
+	ln -s $(LOCALBINDIR)/configtool-`date -I` $(LOCALBINDIR)/configtool
+	cp -r /tmp/ctdeliver/configtool/* $(LOCALBINDIR)
+
+# Copies an archive to a suitable place for people to grab
+installtarball: releasect
+	mkdir -p $(LOCALARCHIVEDIR)/`date -I`
+	cp /tmp/ctdeliver/configtool*.tgz $(LOCALARCHIVEDIR)/`date -I`
+
+### GUI Configtool files
+
+$(CTBUILDDIR)/aboutdlg.o: $(CTDIR)/aboutdlg.cpp $(CTDIR)/aboutdlg.h $(CTDIR)/symbols.h
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+$(CTBUILDDIR)/admindlg.o: $(CTDIR)/admindlg.cpp $(CTDIR)/admindlg.h
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+$(CTBUILDDIR)/appsettings.o: $(CTDIR)/appsettings.cpp $(CTDIR)/appsettings.h
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+$(CTBUILDDIR)/buildoptionsdlg.o: $(CTDIR)/buildoptionsdlg.cpp $(CTDIR)/buildoptionsdlg.h
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+$(CTBUILDDIR)/choosereposdlg.o: $(CTDIR)/choosereposdlg.cpp $(CTDIR)/choosereposdlg.h
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+$(CTBUILDDIR)/configitem.o: $(CTDIR)/configitem.cpp $(CTDIR)/configitem.h
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+$(CTBUILDDIR)/configpropdlg.o: $(CTDIR)/configpropdlg.cpp $(CTDIR)/configpropdlg.h
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+$(CTBUILDDIR)/configtool.o: $(CTDIR)/configtool.cpp $(CTDIR)/configtool.h
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+$(CTBUILDDIR)/configtooldoc.o: $(CTDIR)/configtooldoc.cpp $(CTDIR)/configtooldoc.h
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+$(CTBUILDDIR)/configtoolview.o: $(CTDIR)/configtoolview.cpp $(CTDIR)/configtoolview.h
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+$(CTBUILDDIR)/configtree.o: $(CTDIR)/configtree.cpp $(CTDIR)/configtree.h
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+$(CTBUILDDIR)/conflictsdlg.o: $(CTDIR)/conflictsdlg.cpp $(CTDIR)/conflictsdlg.h
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+$(CTBUILDDIR)/conflictwin.o: $(CTDIR)/conflictwin.cpp $(CTDIR)/conflictwin.h
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+$(CTBUILDDIR)/docsystem.o: $(CTDIR)/docsystem.cpp $(CTDIR)/docsystem.h
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+$(CTBUILDDIR)/ecutils.o: $(CTDIR)/ecutils.cpp $(CTDIR)/ecutils.h
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+$(CTBUILDDIR)/ecscrolwin.o: $(CTDIR)/ecscrolwin.cpp $(CTDIR)/ecscrolwin.h
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+$(CTBUILDDIR)/filename.o: $(CTDIR)/filename.cpp $(CTDIR)/filename.h
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+$(CTBUILDDIR)/finddlg.o: $(CTDIR)/finddlg.cpp $(CTDIR)/finddlg.h
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+$(CTBUILDDIR)/folderdlg.o: $(CTDIR)/folderdlg.cpp $(CTDIR)/folderdlg.h
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+$(CTBUILDDIR)/htmlparser.o: $(CTDIR)/htmlparser.cpp $(CTDIR)/htmlparser.h
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+$(CTBUILDDIR)/licensedlg.o: $(CTDIR)/licensedlg.cpp $(CTDIR)/licensedlg.h
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+$(CTBUILDDIR)/mainwin.o: $(CTDIR)/mainwin.cpp $(CTDIR)/mainwin.h
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+$(CTBUILDDIR)/mltwin.o: $(CTDIR)/mltwin.cpp $(CTDIR)/mltwin.h
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+$(CTBUILDDIR)/msgdlgex.o: $(CTDIR)/msgdlgex.cpp $(CTDIR)/msgdlgex.h
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+$(CTBUILDDIR)/outputwin.o: $(CTDIR)/outputwin.cpp $(CTDIR)/outputwin.h
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+$(CTBUILDDIR)/packagesdlg.o: $(CTDIR)/packagesdlg.cpp $(CTDIR)/packagesdlg.h
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+$(CTBUILDDIR)/platformeditordlg.o: $(CTDIR)/platformeditordlg.cpp $(CTDIR)/platformeditordlg.h
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+$(CTBUILDDIR)/platformsdlg.o: $(CTDIR)/platformsdlg.cpp $(CTDIR)/platformsdlg.h
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+$(CTBUILDDIR)/propertywin.o: $(CTDIR)/propertywin.cpp $(CTDIR)/propertywin.h
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+$(CTBUILDDIR)/reposdlg.o: $(CTDIR)/reposdlg.cpp $(CTDIR)/reposdlg.h
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+$(CTBUILDDIR)/runtestsdlg.o: $(CTDIR)/runtestsdlg.cpp $(CTDIR)/runtestsdlg.h
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+$(CTBUILDDIR)/sectiondlg.o: $(CTDIR)/sectiondlg.cpp $(CTDIR)/sectiondlg.h
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+$(CTBUILDDIR)/settingsdlg.o: $(CTDIR)/settingsdlg.cpp $(CTDIR)/settingsdlg.h
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+$(CTBUILDDIR)/shortdescrwin.o: $(CTDIR)/shortdescrwin.cpp $(CTDIR)/shortdescrwin.h
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+$(CTBUILDDIR)/solutionswin.o: $(CTDIR)/solutionswin.cpp $(CTDIR)/solutionswin.h
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+$(CTBUILDDIR)/splittree.o: $(CTDIR)/splittree.cpp $(CTDIR)/splittree.h
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+$(CTBUILDDIR)/templatesdlg.o: $(CTDIR)/templatesdlg.cpp $(CTDIR)/templatesdlg.h
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+
+### Common files
+
+$(CTBUILDDIR)/build.o:	$(ECOSDIR)/host/tools/configtool/common/common/build.cxx $(ECOSDIR)/host/tools/configtool/common/common/build.hxx
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+$(CTBUILDDIR)/flags.o:	$(ECOSDIR)/host/tools/configtool/common/common/flags.cxx $(ECOSDIR)/host/tools/configtool/common/common/flags.hxx
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+$(CTBUILDDIR)/Collections.o:	$(ECOSDIR)/host/tools/Utils/common/Collections.cpp
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+$(CTBUILDDIR)/Properties.o:	$(ECOSDIR)/host/tools/Utils/common/Properties.cpp
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+$(CTBUILDDIR)/Subprocess.o:	$(ECOSDIR)/host/tools/Utils/common/Subprocess.cpp
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+$(CTBUILDDIR)/eCosSerial.o:	$(ECOSDIR)/host/tools/Utils/common/eCosSerial.cpp
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+$(CTBUILDDIR)/eCosSocket.o:	$(ECOSDIR)/host/tools/Utils/common/eCosSocket.cpp
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+$(CTBUILDDIR)/eCosStd.o:	$(ECOSDIR)/host/tools/Utils/common/eCosStd.cpp
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+$(CTBUILDDIR)/eCosThreadUtils.o:	$(ECOSDIR)/host/tools/Utils/common/eCosThreadUtils.cpp
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+$(CTBUILDDIR)/eCosTrace.o:	$(ECOSDIR)/host/tools/Utils/common/eCosTrace.cpp
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+$(CTBUILDDIR)/eCosTest.o:	$(ECOSDIR)/host/tools/ecostest/common/eCosTest.cpp
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+$(CTBUILDDIR)/eCosTestDownloadFilter.o:	$(ECOSDIR)/host/tools/ecostest/common/eCosTestDownloadFilter.cpp
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+$(CTBUILDDIR)/eCosTestPlatform.o:	$(ECOSDIR)/host/tools/ecostest/common/eCosTestPlatform.cpp
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+$(CTBUILDDIR)/eCosTestSerialFilter.o:	$(ECOSDIR)/host/tools/ecostest/common/eCosTestSerialFilter.cpp
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+$(CTBUILDDIR)/eCosTestUtils.o:	$(ECOSDIR)/host/tools/ecostest/common/eCosTestUtils.cpp
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+$(CTBUILDDIR)/ResetAttributes.o:	$(ECOSDIR)/host/tools/ecostest/common/ResetAttributes.cpp
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+$(CTBUILDDIR)/TestResource.o:	$(ECOSDIR)/host/tools/ecostest/common/TestResource.cpp
+	$(CC) $(CPPDEBUGOPTIONS) -c $(EXTRACPPFLAGS) $(CPPFLAGS) -o $@ $<
+
+
--- a/host/tools/configtool/standalone/wxwin/setup/innobott.txt
+++ b/host/tools/configtool/standalone/wxwin/setup/innobott.txt
@@ -1,4 +1,4 @@
-    Source: c:\winnt\system32\tcl84.dll; DestDir: {sys}\; DestName: tcl84.dll; CopyMode: onlyifdoesntexist; Flags: uninsneveruninstall
+    Source: c:\winnt\system32\tcl82.dll; DestDir: {sys}\; DestName: tcl82.dll; CopyMode: onlyifdoesntexist; Flags: uninsneveruninstall
     Source: c:\winnt\system32\msvcirt.dll; DestDir: {sys}\; DestName: msvcirt.dll; CopyMode: onlyifdoesntexist; Flags: uninsneveruninstall
     Source: c:\winnt\system32\msvcp60.dll; DestDir: {sys}\; DestName: msvcp60.dll; CopyMode: onlyifdoesntexist; Flags: uninsneveruninstall
     Source: c:\winnt\system32\msvcrt.dll; DestDir: {sys}\; DestName: msvcrt.dll; CopyMode: onlyifdoesntexist; Flags: uninsneveruninstall
--- a/packages/ChangeLog
+++ b/packages/ChangeLog
@@ -1,3 +1,8 @@
+2001-06-22  Jonathan Larmour  <jlarmour@redhat.com>
+
+	* ecos.db: Add CYGPKG_NET_ETH_DRIVERS alias for CYGPKG_IO_ETH_DRIVERS
+	temporarily
+
 2001-06-22  Hugo Tyson  <hmt@redhat.com>
 
 	* ecos.db: Add entry for generic SMSC lan91cxx ethernet controller.
@@ -11,6 +16,10 @@ 2001-06-21  Jonathan Larmour  <jlarmour@
 	packages in those targets which can use them.
 	Make CYGPKG_DEVS_ETH_CF have hardware attribute.
 
+2001-06-13  Jesper Skov  <jskov@redhat.com>
+
+	* ecos.db: Added DP83902A driver.
+
 2001-06-08  Jonathan Larmour  <jlarmour@redhat.com>
 
 	* ecos.db: PC target uses generic 16x5x serial driver now.
new file mode 100644
--- /dev/null
+++ b/packages/devs/eth/ns/dp83902a/current/ChangeLog
@@ -0,0 +1,69 @@
+2001-06-21  Jesper Skov  <jskov@redhat.com>
+
+	* src/if_dp83902a.c: Fix various build problems when net package
+	is included.
+
+2001-06-16  Jesper Skov  <jskov@redhat.com>
+
+	* src/if_dp83902a.c (dp83902a_poll): Ignore spurious Tx events.
+
+2001-06-15  Jesper Skov  <jskov@redhat.com>
+
+	* src/if_dp83902a.c: Added crude CR race check. Use plf interrupt
+	clear to allow for CF driver to use this driver. Cleaned up debug
+	output some.
+	(dp83902a_send): Added some magic delays to get driver working on
+	some (apparently) broken boards.
+
+	* src/dp83902a.h: Moved..
+	* include/dp83902a.h: to here. Moved macro definitions here from
+	the src file.
+
+	* cdl/ns_dp83902a_eth_drivers.cdl: Export header file.
+
+2001-06-14  Jesper Skov  <jskov@redhat.com>
+
+	* src/if_dp83902a.c: Added some more debug info.
+
+	* src/dp83902a.h: Added 16bit/BE macros (untested).
+
+	* src/if_dp83902a.c: Add some debug code, fix endian issue. Proper
+	handling of odd-length reads in 16bit mode.
+
+2001-06-13  Jesper Skov  <jskov@redhat.com>
+
+	* src/if_dp83902a.c: Assume LE ordering of read header data.
+
+	* src/dp83902a.h: BE/LE versions of data IO. Define proper DCR
+	init value depending on data access width.
+
+	* Cloned from DP8390 driver.
+
+//===========================================================================
+//####COPYRIGHTBEGIN####
+//                                                                          
+// -------------------------------------------                              
+// The contents of this file are subject to the Red Hat eCos Public License 
+// Version 1.1 (the "License"); you may not use this file except in         
+// compliance with the License.  You may obtain a copy of the License at    
+// http://www.redhat.com/                                                   
+//                                                                          
+// Software distributed under the License is distributed on an "AS IS"      
+// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the 
+// License for the specific language governing rights and limitations under 
+// the License.                                                             
+//                                                                          
+// The Original Code is eCos - Embedded Configurable Operating System,      
+// released September 30, 1998.                                             
+//                                                                          
+// The Initial Developer of the Original Code is Red Hat.                   
+// Portions created by Red Hat are                                          
+// Copyright (C) 1998, 1999, 2000, 2001 Red Hat, Inc.
+// All Rights Reserved.                                                     
+// -------------------------------------------                              
+//                                                                          
+//####COPYRIGHTEND####
+//===========================================================================
+	
+	
+
new file mode 100644
--- /dev/null
+++ b/packages/devs/eth/ns/dp83902a/current/cdl/ns_dp83902a_eth_drivers.cdl
@@ -0,0 +1,78 @@
+# ====================================================================
+#
+#      ns_dp83902a_eth_drivers.cdl
+#
+#      Ethernet drivers - device support for NS DP83902A Ethernet
+#
+# ====================================================================
+#####COPYRIGHTBEGIN####
+#                                                                          
+# -------------------------------------------                              
+# The contents of this file are subject to the Red Hat eCos Public License 
+# Version 1.1 (the "License"); you may not use this file except in         
+# compliance with the License.  You may obtain a copy of the License at    
+# http://www.redhat.com/                                                   
+#                                                                          
+# Software distributed under the License is distributed on an "AS IS"      
+# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the 
+# License for the specific language governing rights and limitations under 
+# the License.                                                             
+#                                                                          
+# The Original Code is eCos - Embedded Configurable Operating System,      
+# released September 30, 1998.                                             
+#                                                                          
+# The Initial Developer of the Original Code is Red Hat.                   
+# Portions created by Red Hat are                                          
+# Copyright (C) 1998, 1999, 2000, 2001 Red Hat, Inc.                             
+# All Rights Reserved.                                                     
+# -------------------------------------------                              
+#                                                                          
+#####COPYRIGHTEND####
+# ====================================================================
+######DESCRIPTIONBEGIN####
+#
+# Author(s):      gthomas
+# Contributors:   gthomas, jskov
+# Date:           2001-06-13
+#
+#####DESCRIPTIONEND####
+#
+# ====================================================================
+
+cdl_package CYGPKG_DEVS_ETH_NS_DP83902A {
+    display       "NS DP83902A ethernet drivers"
+
+    parent        CYGPKG_IO_ETH_DRIVERS
+    active_if     CYGPKG_IO_ETH_DRIVERS
+
+    implements    CYGHWR_NET_DRIVERS
+
+    active_if     CYGINT_DEVS_ETH_NS_DP83902A_REQUIRED
+
+    include_dir   cyg/io
+    description   "Ethernet driver for NS DP83902A (and DP8390) ethernet controller."
+    compile       -library=libextras.a if_dp83902a.c
+
+    define_proc {
+        puts $::cdl_header "#include <pkgconf/system.h>";
+        puts $::cdl_header "#include CYGDAT_DEVS_ETH_NS_DP83902A_CFG";
+    }
+
+    cdl_component CYGPKG_DEVS_ETH_DP83902A_OPTIONS {
+        display "DP83902A ethernet driver build options"
+        flavor  none
+	no_define
+
+        cdl_option CYGPKG_DEVS_ETH_DP83902A_CFLAGS_ADD {
+            display "Additional compiler flags"
+            flavor  data
+            no_define
+            default_value { "-D_KERNEL -D__ECOS" }
+            description   "
+                This option modifies the set of compiler flags for
+                building the Cirrus Logic ethernet driver package.
+                These flags are used in addition
+                to the set of global flags."
+        }
+    }
+}
new file mode 100644
--- /dev/null
+++ b/packages/devs/eth/ns/dp83902a/current/include/dp83902a.h
@@ -0,0 +1,373 @@
+//==========================================================================
+//
+//      dev/dp83902a.h
+//
+//      National Semiconductor DP83902a ethernet chip
+//
+//==========================================================================
+//####COPYRIGHTBEGIN####
+//                                                                          
+// -------------------------------------------                              
+// The contents of this file are subject to the Red Hat eCos Public License 
+// Version 1.1 (the "License"); you may not use this file except in         
+// compliance with the License.  You may obtain a copy of the License at    
+// http://www.redhat.com/                                                   
+//                                                                          
+// Software distributed under the License is distributed on an "AS IS"      
+// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the 
+// License for the specific language governing rights and limitations under 
+// the License.                                                             
+//                                                                          
+// The Original Code is eCos - Embedded Configurable Operating System,      
+// released September 30, 1998.                                             
+//                                                                          
+// The Initial Developer of the Original Code is Red Hat.                   
+// Portions created by Red Hat are                                          
+// Copyright (C) 1998, 1999, 2000, 2001 Red Hat, Inc.
+// All Rights Reserved.                                                     
+// -------------------------------------------                              
+//                                                                          
+//####COPYRIGHTEND####
+//####BSDCOPYRIGHTBEGIN####
+//
+// -------------------------------------------
+//
+// Portions of this software may have been derived from OpenBSD or other sources,
+// and are covered by the appropriate copyright disclaimers included herein.
+//
+// -------------------------------------------
+//
+//####BSDCOPYRIGHTEND####
+//==========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):    gthomas
+// Contributors: gthomas, jskov
+// Date:         2001-06-13
+// Purpose:      
+// Description:  
+//
+//####DESCRIPTIONEND####
+//
+//==========================================================================
+
+#include <cyg/hal/hal_io.h>
+#include <pkgconf/devs_eth_ns_dp83902a.h>
+
+#define __WANT_CONFIG
+#include CYGDAT_DEVS_ETH_NS_DP83902A_INL
+#undef __WANT_CONFIG
+
+// ------------------------------------------------------------------------
+// Debugging details
+
+// Set to perms of:
+// 0 disables all debug output
+// 1 for process debug output
+// 2 for added data IO output: get_reg, put_reg
+// 4 for packet allocation/free output
+// 8 for only startup status, so we can tell we're installed OK
+#define DEBUG 0x0
+
+#if DEBUG & 1
+#define DEBUG_FUNCTION() do { diag_printf("%s\n", __FUNCTION__); } while (0)
+#define DEBUG_LINE() do { diag_printf("%d\n", __LINE__); } while (0)
+#else
+#define DEBUG_FUNCTION() do {} while(0)
+#define DEBUG_LINE() do {} while(0)
+#endif
+
+// ------------------------------------------------------------------------
+// MAcros for keeping track of statistics
+#if defined(ETH_DRV_GET_IF_STATS) || defined (ETH_DRV_GET_IF_STATS_UD)
+#define KEEP_STATISTICS
+#endif
+
+#ifdef KEEP_STATISTICS
+#define INCR_STAT( _x_ )        (dp->stats. _x_ ++)
+#else
+#define INCR_STAT( _x_ )        CYG_EMPTY_STATEMENT
+#endif
+
+// ------------------------------------------------------------------------
+// Private driver structure
+typedef struct dp83902a_priv_data {
+    cyg_uint8* base;
+    cyg_uint8* data;
+    int tx_next;           // First free Tx page
+    int tx_int;            // Expecting interrupt from this buffer
+    int rx_next;           // First free Rx page
+    int tx1, tx2;          // Page numbers for Tx buffers
+    unsigned long tx1_key, tx2_key;   // Used to ack when packet sent
+    int tx1_len, tx2_len;
+    bool tx_started, running, hardwired_esa;
+    struct cyg_netdevtab_entry *tab;
+    cyg_uint8 esa[6];
+    cyg_vector_t interrupt;             // Interrupt vector used by controller
+    cyg_handle_t  interrupt_handle;
+    cyg_interrupt interrupt_object;
+    void* plf_priv;
+
+    // For debugging
+    volatile int cr_lock;
+    volatile int cr_owner;
+} dp83902a_priv_data_t;
+
+// ------------------------------------------------------------------------
+// Macros for accessing structure elements
+
+#define _SU8( _base_, _offset_) \
+        *((volatile cyg_uint8 *)((CYG_ADDRWORD)_base_+(_offset_)))
+#define _SU16( _base_, _offset_) \
+        *((volatile cyg_uint16 *)((CYG_ADDRWORD)_base_+(_offset_)))
+#define _SU32( _base_, _offset_) \
+        *((volatile cyg_uint32 *)((CYG_ADDRWORD)_base_+(_offset_)))
+
+#define _SI8( _base_, _offset_) \
+        *((volatile cyg_int8 *)((CYG_ADDRWORD)_base_+(_offset_)))
+#define _SI16( _base_, _offset_) \
+        *((volatile cyg_int16 *)((CYG_ADDRWORD)_base_+(_offset_)))
+#define _SI32( _base_, _offset_) \
+        *((volatile cyg_int32 *)((CYG_ADDRWORD)_base_+(_offset_)))
+
+// ------------------------------------------------------------------------
+// Macros for accessing DP registers
+// These can be overridden by the platform header
+
+#ifndef DP_IN
+# define DP_IN(_b_, _o_, _d_)  HAL_READ_UINT8 ((cyg_addrword_t)(_b_)+(_o_), (_d_))
+# define DP_OUT(_b_, _o_, _d_) HAL_WRITE_UINT8((cyg_addrword_t)(_b_)+(_o_), (_d_))
+#endif
+
+#ifndef DP_IN_DATA
+# ifdef CYGHWR_NS_DP83902A_PLF_16BIT_DATA
+#  ifdef BIGEND
+#   define DP_IN_DATA(_b_, _d_)                                 \
+    CYG_MACRO_START                                             \
+    cyg_uint16 _t;                                              \
+    HAL_READ_UINT16 ((cyg_addrword_t)(_b_), _t);                \
+    DELAY();                                                    \
+    (_d_) = ((_t >> 8) & 0xff) | ((_t & 0xff) << 8);            \
+    CYG_MACRO_END
+
+#   define DP_OUT_DATA(_b_, _d_)                                \
+    CYG_MACRO_START                                             \
+    cyg_uint16 _t;                                              \
+    _t = (_d_);                                                 \
+    (_t) = (((_t) >> 8) & 0xff) | ((_t & 0xff) << 8);           \
+    HAL_WRITE_UINT16((cyg_addrword_t)(_b_), _t);                \
+    DELAY();                                                    \
+    CYG_MACRO_END
+#  else
+#   define DP_IN_DATA(_b_, _d_)  HAL_READ_UINT16  ((cyg_addrword_t)(_b_), (_d_))
+#   define DP_OUT_DATA(_b_, _d_) HAL_WRITE_UINT16 ((cyg_addrword_t)(_b_), (_d_))
+#  endif
+# else
+#  define DP_IN_DATA(_b_, _d_)  HAL_READ_UINT8  ((cyg_addrword_t)(_b_), (_d_))
+#  define DP_OUT_DATA(_b_, _d_) HAL_WRITE_UINT8 ((cyg_addrword_t)(_b_), (_d_))
+# endif
+#endif
+
+// ------------------------------------------------------------------------
+// Macros allowing platform to customize some of the driver details
+
+#ifndef CYGHWR_NS_DP83902A_PLF_RESET
+# define CYGHWR_NS_DP83902A_PLF_RESET(_b_) do { } while (0)
+#endif
+
+#ifndef CYGHWR_NS_DP83902A_PLF_INT_CLEAR
+# define CYGHWR_NS_DP83902A_PLF_INT_CLEAR(_dp_)
+#endif
+
+// ------------------------------------------------------------------------
+// Hack that should go away, probably
+#define CR_UP()                                                  \
+    CYG_MACRO_START                                              \
+        if (++dp->cr_lock > 1) {                                 \
+          diag_printf("*** Race on CR %s:%d owner %d\n",      \
+                      __FUNCTION__, __LINE__, dp->cr_owner);     \
+          for (;;);                                              \
+        }                                                        \
+        dp->cr_owner = __LINE__;                                 \
+    CYG_MACRO_END
+
+#define CR_DOWN()                               \
+    dp->cr_lock--;
+
+// ------------------------------------------------------------------------
+// Some forward declarations
+static void dp83902a_poll(struct eth_drv_sc *sc);
+
+// ------------------------------------------------------------------------
+// Register offsets
+
+#define DP_CR          0x00
+#define DP_CLDA0       0x01
+#define DP_PSTART      0x01             // write
+#define DP_CLDA1       0x02
+#define DP_PSTOP       0x02             // write
+#define DP_BNDRY       0x03
+#define DP_TSR         0x04
+#define DP_TPSR        0x04             // write
+#define DP_NCR         0x05
+#define DP_TBCL        0x05             // write
+#define DP_FIFO        0x06
+#define DP_TBCH        0x06             // write
+#define DP_ISR         0x07
+#define DP_CRDA0       0x08
+#define DP_RSAL        0x08             // write
+#define DP_CRDA1       0x09
+#define DP_RSAH        0x09             // write
+#define DP_RBCL        0x0a             // write
+#define DP_RBCH        0x0b             // write
+#define DP_RSR         0x0c
+#define DP_RCR         0x0c             // write
+#define DP_FER         0x0d
+#define DP_TCR         0x0d             // write
+#define DP_CER         0x0e
+#define DP_DCR         0x0e             // write
+#define DP_MISSED      0x0f
+#define DP_IMR         0x0f             // write
+
+#define DP_P1_CR       0x00
+#define DP_P1_PAR0     0x01
+#define DP_P1_PAR1     0x02
+#define DP_P1_PAR2     0x03
+#define DP_P1_PAR3     0x04
+#define DP_P1_PAR4     0x05
+#define DP_P1_PAR5     0x06
+#define DP_P1_CURP     0x07
+#define DP_P1_MAR0     0x08
+#define DP_P1_MAR1     0x09
+#define DP_P1_MAR2     0x0a
+#define DP_P1_MAR3     0x0b
+#define DP_P1_MAR4     0x0c
+#define DP_P1_MAR5     0x0d
+#define DP_P1_MAR6     0x0e
+#define DP_P1_MAR7     0x0f
+
+#define DP_P2_CR       0x00
+#define DP_P2_PSTART   0x01
+#define DP_P2_CLDA0    0x01             // write
+#define DP_P2_PSTOP    0x02
+#define DP_P2_CLDA1    0x02             // write
+#define DP_P2_RNPP     0x03
+#define DP_P2_TPSR     0x04
+#define DP_P2_LNPP     0x05
+#define DP_P2_ACH      0x06
+#define DP_P2_ACL      0x07
+#define DP_P2_RCR      0x0c
+#define DP_P2_TCR      0x0d
+#define DP_P2_DCR      0x0e
+#define DP_P2_IMR      0x0f
+
+// Command register - common to all pages
+
+#define DP_CR_STOP    0x01   // Stop: software reset
+#define DP_CR_START   0x02   // Start: initialize device
+#define DP_CR_TXPKT   0x04   // Transmit packet
+#define DP_CR_RDMA    0x08   // Read DMA  (recv data from device)
+#define DP_CR_WDMA    0x10   // Write DMA (send data to device)
+#define DP_CR_SEND    0x18   // Send packet
+#define DP_CR_NODMA   0x20   // Remote (or no) DMA
+#define DP_CR_PAGE0   0x00   // Page select
+#define DP_CR_PAGE1   0x40
+#define DP_CR_PAGE2   0x80
+#define DP_CR_PAGEMSK 0x3F   // Used to mask out page bits
+
+// Data configuration register
+
+#define DP_DCR_WTS    0x01   // 1=16 bit word transfers
+#define DP_DCR_BOS    0x02   // 1=Little Endian
+#define DP_DCR_LAS    0x04   // 1=Single 32 bit DMA mode
+#define DP_DCR_LS     0x08   // 1=normal mode, 0=loopback
+#define DP_DCR_ARM    0x10   // 0=no send command (program I/O)
+#define DP_DCR_FIFO_1 0x00   // FIFO threshold
+#define DP_DCR_FIFO_2 0x20
+#define DP_DCR_FIFO_4 0x40
+#define DP_DCR_FIFO_6 0x60
+
+#ifdef CYGHWR_NS_DP83902A_PLF_16BIT_DATA
+# ifdef BIGENDIAN
+#  define DP_DCR_INIT   (DP_DCR_BOS|DP_DCR_WTS|DP_DCR_LS|DP_DCR_FIFO_4)
+# else
+#  define DP_DCR_INIT   (DP_DCR_WTS|DP_DCR_LS|DP_DCR_FIFO_4)
+# endif
+#else
+# define DP_DCR_INIT   (DP_DCR_LS|DP_DCR_FIFO_4)
+#endif
+
+// Interrupt status register
+
+#define DP_ISR_RxP    0x01   // Packet received
+#define DP_ISR_TxP    0x02   // Packet transmitted
+#define DP_ISR_RxE    0x04   // Receive error
+#define DP_ISR_TxE    0x08   // Transmit error
+#define DP_ISR_OFLW   0x10   // Receive overflow
+#define DP_ISR_CNT    0x20   // Tally counters need emptying
+#define DP_ISR_RDC    0x40   // Remote DMA complete
+#define DP_ISR_RESET  0x80   // Device has reset (shutdown, error)
+
+// Interrupt mask register
+
+#define DP_IMR_RxP    0x01   // Packet received
+#define DP_IMR_TxP    0x02   // Packet transmitted
+#define DP_IMR_RxE    0x04   // Receive error
+#define DP_IMR_TxE    0x08   // Transmit error
+#define DP_IMR_OFLW   0x10   // Receive overflow
+#define DP_IMR_CNT    0x20   // Tall counters need emptying
+#define DP_IMR_RDC    0x40   // Remote DMA complete
+
+#define DP_IMR_All    0x3F   // Everything but remote DMA
+
+// Receiver control register
+
+#define DP_RCR_SEP    0x01   // Save bad(error) packets
+#define DP_RCR_AR     0x02   // Accept runt packets
+#define DP_RCR_AB     0x04   // Accept broadcast packets
+#define DP_RCR_AM     0x08   // Accept multicast packets
+#define DP_RCR_PROM   0x10   // Promiscuous mode
+#define DP_RCR_MON    0x20   // Monitor mode - 1=accept no packets
+
+// Receiver status register
+
+#define DP_RSR_RxP    0x01   // Packet received
+#define DP_RSR_CRC    0x02   // CRC error
+#define DP_RSR_FRAME  0x04   // Framing error
+#define DP_RSR_FO     0x08   // FIFO overrun
+#define DP_RSR_MISS   0x10   // Missed packet
+#define DP_RSR_PHY    0x20   // 0=pad match, 1=mad match
+#define DP_RSR_DIS    0x40   // Receiver disabled
+#define DP_RSR_DFR    0x80   // Receiver processing deferred
+
+// Transmitter control register
+
+#define DP_TCR_NOCRC  0x01   // 1=inhibit CRC
+#define DP_TCR_NORMAL 0x00   // Normal transmitter operation
+#define DP_TCR_LOCAL  0x02   // Internal NIC loopback
+#define DP_TCR_INLOOP 0x04   // Full internal loopback
+#define DP_TCR_OUTLOOP 0x08  // External loopback
+#define DP_TCR_ATD    0x10   // Auto transmit disable
+#define DP_TCR_OFFSET 0x20   // Collision offset adjust
+
+// Transmit status register
+
+#define DP_TSR_TxP    0x01   // Packet transmitted
+#define DP_TSR_COL    0x04   // Collision (at least one)
+#define DP_TSR_ABT    0x08   // Aborted because of too many collisions
+#define DP_TSR_CRS    0x10   // Lost carrier
+#define DP_TSR_FU     0x20   // FIFO underrun
+#define DP_TSR_CDH    0x40   // Collision Detect Heartbeat
+#define DP_TSR_OWC    0x80   // Collision outside normal window
+
+// Page (buffer) allocation
+// FIXME: Driver should use more RX and (in particular) TX buffers,
+// limit these on variants where required (CF Low Power)
+#define DP_TX_BUF1    0x40
+#define DP_TX_BUF2    0x48
+#define DP_RX_START   0x50
+#define DP_RX_STOP    0x80
+
+#define IEEE_8023_MAX_FRAME         1518    // Largest possible ethernet frame
+#define IEEE_8023_MIN_FRAME           64    // Smallest possible ethernet frame
+
new file mode 100644
--- /dev/null
+++ b/packages/devs/eth/ns/dp83902a/current/src/if_dp83902a.c
@@ -0,0 +1,693 @@
+//==========================================================================
+//
+//      dev/if_dp83902a.c
+//
+//      Ethernet device driver for NS DP83902a ethernet controller
+//
+//==========================================================================
+//####COPYRIGHTBEGIN####
+//                                                                          
+// -------------------------------------------                              
+// The contents of this file are subject to the Red Hat eCos Public License 
+// Version 1.1 (the "License"); you may not use this file except in         
+// compliance with the License.  You may obtain a copy of the License at    
+// http://www.redhat.com/                                                   
+//                                                                          
+// Software distributed under the License is distributed on an "AS IS"      
+// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the 
+// License for the specific language governing rights and limitations under 
+// the License.                                                             
+//                                                                          
+// The Original Code is eCos - Embedded Configurable Operating System,      
+// released September 30, 1998.                                             
+//                                                                          
+// The Initial Developer of the Original Code is Red Hat.                   
+// Portions created by Red Hat are                                          
+// Copyright (C) 1998, 1999, 2000, 2001 Red Hat, Inc.
+// All Rights Reserved.                                                     
+// -------------------------------------------                              
+//                                                                          
+//####COPYRIGHTEND####
+//####BSDCOPYRIGHTBEGIN####
+//
+// -------------------------------------------
+//
+// Portions of this software may have been derived from OpenBSD or other sources,
+// and are covered by the appropriate copyright disclaimers included herein.
+//
+// -------------------------------------------
+//
+//####BSDCOPYRIGHTEND####
+//==========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):    gthomas
+// Contributors: gthomas, jskov
+// Date:         2001-06-13
+// Purpose:      
+// Description:
+//
+// FIXME:        Will fail if pinged with large packets (1520 bytes)
+//               Add promisc config
+//               Add SNMP
+//
+//####DESCRIPTIONEND####
+//
+//==========================================================================
+
+#include <pkgconf/system.h>
+#include <cyg/infra/cyg_type.h>
+#include <cyg/hal/hal_arch.h>
+#include <cyg/infra/diag.h>
+#include <cyg/hal/drv_api.h>
+#define __ECOS
+#include <eth_drv.h>
+#include <netdev.h>
+
+#ifdef CYGPKG_NET
+#include <pkgconf/net.h>
+#include <pkgconf/io_eth_drivers.h>
+#else
+#include <cyg/hal/hal_if.h>
+#endif
+
+#include <cyg/io/dp83902a.h>
+
+#define __WANT_DEVS
+#include CYGDAT_DEVS_ETH_NS_DP83902A_INL
+#undef __WANT_DEVS
+
+// This ISR is called when the ethernet interrupt occurs
+static cyg_uint32
+dp83902a_isr(cyg_vector_t vector, cyg_addrword_t data)
+{
+    dp83902a_priv_data_t *dp = (dp83902a_priv_data_t *)data;
+
+    DEBUG_FUNCTION();
+//    INCR_STAT( interrupts );
+
+    cyg_drv_interrupt_mask(dp->interrupt);
+    cyg_drv_interrupt_acknowledge(dp->interrupt);
+    return (CYG_ISR_HANDLED|CYG_ISR_CALL_DSR);  // Run the DSR
+}
+
+static void
+dp83902a_dsr(cyg_vector_t vector, cyg_ucount32 count, cyg_addrword_t data)
+{
+    // This conditioning out is necessary because of explicit calls to this
+    // DSR - which would not ever be called in the case of a polled mode
+    // usage ie. in RedBoot.
+#ifdef CYGPKG_IO_ETH_DRIVERS_NET
+    dp83902a_priv_data_t* dp = (dp83902a_priv_data_t *)data;
+    struct cyg_netdevtab_entry *ndp = (struct cyg_netdevtab_entry *)(dp->tab);
+    struct eth_drv_sc *sc = (struct eth_drv_sc *)(ndp->device_instance);
+
+    DEBUG_FUNCTION();
+
+    // but here, it must be a *sc:
+    eth_drv_dsr( vector, count, (cyg_addrword_t)sc );
+#else
+# ifndef CYGPKG_REDBOOT
+#  error Empty DP83902A ethernet DSR is compiled.  Is this what you want?
+# endif
+#endif
+}
+
+
+// The deliver function (ex-DSR)  handles the ethernet [logical] processing
+static void
+dp83902a_deliver(struct eth_drv_sc *sc)
+{
+    dp83902a_priv_data_t *dp = (dp83902a_priv_data_t *)sc->driver_private;
+
+    DEBUG_FUNCTION();
+
+    // Service the interrupt:
+    dp83902a_poll(sc);
+    // Allow interrupts to happen again
+    cyg_drv_interrupt_unmask(dp->interrupt);
+}
+
+static bool 
+dp83902a_init(struct cyg_netdevtab_entry *tab)
+{
+    struct eth_drv_sc *sc = (struct eth_drv_sc *)tab->device_instance;
+    dp83902a_priv_data_t *dp = (dp83902a_priv_data_t *)sc->driver_private;
+    cyg_uint8* base = dp->base;
+    int i;
+
+    DEBUG_FUNCTION();
+
+    dp->tab = tab;
+    dp->cr_lock = 0;
+
+    CYGHWR_NS_DP83902A_PLF_RESET(base);
+
+    DEBUG_LINE();
+
+    // Prepare ESA
+    DP_OUT(base, DP_CR, DP_CR_NODMA | DP_CR_PAGE1);  // Select page 1
+    if (dp->hardwired_esa) {
+        // Force the NIC to use the specified ESA
+        for (i = 0; i < 6; i++)
+            DP_OUT(base, DP_P1_PAR0+i, dp->esa[i]);
+    } else {
+        // Use the address from the serial EEPROM
+        for (i = 0; i < 6; i++)
+            DP_IN(base, DP_P1_PAR0+i, dp->esa[i]);
+    }
+    DP_OUT(base, DP_CR, DP_CR_NODMA | DP_CR_PAGE0);  // Select page 0
+
+    diag_printf("DP83902A - %s ESA: %02x:%02x:%02x:%02x:%02x:%02x\n",
+                (dp->hardwired_esa) ? "static" : "eeprom",
+                dp->esa[0],
+                dp->esa[1],
+                dp->esa[2],
+                dp->esa[3],
+                dp->esa[4],
+                dp->esa[5] );
+
+    cyg_drv_interrupt_create(
+        dp->interrupt,
+        0,                  // Priority - unused
+        (cyg_addrword_t)dp,// Data item passed to ISR & DSR
+        dp83902a_isr,          // ISR
+        dp83902a_dsr,          // DSR
+        &dp->interrupt_handle, // handle to intr obj
+        &dp->interrupt_object ); // space for int obj
+
+    cyg_drv_interrupt_attach(dp->interrupt_handle);
+    cyg_drv_interrupt_unmask(dp->interrupt);
+
+    // Initialize upper level driver
+    (sc->funs->eth_drv->init)(sc, dp->esa);
+
+    return true;
+}
+
+static void
+dp83902a_stop(struct eth_drv_sc *sc)
+{
+    dp83902a_priv_data_t *dp = (dp83902a_priv_data_t *)sc->driver_private;
+    cyg_uint8 *base = dp->base;
+
+    DEBUG_FUNCTION();
+
+    CR_UP();
+    DP_OUT(base, DP_CR, DP_CR_PAGE0 | DP_CR_NODMA | DP_CR_STOP);  // Brutal
+    DP_OUT(base, DP_ISR, 0xFF);               // Clear any pending interrupts
+    DP_OUT(base, DP_IMR, 0x00);               // Disable all interrupts
+    CR_DOWN();
+
+    dp->running = false;
+}
+
+//
+// This function is called to "start up" the interface.  It may be called
+// multiple times, even when the hardware is already running.  It will be
+// called whenever something "hardware oriented" changes and should leave
+// the hardware ready to send/receive packets.
+//
+static void
+dp83902a_start(struct eth_drv_sc *sc, unsigned char *enaddr, int flags)
+{
+    dp83902a_priv_data_t *dp = (dp83902a_priv_data_t *)sc->driver_private;
+    cyg_uint8 *base = dp->base;
+    int i;
+
+    DEBUG_FUNCTION();
+
+    CR_UP();
+    DP_OUT(base, DP_CR, DP_CR_PAGE0 | DP_CR_NODMA | DP_CR_STOP); // Brutal
+    DP_OUT(base, DP_DCR, DP_DCR_INIT);
+    DP_OUT(base, DP_RBCH, 0);                 // Remote byte count
+    DP_OUT(base, DP_RBCL, 0);
+    DP_OUT(base, DP_RCR, DP_RCR_MON);     // Accept no packets
+    DP_OUT(base, DP_TCR, DP_TCR_LOCAL);   // Transmitter [virtually] off
+    DP_OUT(base, DP_TPSR, DP_TX_BUF1);    // Transmitter start page
+    dp->tx1 = dp->tx2 = 0;
+    dp->tx_next = DP_TX_BUF1;
+    dp->tx_started = false;
+    DP_OUT(base, DP_PSTART, DP_RX_START); // Receive ring start page
+    DP_OUT(base, DP_BNDRY, DP_RX_STOP-1); // Receive ring boundary
+    DP_OUT(base, DP_PSTOP, DP_RX_STOP);   // Receive ring end page
+    dp->rx_next = DP_RX_START-1;
+    DP_OUT(base, DP_ISR, 0xFF);               // Clear any pending interrupts
+    DP_OUT(base, DP_IMR, DP_IMR_All);     // Enable all interrupts
+    DP_OUT(base, DP_CR, DP_CR_NODMA | DP_CR_PAGE1);  // Select page 1
+    DP_OUT(base, DP_P1_CURP, DP_RX_START);   // Current page - next free page for Rx
+    for (i = 0;  i < ETHER_ADDR_LEN;  i++) {
+        DP_OUT(base, DP_P1_PAR0+i, enaddr[i]);
+    }
+    // Enable and start device
+    DP_OUT(base, DP_CR, DP_CR_PAGE0 | DP_CR_NODMA | DP_CR_START);  
+    DP_OUT(base, DP_TCR, DP_TCR_NORMAL); // Normal transmit operations
+    DP_OUT(base, DP_RCR, DP_RCR_AB);  // Accept broadcast, no errors, no multicast
+    dp->running = true;
+    CR_DOWN();
+}
+
+//
+// This routine is called to perform special "control" opertions
+//
+static int
+dp83902a_control(struct eth_drv_sc *sc, unsigned long key,
+               void *data, int data_len)
+{
+    switch (key) {
+    case ETH_DRV_SET_MAC_ADDRESS:
+        return 0;
+        break;
+    default:
+        return 1;
+        break;
+    }
+}
+
+//
+// This routine is called to see if it is possible to send another packet.
+// It will return non-zero if a transmit is possible, zero otherwise.
+//
+static int
+dp83902a_can_send(struct eth_drv_sc *sc)
+{
+    dp83902a_priv_data_t *dp = (dp83902a_priv_data_t *)sc->driver_private;
+
+    DEBUG_FUNCTION();
+
+    return ((dp->tx1 == 0) || (dp->tx2 == 0));
+}
+
+//
+// This routine is called to start the transmitter.  It is split out from the
+// data handling routine so it may be called either when data becomes first 
+// available or when an Tx interrupt occurs
+//
+
+static void
+dp83902a_start_xmit(struct eth_drv_sc *sc, int start_page, int len)
+{    
+    dp83902a_priv_data_t *dp = (dp83902a_priv_data_t *)sc->driver_private;
+    cyg_uint8 *base = dp->base;
+
+    DEBUG_FUNCTION();
+
+#if DEBUG & 1
+    diag_printf("Tx pkt %d len %d\n", start_page, len);
+    if (dp->tx_started)
+        diag_printf("TX already started?!?\n");
+#endif
+
+    CR_UP();
+    DP_OUT(base, DP_ISR, (DP_ISR_TxP | DP_ISR_TxE));
+    DP_OUT(base, DP_CR, DP_CR_PAGE0 | DP_CR_NODMA | DP_CR_START);
+    DP_OUT(base, DP_TBCL, len & 0xFF);
+    DP_OUT(base, DP_TBCH, len >> 8);
+    DP_OUT(base, DP_TPSR, start_page);
+    DP_OUT(base, DP_CR, DP_CR_NODMA | DP_CR_TXPKT | DP_CR_START);
+
+    CR_DOWN();
+    dp->tx_started = true;
+}
+
+//
+// This routine is called to send data to the hardware.  It is known a-priori
+// that there is free buffer space (dp->tx_next).
+//
+static void 
+dp83902a_send(struct eth_drv_sc *sc, struct eth_drv_sg *sg_list, int sg_len, 
+            int total_len, unsigned long key)
+{
+    struct dp83902a_priv_data *dp = (struct dp83902a_priv_data *)sc->driver_private;
+    cyg_uint8 *base = dp->base;
+    int i, len, start_page, pkt_len;
+    unsigned char *data;
+    cyg_uint8 isr;
+#if DEBUG & 4
+    int dx;
+#endif
+
+    DEBUG_FUNCTION();
+
+    pkt_len = total_len;
+    if (pkt_len < IEEE_8023_MIN_FRAME) pkt_len = IEEE_8023_MIN_FRAME;
+    start_page = dp->tx_next;
+    if (dp->tx_next == DP_TX_BUF1) {
+        dp->tx1 = start_page;
+        dp->tx1_len = pkt_len;
+        dp->tx1_key = key;
+        dp->tx_next = DP_TX_BUF2;
+    } else {
+        dp->tx2 = start_page;
+        dp->tx2_len = pkt_len;
+        dp->tx2_key = key;
+        dp->tx_next = DP_TX_BUF1;
+    }
+    CR_UP();
+
+#if DEBUG & 5
+    diag_printf("TX prep page %d len %d\n", start_page, pkt_len);
+#endif
+
+    DP_OUT(base, DP_ISR, DP_ISR_RDC);  // Clear end of DMA
+    // Set these first, following the small print of the manual
+    DP_OUT(base, DP_RBCL, 1);
+    DP_OUT(base, DP_CR, DP_CR_PAGE0 | DP_CR_RDMA | DP_CR_START);
+
+#ifdef CYGHWR_NS_DP83902A_PLF_BROKEN_TX_DMA
+    // Stall for a bit before continuing to work around random data
+    // corruption problems on some platforms.
+    CYGACC_CALL_IF_DELAY_US(1);
+#endif
+
+    // Send data to device buffer(s)
+    DP_OUT(base, DP_RSAL, 0);
+    DP_OUT(base, DP_RSAH, start_page);
+    DP_OUT(base, DP_RBCL, pkt_len & 0xFF);
+    DP_OUT(base, DP_RBCH, pkt_len >> 8);
+    DP_OUT(base, DP_CR, DP_CR_WDMA | DP_CR_START);
+
+    // Put data into buffer
+    for (i = 0;  i < sg_len;  i++) {
+        data = (unsigned char *)sg_list[i].buf;
+        len = sg_list[i].len;
+#if DEBUG & 4
+        diag_printf(" sg buf %08x len %08x\n ", data, len);
+        dx = 0;
+#endif
+        while (len > 0) {
+#ifdef CYGHWR_NS_DP83902A_PLF_16BIT_DATA
+            cyg_uint16 tmp;
+            tmp = *data++ << 8;
+            len -= 2;
+            if (len >= 0)
+                tmp |= *data++;
+            DP_OUT_DATA(dp->data, tmp);
+#if DEBUG & 4
+            diag_printf(" %04x", tmp);
+            if (0 == (++dx % 8)) diag_printf("\n ");
+#endif
+#else
+#if DEBUG & 4
+            diag_printf(" %02x", *data);
+            if (0 == (++dx % 16)) diag_printf("\n ");
+#endif
+            DP_OUT_DATA(dp->data, *data++);
+            len--;
+#endif
+        }
+#if DEBUG & 4
+        diag_printf("\n");
+#endif
+    }
+    if (total_len < pkt_len) {
+#if DEBUG & 4
+        diag_printf("  + %d bytes of padding\n", pkt_len - total_len);
+#endif
+        // Padding to 802.3 length was required
+        for (i = total_len;  i < pkt_len;) {
+#ifdef CYGHWR_NS_DP83902A_PLF_16BIT_DATA
+            i += 2;
+#else
+            i++;
+#endif
+            DP_OUT_DATA(dp->data, 0);
+        }
+    }
+
+#ifdef CYGHWR_NS_DP83902A_PLF_BROKEN_TX_DMA
+    // After last data write, delay for a bit before accessing the
+    // device again, or we may get random data corruption in the last
+    // datum (on some platforms).
+    CYGACC_CALL_IF_DELAY_US(1);
+#endif
+
+    // Wait for DMA to complete
+    do {
+        DP_IN(base, DP_ISR, isr);
+    } while ((isr & DP_ISR_RDC) == 0);
+    // Then disable DMA
+    DP_OUT(base, DP_CR, DP_CR_PAGE0 | DP_CR_NODMA | DP_CR_START);
+    CR_DOWN();
+
+    // Start transmit if not already going
+    if (!dp->tx_started) {
+        if (start_page == dp->tx1) {
+            dp->tx_int = 1;  // Expecting interrupt from BUF1
+        } else {
+            dp->tx_int = 2;  // Expecting interrupt from BUF2
+        }
+        dp83902a_start_xmit(sc, start_page, pkt_len);
+    }
+}
+
+//
+// This function is called when a packet has been received.  It's job is
+// to prepare to unload the packet from the hardware.  Once the length of
+// the packet is known, the upper layer of the driver can be told.  When
+// the upper layer is ready to unload the packet, the internal function
+// 'dp83902a_recv' will be called to actually fetch it from the hardware.
+//
+static void
+dp83902a_RxEvent(struct eth_drv_sc *sc, int stat)
+{
+    struct dp83902a_priv_data *dp = (struct dp83902a_priv_data *)sc->driver_private;
+    cyg_uint8 *base = dp->base;
+    unsigned char rsr;
+    unsigned char rcv_hdr[4];
+    int i, len, pkt, cur;
+
+    DEBUG_FUNCTION();
+
+    DP_IN(base, DP_RSR, rsr);
+    while (true) {
+        CR_UP();
+        // Read incoming packet header
+        DP_OUT(base, DP_CR, DP_CR_PAGE1 | DP_CR_NODMA | DP_CR_START);
+        DP_IN(base, DP_P1_CURP, cur);
+        DP_OUT(base, DP_P1_CR, DP_CR_PAGE0 | DP_CR_NODMA | DP_CR_START);
+        DP_IN(base, DP_BNDRY, pkt);
+        pkt += 1;
+        if (pkt == cur) {
+            CR_DOWN();
+            break;
+        }
+        if (pkt == DP_RX_STOP) pkt = DP_RX_START;
+        DP_OUT(base, DP_RBCL, sizeof(rcv_hdr));
+        DP_OUT(base, DP_RBCH, 0);
+        DP_OUT(base, DP_RSAL, 0);
+        DP_OUT(base, DP_RSAH, pkt);
+        if (dp->rx_next == pkt) {
+            DP_OUT(base, DP_BNDRY, cur-1); // Update pointer
+            CR_DOWN();
+            return;
+        }
+        dp->rx_next = pkt;
+        DP_OUT(base, DP_ISR, DP_ISR_RDC); // Clear end of DMA
+        DP_OUT(base, DP_CR, DP_CR_RDMA | DP_CR_START);
+
+        for (i = 0;  i < sizeof(rcv_hdr);) {
+#ifdef CYGHWR_NS_DP83902A_PLF_16BIT_DATA
+            cyg_uint16 tmp;
+            DP_IN_DATA(dp->data, tmp);
+            rcv_hdr[i++] = (tmp >> 8) & 0xff;
+            rcv_hdr[i++] = tmp & 0xff;
+#else
+            DP_IN_DATA(dp->data, rcv_hdr[i++]);
+#endif
+        }
+        CR_DOWN();
+
+#if DEBUG & 5
+        diag_printf("rx hdr %02x %02x %02x %02x\n",
+                    rcv_hdr[0], rcv_hdr[1], rcv_hdr[2], rcv_hdr[3]);
+#endif
+        len = ((rcv_hdr[3] << 8) | rcv_hdr[2]) - sizeof(rcv_hdr);
+        (sc->funs->eth_drv->recv)(sc, len);
+        DP_OUT(base, DP_BNDRY, rcv_hdr[1]-1); // Update pointer
+    }
+}
+
+//
+// This function is called as a result of the "eth_drv_recv()" call above.
+// It's job is to actually fetch data for a packet from the hardware once
+// memory buffers have been allocated for the packet.  Note that the buffers
+// may come in pieces, using a scatter-gather list.  This allows for more
+// efficient processing in the upper layers of the stack.
+//
+static void
+dp83902a_recv(struct eth_drv_sc *sc, struct eth_drv_sg *sg_list, int sg_len)
+{
+    struct dp83902a_priv_data *dp = (struct dp83902a_priv_data *)sc->driver_private;
+    cyg_uint8 *base = dp->base;
+    int i, mlen, len;
+    unsigned char *data;
+    cyg_uint8 saved_char = 0;
+    bool saved;
+#if DEBUG & 4
+    int dx;
+#endif
+
+    DEBUG_FUNCTION();
+
+    // Compute total packet length
+    len = 0;
+    for (i = 0;  i < sg_len;  i++) {
+        len += sg_list[i].len;
+    }
+
+#if DEBUG & 5
+    diag_printf("Rx packet %d length %d\n", dp->rx_next, len);
+#endif
+
+    CR_UP();
+
+    // Read incoming packet data
+    DP_OUT(base, DP_CR, DP_CR_PAGE0 | DP_CR_NODMA | DP_CR_START);
+    DP_OUT(base, DP_RBCL, len & 0xFF);
+    DP_OUT(base, DP_RBCH, len >> 8);
+    DP_OUT(base, DP_RSAL, 4);           // Past header
+    DP_OUT(base, DP_RSAH, dp->rx_next);
+    DP_OUT(base, DP_ISR, DP_ISR_RDC); // Clear end of DMA
+    DP_OUT(base, DP_CR, DP_CR_RDMA | DP_CR_START);
+
+    saved = false;
+    for (i = 0;  i < sg_len;  i++) {
+        data = (unsigned char *)sg_list[i].buf;
+        if (data) {
+            mlen = sg_list[i].len;
+#if DEBUG & 4
+            diag_printf(" sg buf %08x len %08x \n", data, mlen);
+            dx = 0;
+#endif
+            while (0 < mlen) {
+                // Saved byte from previous loop?
+                if (saved) {
+                    *data++ = saved_char;
+                    mlen--;
+                    saved = false;
+                    continue;
+                }
+
+#ifdef CYGHWR_NS_DP83902A_PLF_16BIT_DATA
+                {
+                    cyg_uint16 tmp;
+                    DP_IN_DATA(dp->data, tmp);
+#if DEBUG & 4
+                    diag_printf(" %04x", tmp);
+                    if (0 == (++dx % 8)) diag_printf("\n ");
+#endif
+                    *data++ = (tmp >> 8) & 0xff;
+                    mlen--;
+                    if (0 == mlen) {
+                        saved_char = tmp & 0xff;
+                        saved = true;
+                    } else {
+                        *data++ = tmp & 0xff;
+                        mlen--;
+                    }
+                }
+#else
+                {
+                    cyg_uint8 tmp;
+                    DP_IN_DATA(dp->data, tmp);
+#if DEBUG & 4
+                    diag_printf(" %02x", tmp);
+                    if (0 == (++dx % 16)) diag_printf("\n ");
+#endif
+                    *data++ = tmp;;
+                    mlen--;
+                }
+#endif
+            }
+#if DEBUG & 4
+            diag_printf("\n");
+#endif
+        }
+    }
+    CR_DOWN();
+}
+
+static void
+dp83902a_TxEvent(struct eth_drv_sc *sc, int stat)
+{
+    struct dp83902a_priv_data *dp = (struct dp83902a_priv_data *)sc->driver_private;
+    cyg_uint8 *base = dp->base;
+    unsigned char tsr;
+    unsigned long key;
+
+    DEBUG_FUNCTION();
+
+    DP_IN(base, DP_TSR, tsr);
+    if (dp->tx_int == 1) {
+        key = dp->tx1_key;
+        dp->tx1 = 0;
+    } else {
+        key = dp->tx2_key;
+        dp->tx2 = 0;
+    }
+    // Start next packet if one is ready
+    dp->tx_started = false;
+    if (dp->tx1) {
+        dp83902a_start_xmit(sc, dp->tx1, dp->tx1_len);
+        dp->tx_int = 1;
+    } else if (dp->tx2) {
+        dp83902a_start_xmit(sc, dp->tx2, dp->tx2_len);
+        dp->tx_int = 2;
+    } else {
+        dp->tx_int = 0;
+    }
+    // Tell higher level we sent this packet
+    (sc->funs->eth_drv->tx_done)(sc, key, 0);
+}
+
+static void
+dp83902a_BufEvent(struct eth_drv_sc *sc, int stat)
+{
+    // What to do if the receive buffers overflow?
+    if (stat & DP_ISR_OFLW) {
+        // Note: [so far] it seems safe to just ignore this condition
+        // The Linux driver goes through extraordinary pains to handle
+        // it, including totally shutting down the chip and restarting.
+    }
+}
+
+static void
+dp83902a_poll(struct eth_drv_sc *sc)
+{
+    struct dp83902a_priv_data *dp = (struct dp83902a_priv_data *)sc->driver_private;
+    cyg_uint8 *base = dp->base;
+    unsigned char isr;
+
+//    DEBUG_FUNCTION();
+
+    CR_UP();
+    DP_OUT(base, DP_CR, DP_CR_NODMA | DP_CR_PAGE0 | DP_CR_START);
+    CR_DOWN();
+    DP_IN(base, DP_ISR, isr);
+    while (0 != isr) {
+        DP_OUT(base, DP_ISR, isr);      // Clear set bits
+        if (!dp->running) break;        // Is this necessary?
+        // Check for tx_started on TX event since these may happen
+        // spuriously it seems.
+        if (isr & (DP_ISR_TxP|DP_ISR_TxE) && dp->tx_started) {
+            dp83902a_TxEvent(sc, isr);
+        }
+        if (isr & (DP_ISR_RxP|DP_ISR_RxE)) {
+            dp83902a_RxEvent(sc, isr);
+        }
+        if (isr & (DP_ISR_OFLW|DP_ISR_CNT)) {
+            dp83902a_BufEvent(sc, isr);
+        }
+        DP_IN(base, DP_ISR, isr);
+    }
+
+    CYGHWR_NS_DP83902A_PLF_INT_CLEAR(dp);
+}
+
+static int
+dp83902a_int_vector(struct eth_drv_sc *sc)
+{
+    struct dp83902a_priv_data *dp = (struct dp83902a_priv_data *)sc->driver_private;
+    return dp->interrupt;
+}
--- a/packages/ecos.db
+++ b/packages/ecos.db
@@ -560,7 +560,7 @@ package CYGPKG_FS_ROM {
 }
 
 package CYGPKG_IO_ETH_DRIVERS {
-	alias 		{ "Common ethernet support" net_drivers eth_drivers }
+	alias 		{ "Common ethernet support" net_drivers eth_drivers CYGPKG_NET_ETH_DRIVERS }
 	directory	io/eth
 	script		eth_drivers.cdl
         description     "Platform independent ethernet support."
@@ -697,6 +697,14 @@ package CYGPKG_DEVS_ETH_MIPS_ATLAS {
         description     "Ethernet driver for MIPS Atlas with onboard SAA9730 NIC."
 }
 
+package CYGPKG_DEVS_ETH_NS_DP83902A {
+	alias 		{ "NS DP83902A ethernet driver" dp83902a_eth_driver }
+	hardware
+	directory	devs/eth/ns/dp83902a
+	script		ns_dp83902a_eth_drivers.cdl
+        description     "Ethernet driver for NS DP83902A controller."
+}
+
 # Not sure whether this should be "hardware"; if so, it should be mentioned
 # in all targets that can use it.
 package CYGPKG_DEVS_ETH_CF {
--- a/packages/hal/mips/rm7000/var/current/ChangeLog
+++ b/packages/hal/mips/rm7000/var/current/ChangeLog
@@ -1,3 +1,10 @@
+2001-06-25  Jesper Skov  <jskov@redhat.com>
+
+	* include/var_cache.h: Default definition for
+	CYGHWR_HAL_MIPS_RM7000_CACHE_SCRUB_BASE.
+	* src/var_mk_defs.c: export CYGHWR_HAL_MIPS_RM7000_CACHE_SCRUB_BASE.
+	* include/variant.inc: Use CYGHWR_HAL_MIPS_RM7000_CACHE_SCRUB_BASE.
+
 2001-06-08  Jesper Skov  <jskov@redhat.com>
 
 	* include/variant.inc: Scrub cache according to erratum #31.
--- a/packages/hal/mips/rm7000/var/current/include/var_cache.h
+++ b/packages/hal/mips/rm7000/var/current/include/var_cache.h
@@ -50,12 +50,23 @@
 //=============================================================================
 
 #include <pkgconf/hal.h>
+#include CYGHWR_MEMORY_LAYOUT_H
+
 #include <cyg/infra/cyg_type.h>
 
 #include <cyg/hal/mips-regs.h>
 
 #include <cyg/hal/plf_cache.h>
 
+
+//=============================================================================
+// Area to use for cache scrubbing. This must be a cache sized area in
+// cachable space which can be cleared. Defaults to use the area reserved
+// for shared PCI memory space.
+#ifndef CYGHWR_HAL_MIPS_RM7000_CACHE_SCRUB_BASE
+# define CYGHWR_HAL_MIPS_RM7000_CACHE_SCRUB_BASE  CYGMEM_SECTION_pci_window
+#endif
+
 //=============================================================================
 // QED RM7000A
 
--- a/packages/hal/mips/rm7000/var/current/include/variant.inc
+++ b/packages/hal/mips/rm7000/var/current/include/variant.inc
@@ -110,20 +110,32 @@
         mtc0    zero,taghi
 
         # D-cache:
-        la      t0,0x80000000
+        la      t0,CYGHWR_HAL_MIPS_RM7000_CACHE_SCRUB_BASE
         ori     t1,t0,HAL_DCACHE_SIZE
 1:
         cache   0x09,0x0000(t0)
         cache   0x09,0x1000(t0)
         cache   0x09,0x2000(t0)
         cache   0x09,0x3000(t0)
+
+	# Clear area so Icache loads below will read valid
+	# instructions.
+	sw	zero,0x00(t0)
+	sw	zero,0x04(t0)
+	sw	zero,0x08(t0)
+	sw	zero,0x0c(t0)
+	sw	zero,0x10(t0)
+	sw	zero,0x14(t0)
+	sw	zero,0x18(t0)
+	sw	zero,0x1c(t0)
+	
         addi    t0,t0,0x20
         sub     v0,t1,t0
         bgez    v0,1b
          nop
 
         # I-cache:
-        la      a0,0x80000000
+        la      a0,CYGHWR_HAL_MIPS_RM7000_CACHE_SCRUB_BASE
         ori     a1,a0,HAL_ICACHE_SIZE
 1:
         cache   0x08,0x0000(a0)
--- a/packages/hal/mips/rm7000/var/current/src/var_mk_defs.c
+++ b/packages/hal/mips/rm7000/var/current/src/var_mk_defs.c
@@ -72,6 +72,8 @@ main(void)
     // Cache stuff
     DEFINE(HAL_DCACHE_SIZE, HAL_DCACHE_SIZE);
     DEFINE(HAL_ICACHE_SIZE, HAL_ICACHE_SIZE);
+    DEFINE(CYGHWR_HAL_MIPS_RM7000_CACHE_SCRUB_BASE, CYGHWR_HAL_MIPS_RM7000_CACHE_SCRUB_BASE);
+
     return 0;
 }