Add support for NWB-231A 4-port RS-232C card.

This commit is contained in:
tsubai 1998-06-05 14:19:22 +00:00
parent 780f7fcf6f
commit 26eb9abb32
5 changed files with 78 additions and 72 deletions

View File

@ -1,7 +1,7 @@
#
# NEWS3400 config file
#
# $NetBSD: GENERIC,v 1.4 1998/04/30 14:16:13 tsubai Exp $
# $NetBSD: GENERIC,v 1.5 1998/06/05 14:19:22 tsubai Exp $
#
include "arch/newsmips/conf/std.newsmips"
@ -60,12 +60,21 @@ options FIFO # POSIX fifo support (in all filesystems)
# Networking options
options INET # Internet protocols
options TCP_COMPAT_42 # compatibility with 4.2BSD TCP/IP
#options GATEWAY # IP packet forwarding
#options MROUTING # packet forwarding of multicast packets
options NS # Xerox NS networking
#options NSIP # Xerox NS tunneling over IP
#options ISO,TPIP # OSI networking
#options EON # OSI tunneling over IP
#options CCITT,LLC,HDLC # X.25
#options PFIL_HOOKS # pfil(9) packet filter hooks.
options NETATALK # AppleTalk (over Ethernet) protocol
#options PPP_BSDCOMP # BSD-Compress compression support for PPP
#options PPP_DEFLATE # Deflate compression support for PPP
#options PPP_FILTER # Active filter support for PPP (requires bpf)
#options PFIL_HOOKS # pfil(9) packet filter hooks
#options IPFILTER_LOG # ipmon(8) log support
#options TCP_COMPAT_42 # compatibility with 4.2BSD TCP/IP
config netbsd root on ? type ?
@ -82,9 +91,15 @@ le0 at hb0 addr 0xbff80000 # onboard LANCE ethernet
kb0 at hb0 addr 0xbfd00000 # keyboard
ms0 at hb0 addr 0xbfd00004 # mouse
zsc0 at hb0 addr 0xbfec0000
zstty0 at zsc0 channel 0 flags 0x01 # tty00
zstty1 at zsc0 channel 1 flags 0x01 # tty01
zsc0 at hb0 addr 0xbfec0000 # onboard
#zsc1 at hb0 addr 0xb8c40100
#zsc2 at hb0 addr 0xb8c40104
zstty0 at zsc0 channel 0 # tty00
zstty1 at zsc0 channel 1 # tty01
#zstty2 at zsc1 channel 0 # tty02
#zstty3 at zsc1 channel 1 # tty03
#zstty4 at zsc2 channel 0 # tty04
#zstty5 at zsc2 channel 1 # tty05
fb0 at hb0 addr 0x88000000 # framebuffer

View File

