Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Dec 1995 01:21:57 +0200
From:      Heikki Suonsivu <hsu@clinet.fi>
To:        Michael Smith <msmith@atrad.adelaide.edu.au>
Cc:        hackers@freebsd.org
Subject:   Re: Cyclades 32-port card, cy/cyb drivers
Message-ID:  <199512252321.BAA29093@plentium.clinet.fi>
In-Reply-To: Michael Smith's message of 23 Dec 1995 10:01:11 %2B0200
References:  <199512230756.SAA22017@genesis.atrad.adelaide.edu.au>

next in thread | previous in thread | raw e-mail | index | archive | help

   I'm trying to get one of these cards (Cyclom-32Y) up and working under
   either the cy or cyb drivers and 2.1R.

   Brian's web page advertises the fact that several sites are using this driver
   in a 'production' environment, but Brian is impossible to nail down to work
   on the problem.

   The 'cy' driver is not necessarily known to work with this card...

   If _anyone_ out there has one of these cards working, I'd love to hear
   from you; I don't want to bore the list to death just yet with gory details
   when I can't be sure that we're not doing something trivial and stupid.

I just hacked this together.  Please notice that you need a config line

# Allow 32 port cyclades boards
options "CY_MAX_CD1400s=8"

to enable 32 ports.  You can't put more than one 32 port board in, and you
can't use the same kernel for configurations with multiple smaller boards,
as there are not enough minor numbers available.

I have been running this in production for 2 days so don't expect too much
for stability.  It crashed once during that time, but it did not generate a
core dump.  I don't know yet whether it is related to cy patches or just
ordinary every couple-of-days panic most freebsd systems here do all the
time, as the load is quite low for holidays.


*** sys/i386/isa/cy.c.orig	Fri Dec 22 17:57:20 1995
--- sys/i386/isa/cy.c	Tue Dec 26 00:43:38 1995
***************
*** 149,159 ****
  
  /* We encode the cyclom unit number (cyu) in spare bits in the IVR's. */
  #define	CD1400_xIVR_CHAN_SHIFT	3
! #define	CD1400_xIVR_CHAN	0x0F	/* XXX reduce to pack Cyclom-8Ys */
  
  #define	LOTS_OF_EVENTS	64	/* helps separate urgent events from input */
  #define	RB_I_HIGH_WATER	(TTYHOG - 2 * RS_IBUFSIZE)
  #define	RS_IBUFSIZE	256
  
  #define	CALLOUT_MASK		0x80
  #define	CONTROL_MASK		0x60
--- 149,161 ----
  
  /* We encode the cyclom unit number (cyu) in spare bits in the IVR's. */
  #define	CD1400_xIVR_CHAN_SHIFT	3
! #define	CD1400_xIVR_CHAN	0x1F	/* XXX reduce to pack Cyclom-8Ys */
  
  #define	LOTS_OF_EVENTS	64	/* helps separate urgent events from input */
  #define	RB_I_HIGH_WATER	(TTYHOG - 2 * RS_IBUFSIZE)
+ #ifndef RS_IBUFSIZE
  #define	RS_IBUFSIZE	256
+ #endif
  
  #define	CALLOUT_MASK		0x80
  #define	CONTROL_MASK		0x60
***************
*** 453,461 ****
  	int	cyu;
  	u_char	firmware_version;
  	cy_addr	iobase;
  	int	unit;
  
! 	iobase = (cy_addr)dev->id_maddr;
  	unit = dev->id_unit;
  	if ((u_int)unit >= NCY)
  		return (0);
--- 455,464 ----
  	int	cyu;
  	u_char	firmware_version;
  	cy_addr	iobase;
+ 	cy_addr cy_iobase;
  	int	unit;
  
! 	cy_iobase = (cy_addr)dev->id_maddr;
  	unit = dev->id_unit;
  	if ((u_int)unit >= NCY)
  		return (0);
***************
*** 464,478 ****
  
  
  	/* Cyclom-16Y hardware reset (Cyclom-8Ys don't care) */
