1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-19 02:29:40 +00:00

Add the Cyclades serial driver code (ALPHA) from Andrew Werple and

adapted to FreeBSD by Heikki Suonsivu <hsu@cs.hut.fi>.
Submitted by:	Andrew Werple <andrew@werple.apana.org.au> and
		Heikki Suonsivu <hsu@cs.hut.fi>
Obtained from:	NetBSD
This commit is contained in:
Jordan K. Hubbard 1995-02-09 09:47:31 +00:00
parent 0ba70b00c0
commit cfc9f6212d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=6261
10 changed files with 5301 additions and 5 deletions

View File

@ -2,7 +2,7 @@
# LINT -- config file for checking all the sources, tries to pull in
# as much of the source tree as it can.
#
# $Id: LINT,v 1.135 1995/02/05 10:56:45 jkh Exp $
# $Id: LINT,v 1.136 1995/02/06 23:19:47 jkh Exp $
#
# NB: You probably don't want to try running a kernel built from this
# file. Instead, you should start from GENERIC, and add options from
@ -448,6 +448,7 @@ options FDSEEKWAIT="16"
# mse: Logitech and ATI InPort bus mouse ports
# psm: PS/2 mouse port (needs ALLOW_CONFLICT_IOADDR, above)
# sio: serial ports (see sio(4))
# cy: Cyclades high-speed serial driver (ALPHA QUALITY!)
# gp: National Instruments AT-GPIB and AT-GPIB/TNT board
# gsc: Genius GS-4500 hand scanner.
# joy: joystick
@ -459,6 +460,7 @@ device sio0 at isa? port "IO_COM1" tty irq 4 vector siointr
device gp0 at isa? port 0x2c0 tty
device gsc0 at isa? port "IO_GSC1" tty drq 3
device joy0 at isa? port "IO_GAME"
device cy0 at isa? tty irq 10 iomem 0xd4000 vector cyintr
# Options for sio:
options COMCONSOLE #prefer serial console to video console

View File

@ -1,7 +1,7 @@
# This file tells config what files go into building a kernel,
# files marked standard are always included.
#
# $Id: files.i386,v 1.77 1995/02/01 23:02:24 se Exp $
# $Id: files.i386,v 1.78 1995/02/06 23:19:49 jkh Exp $
#
i386/apm/apm.c optional apm device-driver
i386/apm/apm_setup.s optional apm
@ -64,6 +64,7 @@ i386/isa/clock.c standard
i386/isa/cronyx.c optional cx device-driver
i386/isa/ctx.c optional ctx device-driver
i386/isa/cx.c optional cx device-driver
i386/isa/cy.c optional cy device-driver
i386/isa/diskslice_machdep.c optional diskslice
i386/isa/fd.c optional fd device-driver
i386/isa/ft.c optional ft device-driver

1682
sys/dev/cy/cy.c Normal file

File diff suppressed because it is too large Load Diff

1682
sys/dev/cy/cy_isa.c Normal file

File diff suppressed because it is too large Load Diff

121
sys/dev/ic/cd1400.h Normal file
View File

