Add support for clearing IRQ 0, which is latched by the IOEB (on IOEB systems).

This commit is contained in:
bjh21 2000-08-18 12:50:00 +00:00
parent d5b133164a
commit cc396125ae
3 changed files with 72 additions and 5 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: irq.c,v 1.3 2000/06/29 08:32:34 mrg Exp $ */
/* $NetBSD: irq.c,v 1.4 2000/08/18 12:50:00 bjh21 Exp $ */
/*-
* Copyright (c) 2000 Ben Harris
@ -33,7 +33,7 @@
#include <sys/param.h>
__RCSID("$NetBSD: irq.c,v 1.3 2000/06/29 08:32:34 mrg Exp $");
__RCSID("$NetBSD: irq.c,v 1.4 2000/08/18 12:50:00 bjh21 Exp $");
#include <sys/device.h>
#include <sys/kernel.h> /* for cold */
@ -53,7 +53,16 @@ __RCSID("$NetBSD: irq.c,v 1.3 2000/06/29 08:32:34 mrg Exp $");
#include <arch/arm26/iobus/iocreg.h>
#include <arch/arm26/iobus/iocvar.h>
#include "ioeb.h"
#if NIOEB > 0
#include <arch/arm26/ioc/ioebvar.h>
#endif
extern struct cfdriver ioc_cd;
#if NIOEB > 0
extern struct cfdriver ioeb_cd;
#endif
#define NIRQ 16
extern char *irqnames[];
@ -132,7 +141,11 @@ irq_handler(struct irqframe *irqf)
#endif
if (h->mask & IOC_IRQ_CLEARABLE_MASK)
ioc_irq_clear(ioc_cd.cd_devs[0], h->mask);
/* XXX IOEB support needed */
#if NIOEB > 0
else if ((h->mask & IOEB_IRQ_CLEARABLE_MASK) &&
ioeb_cd.cd_ndevs > 0 && ioeb_cd.cd_devs[0] != NULL)
ioeb_irq_clear(ioeb_cd.cd_devs[0], h->mask);
#endif
if (h->arg == NULL)
result = (h->func)(irqf);
else

View File

@ -1,4 +1,4 @@
/* $NetBSD: ioeb.c,v 1.1 2000/05/09 21:56:02 bjh21 Exp $ */
/* $NetBSD: ioeb.c,v 1.2 2000/08/18 12:50:01 bjh21 Exp $ */
/*-
* Copyright (c) 2000 Ben Harris
@ -30,7 +30,7 @@
#include <sys/param.h>
__KERNEL_RCSID(0, "$NetBSD: ioeb.c,v 1.1 2000/05/09 21:56:02 bjh21 Exp $");
__KERNEL_RCSID(0, "$NetBSD: ioeb.c,v 1.2 2000/08/18 12:50:01 bjh21 Exp $");
#include <sys/device.h>
#include <sys/systm.h>
@ -39,9 +39,12 @@ __KERNEL_RCSID(0, "$NetBSD: ioeb.c,v 1.1 2000/05/09 21:56:02 bjh21 Exp $");
#include <arch/arm26/iobus/iocvar.h>
#include <arch/arm26/ioc/ioebreg.h>
#include <arch/arm26/ioc/ioebvar.h>
struct ioeb_softc {
struct device sc_dev;
bus_space_tag_t sc_iot;
bus_space_handle_t sc_ioh;
};
static int ioeb_match(struct device *, struct cfdata *, void *);
@ -68,6 +71,20 @@ ioeb_match(struct device *parent, struct cfdata *cf, void *aux)
static void
ioeb_attach(struct device *parent, struct device *self, void *aux)
{
struct ioeb_softc *sc = (void *)self;
struct ioc_attach_args *ioc = aux;
sc->sc_iot = ioc->ioc_fast_t;
sc->sc_ioh = ioc->ioc_fast_h;
printf("\n");
}
void
ioeb_irq_clear(struct device *self, int mask)
{
struct ioeb_softc *sc = (void *)self;
/* The IOEB only controls interrupt 0 */
if (mask & IOEB_IRQ_CLEARABLE_MASK)
bus_space_write_1(sc->sc_iot, sc->sc_ioh, IOEB_REG_INTRCLR, 0);
}

View File

@ -0,0 +1,37 @@
/* $NetBSD: ioebvar.h,v 1.1 2000/08/18 12:50:01 bjh21 Exp $ */
/*-
* Copyright (c) 2000 Ben Harris
* 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. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
*/
/* This file is part of NetBSD/arm26 -- a port of NetBSD to ARM2/3 machines. */
#ifndef _IOEBVAR_H_
#define _IOEBVAR_H_
#define IOEB_IRQ_CLEARABLE_MASK 0x0001
extern void ioeb_irq_clear(struct device *self, int mask);
#endif