! 	cy_inb(iobase, CY16_RESET);	/* XXX? */
  	DELAY(500);	/* wait for the board to get its act together */
  
  	/* this is needed to get the board out of reset */
! 	cy_outb(iobase, CY_CLEAR_INTR, 0);
  	DELAY(500);
  
! 	for (cyu = 0; cyu < CY_MAX_CD1400s;
! 	    ++cyu, iobase += CY_CD1400_MEMSIZE) {
  		int	i;
  
  		/* wait for chip to become ready for new command */
--- 467,483 ----
  
  
  	/* Cyclom-16Y hardware reset (Cyclom-8Ys don't care) */
! 	cy_inb(cy_iobase, CY16_RESET);	/* XXX? */
  	DELAY(500);	/* wait for the board to get its act together */
  
  	/* this is needed to get the board out of reset */
! 	cy_outb(cy_iobase, CY_CLEAR_INTR, 0);
  	DELAY(500);
  
! 	for (cyu = 0, iobase = cy_iobase; cyu < CY_MAX_CD1400s;
! 	    ++cyu, (cyu == 4
! 		    ? (iobase = cy_iobase + CY_CD1400_MEMSIZE / 2)
! 		    : (iobase += CY_CD1400_MEMSIZE))) {
  		int	i;
  
  		/* wait for chip to become ready for new command */
***************
*** 534,540 ****
  	cy_iobase = (cy_addr)isdp->id_maddr;
  	unit *= CY_MAX_PORTS;
  	for (cyu = 0, iobase = cy_iobase; cyu < ncyu;
! 	     ++cyu, iobase += CY_CD1400_MEMSIZE) {
  		int	cdu;
  
  		/* Set up a receive timeout period of than 1+ ms. */
--- 539,547 ----
  	cy_iobase = (cy_addr)isdp->id_maddr;
  	unit *= CY_MAX_PORTS;
  	for (cyu = 0, iobase = cy_iobase; cyu < ncyu;
! 	     ++cyu, (cyu == 4
! 		     ? (iobase = cy_iobase + CY_CD1400_MEMSIZE / 2)
! 		     : (iobase += CY_CD1400_MEMSIZE))) {
  		int	cdu;
  
  		/* Set up a receive timeout period of than 1+ ms. */
***************
*** 1036,1042 ****
  
  	/* check each CD1400 in turn */
  	for (cyu = 0, iobase = cy_iobase; cyu < cy_nr_cd1400s[unit];
! 	     ++cyu, iobase += CY_CD1400_MEMSIZE) {
  		/* poll to see if it has any work */
  		status = cd_inb(iobase, CD1400_SVRR);
  		if (status == 0)
--- 1043,1051 ----
  
  	/* check each CD1400 in turn */
  	for (cyu = 0, iobase = cy_iobase; cyu < cy_nr_cd1400s[unit];
! 	     ++cyu, (cyu == 4
! 		     ? (iobase = cy_iobase + CY_CD1400_MEMSIZE / 2)
! 		     : (iobase += CY_CD1400_MEMSIZE))) {
  		/* poll to see if it has any work */
  		status = cd_inb(iobase, CD1400_SVRR);
  		if (status == 0)
*** sys/i386/isa/cyreg.h.orig	Tue Dec 26 00:35:55 1995
--- sys/i386/isa/cyreg.h	Tue Dec 26 00:47:08 1995
***************
*** 40,46 ****
--- 40,48 ----
  #define	CY16_RESET		0x1400
  #define	CY_CLEAR_INTR		0x1800	/* intr ack address */
  
+ #ifndef CY_MAX_CD1400s
  #define	CY_MAX_CD1400s		4	/* for Cyclom-16Y */
+ #endif
  
  #define	CY_CLOCK		25000000	/* baud rate clock */
  
-- 
Heikki Suonsivu, T{ysikuu 10 C 83/02210 Espoo/FINLAND,
hsu@clinet.fi  work +358-0-4375209 fax -4555276 home -8031121



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