Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm/broadcom Use PIC_IRQBASE_ALLOC and allow condit...
details: https://anonhg.NetBSD.org/src/rev/8d27f98b5a26
branches: trunk
changeset: 967872:8d27f98b5a26
user: skrll <skrll%NetBSD.org@localhost>
date: Wed Dec 25 10:49:29 2019 +0000
description:
Use PIC_IRQBASE_ALLOC and allow conditional attachment of interrupt
handlers (for RPI4)
diffstat:
sys/arch/arm/broadcom/bcm2835_intr.c | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
diffs (50 lines):
diff -r 45cfca32ca04 -r 8d27f98b5a26 sys/arch/arm/broadcom/bcm2835_intr.c
--- a/sys/arch/arm/broadcom/bcm2835_intr.c Wed Dec 25 02:23:37 2019 +0000
+++ b/sys/arch/arm/broadcom/bcm2835_intr.c Wed Dec 25 10:49:29 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bcm2835_intr.c,v 1.27 2019/11/29 17:44:27 thorpej Exp $ */
+/* $NetBSD: bcm2835_intr.c,v 1.28 2019/12/25 10:49:29 skrll Exp $ */
/*-
* Copyright (c) 2012, 2015, 2019 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bcm2835_intr.c,v 1.27 2019/11/29 17:44:27 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm2835_intr.c,v 1.28 2019/12/25 10:49:29 skrll Exp $");
#define _INTR_PRIVATE
@@ -98,6 +98,9 @@
static int bcm2835_icu_match(device_t, cfdata_t, void *);
static void bcm2835_icu_attach(device_t, device_t, void *);
+static int bcm2835_int_base;
+static int bcm2836mp_int_base;
+
static void
bcm2835_set_priority(struct pic_softc *pic, int ipl)
{
@@ -314,7 +317,7 @@
bcmicu_sc = sc;
sc->sc_ioh = ioh;
sc->sc_phandle = phandle;
- pic_add(&bcm2835_pic, BCM2835_INT_BASE);
+ bcm2835_int_base = pic_add(&bcm2835_pic, PIC_IRQBASE_ALLOC);
ifuncs = &bcm2835icu_fdt_funcs;
}
@@ -827,7 +830,11 @@
snprintf(suffix, sizeof(suffix), "#%lu", cpuid);
strlcat(pic->pic_name, suffix, sizeof(pic->pic_name));
#endif
- pic_add(pic, BCM2836_INT_BASECPUN(cpuid));
+ if (cpuid == 0) {
+ bcm2836mp_int_base = pic_add(pic, PIC_IRQBASE_ALLOC);
+ } else {
+ pic_add(pic, BCM2836_INT_BASECPUN(cpuid));
+ }
#if defined(MULTIPROCESSOR)
intr_establish(BCM2836_INT_MAILBOX0_CPUN(cpuid), IPL_HIGH,
Home |
Main Index |
Thread Index |
Old Index