From owner-freebsd-bugs Fri Jun 18 7:50: 5 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 9C2541543D for ; Fri, 18 Jun 1999 07:50:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id HAA68254; Fri, 18 Jun 1999 07:50:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from amalthea.watson.org (adsl-151-200-24-159.bellatlantic.net [151.200.24.159]) by hub.freebsd.org (Postfix) with ESMTP id 4506814CA9 for ; Fri, 18 Jun 1999 07:45:44 -0700 (PDT) (envelope-from robert@amalthea.watson.org) Received: (from robert@localhost) by amalthea.watson.org (8.9.3/8.9.3) id KAA20824; Fri, 18 Jun 1999 10:45:19 -0400 (EDT) (envelope-from robert) Message-Id: <199906181445.KAA20824@amalthea.watson.org> Date: Fri, 18 Jun 1999 10:45:19 -0400 (EDT) From: robert@fledge.watson.org Reply-To: robert+freebsd@cyrus.watson.org To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: kern/12275: lnc support for AMD home phone line networking chipset Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 12275 >Category: kern >Synopsis: Patches to add support for new chipset >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Fri Jun 18 07:50:00 PDT 1999 >Closed-Date: >Last-Modified: >Originator: Robert Watson >Release: FreeBSD 4.0-CURRENT i386 >Organization: >Environment: 4.0-CURRENT >Description: AMD has released a chipset that supports ethernet over phone wire at about a megabit. Diamond and others have cards based on this; I had to twiddle some registers and add probe lines for the chipset to get it to work. >How-To-Repeat: >Fix: Please add a comment to the top of if_lnc.c indicating that any questions about support for this chipset may be directed to me at robert+freebsd@cyrus.watson.org Apparently the card suffers from interference from power lines running near phone lines; I'm not sure how much of this is a product of my local configuration. I'm currently adding more code to a local copy of the driver to try and switch the power mode and speed of the card to see if that helps, and am interested in any feedback that might help improve support for this chipset. Thanks. Patches: Index: if_lnc.c =================================================================== RCS file: /home/ncvs/src/sys/i386/isa/if_lnc.c,v retrieving revision 1.60 diff -u -r1.60 if_lnc.c --- if_lnc.c 1999/05/09 23:24:47 1.60 +++ if_lnc.c 1999/06/03 15:27:03 @@ -151,6 +151,7 @@ "PCnet-PCI II", "PCnet-FAST", "PCnet-FAST+", + "PCnet-Home", }; static void lnc_setladrf __P((struct lnc_softc *sc)); @@ -1192,7 +1193,13 @@ return (PCnet_FAST); case Am79C972: return (PCnet_FASTplus); + case Am79C978: + return (PCnet_Home); default: + if (bootverbose) + printf("pcnet_probe: unknown PCnet " + "type (%lx)\n", chip_id & + PART_MASK); break; } } @@ -1360,6 +1367,9 @@ } } else { + if (bootverbose) + printf("lnc_attach_ne2100_pci: sc->nic.ic = " + "%d, too low\n", sc->nic.ident); free(sc, M_DEVBUF); sc = NULL; } @@ -1490,6 +1500,24 @@ sc->pending_transmits = 0; /* Give the LANCE the physical address of the initialisation block */ + + if (sc->nic.ic == PCnet_Home) { + u_short media; + /* Set PHY_SEL to HomeRun */ +#ifdef DIAGNOSTIC + printf("lnc_init: setting PCnet_Home-specific register\n"); +#endif + media = read_bcr(sc, BCR49); +#ifdef DIAGNOSTIC + printf("lnc_init: old value %u\n", (u_int) media); +#endif + media &= ~3; + media |= 1; +#ifdef DIAGNOSTIC + printf("lnc_init: new value %u\n", (u_int) media); +#endif + write_bcr(sc, BCR49, media); + } write_csr(sc, CSR1, kvtop(sc->init_block)); write_csr(sc, CSR2, (kvtop(sc->init_block) >> 16) & 0xff); Index: if_lnc.h =================================================================== RCS file: /home/ncvs/src/sys/i386/isa/if_lnc.h,v retrieving revision 1.10 diff -u -r1.10 if_lnc.h --- if_lnc.h 1999/01/31 00:56:32 1.10 +++ if_lnc.h 1999/05/30 05:35:55 @@ -107,6 +107,7 @@ #define PCnet_PCI_II 8 /* Am79C970A */ #define PCnet_FAST 9 /* Am79C971 */ #define PCnet_FASTplus 10 /* Am79C972 */ +#define PCnet_Home 11 /* Am79C978 */ /* CSR88-89: Chip ID masks */ #define AMD_MASK 0x003 @@ -119,6 +120,7 @@ #define Am79C970A 0x2621 #define Am79C971 0x2623 #define Am79C972 0x2624 +#define Am79C978 0x2626 /* Board types */ #define UNKNOWN 0 Index: ic/Am7990.h =================================================================== RCS file: /home/ncvs/src/sys/i386/isa/ic/Am7990.h,v retrieving revision 1.2 diff -u -r1.2 Am7990.h --- Am7990.h 1995/05/30 08:03:30 1.2 +++ Am7990.h 1999/05/30 21:02:47 @@ -21,6 +21,7 @@ #define CSR1 1 #define CSR2 2 #define CSR3 3 +#define BCR49 49 #define CSR88 88 #define CSR89 89 >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message