* Copyright (c) 1988 University of Utah.
* Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
* This code is derived from software contributed to Berkeley by
* the Systems Programming Group of the University of Utah Computer
* Redistribution is only permitted until one year after the first shipment
* of 4.4BSD by the Regents. Otherwise, redistribution and use in source and
* binary forms are permitted provided that: (1) source distributions retain
* this entire copyright notice and comment, and (2) distributions including
* binaries display the following acknowledgement: This product includes
* software developed by the University of California, Berkeley and its
* contributors'' in the documentation or other materials provided with the
* distribution and in all advertising materials mentioning features or use
* of this software. Neither the name of the University nor the names of
* its contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
* from: Utah $Hdr: dcmreg.h 1.3 89/08/23$
* @(#)dcmreg.h 7.3 (Berkeley) 6/22/90
struct dcmdevice
{ /* host address, only odd bytes addressed */
volatile u_char dcm_rsid
; /* Reset / ID 0001 */
volatile u_char dcm_ic
; /* Interrupt control register 0003 */
volatile u_char dcm_sem
; /* Semaphore register 0005 */
u_char dcm_pad3
[0x7ffa]; /* Unaddressable 0006-7fff */
volatile u_char dcm_iir
; /* Interrupt ident register 8001 */
volatile u_char dcm_cr
; /* Command register 8003 */
u_char dcm_pad6
[0x3fc]; /* Card scratch 8004-83ff */
volatile u_char data_char
;
volatile u_char data_stat
;
} dcm_rfifos
[4][0x80]; /* Receive queues 8400 */
volatile u_char data_data
;
} dcm_bmap
[0x100]; /* Bitmap table 8c00 */
} dcm_rhead
[4]; /* Fifo head - receive 8e00 */
} dcm_rtail
[4]; /* Fifo tail - receive 8e08 */
} dcm_thead
[4]; /* Fifo head - transmit 8e10 */
} dcm_ttail
[4]; /* Fifo tail - transmit 8e18 */
volatile u_char dcm_conf
;
volatile u_char dcm_baud
;
} dcm_data
[4]; /* Configuration registers 8e20 */
volatile u_char dcm_mdmin
; /* Modem in 8e31 */
volatile u_char dcm_mdmout
; /* Modem out 8e33 */
volatile u_char dcm_mdmmsk
; /* Modem mask 8e35 */
volatile u_char dcm_data
;
} dcm_cmdtab
[4]; /* Command tables 8e36 */
volatile u_char dcm_data
;
} dcm_icrtab
[4]; /* Interrupt data 8e3e */
volatile u_char dcm_stcon
; /* Self test condition 8e47 */
u_char dcm_pad11
[0x98]; /* Undef SR regs 8e48-8edf */
volatile u_char data_char
;
} dcm_tfifos
[4][0x10]; /* Transmit queues 8ee0 */
* Overlay structure for port specific queue "registers".
* Starts at offset 0x8E00+(port*2).
volatile u_char r_head
; /* +01 */
u_char pad1
[7]; /* +02 */
volatile u_char r_tail
; /* +09 */
u_char pad2
[7]; /* +0A */
volatile u_char t_head
; /* +11 */
u_char pad3
[7]; /* +12 */
volatile u_char t_tail
; /* +19 */
#define dcm_preg(d, p) ((struct dcmpreg *)((u_int)(d)+0x8e00+(p)*2))
#define DCMCON 0x80 /* REMOTE/LOCAL switch, read */
#define DCMID 0x5 /* hardwired card id, read */
#define DCMRS 0x80 /* software reset, write */
#define DCMIPL(x) ((((x) >> 4) & 3) + 3) /* interupt level, read */
#define IC_IR 0x40 /* interupt request, read */
#define IC_IE 0x80 /* interupt enable, write */
#define IC_ID 0x00 /* interupt disable, write */
#define SEM_BSY 0x80 /* read */
#define SEM_CLR 0xFF /* write */
#define SEM_LOCK(dcm) while ((dcm)->dcm_sem & SEM_BSY)
#define SEM_UNLOCK(dcm) (dcm)->dcm_sem = SEM_CLR
#define CR_MODM 0x10 /* change modem output lines */
#define CR_TIMER 0x20 /* 16ms interrupt timer toggle */
#define CR_SELFT 0x40 /* run self test */
/* interrupt ident register */
#define IIR_SELFT 0x10 /* self test completed */
#define IIR_MODM 0x20 /* change in modem input lines */
#define IIR_TIMEO 0x40 /* Time out */
/* Line configuration register */
/* modem input register */
/* modem output register */
#define MO_ON ((MO_DTR) | (MO_RTS))
/* cmd-tab values, write */
#define CT_CON 0x1 /* configuration change */
#define CT_TX 0x2 /* transmit buffer not empty */
#define CT_BRK 0x4 /* toggle BREAK */
/* icr-tab values, read */
#define IT_TX 0x1 /* transmit buffer empty */
#define IT_SPEC 0x2 /* special character received */
/* Transmit/Receive masks */
* WARNING: Serial console is assumed to be the lowest select-code card
* and that card must be logical unit 0 in the kernel. Also, CONUNIT must
* be 1, the port affected by the REMOTE/LOCAL switch.