summaryrefslogtreecommitdiffstats
path: root/bsd_eth_drivers/if_pcn
diff options
context:
space:
mode:
authorTill Straumann <strauman@slac.stanford.edu>2009-04-22 22:06:58 +0000
committerTill Straumann <strauman@slac.stanford.edu>2009-04-22 22:06:58 +0000
commitc7b02a7980ed41a969c76ce377dd87e77c3cf49f (patch)
tree2ddade9b81c5a82bef5968fad99480acd423f70b /bsd_eth_drivers/if_pcn
parent2009-02-20 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
parent - importing updated version from SLAC as of 20090422 (diff)
downloadlibbsdport-c7b02a7980ed41a969c76ce377dd87e77c3cf49f.tar.bz2
This commit was generated by cvs2svn to compensate for changes in r20, which
included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'bsd_eth_drivers/if_pcn')
-rw-r--r--bsd_eth_drivers/if_pcn/Makefile143
-rw-r--r--bsd_eth_drivers/if_pcn/README.rtems73
2 files changed, 216 insertions, 0 deletions
diff --git a/bsd_eth_drivers/if_pcn/Makefile b/bsd_eth_drivers/if_pcn/Makefile
new file mode 100644
index 0000000..7e52001
--- /dev/null
+++ b/bsd_eth_drivers/if_pcn/Makefile
@@ -0,0 +1,143 @@
+#
+# Makefile.leaf,v 1.7 2002/07/22 22:56:09 joel Exp
+#
+# Templates/Makefile.leaf
+# Template leaf node Makefile
+#
+#
+LIBNAME=libif_pcn.a
+
+LINKS=pci/if_pcnreg.h
+
+# C source names, if any, go here -- minus the .c
+C_PIECES=
+
+C_PIECES+=if_pcn
+
+C_FILES=$(C_PIECES:%=%.c)
+C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
+
+# C++ source names, if any, go here -- minus the .cc
+CC_PIECES=
+CC_FILES=$(CC_PIECES:%=%.cc)
+CC_O_FILES=$(CC_PIECES:%=${ARCH}/%.o)
+
+H_FILES=
+
+# Assembly source names, if any, go here -- minus the .S
+S_PIECES=
+S_FILES=$(S_PIECES:%=%.S)
+S_O_FILES=$(S_FILES:%.S=${ARCH}/%.o)
+
+SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
+OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
+
+# If your PGMS target has the '.exe' extension, a statically
+# linked application is generated.
+# If it has a '.obj' extension, a loadable module is built.
+#
+#
+ifdef LIBNAME
+LIB=${ARCH}/${LIBNAME}
+else
+PGMS=${ARCH}/if_pcn.obj
+endif
+
+# List of RTEMS Classic API Managers to be included in the application
+# goes here. Use:
+# MANAGERS=all
+# to include all RTEMS Classic API Managers in the application or
+# something like this to include a specific set of managers.
+# MANAGERS=io event message rate_monotonic semaphore timer
+#
+# UNUSED for loadable modules
+MANAGERS=ALL
+
+ifndef RTEMS_MAKEFILE_PATH
+$(error you need to set the RTEMS_MAKEFILE_PATH environment variable)
+endif
+
+all:
+
+depend: ${LINKS}
+
+include $(RTEMS_MAKEFILE_PATH)/Makefile.inc
+
+include $(RTEMS_CUSTOM)
+ifdef LIBNAME
+include $(RTEMS_ROOT)/make/lib.cfg
+else
+include $(RTEMS_ROOT)/make/leaf.cfg
+endif
+
+#
+# (OPTIONAL) Add local stuff here using +=
+#
+
+#DEFINES += -DPCN_DEBUG
+CPPFLAGS += -I. -I../libbsdport -I../libbsdport/dummyheaders
+CFLAGS +=
+
+#
+# CFLAGS_DEBUG_V are used when the `make debug' target is built.
+# To link your application with the non-optimized RTEMS routines,
+# uncomment the following line:
+# CFLAGS_DEBUG_V += -qrtems_debug
+#
+
+LD_PATHS +=
+LD_LIBS +=
+LDFLAGS +=
+
+#
+# Add your list of files to delete here. The config files
+# already know how to delete some stuff, so you may want
+# to just run 'make clean' first to see what gets missed.
+# 'make clobber' already includes 'make clean'
+#
+
+CLEAN_ADDITIONS +=
+CLOBBER_ADDITIONS += pci
+
+all: ${LINKS} ${ARCH} $(SRCS) $(PGMS) ${LIB}
+
+pci/%:%
+ if [ ! -d pci ]; then mkdir -p pci; fi ; ln -s ../$^ $@
+
+#How to make a relocatable object
+$(filter %.obj, $(PGMS)): ${OBJS}
+ $(make-obj)
+
+#How to make an executable (statically linked)
+$(filter %.exe,$(PGMS)): ${LINK_FILES}
+ $(make-exe)
+ifdef ELFEXT
+ifdef XSYMS
+ $(XSYMS) $(@:%.exe=%.$(ELFEXT)) $(@:%.exe=%.sym)
+endif
+endif
+
+$(LIB): ${OBJS}
+ $(make-library)
+
+ifndef RTEMS_SITE_INSTALLDIR
+RTEMS_SITE_INSTALLDIR = $(PROJECT_RELEASE)
+endif
+
+${RTEMS_SITE_INSTALLDIR}/include \
+${RTEMS_SITE_INSTALLDIR}/lib \
+${RTEMS_SITE_INSTALLDIR}/bin:
+ test -d $@ || mkdir -p $@
+# Install the program(s), appending _g or _p as appropriate.
+# for include files, just use $(INSTALL_CHANGE)
+#
+# - Some BSPs might generate bootable executables in yet another
+# format (such as .srec) and you might need to extend the rule
+# below so the essential files get installed. YMMV.
+ifdef LIBNAME
+install: all $(RTEMS_SITE_INSTALLDIR)/lib
+ $(INSTALL_VARIANT) -m 644 ${LIB} ${RTEMS_SITE_INSTALLDIR}/lib
+else
+install: all $(RTEMS_SITE_INSTALLDIR)/bin
+ $(INSTALL_VARIANT) -m 555 ${PGMS} ${PGMS:%.exe=%.bin} ${PGMS:%.exe=%.sym} ${RTEMS_SITE_INSTALLDIR}/bin
+endif
diff --git a/bsd_eth_drivers/if_pcn/README.rtems b/bsd_eth_drivers/if_pcn/README.rtems
new file mode 100644
index 0000000..ab8ba09
--- /dev/null
+++ b/bsd_eth_drivers/if_pcn/README.rtems
@@ -0,0 +1,73 @@
+RTEMS PORT OF THE 'pcn' ETHERNET DRIVER
+=======================================
+
+This is a port of the FreeBSD 'pcn' driver as of
+2007/7/17 (checked out from FreeBSD/head on that date).
+
+SUPPORTED BSPs:
+- you need 'libbsdport' which in turn needs 'libbspExt'
+ These work for i386/pc386 and powerpc/new-exception-processing
+ BSPs, i.e., the BSP must implement <rtems/pci.h> and <rtems/irq.h>.
+
+USAGE:
+- to attach this driver:
+ * define a NULL terminated list with all libbsdport supported
+ drivers you want to include with your application:
+
+ extern driver_t libbsdport_pcn_driver;
+
+ driver_t *libbsdport_netdriver_table[] = {
+ &libbsdport_pcn_driver,
+ /* other drivers here or upstream of 'pcn' if they support
+ * the same hardware but are preferred.
+ */
+ 0
+ };
+
+ * specify libbsdport_netdriver_attach for the 'attach' function
+ pointer in struct rtems_bsdnet_ifconfig.
+
+ * use the 'name' field in struct rtems_bsdnet_ifconfig to filter
+ drivers and device instances:
+
+ <driver_name><instance>
+
+ either may be omitted which means that the next available
+ driver/hardware device is to be used. Here are a few examples:
+
+ "" /* use first device found supported by any driver in the
+ * libbsdport_driver_table[].
+ */
+
+ "pcn2" /* use second device supported by the 'pcn' driver */
+
+ Notes: Counting instances begins with 1 (not 0).
+ Consult libbsdport/README for more information.
+
+KNOWN ISSUES:
+- 'ignore_broadcast' and 'mtu' settings from
+ struct rtems_bsdnet_ifconfig are ignored. I haven't seen
+ many drivers that honour 'ignore_broadcast' and 'mtu' can be
+ set using a ioctl(). I'm trying to keep changes to BSD sources
+ minimal...
+- ring sizes are restricted fixed to hardcoded size.
+- Only the internal phy of the 973/975 chips are supported
+ and will allow SIOCGIFMEDIA/SIOCSIFMEDIA to work. I don't know
+ what happens with other chips or external phys.
+ Probably, the factory-default setup should work with autonegotiation
+ but the ioctls wont. YMMV.
+
+OTHER NOTES:
+- you can use the (more generic) 'le' driver for the 79C971
+ and upwards chips, too, but 'pcn' supposedly uses more advanced
+ features of these chips.
+
+TESTED WITH:
+ Technobox 10/100-TX Ethernet PMC (AMD Am79C973 chip)
+
+TESTED ON:
+ rtems-4.7
+ powerpc/beatnik (motorola MVME5500 and MVME6100 VME boards)
+ i386/pc686 (concurrent technologies PP410 compact PCI)
+
+T.S, 200707