Take a stab at EB66 support. An EB66 is basically an EB64+ with a

21066 LCA instead of a 21064 + APECS.
This commit is contained in:
thorpej 1998-06-27 10:10:51 +00:00
parent 58091d9dec
commit 02b767eee5
10 changed files with 734 additions and 10 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: cpuconf.c,v 1.17 1998/06/26 21:49:25 ross Exp $ */
/* $NetBSD: cpuconf.c,v 1.18 1998/06/27 10:10:51 thorpej Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
@ -128,6 +128,13 @@ extern void dec_alphabook1_init __P((void));
#define dec_alphabook1_init platform_not_configured
#endif
#include "opt_dec_eb66.h"
#ifdef DEC_EB66
extern void dec_eb66_init __P((void));
#else
#define dec_eb66_init platform_not_configured
#endif
struct cpuinit cpuinit[] = {
cpu_notsupp("???"), /* 0: ??? */
cpu_notsupp("ST_ADU"), /* 1: ST_ADU */
@ -148,7 +155,7 @@ struct cpuinit cpuinit[] = {
cpu_notsupp("???"), /* 16: ??? */
cpu_init(dec_1000a_init,"ST_DEC_1000"), /* 17: ST_DEC_1000 */
cpu_notsupp("???"), /* 18: ??? */
cpu_notsupp("ST_EB66"), /* 19: ST_EB66 */
cpu_init(dec_eb66_init,"DEC_EB66"), /* 19: ST_EB66 */
cpu_init(dec_eb64plus_init,"DEC_EB64PLUS"), /* 20: ST_EB64P */
cpu_init(dec_alphabook1_init,"DEC_ALPHABOOK1"),/* 21: ST_ALPHABOOK1 */
cpu_init(dec_kn300_init,"ST_DEC_4100"), /* 22: ST_DEC_4100 */

View File

@ -0,0 +1,271 @@
/* $NetBSD: dec_eb66.c,v 1.1 1998/06/27 10:10:51 thorpej Exp $ */
/*
* Copyright (c) 1995, 1996, 1997 Carnegie-Mellon University.
* All rights reserved.
*
* Author: Chris G. Demetriou
*
* Permission to use, copy, modify and distribute this software and
* its documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
*
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*
* Carnegie Mellon requests users of this software to return to
*
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
* School of Computer Science
* Carnegie Mellon University
* Pittsburgh PA 15213-3890
*
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*/
/*
* Additional Copyright (c) 1997 by Matthew Jacob for NASA/Ames Research Center
*/
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: dec_eb66.c,v 1.1 1998/06/27 10:10:51 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/device.h>
#include <sys/termios.h>
#include <dev/cons.h>
#include <machine/rpb.h>
#include <machine/autoconf.h>
#include <machine/conf.h>
#include <machine/bus.h>
#include <dev/ic/comreg.h>
#include <dev/ic/comvar.h>
#include <dev/isa/isavar.h>
#include <dev/isa/pckbcvar.h>
#include <dev/pci/pcireg.h>
#include <dev/pci/pcivar.h>
#include <alpha/pci/lcareg.h>
#include <alpha/pci/lcavar.h>
#include <dev/scsipi/scsi_all.h>
#include <dev/scsipi/scsipi_all.h>
#include <dev/scsipi/scsiconf.h>
#include "pckbd.h"
#ifndef CONSPEED
#define CONSPEED TTYDEF_SPEED
#endif
static int comcnrate = CONSPEED;
void dec_eb66_init __P((void));
static void dec_eb66_cons_init __P((void));
static void dec_eb66_device_register __P((struct device *, void *));
const struct alpha_variation_table dec_eb66_variations[] = {
{ 0, "DEC EB66" },
{ 0, NULL },
};
void
dec_eb66_init()
{
u_int64_t variation;
platform.family = "EB66";
if ((platform.model = alpha_dsr_sysname()) == NULL) {
variation = hwrpb->rpb_variation & SV_ST_MASK;
if ((platform.model = alpha_variation_name(variation,
dec_eb66_variations)) == NULL)
platform.model = alpha_unknown_sysname();
}
platform.iobus = "lca";
platform.cons_init = dec_eb66_cons_init;
platform.device_register = dec_eb66_device_register;
}
static void
dec_eb66_cons_init()
{
struct ctb *ctb;
struct lca_config *lcp;
extern struct lca_config lca_configuration;
lcp = &lca_configuration;
lca_init(lcp, 0);
ctb = (struct ctb *)(((caddr_t)hwrpb) + hwrpb->rpb_ctb_off);
switch (ctb->ctb_term_type) {
case 2:
/* serial console ... */
/* XXX */
{
/*
* Delay to allow PROM putchars to complete.
* FIFO depth * character time,
* character time = (1000000 / (defaultrate / 10))
*/
DELAY(160000000 / comcnrate);
if(comcnattach(&lcp->lc_iot, 0x3f8, comcnrate,
COM_FREQ,
(TTYDEF_CFLAG & ~(CSIZE | PARENB)) | CS8))
panic("can't init serial console");
break;
}
case 3:
#if NPCKBD > 0
/* display console ... */
/* XXX */
(void) pckbc_cnattach(&lcp->lc_iot, PCKBC_KBD_SLOT);
if ((ctb->ctb_turboslot & 0xffff) == 0)
isa_display_console(&lcp->lc_iot, &lcp->lc_memt);
else
pci_display_console(&lcp->lc_iot, &lcp->lc_memt,
&lcp->lc_pc, (ctb->ctb_turboslot >> 8) & 0xff,
ctb->ctb_turboslot & 0xff, 0);
#else
panic("not configured to use display && keyboard console");
#endif
break;
default:
printf("ctb->ctb_term_type = 0x%lx\n", ctb->ctb_term_type);
printf("ctb->ctb_turboslot = 0x%lx\n", ctb->ctb_turboslot);
panic("consinit: unknown console type %d\n",
ctb->ctb_term_type);
}
}
static void
dec_eb66_device_register(dev, aux)
struct device *dev;
void *aux;
{
static int found, initted, scsiboot, netboot;
static struct device *pcidev, *scsidev;
struct bootdev_data *b = bootdev_data;
struct device *parent = dev->dv_parent;
struct cfdata *cf = dev->dv_cfdata;
struct cfdriver *cd = cf->cf_driver;
if (found)
return;
if (!initted) {
scsiboot = (strcmp(b->protocol, "SCSI") == 0);
netboot = (strcmp(b->protocol, "BOOTP") == 0);
#if 0
printf("scsiboot = %d, netboot = %d\n", scsiboot, netboot);
#endif
initted =1;
}
if (pcidev == NULL) {
if (strcmp(cd->cd_name, "pci"))
return;
else {
struct pcibus_attach_args *pba = aux;
if ((b->slot / 1000) != pba->pba_bus)
return;
pcidev = dev;
#if 0
printf("\npcidev = %s\n", pcidev->dv_xname);
#endif
return;
}
}
if (scsiboot && (scsidev == NULL)) {
if (parent != pcidev)
return;
else {
struct pci_attach_args *pa = aux;
if ((b->slot % 1000) != pa->pa_device)
return;
/* XXX function? */
scsidev = dev;
#if 0
printf("\nscsidev = %s\n", scsidev->dv_xname);
#endif
return;
}
}
if (scsiboot &&
(!strcmp(cd->cd_name, "sd") ||
!strcmp(cd->cd_name, "st") ||
!strcmp(cd->cd_name, "cd"))) {
struct scsipibus_attach_args *sa = aux;
if (parent->dv_parent != scsidev)
return;
if (b->unit / 100 != sa->sa_sc_link->scsipi_scsi.target)
return;
/* XXX LUN! */
switch (b->boot_dev_type) {
case 0:
if (strcmp(cd->cd_name, "sd") &&
strcmp(cd->cd_name, "cd"))
return;
break;
case 1:
if (strcmp(cd->cd_name, "st"))
return;
break;
default:
return;
}
/* we've found it! */
booted_device = dev;
#if 0
printf("\nbooted_device = %s\n", booted_device->dv_xname);
#endif
found = 1;
}
if (netboot) {
if (parent != pcidev)
return;
else {
struct pci_attach_args *pa = aux;
if ((b->slot % 1000) != pa->pa_device)
return;
/* XXX function? */
booted_device = dev;
#if 0
printf("\nbooted_device = %s\n", booted_device->dv_xname);
#endif
found = 1;
return;
}
}
}

View File

@ -1,4 +1,4 @@
# $NetBSD: ALPHA,v 1.81 1998/06/26 05:43:21 thorpej Exp $
# $NetBSD: ALPHA,v 1.82 1998/06/27 10:10:52 thorpej Exp $
#
# Alpha kernel with all the options you'd want, and more.
@ -22,6 +22,7 @@ options DEC_KN300 # KN300: AlphaServer 4100
options DEC_550 # Miata: Digital Personal Workstation
options DEC_1000A # Corelle etc: Digital AlphaServer 800/1000A
options DEC_ALPHABOOK1 # AlphaBook1: Tadpole/DEC AlphaBook
options DEC_EB66 # EB66: 21066 Evaluation Board
# Standard system options
options KTRACE # System call tracing support

View File

@ -1,4 +1,4 @@
# $NetBSD: GENERIC,v 1.93 1998/06/26 21:53:11 ross Exp $
# $NetBSD: GENERIC,v 1.94 1998/06/27 10:10:52 thorpej Exp $
#
# Generic Alpha kernel. Enough to get booted, etc., but not much more.
@ -23,6 +23,7 @@ options DEC_550 # Miata: Digital Personal Workstation
options DEC_1000 # Mikasa etc: Digital AlphaServer 1000
options DEC_1000A # Corelle etc: Digital AlphaServer 800/1000A
options DEC_ALPHABOOK1 # AlphaBook1: Tadpole/DEC AlphaBook
options DEC_EB66 # EB66: 21066 Evaluation Board
# Standard system options
options KTRACE # System call tracing support

View File

@ -1,4 +1,4 @@
# $NetBSD: files.alpha,v 1.83 1998/06/26 21:53:10 ross Exp $
# $NetBSD: files.alpha,v 1.84 1998/06/27 10:10:52 thorpej Exp $
#
# alpha-specific configuration info
@ -23,6 +23,7 @@ defopt AVALON_A12 # Avalon: A12T1, A12M Parallel Supercomputer
defopt DEC_1000 # Mikasa etc: AlphaServer 1000
defopt DEC_1000A # Corelle etc: AlphaServer 800 and 1000A
defopt DEC_ALPHABOOK1 # AlphaBook1: Tadpole/DEC AlphaBook
defopt DEC_EB66 # EB66: 21066 Evaluation Board
# Miscellaneous CPU-specific option headers
defopt FIX_UNALIGNED_VAX_FP
@ -36,7 +37,7 @@ define alpha_shared_intr
file arch/alpha/common/shared_intr.c alpha_shared_intr | dec_eb164 |
dec_eb64plus | dec_kn20aa | dec_kn8ae |
dec_kn300 | dec_550 | dec_1000 |
dec_1000a
dec_1000a | dec_eb66
define alpha_sgmap
file arch/alpha/common/sgmap_common.c alpha_sgmap | dec_3000_500
@ -297,6 +298,8 @@ file arch/alpha/pci/pci_eb164.c dec_eb164
file arch/alpha/pci/pci_eb164_intr.s dec_eb164
file arch/alpha/pci/pci_eb64plus.c dec_eb64plus
file arch/alpha/pci/pci_eb64plus_intr.s dec_eb64plus
file arch/alpha/pci/pci_eb66.c dec_eb66
file arch/alpha/pci/pci_eb66_intr.s dec_eb66
file arch/alpha/pci/pci_kn20aa.c dec_kn20aa
file arch/alpha/pci/pci_kn8ae.c dec_kn8ae
file arch/alpha/pci/pci_kn300.c dec_kn300
@ -394,6 +397,7 @@ file arch/alpha/alpha/dec_alphabook1.c dec_alphabook1
file arch/alpha/alpha/dec_axppci_33.c dec_axppci_33
file arch/alpha/alpha/dec_eb164.c dec_eb164
file arch/alpha/alpha/dec_eb64plus.c dec_eb64plus
file arch/alpha/alpha/dec_eb66.c dec_eb66
file arch/alpha/alpha/dec_kn20aa.c dec_kn20aa
file arch/alpha/alpha/dec_kn8ae.c dec_kn8ae
file arch/alpha/alpha/dec_kn300.c dec_kn300

View File

@ -1,4 +1,4 @@
/* $NetBSD: intrcnt.h,v 1.15 1998/06/26 21:55:09 ross Exp $ */
/* $NetBSD: intrcnt.h,v 1.16 1998/06/27 10:10:52 thorpej Exp $ */
/*
* Copyright (c) 1995, 1996 Carnegie-Mellon University.
@ -279,7 +279,39 @@
ASCIZ "dec 1000 irq 12"; \
ASCIZ "dec 1000 irq 13"; \
ASCIZ "dec 1000 irq 14"; \
/* 0x15b */ ASCIZ "dec 1000 irq 15";
/* 0x15b */ ASCIZ "dec 1000 irq 15"; \
ASCIZ "eb66 irq 0"; \
ASCIZ "eb66 irq 1"; \
ASCIZ "eb66 irq 2"; \
ASCIZ "eb66 irq 3"; \
/* 0x160 */ ASCIZ "eb66 irq 4"; \
ASCIZ "eb66 irq 5"; \
ASCIZ "eb66 irq 6"; \
ASCIZ "eb66 irq 7"; \
ASCIZ "eb66 irq 8"; \
ASCIZ "eb66 irq 9"; \
ASCIZ "eb66 irq 10"; \
ASCIZ "eb66 irq 11"; \
ASCIZ "eb66 irq 12"; \
ASCIZ "eb66 irq 13"; \
ASCIZ "eb66 irq 14"; \
ASCIZ "eb66 irq 15"; \
ASCIZ "eb66 irq 16"; \
ASCIZ "eb66 irq 17"; \
ASCIZ "eb66 irq 18"; \
ASCIZ "eb66 irq 19"; \
/* 0x170 */ ASCIZ "eb66 irq 20"; \
ASCIZ "eb66 irq 21"; \
ASCIZ "eb66 irq 22"; \
ASCIZ "eb66 irq 23"; \
ASCIZ "eb66 irq 24"; \
ASCIZ "eb66 irq 25"; \
ASCIZ "eb66 irq 26"; \
ASCIZ "eb66 irq 27"; \
ASCIZ "eb66 irq 28"; \
ASCIZ "eb66 irq 29"; \
ASCIZ "eb66 irq 30"; \
/* 0x17b*/ ASCIZ "eb66 irq 31";
#define INTRCNT_DEFINITION \
/* 0x00 */ .quad 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; \
@ -298,6 +330,8 @@
/* 0x130 */ .quad 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; \
/* 0x140 */ .quad 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; \
/* 0x150 */ .quad 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; \
/* 0x160 */ .quad 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; \
/* 0x170 */ .quad 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0;
#define INTRCNT_CLOCK 0
#define INTRCNT_ISA_IRQ (INTRCNT_CLOCK + 1)
@ -335,6 +369,9 @@
#define INTRCNT_DEC_1000_IRQ (INTRCNT_DEC_1000A_IRQ + \
INTRCNT_DEC_1000A_IRQ_LEN)
#define INTRCNT_DEC_1000_IRQ_LEN 16
#define INTRCNT_EB66_IRQ (INTRCNT_DEC_1000_IRQ + \
INTRCNT_DEC_1000_IRQ_LEN)
#define INTRCNT_EB66_IRQ_LEN 32
#ifndef _LOCORE
extern volatile long intrcnt[];