@ -0,0 +1,121 @@
/*
* cyclades cyclom-y serial driver
* Andrew Herbert <andrew@werple.apana.org.au>, 17 August 1993
*
* Copyright (c) 1993 Andrew Herbert.
* 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.
* 3. The name Andrew Herbert may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY ``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 I 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.
*/
#define CD1400_NO_OF_CHANNELS 4 /* four serial channels per chip */
#define CD1400_FIFOSIZE 12 /* 12 chars */
/* register definitions */
#define CD1400_CCR 2*0x05 /* channel control */
#define CD1400_CMD_RESET 0x81 /* full reset */
#define CD1400_SRER 2*0x06 /* service request enable */
#define CD1400_GFRCR 2*0x40 /* global firmware revision code */
#define CD1400_LIVR 2*0x18 /* local intr vector */
#define CD1400_MIVR 2*0x41 /* modem intr vector */
#define CD1400_TIVR 2*0x42 /* transmit intr vector */
#define CD1400_RIVR 2*0x43 /* receive intr vector */
#define CD1400_RIVR_EXCEPTION (1<<2) /* receive exception bit */
#define CD1400_RICR 2*0x44 /* receive intr channel */
#define CD1400_TICR 2*0x45 /* transmit intr channel */
#define CD1400_MICR 2*0x46 /* modem intr channel */
#define CD1400_RDCR 2*0x0e /* rx data count */
#define CD1400_EOSRR 2*0x60 /* end of service request */
#define CD1400_RDSR 2*0x62 /* rx data/status */
#define CD1400_RDSR_OVERRUN (1<<0) /* rx overrun error */
#define CD1400_RDSR_FRAMING (1<<1) /* rx framing error */
#define CD1400_RDSR_PARITY (1<<2) /* rx parity error */
#define CD1400_RDSR_BREAK (1<<3) /* rx break */
#define CD1400_RDSR_SPECIAL (7<<4) /* rx special char */
#define CD1400_RDSR_SPECIAL_SHIFT 4 /* rx special char shift */
#define CD1400_RDSR_TIMEOUT (1<<7) /* rx timeout */
#define CD1400_TDR 2*0x63 /* tx data */
#define CD1400_MISR 2*0x4c /* modem intr status */
#define CD1400_MISR_DSRd (1<<7) /* DSR delta */
#define CD1400_MISR_CTSd (1<<6) /* CTS delta */
#define CD1400_MISR_RId (1<<5) /* RI delta */
#define CD1400_MISR_CDd (1<<4) /* CD delta */
#define CD1400_MSVR 2*0x6d /* modem signals */
#define CD1400_MSVR_DSR (1<<7) /* !DSR line */
#define CD1400_MSVR_CTS (1<<6) /* !CTS line */
#define CD1400_MSVR_RI (1<<5) /* !RI line */
#define CD1400_MSVR_CD (1<<4) /* !CD line */
#define CD1400_MSVR_DTR (1<<1) /* DTR line */
#define CD1400_DTR 2*0x6d /* dtr control */
#define CD1400_DTR_CLEAR 0
#define CD1400_DTR_SET (1<<1)
#define CD1400_PPR 2*0x7e
#define CD1400_CLOCK_25_1MS 0x31
#define CD1400_CAR 2*0x68 /* channel access */
#define CD1400_RIR 2*0x6B /* receive interrupt status */
#define CD1400_TIR 2*0x6A /* transmit interrupt status */
#define CD1400_MIR 2*0x69 /* modem interrupt status */
#define CD1400_RBPR 2*0x78 /* receive baud rate period */
#define CD1400_RCOR 2*0x7C /* receive clock option */
#define CD1400_TBPR 2*0x72 /* transmit baud rate period */
#define CD1400_TCOR 2*0x76 /* transmit clock option */
#define CD1400_COR1 2*0x08 /* channel option 1 */
#define CD1400_COR2 2*0x09 /* channel option 2 */
#define CD1400_COR3 2*0x0A /* channel option 3 */
#define CD1400_COR4 2*0x1E /* channel option 4 */
#define CD1400_COR5 2*0x1F /* channel option 5 */
#define CD1400_SCHR1 2*0x1A /* special character 1 */
#define CD1400_SCHR2 2*0x1B /* special character 2 */
#define CD1400_SCHR3 2*0x1C /* special character 3 */
#define CD1400_SCHR4 2*0x1D /* special character 4 */
#define CD1400_MCOR1 2*0x15 /* modem change 1 */
#define CD1400_MCOR2 2*0x16 /* modem change 2 */
#define CD1400_RTPR 2*0x21 /* receive timeout period */
#define CD1400_SVRR 2*0x67 /* service request */
#define CD1400_SVRR_RX (1<<0)
#define CD1400_SVRR_TX (1<<1)
#define CD1400_SVRR_MDM (1<<2)
/* hardware SVCACK addresses, for use in interrupt handlers */
#define CD1400_SVCACKR 0x100
#define CD1400_SVCACKT 0x200
#define CD1400_SVCACKM 0x300

View File

