Second part of cdev_decl() migration. Declare cputype variable.

Add config info for a12 switch driver and console driver.
This commit is contained in:
ross 1998-03-02 08:04:04 +00:00
parent 41a61f7c9e
commit 03169f0089
4 changed files with 74 additions and 15 deletions

View File

@ -1,7 +1,7 @@
/* $NetBSD: avalon_a12.c,v 1.2 1998/01/31 10:55:42 ross Exp $ */
/* $NetBSD: avalon_a12.c,v 1.3 1998/03/02 08:04:04 ross Exp $ */
/* [Notice revision 2.0]
* Copyright (c) 1997 Avalon Computer Systems, Inc.
/* [Notice revision 2.2]
* Copyright (c) 1997, 1998 Avalon Computer Systems, Inc.
* All rights reserved.
*
* Author: Ross Harvey
@ -25,7 +25,7 @@
* THIS SOFTWARE IS PROVIDED BY AVALON COMPUTER SYSTEMS, INC. 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 FOUNDATION OR CONTRIBUTORS
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL AVALON OR THE 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
@ -64,7 +64,7 @@
#include "opt_avalon_a12.h" /* Config options headers */
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: avalon_a12.c,v 1.2 1998/01/31 10:55:42 ross Exp $");
__KERNEL_RCSID(0, "$NetBSD: avalon_a12.c,v 1.3 1998/03/02 08:04:04 ross Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -75,6 +75,7 @@ __KERNEL_RCSID(0, "$NetBSD: avalon_a12.c,v 1.2 1998/01/31 10:55:42 ross Exp $");
#include <machine/rpb.h>
#include <machine/autoconf.h>
#include <machine/conf.h>
#include <machine/prom.h>
#include <dev/pci/pcireg.h>
#include <dev/pci/pcivar.h>
@ -86,9 +87,20 @@ __KERNEL_RCSID(0, "$NetBSD: avalon_a12.c,v 1.2 1998/01/31 10:55:42 ross Exp $");
#include <dev/scsipi/scsipi_all.h>
#include <dev/scsipi/scsiconf.h>
#include "a12dc.h"
#if NA12DC
#include "a12dcreg.h"
#endif
#ifdef __never
#define AVALON_A12() /* Generate ctags(1) key */
#endif
void avalon_a12_init __P((void));
static void avalon_a12_cons_init __P((void));
static void avalon_a12_device_register __P((struct device *, void *));
static int a12env __P((int));
void
avalon_a12_init()
@ -98,11 +110,38 @@ avalon_a12_init()
platform.iobus = "a12c";
platform.cons_init = avalon_a12_cons_init;
platform.device_register = avalon_a12_device_register;
a12_cpu_local = a12env(A12CONS_CPU_LOCAL); /* our switch port */
a12_cpu_ether = a12env(A12CONS_CPU_ETHER); /* route to outside world */
a12_cpu_global= a12env(A12CONS_CPU_GLOBAL);/* loc in the big picture */
a12_intr_register_icw(NULL);
}
/*
* We _could_ get these configuration parameters directly from the
* detached console, and thereby nuke yet another deprecated prom
* call.
*/
static int
a12env(code)
int code;
{
int q;
char string[16];
prom_getenv(code, string, sizeof(string));
string[sizeof(string)-1] = '\0';
q = string[0] - '0';
if (string[0] && string[1] >= '0')
q = q*10 + string[1] - '0';
return q;
}
void
avalon_a12_cons_init()
{
#if NA12DC
a12dccnattach();
#endif
}
void

View File

@ -1,4 +1,4 @@
/* $NetBSD: conf.c,v 1.29 1998/02/13 02:09:03 cgd Exp $ */
/* $NetBSD: conf.c,v 1.30 1998/03/02 08:04:04 ross Exp $ */
/*-
* Copyright (c) 1991 The Regents of the University of California.
@ -37,7 +37,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: conf.c,v 1.29 1998/02/13 02:09:03 cgd Exp $");
__KERNEL_RCSID(0, "$NetBSD: conf.c,v 1.30 1998/03/02 08:04:04 ross Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -47,6 +47,8 @@ __KERNEL_RCSID(0, "$NetBSD: conf.c,v 1.29 1998/02/13 02:09:03 cgd Exp $");
#include <sys/conf.h>
#include <sys/vnode.h>
#include <machine/conf.h>
#include <vm/vm.h> /* XXX for _PMAP_MAY_USE_PROM_CONSOLE */
#include "fdc.h"
@ -133,8 +135,6 @@ cdev_decl(st);
cdev_decl(cd);
#include "ch.h"
cdev_decl(ch);
#include "scc.h"
cdev_decl(scc);
#include "audio.h"
cdev_decl(audio);
#include "wscons.h"
@ -157,9 +157,8 @@ cdev_decl(wd);
#include "satlink.h"
cdev_decl(satlink);
#ifdef _PMAP_MAY_USE_PROM_CONSOLE
cdev_decl(prom); /* XXX XXX XXX */
#endif
#include "a12dc.h"
#include "scc.h"
#include "se.h"
#include "rnd.h"
@ -210,6 +209,7 @@ struct cdevsw cdevsw[] =
cdev_se_init(NSE,se), /* 37: Cabletron SCSI<->Ethernet */
cdev_satlink_init(NSATLINK,satlink), /* 38: planetconnect satlink */
cdev_rnd_init(NRND,rnd), /* 39: random source pseudo-device */
cdev_tty_init(NA12DC,a12dc), /* 40: Avalon A12 detached console */
};
int nchrdev = sizeof (cdevsw) / sizeof (cdevsw[0]);

View File

@ -1,4 +1,4 @@
# $NetBSD: files.alpha,v 1.63 1998/02/16 22:12:45 thorpej Exp $
# $NetBSD: files.alpha,v 1.64 1998/03/02 08:04:04 ross Exp $
#
# alpha-specific configuration info
@ -248,7 +248,7 @@ file arch/alpha/pci/cia_pci.c cia
file arch/alpha/pci/cia_swiz_bus_io.c cia
file arch/alpha/pci/cia_swiz_bus_mem.c cia
device a12c: pcibus
device a12c { }: pcibus
attach a12c at mainbus
file arch/alpha/pci/a12c.c a12c
file arch/alpha/pci/a12c_bus_mem.c a12c
@ -313,6 +313,22 @@ device ade: ether, ifnet, arp
attach ade at pci
file arch/alpha/pci/if_ade.c ade
#
# alpha/a12 platform-specific drivers
#
# Switch
device xb
attach xb at a12c
file arch/alpha/a12/if_xb.c xb
# Console
device a12dc
attach a12dc at a12c
file arch/alpha/a12/a12dc.c a12dc needs-flag
#
# Devices that can live on multiple busses
#

View File

@ -1,4 +1,4 @@
/* $NetBSD: rpb.h,v 1.17 1998/02/13 00:07:25 thorpej Exp $ */
/* $NetBSD: rpb.h,v 1.18 1998/03/02 08:04:05 ross Exp $ */
/*
* Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@ -383,4 +383,8 @@ struct dsrdb {
*/
#define HWRPB_DSRDB_MINVERS 5
#ifdef _KERNEL
int cputype;
#endif
#endif /* ASSEMBLER */