Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-2-0]: src/sys/arch/macppc/macppc Pull up revision 1.44 (requested...



details:   https://anonhg.NetBSD.org/src/rev/52b75928f29c
branches:  netbsd-2-0
changeset: 561584:52b75928f29c
user:      tron <tron%NetBSD.org@localhost>
date:      Tue Jun 22 09:25:11 2004 +0000

description:
Pull up revision 1.44 (requested by manu in ticket #533):
We used to look for the interrupt controller through the "interrupt-controller"
property of "/chosen" node in OF tree. On newer machines (e.g: iBook G4),
this property does not exist. We look for the node "mpic" as a second attempt
after a failure in /chosen.
This makes the iBook G4 keyboard almost usable (there are still some spurious
inputs on system startupi)

diffstat:

 sys/arch/macppc/macppc/extintr.c |  20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)

diffs (41 lines):

diff -r f00a3e0c76a6 -r 52b75928f29c sys/arch/macppc/macppc/extintr.c
--- a/sys/arch/macppc/macppc/extintr.c  Tue Jun 22 09:24:34 2004 +0000
+++ b/sys/arch/macppc/macppc/extintr.c  Tue Jun 22 09:25:11 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: extintr.c,v 1.42 2004/03/24 19:42:53 matt Exp $        */
+/*     $NetBSD: extintr.c,v 1.42.2.1 2004/06/22 09:25:11 tron Exp $    */
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -74,7 +74,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: extintr.c,v 1.42 2004/03/24 19:42:53 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: extintr.c,v 1.42.2.1 2004/06/22 09:25:11 tron Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -942,9 +942,19 @@
        heathrow_FCR = (void *)(obio_base + HEATHROW_FCR_OFFSET);
 
        memset(type, 0, sizeof(type));
-       chosen = OF_finddevice("/chosen");
-       if (OF_getprop(chosen, "interrupt-controller", &ictlr, 4) == 4)
-               OF_getprop(ictlr, "device_type", type, sizeof(type));
+       ictlr = -1;
+
+       /* 
+        * Look for The interrupt controller. It used to be referenced
+        * by the "interrupt-controller" property of device "/chosen",
+        * but this is not true anymore on newer machines (e.g.: iBook G4)
+        * Device "mpic" is the interrupt controller on theses machines.
+        */
+       if (((chosen = OF_finddevice("/chosen")) == -1)  ||
+           (OF_getprop(chosen, "interrupt-controller", &ictlr, 4) != 4))
+               ictlr = OF_finddevice("mpic");
+
+       OF_getprop(ictlr, "device_type", type, sizeof(type));
 
        if (strcmp(type, "open-pic") != 0) {
                /*



Home | Main Index | Thread Index | Old Index