View File

@ -1,4 +1,4 @@
/* $NetBSD: lca.c,v 1.31 1998/06/27 08:59:03 thorpej Exp $ */
/* $NetBSD: lca.c,v 1.32 1998/06/27 10:10:52 thorpej Exp $ */
/*
* Copyright (c) 1995, 1996 Carnegie-Mellon University.
@ -29,10 +29,11 @@
#include "opt_dec_axppci_33.h"
#include "opt_dec_alphabook1.h"
#include "opt_dec_eb66.h"
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: lca.c,v 1.31 1998/06/27 08:59:03 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: lca.c,v 1.32 1998/06/27 10:10:52 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -57,6 +58,9 @@ __KERNEL_RCSID(0, "$NetBSD: lca.c,v 1.31 1998/06/27 08:59:03 thorpej Exp $");
#ifdef DEC_ALPHABOOK1
#include <alpha/pci/pci_alphabook1.h>
#endif
#ifdef DEC_EB66
#include <alpha/pci/pci_eb66.h>
#endif
int lcamatch __P((struct device *, struct cfdata *, void *));
void lcaattach __P((struct device *, struct device *, void *));
@ -182,6 +186,11 @@ lcaattach(parent, self, aux)
pci_alphabook1_pickintr(lcp);
break;
#endif
#ifdef DEC_EB66
case ST_EB66:
pci_eb66_pickintr(lcp);
break;
#endif
default:
panic("lcaattach: shouldn't be here, really...");

View File

@ -0,0 +1,301 @@
/* $NetBSD: pci_eb66.c,v 1.1 1998/06/27 10:10:51 thorpej Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
* NASA Ames Research Center.
*
* 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 NetBSD
* Foundation, Inc. and its contributors.
* 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, 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
* 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.
*/
/*
* Copyright (c) 1995, 1996 Carnegie-Mellon University.
* All rights reserved.
*
* Author: Chris G. Demetriou
*
* Permission to use, copy, modify and distribute this software and
* its documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
*
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*
* Carnegie Mellon requests users of this software to return to
*
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
* School of Computer Science
* Carnegie Mellon University
* Pittsburgh PA 15213-3890
*
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*/
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: pci_eb66.c,v 1.1 1998/06/27 10:10:51 thorpej Exp $");
#include <sys/types.h>
#include <sys/param.h>
#include <sys/time.h>
#include <sys/systm.h>
#include <sys/errno.h>
#include <sys/malloc.h>
#include <sys/device.h>
#include <sys/syslog.h>
#include <vm/vm.h>
#include <machine/autoconf.h>
#include <dev/pci/pcireg.h>
#include <dev/pci/pcivar.h>
#include <alpha/pci/lcareg.h>
#include <alpha/pci/lcavar.h>
#include <alpha/pci/pci_eb66.h>
#include <machine/intrcnt.h>
#include "sio.h"
#if NSIO
#include <alpha/pci/siovar.h>
#endif
int dec_eb66_intr_map __P((void *, pcitag_t, int, int,
pci_intr_handle_t *));
const char *dec_eb66_intr_string __P((void *, pci_intr_handle_t));
void *dec_eb66_intr_establish __P((void *, pci_intr_handle_t,
int, int (*func)(void *), void *));
void dec_eb66_intr_disestablish __P((void *, void *));
#define EB66_MAX_IRQ 32
#define PCI_STRAY_MAX 5
struct alpha_shared_intr *eb66_pci_intr;
bus_space_tag_t eb66_intrgate_iot;
bus_space_handle_t eb66_intrgate_ioh;
void eb66_iointr __P((void *framep, unsigned long vec));
extern void eb66_intr_enable __P((int irq)); /* pci_eb66_intr.S */
extern void eb66_intr_disable __P((int irq)); /* pci_eb66_intr.S */
void
pci_eb66_pickintr(lcp)
struct lca_config *lcp;
{
bus_space_tag_t iot = &lcp->lc_iot;
pci_chipset_tag_t pc = &lcp->lc_pc;
int i;
pc->pc_intr_v = lcp;
pc->pc_intr_map = dec_eb66_intr_map;
pc->pc_intr_string = dec_eb66_intr_string;
pc->pc_intr_establish = dec_eb66_intr_establish;
pc->pc_intr_disestablish = dec_eb66_intr_disestablish;
/* Not supported on the EB66. */
pc->pc_pciide_compat_intr_establish = NULL;
eb66_intrgate_iot = iot;
if (bus_space_map(eb66_intrgate_iot, 0x804, 3, 0,
&eb66_intrgate_ioh) != 0)
panic("pci_eb66_pickintr: couldn't map interrupt PLD");
for (i = 0; i < EB66_MAX_IRQ; i++)
eb66_intr_disable(i);
eb66_pci_intr = alpha_shared_intr_alloc(EB66_MAX_IRQ);
for (i = 0; i < EB66_MAX_IRQ; i++)
alpha_shared_intr_set_maxstrays(eb66_pci_intr, i,
PCI_STRAY_MAX);
#if NSIO
sio_intr_setup(pc, iot);
#endif
set_iointr(eb66_iointr);
}
int
dec_eb66_intr_map(lcv, bustag, buspin, line, ihp)
void *lcv;
pcitag_t bustag;
int buspin, line;
pci_intr_handle_t *ihp;
{
struct lca_config *lcp = lcv;
pci_chipset_tag_t pc = &lcp->lc_pc;
int bus, device, function;
if (buspin == 0) {
/* No IRQ used. */
return 1;
}
if (buspin > 4) {
printf("dec_eb66_intr_map: bad interrupt pin %d\n", buspin);
return 1;
}
alpha_pci_decompose_tag(pc, bustag, &bus, &device, &function);
/*
* The console places the interrupt mapping in the "line" value.
* A value of (char)-1 indicates there is no mapping.
*/
if (line == 0xff) {
printf("dec_eb66_intr_map: no mapping for %d/%d/%d\n",
bus, device, function);
return (1);
}
if (line >= EB66_MAX_IRQ)
panic("dec_eb66_intr_map: eb66 irq too large (%d)\n",
line);
*ihp = line;
return (0);
}
const char *
dec_eb66_intr_string(lcv, ih)
void *lcv;
pci_intr_handle_t ih;
{
static char irqstr[15]; /* 11 + 2 + NULL + sanity */
if (ih >= EB66_MAX_IRQ)
panic("dec_eb66_intr_string: bogus eb66 IRQ 0x%x\n", ih);
sprintf(irqstr, "eb66 irq %d", ih);
return (irqstr);
}
void *
dec_eb66_intr_establish(lcv, ih, level, func, arg)
void *lcv, *arg;
pci_intr_handle_t ih;
int level;
int (*func) __P((void *));
{
void *cookie;
if (ih >= EB66_MAX_IRQ)
panic("dec_eb66_intr_establish: bogus eb66 IRQ 0x%x\n", ih);
cookie = alpha_shared_intr_establish(eb66_pci_intr, ih, IST_LEVEL,
level, func, arg, "eb66 irq");
if (cookie != NULL && alpha_shared_intr_isactive(eb66_pci_intr, ih))
eb66_intr_enable(ih);
return (cookie);
}
void
dec_eb66_intr_disestablish(lcv, cookie)
void *lcv, *cookie;
{
panic("dec_eb66_intr_disestablish not implemented"); /* XXX */
}
void
eb66_iointr(framep, vec)
void *framep;
unsigned long vec;
{
int irq;
if (vec >= 0x900) {
if (vec >= 0x900 + (EB66_MAX_IRQ << 4))
panic("eb66_iointr: vec 0x%x out of range\n", vec);
irq = (vec - 0x900) >> 4;
if (EB66_MAX_IRQ != INTRCNT_EB66_IRQ_LEN)
panic("eb66 interrupt counter sizes inconsistent");
intrcnt[INTRCNT_EB66_IRQ + irq]++;
if (!alpha_shared_intr_dispatch(eb66_pci_intr, irq)) {
alpha_shared_intr_stray(eb66_pci_intr, irq,
"eb66 irq");
if (eb66_pci_intr[irq].intr_nstrays ==
eb66_pci_intr[irq].intr_maxstrays)
eb66_intr_disable(irq);
}
return;
}
#if NSIO
if (vec >= 0x800) {
sio_iointr(framep, vec);
return;
}
#endif
panic("eb66_iointr: weird vec 0x%x\n", vec);
}
#if 0 /* THIS DOES NOT WORK! see pci_eb66_intr.S. */
u_int8_t eb66_intr_mask[3] = { 0xff, 0xff, 0xff };
void
eb66_intr_enable(irq)
int irq;
{
int byte = (irq / 8), bit = (irq % 8);
#if 1
printf("eb66_intr_enable: enabling %d (%d:%d)\n", irq, byte, bit);
#endif
eb66_intr_mask[byte] &= ~(1 << bit);
bus_space_write_1(eb66_intrgate_iot, eb66_intrgate_ioh, byte,
eb66_intr_mask[byte]);
}
void
eb66_intr_disable(irq)
int irq;
{
int byte = (irq / 8), bit = (irq % 8);
#if 1
printf("eb66_intr_disable: disabling %d (%d:%d)\n", irq, byte, bit);
#endif
eb66_intr_mask[byte] |= (1 << bit);
bus_space_write_1(eb66_intrgate_iot, eb66_intrgate_ioh, byte,
eb66_intr_mask[byte]);
}
#endif

