Support following devices:
- on board 2nd CCU - Midori Elec. MDC-926Rs - Midori-Hayes ESP98 - NEC PC-9861K, PC-9801-101 PC-9801-120 - Melco IND-SP and IND-SS - PIO-9032A/B/C - B98-01 and B98-02 - IO-data device RSA-98II and RSA-98III - MC-16550 - MC-RS98 - Media Inteligent RSB-2000/3000 and RSB-384 - PCMCIA modem card Submitted by: Takahashi Yoshihiro <nyan@wyvern.cc.kogakuin.ac.jp>
This commit is contained in:
parent
468764485d
commit
0f0d2d450c
@ -26,7 +26,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id$
|
||||
* $Id: esp.h,v 1.3 1997/02/22 09:38:00 peter Exp $
|
||||
*/
|
||||
|
||||
#ifndef _IC_ESP_H_
|
||||
@ -39,8 +39,13 @@
|
||||
/*
|
||||
* CMD1 and CMD2 are the command ports, offsets from <esp_iobase>.
|
||||
*/
|
||||
#ifdef PC98
|
||||
#define ESP_CMD1 0x400
|
||||
#define ESP_CMD2 0x500
|
||||
#else
|
||||
#define ESP_CMD1 4
|
||||
#define ESP_CMD2 5
|
||||
#endif
|
||||
|
||||
/*
|
||||
* STAT1 and STAT2 are to get return values and status bytes;
|
||||
@ -59,6 +64,9 @@
|
||||
#define ESP_SETFLOWTYPE 0x08 /* set type of flow-control (2 bytes) */
|
||||
#define ESP_SETRXFLOW 0x0a /* set Rx FIFO flow control levels (4 bytes) */
|
||||
#define ESP_SETMODE 0x10 /* set board mode (1 byte) */
|
||||
#ifdef PC98
|
||||
#define ESP_SETCLOCK 0x23 /* set UART clock prescaler */
|
||||
#endif
|
||||
|
||||
/* Mode bits (ESP_SETMODE). */
|
||||
#define ESP_MODE_FIFO 0x02 /* act like a 16550 (compatibility mode) */
|
||||
|
@ -31,25 +31,12 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)ns16550.h 7.1 (Berkeley) 5/9/91
|
||||
* $Id$
|
||||
* $Id: ns16550.h,v 1.5 1997/02/22 09:38:05 peter Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
* NS16550 UART registers
|
||||
*/
|
||||
#ifdef PC98
|
||||
#define com_data 0x000 /* data register (R/W) */
|
||||
#define com_dlbl 0x000 /* divisor latch low (W) */
|
||||
#define com_dlbh 0x100 /* divisor latch high (W) */
|
||||
#define com_ier 0x100 /* interrupt enable (W) */
|
||||
#define com_iir 0x200 /* interrupt identification (R) */
|
||||
#define com_fifo 0x200 /* FIFO control (W) */
|
||||
#define com_lctl 0x300 /* line control register (R/W) */
|
||||
#define com_cfcr 0x300 /* line control register (R/W) */
|
||||
#define com_mcr 0x400 /* modem control register (R/W) */
|
||||
#define com_lsr 0x500 /* line status register (R/W) */
|
||||
#define com_msr 0x600 /* modem status register (R/W) */
|
||||
#else /* IBM-PC */
|
||||
#define com_data 0 /* data register (R/W) */
|
||||
#define com_dlbl 0 /* divisor latch low (W) */
|
||||
#define com_dlbh 1 /* divisor latch high (W) */
|
||||
@ -61,4 +48,108 @@
|
||||
#define com_mcr 4 /* modem control register (R/W) */
|
||||
#define com_lsr 5 /* line status register (R/W) */
|
||||
#define com_msr 6 /* modem status register (R/W) */
|
||||
|
||||
#ifdef PC98
|
||||
#define com_emr com_msr /* Extension mode register for RSB-2000/3000. */
|
||||
|
||||
/* I/O-DATA RSA Serise Exrension Register */
|
||||
#define rsa_msr 0 /* Mode Status Register (R/W) */
|
||||
#define rsa_ier 1 /* Interrupt Enable Register (R/W) */
|
||||
#define rsa_srr 2 /* Status Read Register (R) */
|
||||
#define rsa_frr 2 /* FIFO Reset Register (W) */
|
||||
#define rsa_tivsr 3 /* Timer Interval Value Set Register (R/W) */
|
||||
#define rsa_tcr 4 /* Timer Control Register (W) */
|
||||
|
||||
/*
|
||||
* RSA-98III RSA Mode Driver Data Sheet
|
||||
*
|
||||
* <<Register Map>>
|
||||
* Base + 0x00
|
||||
* Mode Select Register(Read/Write)
|
||||
* bit4=interrupt type(1: level, 0: edge)
|
||||
* bit3=Auto RTS-CTS Flow Control Enable
|
||||
* bit2=External FIFO Enable
|
||||
* bit1=Reserved(Default 0)Don't Change!!
|
||||
* bit0=Swap Upper 8byte and Lower 8byte in 16byte space.
|
||||
*
|
||||
* Base + 0x01
|
||||
* Interrupt Enable Register(Read/Write)
|
||||
* bit4=Hardware Timer Interrupt Enable
|
||||
* bit3=Character Time-Out Interrupt Enable
|
||||
* bit2=Tx FIFO Empty Interrupt Enable
|
||||
* bit1=Tx FIFO Half Full Interrupt Enable
|
||||
* bit0=Rx FIFO Half Full Interrupt Enable
|
||||
*
|
||||
* Base + 0x02
|
||||
* Status Read Register(Read)
|
||||
* bit7=Hardware Time Out Interrupt Status(1: True, 0: False)
|
||||
* bit6=Character Time Out Interrupt Status
|
||||
* bit5=Rx FIFO Full Flag(0: True, 1: False)
|
||||
* bit4=Rx FIFO Half Full Flag
|
||||
* bit3=Rx FIFO Empty Flag
|
||||
* bit2=Tx FIFO Full Flag
|
||||
* bit1=Tx FIFO Half Full Flag
|
||||
* bit0=Tx FIFO Empty Flag
|
||||
*
|
||||
* Base + 0x02
|
||||
* FIFO Reset Register(Write)
|
||||
* Reset Extrnal FIFO
|
||||
*
|
||||
* Base + 0x03
|
||||
* Timer Interval Value Set Register(Read/Write)
|
||||
* Range of n: 1-255
|
||||
* Interval Value: n * 0.2ms
|
||||
*
|
||||
* Base + 0x04
|
||||
* Timer Control Register(Read/Write)
|
||||
* bit0=Timer Enable
|
||||
*
|
||||
* Base + 0x08 - 0x0f
|
||||
* Same as UART 16550
|
||||
*
|
||||
* Special Regisgter in RSA Mode
|
||||
* UART Data Register(Base + 0x08)
|
||||
* Data transfer between Extrnal FIFO
|
||||
*
|
||||
* UART MCR(Base + 0x0c)
|
||||
* bit3(OUT2[MCR_IENABLE])=1: Diable 16550 to Rx FIFO transfer
|
||||
* bit2(OUT1[MCR_DRS])=1: Diable Tx FIFO to 16550 transfer
|
||||
*
|
||||
* <<Intrrupt and Intrrupt Reset>>
|
||||
* o Reciver Line Status(from UART16550)
|
||||
* Reset: Read LSR
|
||||
*
|
||||
* o Modem Status(from UART16550)
|
||||
* Reset: Read MSR
|
||||
*
|
||||
* o Rx FIFO Half Full(from Extrnal FIFO)
|
||||
* Reset: Read Rx FIFO under Hall Full
|
||||
*
|
||||
* o Character Time Out(from Extrnal FIFO)
|
||||
* Reset: Read Rx FIFO or SRR
|
||||
*
|
||||
* o Tx FIFO Empty(from Extrnal FIFO)
|
||||
* Reset: Write Tx FIFO or Read SRR
|
||||
*
|
||||
* o Tx FIFO Half Full(from Extrnal FIFO)
|
||||
* Reset: Write Tx FIFO until Hall Full or Read SRR
|
||||
*
|
||||
* o Hardware Timer(from Extrnal FIFO)
|
||||
* Reset: Disable Timer in TCR
|
||||
* Notes: If you want to use Timer for next intrrupt,
|
||||
* you must enable Timer in TCR
|
||||
*
|
||||
* <<Used Setting>>
|
||||
* Auto RTS-CTS: Enable or Disable
|
||||
* External FIFO: Enable
|
||||
* Swap 8bytes: Disable
|
||||
* Haredware Timer: Disable
|
||||
* interrupt type: edge
|
||||
* interrupt source:
|
||||
* Hareware Timer
|
||||
* Character Time Out
|
||||
* Tx FIFO Empty
|
||||
* Rx FIFO Half Full
|
||||
*
|
||||
*/
|
||||
#endif /* PC98 */
|
||||
|
@ -31,12 +31,15 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)comreg.h 7.2 (Berkeley) 5/9/91
|
||||
* $Id: sioreg.h,v 1.9 1997/06/04 04:52:40 pst Exp $
|
||||
* $Id: sioreg.h,v 1.10 1997/06/04 16:25:15 pst Exp $
|
||||
*/
|
||||
|
||||
|
||||
/* 16 bit baud rate divisor (lower byte in dca_data, upper in dca_ier) */
|
||||
#define COMBRD(x) (1843200 / (16*(x)))
|
||||
#ifdef PC98
|
||||
#define COMBRD_RSA(x) (14745600 / (16*(x)))
|
||||
#endif
|
||||
|
||||
/* interrupt enable register */
|
||||
#define IER_ERXRDY 0x1
|
||||
@ -106,6 +109,16 @@
|
||||
#define MSR_DDSR 0x02
|
||||
#define MSR_DCTS 0x01
|
||||
|
||||
#ifdef PC98
|
||||
/* Hardware extension mode register for RSB-2000/3000. */
|
||||
#define EMR_EXBUFF 0x04
|
||||
#define EMR_CTSFLW 0x08
|
||||
#define EMR_DSRFLW 0x10
|
||||
#define EMR_RTSFLW 0x20
|
||||
#define EMR_DTRFLW 0x40
|
||||
#define EMR_EFMODE 0x80
|
||||
#endif
|
||||
|
||||
/* speed to initialize to during chip tests */
|
||||
#define SIO_TEST_SPEED 9600
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $Id: Makefile,v 1.19 1998/09/15 14:08:34 kato Exp $
|
||||
# $Id: Makefile,v 1.20 1998/11/23 07:34:37 kato Exp $
|
||||
#
|
||||
|
||||
PROG= boot
|
||||
@ -16,7 +16,8 @@ CFLAGS+= ${CWARNFLAGS}
|
||||
|
||||
# By default, if a serial port is going to be used as console, use COM1
|
||||
# (aka /dev/ttyd0).
|
||||
BOOT_COMCONSOLE_PORT?=0x30
|
||||
#BOOT_COMCONSOLE_PORT?=0x30
|
||||
BOOT_COMCONSOLE_PORT?=0x238
|
||||
BOOT_COMCONSOLE_CLK?=16
|
||||
BOOT_COMCONSOLE_MODE=0x0c
|
||||
CFLAGS+= -DCOMCONSOLE=${BOOT_COMCONSOLE_PORT} \
|
||||
@ -24,8 +25,8 @@ CFLAGS+= -DCOMCONSOLE=${BOOT_COMCONSOLE_PORT} \
|
||||
-DCOMCONSOLE_MODE=${BOOT_COMCONSOLE_MODE}
|
||||
|
||||
# feature not implemented
|
||||
# BOOT_COMCONSOLE_SPEED?=9600
|
||||
# CFLAGS+= -DCONSPEED=${BOOT_COMCONSOLE_SPEED}
|
||||
BOOT_COMCONSOLE_SPEED?=9600
|
||||
CFLAGS+= -DCONSPEED=${BOOT_COMCONSOLE_SPEED}
|
||||
|
||||
# Enable code to take the default boot string from a fixed location on the
|
||||
# disk. See nextboot(8) and README.386BSD for more info.
|
||||
|
@ -24,7 +24,7 @@
|
||||
* the rights to redistribute these changes.
|
||||
*
|
||||
* from: Mach, Revision 2.2 92/04/04 11:34:26 rpd
|
||||
* $Id: serial.S,v 1.6 1997/07/14 12:34:01 kato Exp $
|
||||
* $Id: serial.S,v 1.7 1998/01/02 09:29:15 kato Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -65,17 +65,16 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
* ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#if COMCONSOLE == 0x238
|
||||
#include "../../../i386/boot/biosboot/serial.S"
|
||||
#else
|
||||
/*
|
||||
* modified for PC-98 by KATO T. of Nagoya University
|
||||
*/
|
||||
|
||||
.file "serial.S"
|
||||
|
||||
#ifdef PC98
|
||||
#include <pc98/pc98/sioreg.h>
|
||||
#else
|
||||
#include <i386/isa/sioreg.h>
|
||||
#endif
|
||||
#include "asm.h"
|
||||
|
||||
.text
|
||||
@ -199,3 +198,4 @@ ENTRY(init_serial)
|
||||
outb %al, %dx
|
||||
|
||||
ret
|
||||
#endif
|
||||
|
1311
sys/pc98/cbus/sio.c
1311
sys/pc98/cbus/sio.c
File diff suppressed because it is too large
Load Diff
1311
sys/pc98/pc98/sio.c
1311
sys/pc98/pc98/sio.c
File diff suppressed because it is too large
Load Diff
@ -1,119 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 1991 The Regents of the University of California.
|
||||
* 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. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. 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 BY THE REGENTS AND CONTRIBUTORS ``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 THE REGENTS OR CONTRIBUTORS 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.
|
||||
*
|
||||
* from: @(#)comreg.h 7.2 (Berkeley) 5/9/91
|
||||
* $Id: sioreg.h,v 1.6 1997/06/04 10:27:53 kato Exp $
|
||||
*/
|
||||
|
||||
|
||||
/* 16 bit baud rate divisor (lower byte in dca_data, upper in dca_ier) */
|
||||
#if defined(PC98)
|
||||
#define COMBRD(x) (7372800 / (16*(x)))
|
||||
#else
|
||||
#define COMBRD(x) (1843200 / (16*(x)))
|
||||
#endif
|
||||
|
||||
/* interrupt enable register */
|
||||
#define IER_ERXRDY 0x1
|
||||
#define IER_ETXRDY 0x2
|
||||
#define IER_ERLS 0x4
|
||||
#define IER_EMSC 0x8
|
||||
|
||||
/* interrupt identification register */
|
||||
#define IIR_IMASK 0xf
|
||||
#define IIR_RXTOUT 0xc
|
||||
#define IIR_RLS 0x6
|
||||
#define IIR_RXRDY 0x4
|
||||
#define IIR_TXRDY 0x2
|
||||
#define IIR_NOPEND 0x1
|
||||
#define IIR_MLSC 0x0
|
||||
#define IIR_FIFO_MASK 0xc0 /* set if FIFOs are enabled */
|
||||
|
||||
/* fifo control register */
|
||||
#define FIFO_ENABLE 0x01
|
||||
#define FIFO_RCV_RST 0x02
|
||||
#define FIFO_XMT_RST 0x04
|
||||
#define FIFO_DMA_MODE 0x08
|
||||
#define FIFO_RX_LOW 0x00
|
||||
#define FIFO_RX_MEDL 0x40
|
||||
#define FIFO_RX_MEDH 0x80
|
||||
#define FIFO_RX_HIGH 0xc0
|
||||
|
||||
/* character format control register */
|
||||
#define CFCR_DLAB 0x80
|
||||
#define CFCR_SBREAK 0x40
|
||||
#define CFCR_PZERO 0x30
|
||||
#define CFCR_PONE 0x20
|
||||
#define CFCR_PEVEN 0x10
|
||||
#define CFCR_PODD 0x00
|
||||
#define CFCR_PENAB 0x08
|
||||
#define CFCR_STOPB 0x04
|
||||
#define CFCR_8BITS 0x03
|
||||
#define CFCR_7BITS 0x02
|
||||
#define CFCR_6BITS 0x01
|
||||
#define CFCR_5BITS 0x00
|
||||
|
||||
/* modem control register */
|
||||
#define MCR_LOOPBACK 0x10
|
||||
#define MCR_IENABLE 0x08
|
||||
#define MCR_DRS 0x04
|
||||
#define MCR_RTS 0x02
|
||||
#define MCR_DTR 0x01
|
||||
|
||||
/* line status register */
|
||||
#define LSR_RCV_FIFO 0x80
|
||||
#define LSR_TSRE 0x40
|
||||
#define LSR_TXRDY 0x20
|
||||
#define LSR_BI 0x10
|
||||
#define LSR_FE 0x08
|
||||
#define LSR_PE 0x04
|
||||
#define LSR_OE 0x02
|
||||
#define LSR_RXRDY 0x01
|
||||
#define LSR_RCV_MASK 0x1f
|
||||
|
||||
/* modem status register */
|
||||
#define MSR_DCD 0x80
|
||||
#define MSR_RI 0x40
|
||||
#define MSR_DSR 0x20
|
||||
#define MSR_CTS 0x10
|
||||
#define MSR_DDCD 0x08
|
||||
#define MSR_TERI 0x04
|
||||
#define MSR_DDSR 0x02
|
||||
#define MSR_DCTS 0x01
|
||||
|
||||
/* speed to initialize to during chip tests */
|
||||
#define SIO_TEST_SPEED 9600
|
||||
|
||||
/* default serial console speed if not set with sysctl or probed from boot */
|
||||
#ifndef CONSPEED
|
||||
#define CONSPEED 9600
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user