@ -1,7 +1,7 @@
#
# NEWS3400 config file
#
# $NetBSD: WAPIKO,v 1.3 1998/04/30 14:16:13 tsubai Exp $
# $NetBSD: WAPIKO,v 1.4 1998/06/05 14:19:22 tsubai Exp $
#
include "arch/newsmips/conf/std.newsmips"
@ -14,14 +14,15 @@ options CPU_SINGLE
# Standard system options
options KTRACE # system call tracing support
options NKMEMCLUSTERS=1024 # 4K pages in kernel malloc pool
#options NTP # network time protocol
#options UCONSOLE # users can redirect console (unsafe)
options UVM
# Debugging options
options DDB # kernel dynamic debugger
options DDB_HISTORY_SIZE=100 # enable history editing in DDB
#options DEBUG # extra kernel debugging support
#options DIAGNOSTIC # extra kernel sanity checking
options DIAGNOSTIC # extra kernel sanity checking
options SCSIVERBOSE # Verbose SCSI errors
# Compatibility options
@ -40,12 +41,10 @@ options FIFO # POSIX fifo support (in all filesystems)
# Networking options
options INET # Internet protocols
#options PFIL_HOOKS # pfil(9) packet filter hooks.
#options IPFILTER_LOG # /dev/ipl
options IPALLOWSRCRT=0
#options IPMTUDISC
options PFIL_HOOKS # pfil(9) packet filter hooks
options IPFILTER_LOG # ipmon(8) log support
config netbsd root on ? type ?
config netbsd root on ? type ?
mainbus0 at root
@ -60,23 +59,28 @@ le0 at hb0 addr 0xbff80000 # onboard LANCE ethernet
kb0 at hb0 addr 0xbfd00000 # keyboard
ms0 at hb0 addr 0xbfd00004 # mouse
zsc0 at hb0 addr 0xbfec0000
zstty0 at zsc0 channel 0 flags 0x01 # tty00
zstty1 at zsc0 channel 1 flags 0x01 # tty01
zsc0 at hb0 addr 0xbfec0000 # onboard
zsc1 at hb0 addr 0xb8c40100
zsc2 at hb0 addr 0xb8c40104
zstty0 at zsc0 channel 0 # tty00
zstty1 at zsc0 channel 1 # tty01
zstty2 at zsc1 channel 0 # tty02
zstty3 at zsc1 channel 1 # tty03
zstty4 at zsc2 channel 0 # tty04
zstty5 at zsc2 channel 1 # tty05
fb0 at hb0 addr 0x88000000 # framebuffer
sc0 at hb0 addr 0xbfe00100 # onboard cxd1185 SCSI controller
scsibus0 at sc0
sd* at scsibus? target ? lun ? # SCSI disks
#st* at scsibus? target ? lun ? # SCSI tapes
#cd* at scsibus? target ? lun ? # SCSI CD-ROMs
#pseudo-device vnd 4 # disk-like interface to files
#pseudo-device ccd 4 # concatenated and striped disks
pseudo-device loop # loopback interface; required
pseudo-device pty 32 # pseudo-terminals
pseudo-device bpfilter 16 # Berkeley Packet Filter
#pseudo-device vnd 4 # disk-like interface to files
#pseudo-device ccd 4 # concatenated and striped disks
#pseudo-device ipfilter # ip filter
pseudo-device ipfilter # ip filter

View File