View File

@ -0,0 +1,30 @@
/* $NetBSD: pci_eb66.h,v 1.1 1998/06/27 10:10:51 thorpej Exp $ */
/*
* Copyright (c) 1995, 1996 Carnegie-Mellon University.
* All rights reserved.
*
* Author: Chris G. Demetriou
*
* Permission to use, copy, modify and distribute this software and
* its documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
*
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*
* Carnegie Mellon requests users of this software to return to
*
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
* School of Computer Science
* Carnegie Mellon University
* Pittsburgh PA 15213-3890
*
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*/
void pci_eb66_pickintr __P((struct lca_config *));

View File

@ -0,0 +1,63 @@
/* $NetBSD: pci_eb66_intr.s,v 1.1 1998/06/27 10:10:51 thorpej Exp $ */
/*
* Copyright (c) 1996 Carnegie-Mellon University.
* All rights reserved.
*
* Author: Chris G. Demetriou
*
* Permission to use, copy, modify and distribute this software and
* its documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
*
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*
* Carnegie Mellon requests users of this software to return to
*
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
* School of Computer Science
* Carnegie Mellon University
* Pittsburgh PA 15213-3890
*
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*/
/*
* This file hacked from pci_eb164_intr.s
*
* These functions were written by disassembling a Digital UNIX kernel's
* eb66_intrdsabl and eb66_intrenabl functions (because they had
* interesting names, and looked like the eb164 versions which were
* known to already work), and then playing with them to see how to call
* them correctly.
*
* It looks like the right thing to do is to call them with the interrupt
* request that you want to enable or disable (presumably in the range
* 0 -> 23, since there are 3 8-bit interrupt-enable bits in the
* interrupt mask PLD).
*/
#include <machine/asm.h>
__KERNEL_RCSID(0, "$NetBSD: pci_eb66_intr.s,v 1.1 1998/06/27 10:10:51 thorpej Exp $");
.text
LEAF(eb66_intr_enable,1)
mov a0, a1
ldiq a0, 0x34
call_pal PAL_cserve
RET
END(eb66_intr_enable)
.text
LEAF(eb66_intr_disable,1)
mov a0, a1
ldiq a0, 0x35
call_pal PAL_cserve
RET
END(eb66_intr_enable)