From 7580a0839a52b475e853ff94a7272758562939b3 Mon Sep 17 00:00:00 2001 From: macallan Date: Fri, 2 Mar 2018 19:36:19 +0000 Subject: [PATCH] IRQ0 is perfectly legal to use on at least some macppc, so don't treat it as an error or something special with this svwsata works on my PCI-X G5 --- sys/arch/powerpc/pci/pci_machdep_common.c | 12 +++++++----- sys/arch/powerpc/pic/pic_openpic.c | 6 +++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/sys/arch/powerpc/pci/pci_machdep_common.c b/sys/arch/powerpc/pci/pci_machdep_common.c index e956217b46c4..f6b22845f03b 100644 --- a/sys/arch/powerpc/pci/pci_machdep_common.c +++ b/sys/arch/powerpc/pci/pci_machdep_common.c @@ -1,4 +1,4 @@ -/* $NetBSD: pci_machdep_common.c,v 1.22 2017/06/01 02:45:07 chs Exp $ */ +/* $NetBSD: pci_machdep_common.c,v 1.23 2018/03/02 19:36:19 macallan Exp $ */ /*- * Copyright (c) 2007 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pci_machdep_common.c,v 1.22 2017/06/01 02:45:07 chs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pci_machdep_common.c,v 1.23 2018/03/02 19:36:19 macallan Exp $"); #define _POWERPC_BUS_DMA_PRIVATE @@ -89,7 +89,7 @@ const char * genppc_pci_intr_string(void *v, pci_intr_handle_t ih, char *buf, size_t len) { #ifdef ICU_LEN - if (ih == 0 || ih >= ICU_LEN + if (ih >= ICU_LEN /* XXX on macppc it's completely legal to have PCI interrupts on a slave PIC */ #ifdef IRQ_SLAVE || ih == IRQ_SLAVE @@ -117,7 +117,7 @@ genppc_pci_intr_establish(void *v, pci_intr_handle_t ih, int level, { #ifdef ICU_LEN - if (ih == 0 || ih >= ICU_LEN + if (ih >= ICU_LEN #ifdef IRQ_SLAVE || ih == IRQ_SLAVE #endif @@ -245,8 +245,10 @@ genppc_pci_intr_map(const struct pci_attach_args *pa, pci_intr_handle_t *ihp) * Since IRQ 0 is only used by the clock, and we can't actually be sure * that the BIOS did its job, we also recognize that as meaning that * the BIOS has not configured the device. + * XXX + * it's perfectly legal to use IRQ 0 on macppc */ - if (line == 0 || line == 255) { + if (line == 255) { aprint_error("pci_intr_map: no mapping for pin %c\n", '@' + pin); goto bad; #ifdef ICU_LEN diff --git a/sys/arch/powerpc/pic/pic_openpic.c b/sys/arch/powerpc/pic/pic_openpic.c index a560ed708d9e..f9430c13b0f6 100644 --- a/sys/arch/powerpc/pic/pic_openpic.c +++ b/sys/arch/powerpc/pic/pic_openpic.c @@ -1,4 +1,4 @@ -/* $NetBSD: pic_openpic.c,v 1.11 2018/03/01 16:03:02 macallan Exp $ */ +/* $NetBSD: pic_openpic.c,v 1.12 2018/03/02 19:36:19 macallan Exp $ */ /*- * Copyright (c) 2007 Michael Lorenz @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pic_openpic.c,v 1.11 2018/03/01 16:03:02 macallan Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pic_openpic.c,v 1.12 2018/03/02 19:36:19 macallan Exp $"); #include #include @@ -144,7 +144,7 @@ opic_establish_irq(struct pic_ops *pic, int irq, int type, int pri) x = irq; x |= OPENPIC_IMASK; - if (irq == 0 || type == IST_EDGE_RISING || type == IST_LEVEL_HIGH) + if (type == IST_EDGE_RISING || type == IST_LEVEL_HIGH) x |= OPENPIC_POLARITY_POSITIVE; else x |= OPENPIC_POLARITY_NEGATIVE;