Fix interrupt enable/disable and clearning bits

what was i thinking...
This commit is contained in:
reinoud 2014-04-18 14:18:33 +00:00
parent 37a2323bcc
commit d22dde71f6

View File

@ -1,4 +1,4 @@
/* $NetBSD: exynos_sscom.c,v 1.3 2014/04/16 21:28:51 reinoud Exp $ */
/* $NetBSD: exynos_sscom.c,v 1.4 2014/04/18 14:18:33 reinoud Exp $ */
/*
* Copyright (c) 2014 Reinoud Zandijk
@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: exynos_sscom.c,v 1.3 2014/04/16 21:28:51 reinoud Exp $");
__KERNEL_RCSID(0, "$NetBSD: exynos_sscom.c,v 1.4 2014/04/18 14:18:33 reinoud Exp $");
#include "opt_sscom.h"
#include "opt_ddb.h"
@ -113,9 +113,9 @@ exynos_change_txrx_interrupts(struct sscom_softc *sc, bool unmask_p,
{
int intbits = 0;
if (flags & SSCOM_HW_RXINT)
intbits |= 1 << sc->sc_rx_irqno;
intbits |= UINT_RXD;
if (flags & SSCOM_HW_TXINT)
intbits |= 1 << sc->sc_tx_irqno;
intbits |= UINT_TXD;
if (unmask_p) {
exynos_unmask_interrupts(sc, intbits);
} else {
@ -129,9 +129,9 @@ exynos_clear_interrupts(struct sscom_softc *sc, u_int flags)
uint32_t val = 0;
if (flags & SSCOM_HW_RXINT)
val |= sc->sc_rx_irqno;
val |= UINT_RXD;
if (flags & SSCOM_HW_TXINT)
val |= sc->sc_tx_irqno;
val |= UINT_TXD;
bus_space_write_4(sc->sc_iot, sc->sc_ioh, SSCOM_UINTP, val);
}
@ -154,8 +154,9 @@ sscom_attach(device_t parent, device_t self, void *aux)
sc->sc_change_txrx_interrupts = exynos_change_txrx_interrupts;
sc->sc_clear_interrupts = exynos_clear_interrupts;
sc->sc_rx_irqno = UINT_RXD;
sc->sc_tx_irqno = UINT_TXD;
/* not used here, but do initialise */
sc->sc_rx_irqno = 0;
sc->sc_tx_irqno = 0;
if (!sscom_is_console(sc->sc_iot, unit, &sc->sc_ioh)
&& bus_space_subregion(sc->sc_iot, exyo->exyo_core_bsh,