Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Add a driver for the RDC Semiconductor RDC R6040 10/100 Ethe...



details:   https://anonhg.NetBSD.org/src/rev/b52dcfac2738
branches:  trunk
changeset: 761410:b52dcfac2738
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Wed Jan 26 18:48:11 2011 +0000

description:
Add a driver for the RDC Semiconductor RDC R6040 10/100 Ethernet controller,
as found in the vortex86 SoCs (http://www.vortex86dx.com).
Ported from freebsd.
Not added to amd64's GENERIC because this CPU is 32bit only.

thanks to DM&P Electronics, Inc for providing documentation and sample
devices for this work.

diffstat:

 distrib/sets/lists/man/mi  |     8 +-
 share/man/man4/Makefile    |     8 +-
 share/man/man4/rdcphy.4    |    49 +
 share/man/man4/vte.4       |    90 ++
 sys/arch/i386/conf/GENERIC |     6 +-
 sys/dev/mii/files.mii      |    12 +-
 sys/dev/mii/rdcphy.c       |   253 ++++++
 sys/dev/mii/rdcphyreg.h    |    75 +
 sys/dev/pci/files.pci      |    13 +-
 sys/dev/pci/if_vte.c       |  1732 ++++++++++++++++++++++++++++++++++++++++++++
 sys/dev/pci/if_vtereg.h    |   342 ++++++++
 sys/dev/pci/if_vtevar.h    |   161 ++++
 12 files changed, 2734 insertions(+), 15 deletions(-)

diffs (truncated from 2897 to 300 lines):

diff -r 6a4a3427a57f -r b52dcfac2738 distrib/sets/lists/man/mi
--- a/distrib/sets/lists/man/mi Wed Jan 26 18:43:30 2011 +0000
+++ b/distrib/sets/lists/man/mi Wed Jan 26 18:48:11 2011 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1282 2011/01/26 16:53:17 pooka Exp $
+# $NetBSD: mi,v 1.1283 2011/01/26 18:48:11 bouyer Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -1416,6 +1416,7 @@
 ./usr/share/man/cat4/rlphy.0                   man-sys-catman          .cat
 ./usr/share/man/cat4/rmidi.0                   man-sys-catman          .cat
 ./usr/share/man/cat4/rnd.0                     man-sys-catman          .cat
+./usr/share/man/cat4/rdcphy.0                  man-sys-catman          .cat
 ./usr/share/man/cat4/route.0                   man-sys-catman          .cat
 ./usr/share/man/cat4/rs5c372rtc.0              man-sys-catman          .cat
 ./usr/share/man/cat4/rt.0                      man-sys-catman          .cat
@@ -1745,6 +1746,7 @@
 ./usr/share/man/cat4/vmnet.0                   man-sys-catman          .cat
 ./usr/share/man/cat4/vnd.0                     man-sys-catman          .cat
 ./usr/share/man/cat4/vr.0                      man-sys-catman          .cat
+./usr/share/man/cat4/vte.0                     man-sys-catman          .cat
 ./usr/share/man/cat4/wapbl.0                   man-sys-catman          .cat
 ./usr/share/man/cat4/wb.0                      man-sys-catman          .cat
 ./usr/share/man/cat4/wbsio.0                   man-sys-catman          .cat
@@ -4103,6 +4105,7 @@
 ./usr/share/man/html4/rlphy.html               man-sys-htmlman         html
 ./usr/share/man/html4/rmidi.html               man-sys-htmlman         html
 ./usr/share/man/html4/rnd.html                 man-sys-htmlman         html
+./usr/share/man/html4/rdcphy.html              man-sys-htmlman         html
 ./usr/share/man/html4/route.html               man-sys-htmlman         html
 ./usr/share/man/html4/rs5c372rtc.html          man-sys-htmlman         html
 ./usr/share/man/html4/rt.html                  man-sys-htmlman         html
@@ -4418,6 +4421,7 @@
 ./usr/share/man/html4/vmnet.html               man-sys-htmlman         html
 ./usr/share/man/html4/vnd.html                 man-sys-htmlman         html
 ./usr/share/man/html4/vr.html                  man-sys-htmlman         html
+./usr/share/man/html4/vte.html                 man-sys-htmlman         html
 ./usr/share/man/html4/wapbl.html               man-sys-htmlman         html
 ./usr/share/man/html4/wb.html                  man-sys-htmlman         html
 ./usr/share/man/html4/wbsio.html               man-sys-htmlman         html
@@ -6697,6 +6701,7 @@
 ./usr/share/man/man4/rlphy.4                   man-sys-man             .man
 ./usr/share/man/man4/rmidi.4                   man-sys-man             .man
 ./usr/share/man/man4/rnd.4                     man-sys-man             .man
+./usr/share/man/man4/rdcphy.4                  man-sys-man             .man
 ./usr/share/man/man4/route.4                   man-sys-man             .man
 ./usr/share/man/man4/rs5c372rtc.4              man-sys-man             .man
 ./usr/share/man/man4/rt.4                      man-sys-man             .man
@@ -7026,6 +7031,7 @@
 ./usr/share/man/man4/vmnet.4                   man-sys-man             .man
 ./usr/share/man/man4/vnd.4                     man-sys-man             .man
 ./usr/share/man/man4/vr.4                      man-sys-man             .man
+./usr/share/man/man4/vte.4                     man-sys-man             .man
 ./usr/share/man/man4/wapbl.4                   man-sys-man             .man
 ./usr/share/man/man4/wb.4                      man-sys-man             .man
 ./usr/share/man/man4/wbsio.4                   man-sys-man             .man
diff -r 6a4a3427a57f -r b52dcfac2738 share/man/man4/Makefile
--- a/share/man/man4/Makefile   Wed Jan 26 18:43:30 2011 +0000
+++ b/share/man/man4/Makefile   Wed Jan 26 18:48:11 2011 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.547 2011/01/26 11:25:51 nisimura Exp $
+#      $NetBSD: Makefile,v 1.548 2011/01/26 18:48:12 bouyer Exp $
 #      @(#)Makefile    8.1 (Berkeley) 6/18/93
 
 MAN=   aac.4 ac97.4 acardide.4 aceride.4 acphy.4 \
@@ -47,8 +47,8 @@
        piixpm.4 pim.4 plip.4 pms.4 pmu.4 pnaphy.4 ppbus.4 ppp.4 pppoe.4 \
        pseye.4 ptm.4 pty.4 puc.4 pud.4 puffs.4 px.4 pxg.4 \
        qe.4 qec.4 qsphy.4 \
-       raid.4 ral.4 ray.4 rcons.4 re.4 rgephy.4 rlphy.4 rnd.4 route.4 \
-       rs5c372rtc.4 rtk.4 rtw.4 rum.4 \
+       raid.4 ral.4 ray.4 rcons.4 rdcphy.4 re.4 rgephy.4 rlphy.4 rnd.4 \
+       route.4 rs5c372rtc.4 rtk.4 rtw.4 rum.4 \
        satalink.4 sbus.4 scc.4 schide.4 scsi.4 sd.4 se.4 seeprom.4 sem.4 \
        ses.4 sf.4 sfb.4 sgsmix.4 shb.4 shmif.4 \
        shpcic.4 siisata.4 siop.4 sip.4 siside.4 sk.4 sl.4 slide.4 \
@@ -60,7 +60,7 @@
        tp.4 tr.4 tra.4 trm.4 tty.4 tun.4 tqphy.4 twa.4 twe.4 txp.4 \
        uark.4 ubsec.4 udp.4 uep.4 ug.4 uha.4 uk.4 ukphy.4 unix.4 userconf.4 \
        vald.4 veriexec.4 vga.4 vge.4 viaide.4 video.4 virt.4 vlan.4 vmmon.4 \
-       vmnet.4 vnd.4 vr.4 \
+       vmnet.4 vnd.4 vr.4 vte.4 \
        wapbl.4 wb.4 wbsio.4 wd.4 wdc.4 wi.4 wm.4 wpi.4 \
        wscons.4 wsdisplay.4 wsfont.4 wskbd.4 wsmouse.4 wsmux.4 \
        xbox.4 xge.4 \
diff -r 6a4a3427a57f -r b52dcfac2738 share/man/man4/rdcphy.4
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/share/man/man4/rdcphy.4   Wed Jan 26 18:48:11 2011 +0000
@@ -0,0 +1,49 @@
+.\"    $NetBSD: rdcphy.4,v 1.1 2011/01/26 18:48:12 bouyer Exp $
+.\"
+.\" Copyright (c) 1998 The NetBSD Foundation, Inc.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to The NetBSD Foundation
+.\" by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
+.\" NASA Ames Research Center.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+.\" POSSIBILITY OF SUCH DAMAGE.
+.\"
+.Dd January 23, 2011
+.Dt RDCPHY 4
+.Os
+.Sh NAME
+.Nm rdcphy
+.Nd Driver for RDC R6040 Fast Ethernet controller internal PHY
+.Sh SYNOPSIS
+.Cd "rdcphy* at mii? phy ?"
+.Sh DESCRIPTION
+The
+.Nm
+driver supports the internal PHY on RDC R6040 Ethernet interfaces,
+commonly found on Vortex86 System On a Chip (SoC).
+.Sh SEE ALSO
+.Xr ifmedia 4 ,
+.Xr intro 4 ,
+.Xr mii 4 ,
+.Xr vte 4 ,
+.Xr ifconfig 8
diff -r 6a4a3427a57f -r b52dcfac2738 share/man/man4/vte.4
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/share/man/man4/vte.4      Wed Jan 26 18:48:11 2011 +0000
@@ -0,0 +1,90 @@
+.\"     $NetBSD: vte.4,v 1.1 2011/01/26 18:48:12 bouyer Exp $
+.\" Copyright (c) 2010 Pyun YongHyeon
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" FreeBSD: src/share/man/man4/vte.4,v 1.2 2010/12/31 21:52:51 yongari Exp
+.\"
+.Dd January 23, 2011
+.Dt VTE 4
+.Os
+.Sh NAME
+.Nm vte
+.Nd Vortex86 RDC R6040 Fast Ethernet driver
+.Sh SYNOPSIS
+.Cd "vte* at pci? dev ? function ?"
+.Pp
+Configuration of PHYs is necessary.
+See
+.Xr rdcphy 4 .
+.Sh DESCRIPTION
+The
+.Nm
+device driver provides support for RDC R6040 Fast Ethernet controller
+which is commonly found on Vortex86 System On a Chip (SoC).
+.Pp
+The RDC R6040 has integrated 10/100 PHY for 10/100Mbps support in full
+or half-duplex.
+The controller supports interrupt moderation mechanism, a 64-bit multicast
+hash filter, VLAN over-size frame and four station addresses.
+The
+.Nm
+device driver uses three station addresses out of four as perfect
+multicast filter.
+.Sh SYSCTL VARIABLES
+The following variables are available 
+.Bl -tag -width "xxxxxx"
+.It Va hw.vte.vte<x>.int_rxct
+Maximum number of packets to fire RX completion interrupt.
+The accepted range is 0 (disable interrupt moderation) to 15, the default is 0.
+.It Va hw.vte.vte<x>.int_txct
+Maximum number of packets to fire TX completion interrupt.
+The accepted range is 0 (disable interrupt moderation) to 15, the default is 0.
+.El
+.Sh SEE ALSO
+.Xr ifmedia 4 ,
+.Xr mii 4 ,
+.Xr netintro 4 ,
+.Xr vlan 4 ,
+.Xr ifconfig 8
+.Rs
+.%T "DM&P Electronics Inc. Vortex86"
+.%U http://www.dmp.com.tw
+.Re
+.Sh HISTORY
+The
+.Nm
+driver was written for
+.Fx 
+by
+.An Pyun YongHyeon
+.Aq yongari%FreeBSD.org@localhost
+and ported to
+.Nx
+by
+.An Manuel Bouyer
+.Aq bouyer%NetBSD.org@localhost .
+The
+.Nm
+device driver first appeared in
+.Nx 6.0 .
diff -r 6a4a3427a57f -r b52dcfac2738 sys/arch/i386/conf/GENERIC
--- a/sys/arch/i386/conf/GENERIC        Wed Jan 26 18:43:30 2011 +0000
+++ b/sys/arch/i386/conf/GENERIC        Wed Jan 26 18:48:11 2011 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.1008 2011/01/26 00:25:55 pooka Exp $
+# $NetBSD: GENERIC,v 1.1009 2011/01/26 18:48:12 bouyer Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@
 
 options        INCLUDE_CONFIG_FILE     # embed config file in kernel binary
 
-#ident                 "GENERIC-$Revision: 1.1008 $"
+#ident                 "GENERIC-$Revision: 1.1009 $"
 
 maxusers       64              # estimated number of users
 
@@ -989,6 +989,7 @@
 tl*    at pci? dev ? function ?        # ThunderLAN-based Ethernet
 tlp*   at pci? dev ? function ?        # DECchip 21x4x and clones
 txp*   at pci? dev ? function ?        # 3com 3cr990
+vte*   at pci? dev ? function ?        # RDC R6040 10/100 Ethernet
 vge*   at pci? dev ? function ?        # VIATech VT612X Gigabit Ethernet
 vr*    at pci? dev ? function ?        # VIA Rhine Fast Ethernet
 wi*    at pci? dev ? function ?        # Intersil Prism Mini-PCI (802.11b)
@@ -1104,6 +1105,7 @@
 nsphyter* at mii? phy ?                # NS83843 PHYs
 pnaphy* at mii? phy ?                  # generic HomePNA PHYs
 qsphy* at mii? phy ?                   # Quality Semiconductor QS6612 PHYs
+rdcphy*        at mii? phy ?                   # RDC R6040 10/100 PHY
 rgephy* at mii? phy ?                  # Realtek 8169S/8110S internal PHYs
 rlphy* at mii? phy ?                   # Realtek 8139/8201L PHYs
 sqphy* at mii? phy ?                   # Seeq 80220/80221/80223 PHYs
diff -r 6a4a3427a57f -r b52dcfac2738 sys/dev/mii/files.mii
--- a/sys/dev/mii/files.mii     Wed Jan 26 18:43:30 2011 +0000
+++ b/sys/dev/mii/files.mii     Wed Jan 26 18:48:11 2011 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.mii,v 1.47 2010/11/27 20:15:27 christos Exp $
+#      $NetBSD: files.mii,v 1.48 2011/01/26 18:48:12 bouyer Exp $
 
 defflag        opt_mii.h       MIIVERBOSE
 
@@ -141,6 +141,10 @@
 attach ihphy at mii
 file   dev/mii/ihphy.c                         ihphy
 
-device  etphy: mii_phy
-attach  etphy at mii
-file    dev/mii/etphy.c                         etphy
+device etphy: mii_phy
+attach etphy at mii
+file   dev/mii/etphy.c                         etphy
+
+device rdcphy: mii_phy
+attach rdcphy at mii
+file   dev/mii/rdcphy.c                        rdcphy
diff -r 6a4a3427a57f -r b52dcfac2738 sys/dev/mii/rdcphy.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/dev/mii/rdcphy.c      Wed Jan 26 18:48:11 2011 +0000
@@ -0,0 +1,253 @@
+/*      $NetBSD: rdcphy.c,v 1.1 2011/01/26 18:48:12 bouyer Exp $        */
+
+/*-
+ * Copyright (c) 2010, Pyun YongHyeon <yongari%FreeBSD.org@localhost>
+ * All rights reserved.
+ *



Home | Main Index | Thread Index | Old Index