@ -2,7 +2,7 @@
# LINT -- config file for checking all the sources, tries to pull in
# as much of the source tree as it can.
#
# $Id: LINT,v 1.135 1995/02/05 10:56:45 jkh Exp $
# $Id: LINT,v 1.136 1995/02/06 23:19:47 jkh Exp $
#
# NB: You probably don't want to try running a kernel built from this
# file. Instead, you should start from GENERIC, and add options from
@ -448,6 +448,7 @@ options FDSEEKWAIT="16"
# mse: Logitech and ATI InPort bus mouse ports
# psm: PS/2 mouse port (needs ALLOW_CONFLICT_IOADDR, above)
# sio: serial ports (see sio(4))
# cy: Cyclades high-speed serial driver (ALPHA QUALITY!)
# gp: National Instruments AT-GPIB and AT-GPIB/TNT board
# gsc: Genius GS-4500 hand scanner.
# joy: joystick
@ -459,6 +460,7 @@ device sio0 at isa? port "IO_COM1" tty irq 4 vector siointr
device gp0 at isa? port 0x2c0 tty
device gsc0 at isa? port "IO_GSC1" tty drq 3
device joy0 at isa? port "IO_GAME"
device cy0 at isa? tty irq 10 iomem 0xd4000 vector cyintr
# Options for sio:
options COMCONSOLE #prefer serial console to video console

View File

@ -2,7 +2,7 @@
# LINT -- config file for checking all the sources, tries to pull in
# as much of the source tree as it can.
#
# $Id: LINT,v 1.135 1995/02/05 10:56:45 jkh Exp $
# $Id: LINT,v 1.136 1995/02/06 23:19:47 jkh Exp $
#
# NB: You probably don't want to try running a kernel built from this
# file. Instead, you should start from GENERIC, and add options from
@ -448,6 +448,7 @@ options FDSEEKWAIT="16"
# mse: Logitech and ATI InPort bus mouse ports
# psm: PS/2 mouse port (needs ALLOW_CONFLICT_IOADDR, above)
# sio: serial ports (see sio(4))
# cy: Cyclades high-speed serial driver (ALPHA QUALITY!)
# gp: National Instruments AT-GPIB and AT-GPIB/TNT board
# gsc: Genius GS-4500 hand scanner.
# joy: joystick
@ -459,6 +460,7 @@ device sio0 at isa? port "IO_COM1" tty irq 4 vector siointr
device gp0 at isa? port 0x2c0 tty
device gsc0 at isa? port "IO_GSC1" tty drq 3
device joy0 at isa? port "IO_GAME"
device cy0 at isa? tty irq 10 iomem 0xd4000 vector cyintr
# Options for sio:
options COMCONSOLE #prefer serial console to video console

View File

@ -1,7 +1,7 @@
# This file tells config what files go into building a kernel,
# files marked standard are always included.
#
# $Id: files.i386,v 1.77 1995/02/01 23:02:24 se Exp $
# $Id: files.i386,v 1.78 1995/02/06 23:19:49 jkh Exp $
#
i386/apm/apm.c optional apm device-driver
i386/apm/apm_setup.s optional apm
@ -64,6 +64,7 @@ i386/isa/clock.c standard
i386/isa/cronyx.c optional cx device-driver
i386/isa/ctx.c optional ctx device-driver
i386/isa/cx.c optional cx device-driver
i386/isa/cy.c optional cy device-driver
i386/isa/diskslice_machdep.c optional diskslice
i386/isa/fd.c optional fd device-driver
i386/isa/ft.c optional ft device-driver

1682
sys/i386/isa/cy.c Normal file

File diff suppressed because it is too large Load Diff

121
sys/i386/isa/ic/cd1400.h Normal file
View File

