From 6fec1d4f73055f0f296a7540e417c797fba92223 Mon Sep 17 00:00:00 2001 From: briggs Date: Tue, 7 Dec 2004 13:22:51 +0000 Subject: [PATCH] OpenFirmware on machines with the "Grackle" bridge assign an 'AAPL,interrupts' property instead of 'interrupt-map' and 'interrupt-map-mask' properties. Adjust for this by checking for the latter, and if they're not present (and the parent isn't 'pci-bridge'), then look for 'AAPL,interrupts'. Problem analyzed and patched by Tim Kelly on port-macppc. I modified the patch to move the fallback into find_node_intr(), tweaking some previously- disabled code. --- sys/arch/macppc/pci/pci_machdep.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/sys/arch/macppc/pci/pci_machdep.c b/sys/arch/macppc/pci/pci_machdep.c index a1d401a22507..dd4334cc4c12 100644 --- a/sys/arch/macppc/pci/pci_machdep.c +++ b/sys/arch/macppc/pci/pci_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: pci_machdep.c,v 1.25 2004/04/08 23:58:24 matt Exp $ */ +/* $NetBSD: pci_machdep.c,v 1.26 2004/12/07 13:22:51 briggs Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. @@ -43,7 +43,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.25 2004/04/08 23:58:24 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.26 2004/12/07 13:22:51 briggs Exp $"); #include #include @@ -494,12 +494,13 @@ nomap: #endif } -#if 0 - /* XXX This may be wrong... */ - len = OF_getprop(node, "interrupts", intr, 4) ; + /* + * If all else fails, attempt to get AAPL, interrupts property. + * Grackle, at least, uses this instead of above in some cases. + */ + len = OF_getprop(node, "AAPL,interrupts", intr, 4) ; if (len == 4) return len; -#endif return -1; }