From owner-freebsd-hackers Mon Dec 25 15:15:32 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id PAA05917 for hackers-outgoing; Mon, 25 Dec 1995 15:15:32 -0800 (PST) Received: from hauki.clinet.fi (root@hauki.clinet.fi [194.100.0.1]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id PAA05910 for ; Mon, 25 Dec 1995 15:15:29 -0800 (PST) Received: from plentium.clinet.fi (plentium.clinet.fi [194.100.0.7]) by hauki.clinet.fi (8.6.12/8.6.4) with ESMTP id BAA19201; Tue, 26 Dec 1995 01:15:17 +0200 Received: (hsu@localhost) by plentium.clinet.fi (8.6.12/8.6.4) id BAA29093; Tue, 26 Dec 1995 01:21:57 +0200 Date: Tue, 26 Dec 1995 01:21:57 +0200 Message-Id: <199512252321.BAA29093@plentium.clinet.fi> From: Heikki Suonsivu To: Michael Smith Cc: hackers@freebsd.org In-reply-to: Michael Smith's message of 23 Dec 1995 10:01:11 +0200 Subject: Re: Cyclades 32-port card, cy/cyb drivers Organization: Clinet Ltd, Espoo, Finland References: <199512230756.SAA22017@genesis.atrad.adelaide.edu.au> Sender: owner-hackers@freebsd.org Precedence: bulk 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