@ -0,0 +1,121 @@
/*
* cyclades cyclom-y serial driver
* Andrew Herbert <andrew@werple.apana.org.au>, 17 August 1993
*
* Copyright (c) 1993 Andrew Herbert.
* 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.
* 3. The name Andrew Herbert may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY ``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 I 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.
*/
#define CD1400_NO_OF_CHANNELS 4 /* four serial channels per chip */
#define CD1400_FIFOSIZE 12 /* 12 chars */
/* register definitions */
#define CD1400_CCR 2*0x05 /* channel control */
#define CD1400_CMD_RESET 0x81 /* full reset */
#define CD1400_SRER 2*0x06 /* service request enable */
#define CD1400_GFRCR 2*0x40 /* global firmware revision code */
#define CD1400_LIVR 2*0x18 /* local intr vector */
#define CD1400_MIVR 2*0x41 /* modem intr vector */
#define CD1400_TIVR 2*0x42 /* transmit intr vector */
#define CD1400_RIVR 2*0x43 /* receive intr vector */
#define CD1400_RIVR_EXCEPTION (1<<2) /* receive exception bit */
#define CD1400_RICR 2*0x44 /* receive intr channel */
#define CD1400_TICR 2*0x45 /* transmit intr channel */
#define CD1400_MICR 2*0x46 /* modem intr channel */
#define CD1400_RDCR 2*0x0e /* rx data count */
#define CD1400_EOSRR 2*0x60 /* end of service request */
#define CD1400_RDSR 2*0x62 /* rx data/status */
#define CD1400_RDSR_OVERRUN (1<<0) /* rx overrun error */
#define CD1400_RDSR_FRAMING (1<<1) /* rx framing error */
#define CD1400_RDSR_PARITY (1<<2) /* rx parity error */
#define CD1400_RDSR_BREAK (1<<3) /* rx break */
#define CD1400_RDSR_SPECIAL (7<<4) /* rx special char */
#define CD1400_RDSR_SPECIAL_SHIFT 4 /* rx special char shift */
#define CD1400_RDSR_TIMEOUT (1<<7) /* rx timeout */
#define CD1400_TDR 2*0x63 /* tx data */
#define CD1400_MISR 2*0x4c /* modem intr status */
#define CD1400_MISR_DSRd (1<<7) /* DSR delta */
#define CD1400_MISR_CTSd (1<<6) /* CTS delta */
#define CD1400_MISR_RId (1<<5) /* RI delta */
#define CD1400_MISR_CDd (1<<4) /* CD delta */
#define CD1400_MSVR 2*0x6d /* modem signals */
#define CD1400_MSVR_DSR (1<<7) /* !DSR line */
#define CD1400_MSVR_CTS (1<<6) /* !CTS line */
#define CD1400_MSVR_RI (1<<5) /* !RI line */
#define CD1400_MSVR_CD (1<<4) /* !CD line */
#define CD1400_MSVR_DTR (1<<1) /* DTR line */
#define CD1400_DTR 2*0x6d /* dtr control */
#define CD1400_DTR_CLEAR 0
#define CD1400_DTR_SET (1<<1)
#define CD1400_PPR 2*0x7e
#define CD1400_CLOCK_25_1MS 0x31
#define CD1400_CAR 2*0x68 /* channel access */
#define CD1400_RIR 2*0x6B /* receive interrupt status */
#define CD1400_TIR 2*0x6A /* transmit interrupt status */
#define CD1400_MIR 2*0x69 /* modem interrupt status */
#define CD1400_RBPR 2*0x78 /* receive baud rate period */
#define CD1400_RCOR 2*0x7C /* receive clock option */
#define CD1400_TBPR 2*0x72 /* transmit baud rate period */
#define CD1400_TCOR 2*0x76 /* transmit clock option */
#define CD1400_COR1 2*0x08 /* channel option 1 */
#define CD1400_COR2 2*0x09 /* channel option 2 */
#define CD1400_COR3 2*0x0A /* channel option 3 */
#define CD1400_COR4 2*0x1E /* channel option 4 */
#define CD1400_COR5 2*0x1F /* channel option 5 */
#define CD1400_SCHR1 2*0x1A /* special character 1 */
#define CD1400_SCHR2 2*0x1B /* special character 2 */
#define CD1400_SCHR3 2*0x1C /* special character 3 */
#define CD1400_SCHR4 2*0x1D /* special character 4 */
#define CD1400_MCOR1 2*0x15 /* modem change 1 */
#define CD1400_MCOR2 2*0x16 /* modem change 2 */
#define CD1400_RTPR 2*0x21 /* receive timeout period */
#define CD1400_SVRR 2*0x67 /* service request */
#define CD1400_SVRR_RX (1<<0)
#define CD1400_SVRR_TX (1<<1)
#define CD1400_SVRR_MDM (1<<2)
/* hardware SVCACK addresses, for use in interrupt handlers */
#define CD1400_SVCACKR 0x100
#define CD1400_SVCACKT 0x200
#define CD1400_SVCACKM 0x300