Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Jul 1995 17:38:26 -0700
From:      Robert Minnear <minnear@Ipsilon.COM>
To:        hackers@freebsd.org
Cc:        rem@ginger.lcs.mit.edu
Message-ID:  <199507110038.RAA05068@servo.ipsilon.com>

next in thread | raw e-mail | index | archive | help
The following are diffs I needed to make to get a Znyx ZX342 10/100
board working under FreeBSD.  The two orignal files /sys/pci/dc21040.h
and /sys/pci/if_de.c were taken from the 2.0.5 release.  I hope
these or similar changes can be made to the driver as we would like
to be able to install FreeBSD with these cards.  Which brings me to
one other question.  How could I create a boot/installation floppy
(with for example with these driver changes) myself?  Thanks.

Robert E. Minnear				    minnear@IPSILON.COM
Ipsilon Networks, Inc.                                   (415) 528-4632
2465 Latham Street, Suite 100
Mountain View, CA 94040                           
fax: (415) 528-4653


*** /sys/pci/dc21040.h	Fri May  5 13:09:48 1995
--- dc21040.h	Mon Jul 10 17:20:15 1995
***************
*** 284,289 ****
--- 284,304 ----
  #define	TULIP_OUI_COGENT_1	0x00
  #define	TULIP_OUI_COGENT_2	0x94
  #define	TULIP_COGENT_EM100_ID	0x12
+ 
+ 
+ /*
+  * These are the defintitions used for the Znyx ZX342
+  * 10/100 board
+  */
+ #define	TULIP_GP_ZX34X_PINS	0x0000011F	/* General Purpose Pin directions */
+ #define	TULIP_GP_ZX34X_OK10	0x00000080	/* 10 Mb/sec Signal Detect gep<7> */
+ #define	TULIP_GP_ZX34X_OK100	0x00000040	/* 100 Mb/sec Signal Detect gep<6> */
+ #define	TULIP_GP_ZX34X_INIT	0x00000009	
+ #define	TULIP_OUI_ZNYX_0	0x00
+ #define	TULIP_OUI_ZNYX_1	0xC0
+ #define	TULIP_OUI_ZNYX_2	0x95
+ 
+ 
  /*
   * SROM definitions for the DC21140 and DC21041.
   */
*** /sys/pci/if_de.c	Fri Jun  2 03:44:24 1995
--- if_de.c	Mon Jul 10 17:24:27 1995
***************
*** 207,213 ****
      TULIP_DC21040_GENERIC,
      TULIP_DC21140_DEC_EB,
      TULIP_DC21140_DEC_DE500,
!     TULIP_DC21140_COGENT_EM100
  } tulip_board_t;
  
  typedef struct _tulip_softc_t tulip_softc_t;
--- 207,214 ----
      TULIP_DC21040_GENERIC,
      TULIP_DC21140_DEC_EB,
      TULIP_DC21140_DEC_DE500,
!     TULIP_DC21140_COGENT_EM100,
!     TULIP_DC21140_ZNYX_ZX34X
  } tulip_board_t;
  
  typedef struct _tulip_softc_t tulip_softc_t;
***************
*** 350,355 ****
--- 351,357 ----
      tulip_dc21040_media_select
  };
  
+ 
  static int
  tulip_dc21140_evalboard_media_probe(
      tulip_softc_t * const sc)
***************
*** 436,441 ****
--- 438,493 ----
      tulip_dc21140_cogent_em100_media_select
  };
  
+ 
+ static int
+ tulip_dc21140_znyx_zx34x_media_probe(
+     tulip_softc_t * const sc)
+ {
+     TULIP_WRITE_CSR(sc, csr_gp, TULIP_GP_ZX34X_PINS);
+     TULIP_WRITE_CSR(sc, csr_gp, TULIP_GP_ZX34X_INIT);
+     TULIP_WRITE_CSR(sc, csr_command,
+ 	TULIP_READ_CSR(sc, csr_command) | TULIP_CMD_PORTSELECT |
+ 	TULIP_CMD_PCSFUNCTION | TULIP_CMD_SCRAMBLER | TULIP_CMD_MUSTBEONE);
+     TULIP_WRITE_CSR(sc, csr_command,
+ 	TULIP_READ_CSR(sc, csr_command) & ~TULIP_CMD_TXTHRSHLDCTL);
+     DELAY(1000000);
+ 
+     return (TULIP_READ_CSR(sc, csr_gp) & TULIP_GP_ZX34X_OK10);
+ }
+ 
+ static void
+ tulip_dc21140_znyx_zx34x_media_select(
+     tulip_softc_t * const sc)
+ {
+     sc->tulip_cmdmode |= TULIP_CMD_STOREFWD|TULIP_CMD_MUSTBEONE;
+     TULIP_WRITE_CSR(sc, csr_gp, TULIP_GP_ZX34X_PINS);
+     TULIP_WRITE_CSR(sc, csr_gp, TULIP_GP_ZX34X_INIT);
+     if (sc->tulip_if.if_flags & IFF_ALTPHYS) {
+ 	if ((sc->tulip_flags & TULIP_ALTPHYS) == 0)
+ 	    printf("%s%d: enabling 100baseTX UTP port\n",
+ 		   sc->tulip_if.if_name, sc->tulip_if.if_unit);
+ 	sc->tulip_cmdmode |= TULIP_CMD_PORTSELECT
+ 	    |TULIP_CMD_PCSFUNCTION|TULIP_CMD_SCRAMBLER;
+ 	sc->tulip_cmdmode &= ~TULIP_CMD_TXTHRSHLDCTL;
+ 	sc->tulip_flags |= TULIP_ALTPHYS;
+     } else {
+ 	if (sc->tulip_flags & TULIP_ALTPHYS)
+ 	    printf("%s%d: enabling 10baseT UTP port\n",
+ 		   sc->tulip_if.if_name, sc->tulip_if.if_unit);
+ 	sc->tulip_cmdmode &= ~(TULIP_CMD_PORTSELECT
+ 			       |TULIP_CMD_PCSFUNCTION|TULIP_CMD_SCRAMBLER);
+ 	sc->tulip_cmdmode |= TULIP_CMD_TXTHRSHLDCTL;
+ 	sc->tulip_flags &= ~TULIP_ALTPHYS;
+     }
+ }
+ 
+ static const tulip_boardsw_t tulip_dc21140_znyx_zx34x_boardsw = {
+     TULIP_DC21140_ZNYX_ZX34X,
+     "Znyx ZX34X ",
+     tulip_dc21140_znyx_zx34x_media_probe,
+     tulip_dc21140_znyx_zx34x_media_select
+ };
+ 
  static int
  tulip_dc21140_de500_media_probe(
      tulip_softc_t * const sc)
***************
*** 1237,1242 ****
--- 1289,1300 ----
  		&& sc->tulip_hwaddr[2] == TULIP_OUI_COGENT_2) {
  	    if (sc->tulip_rombuf[32] == TULIP_COGENT_EM100_ID)
  		sc->tulip_boardsw = &tulip_dc21140_cogent_em100_boardsw;
+ 	}
+ 	if (sc->tulip_hwaddr[0] == TULIP_OUI_ZNYX_0
+ 		&& sc->tulip_hwaddr[1] == TULIP_OUI_ZNYX_1
+ 		&& sc->tulip_hwaddr[2] == TULIP_OUI_ZNYX_2) {
+ 	    /* this at least works for the zx342 from Znyx */
+ 	    sc->tulip_boardsw = &tulip_dc21140_znyx_zx34x_boardsw;
  	}
      }
  





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199507110038.RAA05068>