@ -1,3 +1,4 @@
/* $NetBSD: hb.c,v 1.2 1998/06/05 14:19:22 tsubai Exp $ */
#include <sys/param.h>
#include <sys/systm.h>
@ -8,6 +9,7 @@
static int hb_match __P((struct device *, struct cfdata *, void *));
static void hb_attach __P((struct device *, struct device *, void *));
static int hb_search __P((struct device *, struct cfdata *, void *));
static int hb_print __P((void *, const char *));
struct cfattach hb_ca = {
@ -55,11 +57,27 @@ hb_attach(parent, self, aux)
while (*p) {
ca.ca_name = *p;
config_found(self, &ca, hb_print);
config_search(hb_search, self, &ca);
p++;
}
}
static int
hb_search(parent, cf, aux)
struct device *parent;
struct cfdata *cf;
void *aux;
{
struct confargs *ca = aux;
ca->ca_addr = cf->cf_addr;
if ((*cf->cf_attach->ca_match)(parent, cf, ca) != 0)
config_attach(parent, cf, ca, hb_print);
return 0;
}
/*
* Print out the confargs. The (parent) name is non-NULL
* when there was no match found by config_found().
@ -69,18 +87,14 @@ hb_print(args, name)
void *args;
const char *name;
{
#if 0
struct confargs *ca = args;
#endif
/* Be quiet about empty HB locations. */
if (name)
return(QUIET);
#if 0
if (ca->ca_addr != -1)
printf(" addr 0x%x", ca->ca_addr);
#endif
return(UNCONF);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: zs.c,v 1.1 1998/02/18 13:48:14 tsubai Exp $ */
/* $NetBSD: zs.c,v 1.2 1998/06/05 14:19:22 tsubai Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -86,7 +86,8 @@ int zs_major = 1;
/*
* The news3400 provides a 4.9152 MHz clock to the ZS chips.
*/
#define PCLK (9600 * 512) /* PCLK pin input clock rate */
#define PCLK1 (9600 * 512) /* PCLK pin input clock rate */
#define PCLK2 (7200 * 512)
/*
* Define interrupt levels.
@ -106,23 +107,13 @@ struct zsdevice {
struct zschan zs_chan_a;
};
/* Saved PROM mappings */
static struct zsdevice *zsaddr[NZS] = {
(void *)SCCPORT0B,
(void *)SCCPORT1B,
};
static struct zsdevice *zsaddr[NZS];
/* Flags from cninit() */
static int zs_hwflags[NZS][2];
/* Default speed for each channel */
static int zs_defspeed[NZS][2] = {
{ 9600, /* tty00 */
9600 }, /* tty01 */
{ 9600, /* tty10 */
9600 }, /* tty11 */
};
/* Default speed for all channels */
static int zs_defspeed = 9600;
static u_char zs_init_reg[16] = {
0, /* 0: CMD (reset, etc.) */
@ -201,10 +192,9 @@ zs_match(parent, cf, aux)
if (strcmp(ca->ca_name, "zsc"))
return 0;
/* Make sure zs_init() found mappings. */
va = zsaddr[unit];
if (va == NULL)
return 0;
va = zsaddr[unit] = (void *)cf->cf_addr;
/* This returns -1 on a fault (bus error). */
if (badaddr(va, 1))
@ -249,7 +239,10 @@ zs_attach(parent, self, aux)
cs->cs_channel = channel;
cs->cs_private = NULL;
cs->cs_ops = &zsops_null;
cs->cs_brg_clk = PCLK / 16;
if (zs_unit == 0)
cs->cs_brg_clk = PCLK1 / 16;
else
cs->cs_brg_clk = PCLK2 / 16;
zc = zs_get_chan_addr(zs_unit, channel);
cs->cs_reg_csr = &zc->zc_csr;
@ -263,7 +256,7 @@ zs_attach(parent, self, aux)
if (zsc_args.hwflags & ZS_HWFLAG_CONSOLE)
cs->cs_defspeed = zs_get_speed(cs);
else
cs->cs_defspeed = zs_defspeed[zs_unit][channel];
cs->cs_defspeed = zs_defspeed;
cs->cs_defcflag = zs_def_cflag;
/* Make these correspond to cs_defcflag (-crtscts) */
@ -364,7 +357,7 @@ zshard(arg)
/* We are at splzs here, so no need to lock. */
if (softreq && (zssoftpending == 0)) {
zssoftpending = 1;
timeout(zssoft, arg, 1); /*isr_soft_request(ZSSOFT_PRI);*/
zssoft(arg); /*isr_soft_request(ZSSOFT_PRI);*/
}
return;
}
@ -564,6 +557,7 @@ void
zs_abort(cs)
struct zs_chanstate *cs;
{
Debugger();
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.h,v 1.1 1998/02/18 13:48:15 tsubai Exp $ */
/* $NetBSD: autoconf.h,v 1.2 1998/06/05 14:19:22 tsubai Exp $ */
/*
* Copyright (c) 1994, 1995 Carnegie-Mellon University.
@ -33,29 +33,10 @@
struct confargs;
/* Handle device interrupt for given unit of a driver */
typedef void* intr_arg_t; /* pointer to some softc */
typedef int (*intr_handler_t) __P((intr_arg_t));
/*
* XXX Establish interrupt on an arbitrary decstation/decsystem bus.
*/
extern void
generic_intr_establish __P(( void * parent, void * cookie,
int level,
intr_handler_t handler, intr_arg_t arg));
#define KN02_ASIC_NAME "KN02 " /* ROM name in 3max system slot */
#define INTR_ESTABLISH(parent, cookie, level, handler, val) \
generic_intr_establish((parent), (cookie), (level), (handler), (val))
#define BUS_INTR_ESTABLISH(ca, handler, val) \
generic_intr_establish( ((struct device*)(val))->dv_parent, \
(void*)(ca)->ca_slotpri, 0, (handler), (val))
struct confargs {
char *ca_name; /* Device name. */
@ -65,10 +46,8 @@ struct confargs {
int ca_slotpri; /* Device interrupt "priority" */
};
extern caddr_t baseboard_cvtaddr __P((struct confargs *)); /*XXX*/
/* Locator aliases */
#define cf_addr cf_loc[0]
#ifndef pmax
void set_clockintr __P((void (*)(struct clockframe *)));
#endif
void set_iointr __P((void (*)(void *, int)));
int badaddr __P((void *, u_int));
int badaddr __P((void *, u_int));
void configure __P((void));